Skip to contentSkip to conversation

WCONF, netlink based WE replacement.

PATCH Michael Buesch 5 participants 5 messages Jan 12, 2006 – Jan 20, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This is an attempt to rewrite the Wireless Extensions userspace API, using netlink sockets.
There should also be a notification API, to inform userspace for changes (config changes, state changes, etc). It is not implemented, yet.

This is against the devicescape stack.
This patch is not to be used, but only to be commented on. ;) Basically I would like comments on the API definition in wconf.h

include/net/ieee80211.h +20 -12
diff -urNX linux-2.6.15-ds060105.orig/Documentation/dontdiff linux-2.6.15-ds060105.orig/include/net/ieee80211.h linux-2.6.15-ds060105/include/net/ieee80211.h
@@ -10,6 +10,8 @@
 #ifndef IEEE80211_H
 #define IEEE80211_H
 
+#include <linux/netdevice.h>
+#include <net/wconf.h>
 #include "ieee80211_shared.h"
 
 /* Note! Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsave() can be
@@ -591,35 +593,41 @@
 	int (*atheros_xr_in_use)(struct net_device *dev, int in_use);
 };
 
+struct ieee80211_device {
+	/* Device name string. Usually "wlanX". */
+	__u8 name[IFNAMSIZ + 1];
+	/* Hardware data. */
+	struct ieee80211_hw *hw;
+	/* Wireless Configuration data. */
+	struct wconf_device *wconf;
+	struct net_device *dev;/*TODO: We want to get rid of the master net_device
+				 	and use ieee80211_device instead. */
+};
+
 /* Allocate a new hardware device. This must be called once for each
  * hardware device. The returned pointer must be used to refer to this
  * device when calling other functions. 802.11 code allocates a private data
  * area for the low-level driver. The size of this area is given as
  * priv_data_len. ieee80211_dev_hw_data() is used to get a pointer to the
- * private data area.
- *
- * Note: in this version of the interface the returned pointer is struct
- * net_device *. This may change in the future and low-level driver should
- * not refer the device data directly to remain compatible with the future
- * versions of the interface. */
-struct net_device *ieee80211_alloc_hw(size_t priv_data_len,
-				      void (*setup)(struct net_device *));
+ * private data area. */
+struct ieee80211_device * ieee80211_alloc_hw(size_t priv_data_len,
+					     void (*setup)(struct net_device *));
 
 /* Register hardware device to the IEEE 802.11 code and kernel. Low-level
  * drivers must call this function before using any other IEEE 802.11
  * function. */
-int ieee80211_register_hw(struct net_device *dev, struct ieee80211_hw *hw);
+int ieee80211_register_hw(struct ieee80211_device *dev, struct ieee80211_hw *hw);
 
 /* This function is allowed to update hardware configuration (e.g., list of
  * supported operation modes and rates). */
-int ieee80211_update_hw(struct net_device *dev, struct ieee80211_hw *hw);
+int ieee80211_update_hw(struct ieee80211_device *dev, struct ieee80211_hw *hw);
 
 /* Unregister a hardware device. This function instructs 802.11 code to free
  * allocated resources and unregister netdevices from the kernel. */
-void ieee80211_unregister_hw(struct net_device *dev);
+void ieee80211_unregister_hw(struct ieee80211_device *dev);
 
 /* Free allocated net_device including private data of a driver. */
-void ieee80211_free_hw(struct net_device *dev);
+void ieee80211_free_hw(struct ieee80211_device *dev);
 
 /* Receive frame callback function. The low-level driver uses this function to
  * send received frames to the IEEE 802.11 code. Receive buffer (skb) must
include/net/wconf.h +151 -0

151 lines not on this page · raw message

net/ieee80211/ieee80211.c +70 -40

257 lines not on this page · raw message

net/ieee80211/Makefile +2 -1
diff -urNX linux-2.6.15-ds060105.orig/Documentation/dontdiff linux-2.6.15-ds060105.orig/net/ieee80211/Makefile linux-2.6.15-ds060105/net/ieee80211/Makefile
@@ -12,7 +12,8 @@
 	michael.o \
 	tkip.o \
 	aes_ccm.o \
-	wme.o
+	wme.o \
+	wconf.o
 
 ifeq ($(CONFIG_NET_SCHED),)
   80211-objs += fifo_qdisc.o
net/ieee80211/wconf.c +221 -0

221 lines not on this page · raw message

Signature · 1 line
Greetings Michael.
#1 lore raw

* Michael Buesch <[email protected]> 2006-01-12 18:24

Quoted 5 lines

This is an attempt to rewrite the Wireless Extensions userspace API, using netlink sockets.
There should also be a notification API, to inform userspace for changes (config changes, state changes, etc). It is not implemented, yet.

I'll only comment on the netlink bits and leave the rest to others. I'd highly recommend the use of attributes instead of fixed message structures to allow the interface to be flexible to extensions while staying binary compatible.

Another idea might be to use the new generic netlink family to make things a bit easier to use.

#3 lore raw
In reply to Michael Buesch
Quoted 11 lines · On Thu, 12 Jan 2006 18:24:02 +0100 Michael Buesch <[email protected]> wrote:

This is an attempt to rewrite the Wireless Extensions userspace API, using netlink sockets.
There should also be a notification API, to inform userspace for changes (config changes, state changes, etc). It is not implemented, yet.

This is against the devicescape stack.
This patch is not to be used, but only to be commented on. ;) Basically I would like comments on the API definition in wconf.h

1. You will need more documentation, eventually in Documentation directory.

2. Is there 1:1 relationship between ieee80211_device and net_device or N net_devices per ieee80211_device?

3. Don't put a version number on the protocol messages. The way to us netlink is to us Type Length Variable structures. And write the code to ignore unknown types. Once you decide on a particular Type then it has to be frozen for ABI compatibility. The version numbering in the WE API is part of the problem

4. What about non-ieee80211 devices? With the growth of (mostly proprietary) cell phone carrier wireless, you don't want to shut out that.

#4 lore raw
Quoted 4 lines · Stephen Hemminger

On Thu, 12 Jan 2006 18:24:02 +0100

4. What about non-ieee80211 devices? With the growth of (mostly proprietary) cell phone carrier wireless, you don't want to shut out that.

Don't mix it here. Mobile phones normally talk using AT interface, modem-like.

Pavel

Signature · 1 line
Thanks, Sharp!
#2 lore raw
In reply to Thomas Graf
Quoted 11 lines · Thomas Graf

* Michael Buesch <[email protected]> 2006-01-12 18:24

Quoted 5 lines

This is an attempt to rewrite the Wireless Extensions userspace API, using netlink sockets.
There should also be a notification API, to inform userspace for changes (config changes, state changes, etc). It is not implemented, yet.

I'll only comment on the netlink bits and leave the rest to others. I'd highly recommend the use of attributes instead of fixed message structures to allow the interface to be flexible to extensions while staying binary compatible.

I can only second Thomas' suggestion. The power and flexibility of the
use of netlink is only really unveiled if you use attributes. This way
you can easily extend your data structures later on without breaking compatibility, etc.

Signature · 4 lines
- Harald Welte <[email protected]>          	        http://gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)