This is some preliminary code how I'm currently thinking (and that might
change radically :) ) configuration might look like.
It uses the patch I previously posted to make genetlink attributes
custom-definable.
--- wireless-dev.orig/include/linux/nl80211.h 2006-09-13 22:06:10.539647141
+0200
+++ wireless-dev/include/linux/nl80211.h2006-09-13 22:06:11.919647141
+0200
@@ -45,6 +45,47 @@ enum {
/* get list of all interfaces belonging to a wiphy */
NL80211_CMD_NEW_INTERFACES,
+ /* configure device */
+ NL80211_CMD_CONFIGURE,
+
+ /* request configuration */
+ NL80211_CMD_GET_CONFIG,
+
+ /* configuration sent from kernel */
+ NL80211_CMD_CONFIGURATION,
+
+ /* initiate scan */
+ NL80211_CMD_INITIATE_SCAN,
+
+ /* scan result (kernel - userspace) */
+ NL80211_CMD_SCAN_RESULT,
+
+ /* change roaming control */
+ NL80211_CMD_SET_ROAMING_CONTROL,
+
+ /* get roaming control setting */
+ NL80211_CMD_GET_ROAMING_CONTROL,
+
+ /* set access point BSSID for userspace roaming */
+ NL80211_CMD_SET_BSSID,
+
+ /* get current association information, if not associated then
+* the BSSID attribute is not present in response */
+ NL80211_CMD_GET_ASSOCIATION,
+
+ /* association notification/response to GET_BSSID */
+ NL80211_CMD_ASSOCIATION_CHANGED,
+
+ /* disassociate from current AP */
+ NL80211_CMD_DISASSOCIATE,
+
+ /* deauth from current AP */
+ NL80211_CMD_DEAUTH,
+
+ /* re-associate with current settings
+* (SSID and BSSID if roaming control in userspace) */
+ NL80211_CMD_REASSOCIATE,
+
/* add commands here */
/* used to define NL80211_CMD_MAX below */
@@ -88,6 +129,36 @@ enum {
/* wiphy list */
NL80211_ATTR_WIPHY_LIST,
+ /* attributes used for configuration */
+ /* network ID (pre 802.11 HW) */
+ NL80211_ATTR_NETWORK_ID,
+
+ /* channel, 1-14 are B/G */
+ NL80211_ATTR_CHANNEL,
+
+ /* receiver sensitivity in dBm */
+ NL80211_ATTR_RX_SENSITIVITY,
+
+ /* BSSID to associate to, only used when roaming control
+* is in userspace */
+ NL80211_ATTR_BSSID,
+
+ /* SSID of ESS to associate to */
+ NL80211_ATTR_SSID,
+
+ /* transmit power in mW */
+ NL80211_ATTR_TRANSMIT_POWER,
+
+ /* fragmentation threshold in bytes */
+ NL80211_ATTR_FRAG_THRESHOLD,
+
+ /* one or more information elements */
+ NL80211_ATTR_INFORMATION_ELEMENT,
+
+ NL80211_ATTR_ROAMING_CONTROL,
+
+ NL80211_ATTR_SCAN_TYPE,
+
/* add attributes here */
/* used to define NL80211_ATTR_MAX below */
@@ -134,4 +205,13 @@ enum {
};
#define NL80211_IFTYPE_MAX (__NL80211_IFTYPE_AFTER_LAST - 1)
+enum {
+ NL80211_ROAMING_CONTROL_KERNEL,
+ NL80211_ROAMING_CONTROL_USERSPACE,
+
+ /* keep last */
+ __NL80211_ROAMING_CONTROL_AFTER_LAST
+};
+#define NL80211_ROAMING_CONTROL_MAX (__NL80211_ROAMING_CONTROL_AFTER_LAST-1)
+
#endif /* __LINUX_NL80211_H */
--- wireless-dev.orig/include/net/cfg80211.h2006-09-13 22:06:10.539647141
+0200
+++ wireless-dev/include/net/cfg80211.h 2006-09-13 22:06:11.919647141 +0200
@@ -14,6 +14,30 @@
*/
/**
+ * struct cfg80211_config - description of a configuration (request)
+ */
+struct cfg80211_config {
+ /* first fields with 'internal' validity */
+
+ /* SSID to use, valid if not NULL. change forces reassociation */
+ u8 *ssid;
+
+ /* now fields with explicit validity */
+#define CFG80211_CFG_VALID_NWID(10)
+#define CFG80211_CFG_VALID_RX_SENSITIVITY (11)
+#define CFG80211_CFG_VALID_TRANSMIT_POWER (12)
+#define CFG80211_CFG_VALID_FRAG_THRESHOLD (13)
+#define CFG80211_CFG_VALID_CHANNEL (14)
+ unsigned int valid;
+
+ u16 network_id;
+ s32 rx_sensitivity;
+ u32 transmit_power;
+ u32 fragmentation_threshold;
+ u32 channel;
+};
+
+/**
* struct cfg80211_ops - backend description for wireless configuration
*
* This struct is registered by fullmac card drivers and/or wireless stacks
@@ -35,6 +59,26 @@
* @add_virtual_intf: create a new virtual interface with the given name
*
* @del_virtual_intf: remove the virtual interface determined by ifindex.
+ *
+ * @configure: configure the given interface as requested in the config struct.
+ *must not ignore any configuration item, if something is
+ *is requested that cannot be fulfilled return an error
+ *
+ * @get_config: fill the given config structure with the current configuration
+ *
+ * @reassociate: reassociate with current settings (SSID, BSSID if
+ * userspace roaming is enabled)
+ *
+ * @disassociate: disassociate from current AP
+ *
+ * @deauth: deauth from current AP
+ *
+ * @initiate_scan: ...
+ *
+ * @set_roaming: set who gets to control roaming
+ *
+ *