Wireless extensions rethink
Subsystems (2)
Hi Scott,
I was thinking along the same lines, however I was taking the ethtool interface as the starting point (using a single ioctl for all wireless operations). The private handlers would just have to be converted to plain ioctls handled by the driver itself.
The attached patch can be used as a starting point for this. It is not complete (not by far), but it shows the basic structure. I've called the structure wlantool_ops, again using the example set by ethtool.
Comments?
--- Gertjan.
Quoted 41 lines · Scott
Jeff suggested in an earlier post that there is an opportunity to totally rethink the wireless extensions now that we have wireless-2.6.
Let's get rid of the iotcl and /proc interfaces as Jeff suggests:
1)
iw_handlerAPI goes away and is replaced by structnet_device::wireless_ops(alaethtool_ops).
2) sysfs get/set mapping forwireless_ops.
3)iw_statisticsjust becomes one of thewireless_ops.
4) Remove/proc/net/wirelesssupport fromwireless.c. (Already have sysfs support for the same :)
5) No private handler support. If you need private support, pass it in some other way (custom sysfs of modparam). Or, better yet, make a case that others could benefit and move intowireless_opsas standard.
6) Convert drivers fromiw_handlerandiw_statisticstowireless_ops.
7) Rewrite iw* tools to use sysfs interface rather than ioctl. (scriptable tools?)
8) [Optional] Remove iotcl interface. May want to keep for backward compat with legacy tools? Easy to map between ioctl andwireless_opsinwireless.c.
9) [Open] What to do about wireless events? Any ideas?Proposed sysfs layout:
class/ `-- net |-- eth[x] |-- wireless |-- statistics | |-- beacon | |-- crypt | `-- ... `-- control |-- commit |-- name |-- network_id |-- freq `-- ...
Quoted 5 lines
Is someone already working on this???
Comments?
-scott
include/linux/netdevice.h +4 -0
@@ -41,6 +41,7 @@struct divert_blk ;struct vlan_group ;struct ethtool_ops ; +struct wlantool_ops ;/* source back-compat hooks */ #define SET_ETHTOOL_OPS (netdev,ops) \
@@ -308,6 +309,8 @@struct ethtool_ops *ethtool_ops; +struct wlantool_ops *wlantool_ops; +/* * This marks the end of the "visible" part of the structure. All * fields hereafter are internal to the system, and may change at
@@ -678,6 +681,7 @@extern int netif_receive_skb (struct sk_buff *skb);extern int dev_ioctl (unsigned int cmd,void __user *);extern int dev_ethtool (struct ifreq *); +extern int dev_wlantool (struct ifreq *);extern unsigned dev_get_flags (const struct net_device *);extern int dev_change_flags (struct net_device *,unsigned );extern int dev_set_mtu (struct net_device *,int );
include/linux/sockios.h +2 -0
@@ -83,6 +83,8 @@#define SIOCWANDEV 0x894A/* get/set netdev parameters */ +#define SIOCWLANTOOL 0x894B/* WLANtool interface */ +/* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953/* delete ARP table entry */
include/linux/wlantool.h new file +72 -0
72 lines not on this page · raw message
net/core/Makefile +2 -1
@@ -7,7 +7,8 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core.o obj-y += flow.o dev.o ethtool.o dev_mcast.o dst.o \ - neighbour.o rtnetlink.o utils.o link_watch.o filter.o + neighbour.o rtnetlink.o utils.o link_watch.o filter.o \ + wlantool.o obj-$(CONFIG_SYSFS) += net-sysfs.o obj-$(CONFIG_NETFILTER) += netfilter.o
net/core/dev.c +14 -0
@@ -2700,6 +2700,20 @@case SIOCSIFLINK :return -EINVAL ; +case SIOCWLANTOOL : +dev_load (ifr.ifr_name); +rtnl_lock (); + ret =dev_wlantool (&ifr); +rtnl_unlock (); +if (!ret) { +if (colon) + *colon =':' ; +if (copy_to_user (arg, &ifr, +sizeof (struct ifreq ))) + ret = -EFAULT ; + } +return ret; +/* * Unknown or private ioctl. */
net/core/wlantool.c new file +221 -0
221 lines not on this page · raw message
Quoted 7 lines · Gertjan van Wingerde
Hi Scott,
I was thinking along the same lines, however I was taking the ethtool interface as the starting point (using a single ioctl for all wireless operations). The private handlers would just have to be converted to plain ioctls handled by the driver itself.
Quoted 6 lines
The attached patch can be used as a starting point for this. It is not complete (not by far), but it shows the basic structure. I've called the structure
wlantool_ops, again using the example set by ethtool.Comments?
For what it's worth, I like the idea of using a single IOCTL similar to ethtool...
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com