]> err.no Git - linux-2.6/commitdiff
cfg80211: don't export ieee80211_get_channel
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 26 Mar 2008 13:14:55 +0000 (14:14 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 27 Mar 2008 20:03:20 +0000 (16:03 -0400)
This patch makes ieee80211_get_channel a static inline defined in
cfg80211's header file which simply calls __ieee80211_get_channel
to avoid symbol clashes with the ieee80211 code.

The problem was pointed out by David Miller, thanks!

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/wireless.h
net/wireless/util.c

index f4b77ab66baece4ff34d6162274329901ee23cc8..667b4080d30fe27eee5949a4c9e846ea6b3384ef 100644 (file)
@@ -304,10 +304,22 @@ extern int ieee80211_channel_to_frequency(int chan);
  */
 extern int ieee80211_frequency_to_channel(int freq);
 
+/*
+ * Name indirection necessary because the ieee80211 code also has
+ * a function named "ieee80211_get_channel", so if you include
+ * cfg80211's header file you get cfg80211's version, if you try
+ * to include both header files you'll (rightfully!) get a symbol
+ * clash.
+ */
+extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
+                                                        int freq);
+
 /**
  * ieee80211_get_channel - get channel struct from wiphy for specified frequency
  */
-extern struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
-                                                      int freq);
-
+static inline struct ieee80211_channel *
+ieee80211_get_channel(struct wiphy *wiphy, int freq)
+{
+       return __ieee80211_get_channel(wiphy, freq);
+}
 #endif /* __NET_WIRELESS_H */
index f3e623df3515d8f4ac1bc328b9831d441e09ada7..f54424693a38a378bd5e7cdc25326907b5fbb983 100644 (file)
@@ -33,8 +33,8 @@ int ieee80211_frequency_to_channel(int freq)
 }
 EXPORT_SYMBOL(ieee80211_frequency_to_channel);
 
-struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
-                                               int freq)
+struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
+                                                 int freq)
 {
        enum ieee80211_band band;
        struct ieee80211_supported_band *sband;
@@ -54,7 +54,7 @@ struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
 
        return NULL;
 }
-EXPORT_SYMBOL(ieee80211_get_channel);
+EXPORT_SYMBOL(__ieee80211_get_channel);
 
 static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
                                     enum ieee80211_band band)