* Re: [PATCH][2.6.14.5] fix /sys/class/net/<if>/wireless without dev->get_wireless_stats
[not found] ` <200601021545.59097.ismail@uludag.org.tr>
@ 2006-01-02 17:15 ` Andrey Borzenkov
[not found] ` <200601031852.27386.ismail@uludag.org.tr>
0 siblings, 1 reply; 2+ messages in thread
From: Andrey Borzenkov @ 2006-01-02 17:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I accidentally used wrong lkml address, so I resend it now with proper format.
dev->get_wireless_stats is deprecated but removing it also removes wireless
subdirectory in sysfs. This patch puts it back.
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
- ---
- --- linux-2.6.14.5/net/core/net-sysfs.c.orig 2005-12-27 03:26:33.000000000 +0300
+++ linux-2.6.14.5/net/core/net-sysfs.c 2006-01-02 13:33:34.000000000 +0300
@@ -16,6 +16,7 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
+#include <net/iw_handler.h>
#define to_class_dev(obj) container_of(obj,struct class_device,kobj)
#define to_net_dev(class) container_of(class, struct net_device, class_dev)
@@ -313,13 +314,19 @@ static ssize_t wireless_show(struct clas
char *))
{
struct net_device *dev = to_net_dev(cd);
- - const struct iw_statistics *iw;
+ const struct iw_statistics *iw = NULL;
ssize_t ret = -EINVAL;
read_lock(&dev_base_lock);
- - if (dev_isalive(dev) && dev->get_wireless_stats
- - && (iw = dev->get_wireless_stats(dev)) != NULL)
- - ret = (*format)(iw, buf);
+ if (dev_isalive(dev)) {
+ if(dev->wireless_handlers &&
+ dev->wireless_handlers->get_wireless_stats)
+ iw = dev->wireless_handlers->get_wireless_stats(dev);
+ else if (dev->get_wireless_stats)
+ iw = dev->get_wireless_stats(dev);
+ if (iw != NULL)
+ ret = (*format)(iw, buf);
+ }
read_unlock(&dev_base_lock);
return ret;
@@ -420,7 +427,8 @@ void netdev_unregister_sysfs(struct net_
sysfs_remove_group(&class_dev->kobj, &netstat_group);
#ifdef WIRELESS_EXT
- - if (net->get_wireless_stats)
+ if ((net->get_wireless_stats ||
+ net->wireless_handlers && net->wireless_handlers->get_wireless_stats))
sysfs_remove_group(&class_dev->kobj, &wireless_group);
#endif
class_device_del(class_dev);
@@ -453,7 +461,8 @@ int netdev_register_sysfs(struct net_dev
goto out_unreg;
#ifdef WIRELESS_EXT
- - if (net->get_wireless_stats &&
+ if ((net->get_wireless_stats ||
+ net->wireless_handlers && net->wireless_handlers->get_wireless_stats) &&
(ret = sysfs_create_group(&class_dev->kobj, &wireless_group)))
goto out_cleanup;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDuV+kR6LMutpd94wRAugpAKChYCaH91dykwqMPGb6Xm5kXmIa0ACePENS
QwHqJFgsCyblXHkUKdZM9j0=
=37cH
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][2.6.14.5] fix /sys/class/net/<if>/wireless without dev->get_wireless_stats
[not found] ` <200601031852.27386.ismail@uludag.org.tr>
@ 2006-01-03 17:05 ` Ismail Donmez
0 siblings, 0 replies; 2+ messages in thread
From: Ismail Donmez @ 2006-01-03 17:05 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
Salı 3 Ocak 2006 18:52 tarihinde şunları yazmıştınız:
> Pazartesi 2 Ocak 2006 19:15 tarihinde şunları yazmıştınız:
> > I accidentally used wrong lkml address, so I resend it now with proper
> > format.
> >
> > dev->get_wireless_stats is deprecated but removing it also removes
> > wireless subdirectory in sysfs. This patch puts it back.
> >
> > Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
>
> Did this make it to 2.6.15?
According to Andrey it didn't, but since Linus you are talking about not
breaking userspace, without this patch many userspace applications and
scripts are broken so at least can we put this in 2.6.15.1 ? It doesn't make
any sense when you leave userspace broken obviously ( there is a bugzilla
entry and a ready patch ) and talking about userspace compatibility at the
same time.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-01-03 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200601021349.32823.arvidjaar@mail.ru>
[not found] ` <200601021545.59097.ismail@uludag.org.tr>
2006-01-02 17:15 ` [PATCH][2.6.14.5] fix /sys/class/net/<if>/wireless without dev->get_wireless_stats Andrey Borzenkov
[not found] ` <200601031852.27386.ismail@uludag.org.tr>
2006-01-03 17:05 ` Ismail Donmez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).