diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-09-29 17:27:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:43 -0400 |
commit | 3d23e349d807177eaf519d444677cee86b1a04cf (patch) | |
tree | e800dee247598e59185ddd2dd47d2ac6fe090b9c /include | |
parent | bc974f4a230756faf4f69114f271de2e678b363b (diff) |
wext: refactor
Refactor wext to
* split out iwpriv handling
* split out iwspy handling
* split out procfs support
* allow cfg80211 to have wireless extensions compat code
w/o CONFIG_WIRELESS_EXT
After this, drivers need to
- select WIRELESS_EXT - for wext support
- select WEXT_PRIV - for iwpriv support
- select WEXT_SPY - for iwspy support
except cfg80211 -- which gets new hooks in wext-core.c
and can then get wext handlers without CONFIG_WIRELESS_EXT.
Wireless extensions procfs support is auto-selected
based on PROC_FS and anything that requires the wext core
(i.e. WIRELESS_EXT or CFG80211_WEXT).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/cfg80211.h | 6 | ||||
-rw-r--r-- | include/net/iw_handler.h | 14 | ||||
-rw-r--r-- | include/net/net_namespace.h | 2 | ||||
-rw-r--r-- | include/net/wext.h | 49 |
4 files changed, 49 insertions, 22 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d874c620219..241ea14d6df8 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1171,6 +1171,10 @@ struct wiphy { | |||
1171 | struct net *_net; | 1171 | struct net *_net; |
1172 | #endif | 1172 | #endif |
1173 | 1173 | ||
1174 | #ifdef CONFIG_CFG80211_WEXT | ||
1175 | const struct iw_handler_def *wext; | ||
1176 | #endif | ||
1177 | |||
1174 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1178 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
1175 | }; | 1179 | }; |
1176 | 1180 | ||
@@ -1345,7 +1349,7 @@ struct wireless_dev { | |||
1345 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | 1349 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; |
1346 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 1350 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
1347 | 1351 | ||
1348 | #ifdef CONFIG_WIRELESS_EXT | 1352 | #ifdef CONFIG_CFG80211_WEXT |
1349 | /* wext data */ | 1353 | /* wext data */ |
1350 | struct { | 1354 | struct { |
1351 | struct cfg80211_ibss_params ibss; | 1355 | struct cfg80211_ibss_params ibss; |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index e9054a283fde..d5d337170a56 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -323,18 +323,19 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, | |||
323 | */ | 323 | */ |
324 | struct iw_handler_def | 324 | struct iw_handler_def |
325 | { | 325 | { |
326 | /* Number of handlers defined (more precisely, index of the | ||
327 | * last defined handler + 1) */ | ||
328 | __u16 num_standard; | ||
329 | __u16 num_private; | ||
330 | /* Number of private arg description */ | ||
331 | __u16 num_private_args; | ||
332 | 326 | ||
333 | /* Array of handlers for standard ioctls | 327 | /* Array of handlers for standard ioctls |
334 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] | 328 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] |
335 | */ | 329 | */ |
336 | const iw_handler * standard; | 330 | const iw_handler * standard; |
331 | /* Number of handlers defined (more precisely, index of the | ||
332 | * last defined handler + 1) */ | ||
333 | __u16 num_standard; | ||
337 | 334 | ||
335 | #ifdef CONFIG_WEXT_PRIV | ||
336 | __u16 num_private; | ||
337 | /* Number of private arg description */ | ||
338 | __u16 num_private_args; | ||
338 | /* Array of handlers for private ioctls | 339 | /* Array of handlers for private ioctls |
339 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] | 340 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] |
340 | */ | 341 | */ |
@@ -344,6 +345,7 @@ struct iw_handler_def | |||
344 | * can put it in any order you want and should not leave holes... | 345 | * can put it in any order you want and should not leave holes... |
345 | * We will automatically export that to user space... */ | 346 | * We will automatically export that to user space... */ |
346 | const struct iw_priv_args * private_args; | 347 | const struct iw_priv_args * private_args; |
348 | #endif | ||
347 | 349 | ||
348 | /* New location of get_wireless_stats, to de-bloat struct net_device. | 350 | /* New location of get_wireless_stats, to de-bloat struct net_device. |
349 | * The old pointer in struct net_device will be gradually phased | 351 | * The old pointer in struct net_device will be gradually phased |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index a1202841aadd..699410142bfa 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -80,7 +80,7 @@ struct net { | |||
80 | #ifdef CONFIG_XFRM | 80 | #ifdef CONFIG_XFRM |
81 | struct netns_xfrm xfrm; | 81 | struct netns_xfrm xfrm; |
82 | #endif | 82 | #endif |
83 | #ifdef CONFIG_WIRELESS_EXT | 83 | #ifdef CONFIG_WEXT_CORE |
84 | struct sk_buff_head wext_nlevents; | 84 | struct sk_buff_head wext_nlevents; |
85 | #endif | 85 | #endif |
86 | struct net_generic *gen; | 86 | struct net_generic *gen; |
diff --git a/include/net/wext.h b/include/net/wext.h index 3f2b94de2cfa..4f6e7423174c 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
@@ -1,29 +1,19 @@ | |||
1 | #ifndef __NET_WEXT_H | 1 | #ifndef __NET_WEXT_H |
2 | #define __NET_WEXT_H | 2 | #define __NET_WEXT_H |
3 | 3 | ||
4 | /* | 4 | #include <net/iw_handler.h> |
5 | * wireless extensions interface to the core code | ||
6 | */ | ||
7 | 5 | ||
8 | struct net; | 6 | struct net; |
9 | 7 | ||
10 | #ifdef CONFIG_WIRELESS_EXT | 8 | #ifdef CONFIG_WEXT_CORE |
11 | extern int wext_proc_init(struct net *net); | ||
12 | extern void wext_proc_exit(struct net *net); | ||
13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 9 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
14 | void __user *arg); | 10 | void __user *arg); |
15 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | 11 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, |
16 | unsigned long arg); | 12 | unsigned long arg); |
13 | |||
17 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); | 14 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); |
15 | extern int call_commit_handler(struct net_device *dev); | ||
18 | #else | 16 | #else |
19 | static inline int wext_proc_init(struct net *net) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
23 | static inline void wext_proc_exit(struct net *net) | ||
24 | { | ||
25 | return; | ||
26 | } | ||
27 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 17 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
28 | void __user *arg) | 18 | void __user *arg) |
29 | { | 19 | { |
@@ -36,4 +26,35 @@ static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | |||
36 | } | 26 | } |
37 | #endif | 27 | #endif |
38 | 28 | ||
29 | #ifdef CONFIG_WEXT_PROC | ||
30 | extern int wext_proc_init(struct net *net); | ||
31 | extern void wext_proc_exit(struct net *net); | ||
32 | #else | ||
33 | static inline int wext_proc_init(struct net *net) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | static inline void wext_proc_exit(struct net *net) | ||
38 | { | ||
39 | return; | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | #ifdef CONFIG_WEXT_PRIV | ||
44 | int ioctl_private_call(struct net_device *dev, struct iwreq *iwr, | ||
45 | unsigned int cmd, struct iw_request_info *info, | ||
46 | iw_handler handler); | ||
47 | int compat_private_call(struct net_device *dev, struct iwreq *iwr, | ||
48 | unsigned int cmd, struct iw_request_info *info, | ||
49 | iw_handler handler); | ||
50 | int iw_handler_get_private(struct net_device * dev, | ||
51 | struct iw_request_info * info, | ||
52 | union iwreq_data * wrqu, | ||
53 | char * extra); | ||
54 | #else | ||
55 | #define ioctl_private_call NULL | ||
56 | #define compat_private_call NULL | ||
57 | #endif | ||
58 | |||
59 | |||
39 | #endif /* __NET_WEXT_H */ | 60 | #endif /* __NET_WEXT_H */ |