Re: [Announce] Intel PRO/Wireless 2100 802.11b driver
From: Stephen Hemminger
Date: Thu Mar 11 2004 - 13:39:26 EST
The whole /proc/ipw2100/xxx interface is ugly and a mess. It doesn't expose anything
really useful that can't be found other ways and it is buggy. It doesn't handle
more than one device; I know you don't make hardware with multiple chipsets now but
will that always be true? Also, it forgets to do properly set module owner.
If you really have to keep the interface could you consider putting it in sysfs.
Something like /sys/class/net/eth0/ipw2100/xxx with one value per file.
The way to do that is with attribute groups.
The following wrappers might help:
diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h
--- a/include/linux/netdevice.h Thu Mar 11 10:36:47 2004
+++ b/include/linux/netdevice.h Thu Mar 11 10:36:47 2004
@@ -489,6 +489,20 @@
*/
#define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev))
+
+static inline netdev_sysfs_add_group(struct net_device *dev,
+ const struct attribute_group *grp)
+{
+ return sysfs_create_group(&net->class_dev.kobj, grp);
+}
+
+static inline netdev_sysfs_remove_group(struct net_device *dev,
+ const struct attribute_group *grp)
+{
+ sysfs_remove_group(&net->class_dev.kobj, grp);
+}
+
+
struct packet_type {
unsigned short type; /* This is really htons(ether_type). */
struct net_device *dev; /* NULL is wildcarded here */
--
Stephen Hemminger mailto:shemminger@xxxxxxxx
Open Source Development Lab http://developer.osdl.org/shemminger
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/