diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net-sysfs.c | 12 | ||||
-rw-r--r-- | net/wireless/wext.c | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 7d4c57523b09..821d30918cfc 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <net/sock.h> | 16 | #include <net/sock.h> |
17 | #include <linux/rtnetlink.h> | 17 | #include <linux/rtnetlink.h> |
18 | #include <linux/wireless.h> | 18 | #include <linux/wireless.h> |
19 | #include <net/iw_handler.h> | 19 | #include <net/wext.h> |
20 | 20 | ||
21 | #include "net-sysfs.h" | 21 | #include "net-sysfs.h" |
22 | 22 | ||
@@ -363,15 +363,13 @@ static ssize_t wireless_show(struct device *d, char *buf, | |||
363 | char *)) | 363 | char *)) |
364 | { | 364 | { |
365 | struct net_device *dev = to_net_dev(d); | 365 | struct net_device *dev = to_net_dev(d); |
366 | const struct iw_statistics *iw = NULL; | 366 | const struct iw_statistics *iw; |
367 | ssize_t ret = -EINVAL; | 367 | ssize_t ret = -EINVAL; |
368 | 368 | ||
369 | read_lock(&dev_base_lock); | 369 | read_lock(&dev_base_lock); |
370 | if (dev_isalive(dev)) { | 370 | if (dev_isalive(dev)) { |
371 | if (dev->wireless_handlers && | 371 | iw = get_wireless_stats(dev); |
372 | dev->wireless_handlers->get_wireless_stats) | 372 | if (iw) |
373 | iw = dev->wireless_handlers->get_wireless_stats(dev); | ||
374 | if (iw != NULL) | ||
375 | ret = (*format)(iw, buf); | 373 | ret = (*format)(iw, buf); |
376 | } | 374 | } |
377 | read_unlock(&dev_base_lock); | 375 | read_unlock(&dev_base_lock); |
@@ -505,7 +503,7 @@ int netdev_register_kobject(struct net_device *net) | |||
505 | *groups++ = &netstat_group; | 503 | *groups++ = &netstat_group; |
506 | 504 | ||
507 | #ifdef CONFIG_WIRELESS_EXT_SYSFS | 505 | #ifdef CONFIG_WIRELESS_EXT_SYSFS |
508 | if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats) | 506 | if (net->wireless_handlers || net->ieee80211_ptr) |
509 | *groups++ = &wireless_group; | 507 | *groups++ = &wireless_group; |
510 | #endif | 508 | #endif |
511 | #endif /* CONFIG_SYSFS */ | 509 | #endif /* CONFIG_SYSFS */ |
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index ac4ac26b53ce..60fe57761ca9 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -470,7 +470,7 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd) | |||
470 | /* | 470 | /* |
471 | * Get statistics out of the driver | 471 | * Get statistics out of the driver |
472 | */ | 472 | */ |
473 | static struct iw_statistics *get_wireless_stats(struct net_device *dev) | 473 | struct iw_statistics *get_wireless_stats(struct net_device *dev) |
474 | { | 474 | { |
475 | /* New location */ | 475 | /* New location */ |
476 | if ((dev->wireless_handlers != NULL) && | 476 | if ((dev->wireless_handlers != NULL) && |