diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 17:41:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 17:41:24 -0400 |
commit | a77c64c1a641950626181b4857abb701d8f38ccc (patch) | |
tree | 9bfd2a99cc969b3d863d583b9ef18114a4fc4793 /net | |
parent | ac7f6b5e44cb0982b98c31fa33298ba73fb5dcfc (diff) | |
parent | 0ba8821b12231386c8c1d506c682061f7225ae49 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (48 commits)
[PATCH] bonding: update version number
[PATCH] git-netdev-all: pc300_tty build fix
[PATCH] Make PC300 WAN driver compile again
[PATCH] Modularize generic HDLC
[PATCH] more s2io __iomem annotations
[PATCH] restore __iomem annotations in e1000
[PATCH] 64bit bugs in s2io
[PATCH] bonding: Fix primary selection error at enslavement time
[PATCH] bonding: Don't mangle LACPDUs
[PATCH] bonding: Validate probe replies in ARP monitor
[PATCH] bonding: Don't release slaves when master is admin down
[PATCH] bonding: Add priv_flag to avoid event mishandling
[PATCH] bonding: Handle large hard_header_len
[PATCH] bonding: Remove unneeded NULL test
[PATCH] bonding: Format fix in seq_printf call
[PATCH] bonding: Convert delay value from s16 to int
[PATCH] bonding: Allow bonding to enslave a 10 Gig adapter
Delete unused drivers/net/gt64240eth.h
[PATCH] skge: fiber support
[PATCH] fix possible NULL ptr deref in forcedeth
...
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net-sysfs.c | 5 | ||||
-rw-r--r-- | net/core/wireless.c | 67 | ||||
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_wx.c | 8 |
3 files changed, 46 insertions, 34 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 13472762b18b..f47f319bb7dc 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -344,8 +344,6 @@ static ssize_t wireless_show(struct class_device *cd, char *buf, | |||
344 | if(dev->wireless_handlers && | 344 | if(dev->wireless_handlers && |
345 | dev->wireless_handlers->get_wireless_stats) | 345 | dev->wireless_handlers->get_wireless_stats) |
346 | iw = dev->wireless_handlers->get_wireless_stats(dev); | 346 | iw = dev->wireless_handlers->get_wireless_stats(dev); |
347 | else if (dev->get_wireless_stats) | ||
348 | iw = dev->get_wireless_stats(dev); | ||
349 | if (iw != NULL) | 347 | if (iw != NULL) |
350 | ret = (*format)(iw, buf); | 348 | ret = (*format)(iw, buf); |
351 | } | 349 | } |
@@ -465,8 +463,7 @@ int netdev_register_sysfs(struct net_device *net) | |||
465 | *groups++ = &netstat_group; | 463 | *groups++ = &netstat_group; |
466 | 464 | ||
467 | #ifdef WIRELESS_EXT | 465 | #ifdef WIRELESS_EXT |
468 | if (net->get_wireless_stats | 466 | if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats) |
469 | || (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)) | ||
470 | *groups++ = &wireless_group; | 467 | *groups++ = &wireless_group; |
471 | #endif | 468 | #endif |
472 | 469 | ||
diff --git a/net/core/wireless.c b/net/core/wireless.c index 3168fca312f7..ffff0da46c6e 100644 --- a/net/core/wireless.c +++ b/net/core/wireless.c | |||
@@ -68,6 +68,14 @@ | |||
68 | * | 68 | * |
69 | * v8 - 17.02.06 - Jean II | 69 | * v8 - 17.02.06 - Jean II |
70 | * o RtNetlink requests support (SET/GET) | 70 | * o RtNetlink requests support (SET/GET) |
71 | * | ||
72 | * v8b - 03.08.06 - Herbert Xu | ||
73 | * o Fix Wireless Event locking issues. | ||
74 | * | ||
75 | * v9 - 14.3.06 - Jean II | ||
76 | * o Change length in ESSID and NICK to strlen() instead of strlen()+1 | ||
77 | * o Make standard_ioctl_num and standard_event_num unsigned | ||
78 | * o Remove (struct net_device *)->get_wireless_stats() | ||
71 | */ | 79 | */ |
72 | 80 | ||
73 | /***************************** INCLUDES *****************************/ | 81 | /***************************** INCLUDES *****************************/ |
@@ -234,24 +242,24 @@ static const struct iw_ioctl_description standard_ioctl[] = { | |||
234 | [SIOCSIWESSID - SIOCIWFIRST] = { | 242 | [SIOCSIWESSID - SIOCIWFIRST] = { |
235 | .header_type = IW_HEADER_TYPE_POINT, | 243 | .header_type = IW_HEADER_TYPE_POINT, |
236 | .token_size = 1, | 244 | .token_size = 1, |
237 | .max_tokens = IW_ESSID_MAX_SIZE + 1, | 245 | .max_tokens = IW_ESSID_MAX_SIZE, |
238 | .flags = IW_DESCR_FLAG_EVENT, | 246 | .flags = IW_DESCR_FLAG_EVENT, |
239 | }, | 247 | }, |
240 | [SIOCGIWESSID - SIOCIWFIRST] = { | 248 | [SIOCGIWESSID - SIOCIWFIRST] = { |
241 | .header_type = IW_HEADER_TYPE_POINT, | 249 | .header_type = IW_HEADER_TYPE_POINT, |
242 | .token_size = 1, | 250 | .token_size = 1, |
243 | .max_tokens = IW_ESSID_MAX_SIZE + 1, | 251 | .max_tokens = IW_ESSID_MAX_SIZE, |
244 | .flags = IW_DESCR_FLAG_DUMP, | 252 | .flags = IW_DESCR_FLAG_DUMP, |
245 | }, | 253 | }, |
246 | [SIOCSIWNICKN - SIOCIWFIRST] = { | 254 | [SIOCSIWNICKN - SIOCIWFIRST] = { |
247 | .header_type = IW_HEADER_TYPE_POINT, | 255 | .header_type = IW_HEADER_TYPE_POINT, |
248 | .token_size = 1, | 256 | .token_size = 1, |
249 | .max_tokens = IW_ESSID_MAX_SIZE + 1, | 257 | .max_tokens = IW_ESSID_MAX_SIZE, |
250 | }, | 258 | }, |
251 | [SIOCGIWNICKN - SIOCIWFIRST] = { | 259 | [SIOCGIWNICKN - SIOCIWFIRST] = { |
252 | .header_type = IW_HEADER_TYPE_POINT, | 260 | .header_type = IW_HEADER_TYPE_POINT, |
253 | .token_size = 1, | 261 | .token_size = 1, |
254 | .max_tokens = IW_ESSID_MAX_SIZE + 1, | 262 | .max_tokens = IW_ESSID_MAX_SIZE, |
255 | }, | 263 | }, |
256 | [SIOCSIWRATE - SIOCIWFIRST] = { | 264 | [SIOCSIWRATE - SIOCIWFIRST] = { |
257 | .header_type = IW_HEADER_TYPE_PARAM, | 265 | .header_type = IW_HEADER_TYPE_PARAM, |
@@ -338,8 +346,8 @@ static const struct iw_ioctl_description standard_ioctl[] = { | |||
338 | .max_tokens = sizeof(struct iw_pmksa), | 346 | .max_tokens = sizeof(struct iw_pmksa), |
339 | }, | 347 | }, |
340 | }; | 348 | }; |
341 | static const int standard_ioctl_num = (sizeof(standard_ioctl) / | 349 | static const unsigned standard_ioctl_num = (sizeof(standard_ioctl) / |
342 | sizeof(struct iw_ioctl_description)); | 350 | sizeof(struct iw_ioctl_description)); |
343 | 351 | ||
344 | /* | 352 | /* |
345 | * Meta-data about all the additional standard Wireless Extension events | 353 | * Meta-data about all the additional standard Wireless Extension events |
@@ -389,8 +397,8 @@ static const struct iw_ioctl_description standard_event[] = { | |||
389 | .max_tokens = sizeof(struct iw_pmkid_cand), | 397 | .max_tokens = sizeof(struct iw_pmkid_cand), |
390 | }, | 398 | }, |
391 | }; | 399 | }; |
392 | static const int standard_event_num = (sizeof(standard_event) / | 400 | static const unsigned standard_event_num = (sizeof(standard_event) / |
393 | sizeof(struct iw_ioctl_description)); | 401 | sizeof(struct iw_ioctl_description)); |
394 | 402 | ||
395 | /* Size (in bytes) of the various private data types */ | 403 | /* Size (in bytes) of the various private data types */ |
396 | static const char iw_priv_type_size[] = { | 404 | static const char iw_priv_type_size[] = { |
@@ -465,17 +473,6 @@ static inline struct iw_statistics *get_wireless_stats(struct net_device *dev) | |||
465 | (dev->wireless_handlers->get_wireless_stats != NULL)) | 473 | (dev->wireless_handlers->get_wireless_stats != NULL)) |
466 | return dev->wireless_handlers->get_wireless_stats(dev); | 474 | return dev->wireless_handlers->get_wireless_stats(dev); |
467 | 475 | ||
468 | /* Old location, field to be removed in next WE */ | ||
469 | if(dev->get_wireless_stats) { | ||
470 | static int printed_message; | ||
471 | |||
472 | if (!printed_message++) | ||
473 | printk(KERN_DEBUG "%s (WE) : Driver using old /proc/net/wireless support, please fix driver !\n", | ||
474 | dev->name); | ||
475 | |||
476 | return dev->get_wireless_stats(dev); | ||
477 | } | ||
478 | |||
479 | /* Not found */ | 476 | /* Not found */ |
480 | return (struct iw_statistics *) NULL; | 477 | return (struct iw_statistics *) NULL; |
481 | } | 478 | } |
@@ -1843,8 +1840,33 @@ int wireless_rtnetlink_set(struct net_device * dev, | |||
1843 | */ | 1840 | */ |
1844 | 1841 | ||
1845 | #ifdef WE_EVENT_RTNETLINK | 1842 | #ifdef WE_EVENT_RTNETLINK |
1843 | /* ---------------------------------------------------------------- */ | ||
1844 | /* | ||
1845 | * Locking... | ||
1846 | * ---------- | ||
1847 | * | ||
1848 | * Thanks to Herbert Xu <herbert@gondor.apana.org.au> for fixing | ||
1849 | * the locking issue in here and implementing this code ! | ||
1850 | * | ||
1851 | * The issue : wireless_send_event() is often called in interrupt context, | ||
1852 | * while the Netlink layer can never be called in interrupt context. | ||
1853 | * The fully formed RtNetlink events are queued, and then a tasklet is run | ||
1854 | * to feed those to Netlink. | ||
1855 | * The skb_queue is interrupt safe, and its lock is not held while calling | ||
1856 | * Netlink, so there is no possibility of dealock. | ||
1857 | * Jean II | ||
1858 | */ | ||
1859 | |||
1846 | static struct sk_buff_head wireless_nlevent_queue; | 1860 | static struct sk_buff_head wireless_nlevent_queue; |
1847 | 1861 | ||
1862 | static int __init wireless_nlevent_init(void) | ||
1863 | { | ||
1864 | skb_queue_head_init(&wireless_nlevent_queue); | ||
1865 | return 0; | ||
1866 | } | ||
1867 | |||
1868 | subsys_initcall(wireless_nlevent_init); | ||
1869 | |||
1848 | static void wireless_nlevent_process(unsigned long data) | 1870 | static void wireless_nlevent_process(unsigned long data) |
1849 | { | 1871 | { |
1850 | struct sk_buff *skb; | 1872 | struct sk_buff *skb; |
@@ -1921,13 +1943,6 @@ static inline void rtmsg_iwinfo(struct net_device * dev, | |||
1921 | tasklet_schedule(&wireless_nlevent_tasklet); | 1943 | tasklet_schedule(&wireless_nlevent_tasklet); |
1922 | } | 1944 | } |
1923 | 1945 | ||
1924 | static int __init wireless_nlevent_init(void) | ||
1925 | { | ||
1926 | skb_queue_head_init(&wireless_nlevent_queue); | ||
1927 | return 0; | ||
1928 | } | ||
1929 | |||
1930 | subsys_initcall(wireless_nlevent_init); | ||
1931 | #endif /* WE_EVENT_RTNETLINK */ | 1946 | #endif /* WE_EVENT_RTNETLINK */ |
1932 | 1947 | ||
1933 | /* ---------------------------------------------------------------- */ | 1948 | /* ---------------------------------------------------------------- */ |
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index 75320b6842ab..2aa779d18f38 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c | |||
@@ -80,10 +80,10 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev, | |||
80 | * If it's our network, ignore the change, we're already doing it! | 80 | * If it's our network, ignore the change, we're already doing it! |
81 | */ | 81 | */ |
82 | if((sm->associnfo.associating || sm->associated) && | 82 | if((sm->associnfo.associating || sm->associated) && |
83 | (data->essid.flags && data->essid.length && extra)) { | 83 | (data->essid.flags && data->essid.length)) { |
84 | /* Get the associating network */ | 84 | /* Get the associating network */ |
85 | n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid); | 85 | n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid); |
86 | if(n && n->essid.len == (data->essid.length - 1) && | 86 | if(n && n->essid.len == data->essid.length && |
87 | !memcmp(n->essid.data, extra, n->essid.len)) { | 87 | !memcmp(n->essid.data, extra, n->essid.len)) { |
88 | dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n", | 88 | dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n", |
89 | MAC_ARG(sm->associnfo.bssid)); | 89 | MAC_ARG(sm->associnfo.bssid)); |
@@ -109,8 +109,8 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev, | |||
109 | sm->associnfo.static_essid = 0; | 109 | sm->associnfo.static_essid = 0; |
110 | sm->associnfo.assoc_wait = 0; | 110 | sm->associnfo.assoc_wait = 0; |
111 | 111 | ||
112 | if (data->essid.flags && data->essid.length && extra /*required?*/) { | 112 | if (data->essid.flags && data->essid.length) { |
113 | length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE); | 113 | length = min((int)data->essid.length, IW_ESSID_MAX_SIZE); |
114 | if (length) { | 114 | if (length) { |
115 | memcpy(sm->associnfo.req_essid.data, extra, length); | 115 | memcpy(sm->associnfo.req_essid.data, extra, length); |
116 | sm->associnfo.static_essid = 1; | 116 | sm->associnfo.static_essid = 1; |