diff options
Diffstat (limited to 'net/core/net-sysfs.c')
| -rw-r--r-- | net/core/net-sysfs.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index fdf9e61d0651..72607174ea5a 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -417,72 +417,6 @@ static struct attribute_group netstat_group = { | |||
| 417 | .name = "statistics", | 417 | .name = "statistics", |
| 418 | .attrs = netstat_attrs, | 418 | .attrs = netstat_attrs, |
| 419 | }; | 419 | }; |
| 420 | |||
| 421 | #ifdef CONFIG_WIRELESS_EXT_SYSFS | ||
| 422 | /* helper function that does all the locking etc for wireless stats */ | ||
| 423 | static ssize_t wireless_show(struct device *d, char *buf, | ||
| 424 | ssize_t (*format)(const struct iw_statistics *, | ||
| 425 | char *)) | ||
| 426 | { | ||
| 427 | struct net_device *dev = to_net_dev(d); | ||
| 428 | const struct iw_statistics *iw; | ||
| 429 | ssize_t ret = -EINVAL; | ||
| 430 | |||
| 431 | if (!rtnl_trylock()) | ||
| 432 | return restart_syscall(); | ||
| 433 | if (dev_isalive(dev)) { | ||
| 434 | iw = get_wireless_stats(dev); | ||
| 435 | if (iw) | ||
| 436 | ret = (*format)(iw, buf); | ||
| 437 | } | ||
| 438 | rtnl_unlock(); | ||
| 439 | |||
| 440 | return ret; | ||
| 441 | } | ||
| 442 | |||
| 443 | /* show function template for wireless fields */ | ||
| 444 | #define WIRELESS_SHOW(name, field, format_string) \ | ||
| 445 | static ssize_t format_iw_##name(const struct iw_statistics *iw, char *buf) \ | ||
| 446 | { \ | ||
| 447 | return sprintf(buf, format_string, iw->field); \ | ||
| 448 | } \ | ||
| 449 | static ssize_t show_iw_##name(struct device *d, \ | ||
| 450 | struct device_attribute *attr, char *buf) \ | ||
| 451 | { \ | ||
| 452 | return wireless_show(d, buf, format_iw_##name); \ | ||
| 453 | } \ | ||
| 454 | static DEVICE_ATTR(name, S_IRUGO, show_iw_##name, NULL) | ||
| 455 | |||
| 456 | WIRELESS_SHOW(status, status, fmt_hex); | ||
| 457 | WIRELESS_SHOW(link, qual.qual, fmt_dec); | ||
| 458 | WIRELESS_SHOW(level, qual.level, fmt_dec); | ||
| 459 | WIRELESS_SHOW(noise, qual.noise, fmt_dec); | ||
| 460 | WIRELESS_SHOW(nwid, discard.nwid, fmt_dec); | ||
| 461 | WIRELESS_SHOW(crypt, discard.code, fmt_dec); | ||
| 462 | WIRELESS_SHOW(fragment, discard.fragment, fmt_dec); | ||
| 463 | WIRELESS_SHOW(misc, discard.misc, fmt_dec); | ||
| 464 | WIRELESS_SHOW(retries, discard.retries, fmt_dec); | ||
| 465 | WIRELESS_SHOW(beacon, miss.beacon, fmt_dec); | ||
| 466 | |||
| 467 | static struct attribute *wireless_attrs[] = { | ||
| 468 | &dev_attr_status.attr, | ||
| 469 | &dev_attr_link.attr, | ||
| 470 | &dev_attr_level.attr, | ||
| 471 | &dev_attr_noise.attr, | ||
| 472 | &dev_attr_nwid.attr, | ||
| 473 | &dev_attr_crypt.attr, | ||
| 474 | &dev_attr_fragment.attr, | ||
| 475 | &dev_attr_retries.attr, | ||
| 476 | &dev_attr_misc.attr, | ||
| 477 | &dev_attr_beacon.attr, | ||
| 478 | NULL | ||
| 479 | }; | ||
| 480 | |||
| 481 | static struct attribute_group wireless_group = { | ||
| 482 | .name = "wireless", | ||
| 483 | .attrs = wireless_attrs, | ||
| 484 | }; | ||
| 485 | #endif | ||
| 486 | #endif /* CONFIG_SYSFS */ | 420 | #endif /* CONFIG_SYSFS */ |
| 487 | 421 | ||
| 488 | #ifdef CONFIG_RPS | 422 | #ifdef CONFIG_RPS |
| @@ -1463,14 +1397,6 @@ int netdev_register_kobject(struct net_device *net) | |||
| 1463 | groups++; | 1397 | groups++; |
| 1464 | 1398 | ||
| 1465 | *groups++ = &netstat_group; | 1399 | *groups++ = &netstat_group; |
| 1466 | #ifdef CONFIG_WIRELESS_EXT_SYSFS | ||
| 1467 | if (net->ieee80211_ptr) | ||
| 1468 | *groups++ = &wireless_group; | ||
| 1469 | #ifdef CONFIG_WIRELESS_EXT | ||
| 1470 | else if (net->wireless_handlers) | ||
| 1471 | *groups++ = &wireless_group; | ||
| 1472 | #endif | ||
| 1473 | #endif | ||
| 1474 | #endif /* CONFIG_SYSFS */ | 1400 | #endif /* CONFIG_SYSFS */ |
| 1475 | 1401 | ||
| 1476 | error = device_add(dev); | 1402 | error = device_add(dev); |
