diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2015-01-06 08:00:53 -0500 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2015-02-28 15:31:09 -0500 |
| commit | 2afe38d15cee01b2bb8f22383571f7f4a95f2d99 (patch) | |
| tree | fb20cff972e089702c3c98bffbc7868bb84834ed /net/wireless | |
| parent | 7d9bb2f0653c7830e676f1012051fe9349ce2669 (diff) | |
cfg80211-wext: export symbols only when needed
When a fully converted cfg80211 driver needs cfg80211-wext for
userspace API purposes, the symbols need not be exported. When
other drivers (orinoco/hermes or ipw2200) are enabled, they do
need the symbols exported as they use them directly.
Make those drivers select a new CFG80211_WEXT_EXPORT Kconfig
symbol (instead of just CFG80211_WEXT) and export the functions
only if requested - this saves about 1/2k due to the size of
EXPORT_SYMBOL() itself.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
| -rw-r--r-- | net/wireless/Kconfig | 8 | ||||
| -rw-r--r-- | net/wireless/scan.c | 4 | ||||
| -rw-r--r-- | net/wireless/wext-compat.c | 18 | ||||
| -rw-r--r-- | net/wireless/wext-compat.h | 6 |
4 files changed, 25 insertions, 11 deletions
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index 29c8675f9a11..b13dfb4ff001 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
| @@ -178,10 +178,18 @@ config CFG80211_WEXT | |||
| 178 | bool "cfg80211 wireless extensions compatibility" | 178 | bool "cfg80211 wireless extensions compatibility" |
| 179 | depends on CFG80211 | 179 | depends on CFG80211 |
| 180 | select WEXT_CORE | 180 | select WEXT_CORE |
| 181 | default y if CFG80211_WEXT_EXPORT | ||
| 181 | help | 182 | help |
| 182 | Enable this option if you need old userspace for wireless | 183 | Enable this option if you need old userspace for wireless |
| 183 | extensions with cfg80211-based drivers. | 184 | extensions with cfg80211-based drivers. |
| 184 | 185 | ||
| 186 | config CFG80211_WEXT_EXPORT | ||
| 187 | bool | ||
| 188 | depends on CFG80211 | ||
| 189 | help | ||
| 190 | Drivers should select this option if they require cfg80211's | ||
| 191 | wext compatibility symbols to be exported. | ||
| 192 | |||
| 185 | config LIB80211 | 193 | config LIB80211 |
| 186 | tristate | 194 | tristate |
| 187 | default n | 195 | default n |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index c705c3e2b751..25e1e1fad905 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
| @@ -1237,7 +1237,7 @@ int cfg80211_wext_siwscan(struct net_device *dev, | |||
| 1237 | kfree(creq); | 1237 | kfree(creq); |
| 1238 | return err; | 1238 | return err; |
| 1239 | } | 1239 | } |
| 1240 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwscan); | 1240 | EXPORT_WEXT_HANDLER(cfg80211_wext_siwscan); |
| 1241 | 1241 | ||
| 1242 | static void ieee80211_scan_add_ies(struct iw_request_info *info, | 1242 | static void ieee80211_scan_add_ies(struct iw_request_info *info, |
| 1243 | const struct cfg80211_bss_ies *ies, | 1243 | const struct cfg80211_bss_ies *ies, |
| @@ -1545,5 +1545,5 @@ int cfg80211_wext_giwscan(struct net_device *dev, | |||
| 1545 | 1545 | ||
| 1546 | return res; | 1546 | return res; |
| 1547 | } | 1547 | } |
| 1548 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwscan); | 1548 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwscan); |
| 1549 | #endif | 1549 | #endif |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 5b24d39d7903..fff1bef6ed6d 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
| @@ -63,7 +63,7 @@ int cfg80211_wext_giwname(struct net_device *dev, | |||
| 63 | 63 | ||
| 64 | return 0; | 64 | return 0; |
| 65 | } | 65 | } |
| 66 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwname); | 66 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwname); |
| 67 | 67 | ||
| 68 | int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | 68 | int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, |
| 69 | u32 *mode, char *extra) | 69 | u32 *mode, char *extra) |
| @@ -99,7 +99,7 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | |||
| 99 | 99 | ||
| 100 | return cfg80211_change_iface(rdev, dev, type, NULL, &vifparams); | 100 | return cfg80211_change_iface(rdev, dev, type, NULL, &vifparams); |
| 101 | } | 101 | } |
| 102 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwmode); | 102 | EXPORT_WEXT_HANDLER(cfg80211_wext_siwmode); |
| 103 | 103 | ||
| 104 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | 104 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, |
| 105 | u32 *mode, char *extra) | 105 | u32 *mode, char *extra) |
| @@ -134,7 +134,7 @@ int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | |||
| 134 | } | 134 | } |
| 135 | return 0; | 135 | return 0; |
| 136 | } | 136 | } |
| 137 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwmode); | 137 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwmode); |
| 138 | 138 | ||
| 139 | 139 | ||
| 140 | int cfg80211_wext_giwrange(struct net_device *dev, | 140 | int cfg80211_wext_giwrange(struct net_device *dev, |
| @@ -248,7 +248,7 @@ int cfg80211_wext_giwrange(struct net_device *dev, | |||
| 248 | 248 | ||
| 249 | return 0; | 249 | return 0; |
| 250 | } | 250 | } |
| 251 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwrange); | 251 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwrange); |
| 252 | 252 | ||
| 253 | 253 | ||
| 254 | /** | 254 | /** |
| @@ -303,7 +303,7 @@ int cfg80211_wext_siwrts(struct net_device *dev, | |||
| 303 | 303 | ||
| 304 | return err; | 304 | return err; |
| 305 | } | 305 | } |
| 306 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwrts); | 306 | EXPORT_WEXT_HANDLER(cfg80211_wext_siwrts); |
| 307 | 307 | ||
| 308 | int cfg80211_wext_giwrts(struct net_device *dev, | 308 | int cfg80211_wext_giwrts(struct net_device *dev, |
| 309 | struct iw_request_info *info, | 309 | struct iw_request_info *info, |
| @@ -317,7 +317,7 @@ int cfg80211_wext_giwrts(struct net_device *dev, | |||
| 317 | 317 | ||
| 318 | return 0; | 318 | return 0; |
| 319 | } | 319 | } |
| 320 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwrts); | 320 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwrts); |
| 321 | 321 | ||
| 322 | int cfg80211_wext_siwfrag(struct net_device *dev, | 322 | int cfg80211_wext_siwfrag(struct net_device *dev, |
| 323 | struct iw_request_info *info, | 323 | struct iw_request_info *info, |
| @@ -343,7 +343,7 @@ int cfg80211_wext_siwfrag(struct net_device *dev, | |||
| 343 | 343 | ||
| 344 | return err; | 344 | return err; |
| 345 | } | 345 | } |
| 346 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwfrag); | 346 | EXPORT_WEXT_HANDLER(cfg80211_wext_siwfrag); |
| 347 | 347 | ||
| 348 | int cfg80211_wext_giwfrag(struct net_device *dev, | 348 | int cfg80211_wext_giwfrag(struct net_device *dev, |
| 349 | struct iw_request_info *info, | 349 | struct iw_request_info *info, |
| @@ -357,7 +357,7 @@ int cfg80211_wext_giwfrag(struct net_device *dev, | |||
| 357 | 357 | ||
| 358 | return 0; | 358 | return 0; |
| 359 | } | 359 | } |
| 360 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwfrag); | 360 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwfrag); |
| 361 | 361 | ||
| 362 | static int cfg80211_wext_siwretry(struct net_device *dev, | 362 | static int cfg80211_wext_siwretry(struct net_device *dev, |
| 363 | struct iw_request_info *info, | 363 | struct iw_request_info *info, |
| @@ -427,7 +427,7 @@ int cfg80211_wext_giwretry(struct net_device *dev, | |||
| 427 | 427 | ||
| 428 | return 0; | 428 | return 0; |
| 429 | } | 429 | } |
| 430 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwretry); | 430 | EXPORT_WEXT_HANDLER(cfg80211_wext_giwretry); |
| 431 | 431 | ||
| 432 | static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev, | 432 | static int __cfg80211_set_encryption(struct cfg80211_registered_device *rdev, |
| 433 | struct net_device *dev, bool pairwise, | 433 | struct net_device *dev, bool pairwise, |
diff --git a/net/wireless/wext-compat.h b/net/wireless/wext-compat.h index ebcacca2f731..94c7405a5413 100644 --- a/net/wireless/wext-compat.h +++ b/net/wireless/wext-compat.h | |||
| @@ -4,6 +4,12 @@ | |||
| 4 | #include <net/iw_handler.h> | 4 | #include <net/iw_handler.h> |
| 5 | #include <linux/wireless.h> | 5 | #include <linux/wireless.h> |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_CFG80211_WEXT_EXPORT | ||
| 8 | #define EXPORT_WEXT_HANDLER(h) EXPORT_SYMBOL_GPL(h) | ||
| 9 | #else | ||
| 10 | #define EXPORT_WEXT_HANDLER(h) | ||
| 11 | #endif /* CONFIG_CFG80211_WEXT_EXPORT */ | ||
| 12 | |||
| 7 | int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | 13 | int cfg80211_ibss_wext_siwfreq(struct net_device *dev, |
| 8 | struct iw_request_info *info, | 14 | struct iw_request_info *info, |
| 9 | struct iw_freq *freq, char *extra); | 15 | struct iw_freq *freq, char *extra); |
