connect API, wext conversion
Johannes Berg
maintainerv3 cover connect API, wext conversion
Now with association request IEs where necessary,
and with a mac80211 patch to disable 11n again
depending on the configuration.
johannes
Johannes Berg
maintainerPATCH v3 1/8 cfg80211: connect/disconnect API
From: Samuel Ortiz <[email protected]>
This patch introduces the cfg80211 connect/disconnect API. The goal here is to run the AUTH and ASSOC steps in one call. This is needed for some fullmac cards that run both steps directly from the target, after the host driver sends a connect command.
Additionally, all the new crypto parameters for connect() are now also valid for associate() -- although associate requires the IEs to be used, the information can be useful for drivers and should be given.
--- include/linux/nl80211.h | 80 ++++++++++ include/net/cfg80211.h | 135 ++++++++++++++++- net/mac80211/cfg.c | 2 net/wireless/Makefile | 2 net/wireless/core.c | 16 +- net/wireless/core.h | 7 net/wireless/nl80211.c | 368 +++++++++++++++++++++++++++++++++++++++++++++++- net/wireless/nl80211.h | 13 + net/wireless/sme.c | 224 +++++++++++++++++++++++++++++ 9 files changed, 829 insertions(+), 18 deletions(-)
include/linux/nl80211.h +80 -0
@@ -246,6 +246,22 @@* to identify the device, and the TESTDATA blob attribute to pass through * to the driver. * +* @NL80211_CMD_CONNECT: connection request and notification; this command +* requests to connect to a specified network but without separating +* auth and assoc steps. For this, you need to specify the SSID in a +* %NL80211_ATTR_SSID attribute, and can optionally specify the association +* IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, +* %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. +* It is also sent as an event, with the BSSID and response IEs when the +* connection is established or failed to be established. This can be +* determined by the STATUS_CODE attribute. +* @NL80211_CMD_ROAM: request that the card roam (currently not implemented), +* sent as an event when the card/driver roamed by itself. +* @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify +* userspace that a connection was dropped by the AP or due to other +* reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and +* %NL80211_ATTR_REASON_CODE attributes are used. +* * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */
@@ -316,6 +332,10 @@ enum nl80211_commands {NL80211_CMD_TESTMODE , +NL80211_CMD_CONNECT , +NL80211_CMD_ROAM , + NL80211_CMD_DISCONNECT, +/* add new commands above here */ /* used to define NL80211_CMD_MAX below */
@@ -520,6 +540,30 @@ enum nl80211_commands {* @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. * We recommend using nested, driver-specific attributes within this. * +* @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT +* event was due to the AP disconnecting the station, and not due to +* a local disconnect request. +* @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT +* event (u16) +* @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating +* that protected APs should be used. +* +* @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to +* indicate which unicast key ciphers will be used with the connection +* (an array of u32). +* @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate +* which group key cipher will be used with the connection (a u32). +* @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate +* which WPA version(s) the AP we want to associate with is using +* (a u32 with flags from &enum nl80211_wpa_versions). +* @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate +* which key management algorithm(s) to use (an array of u32). +* +* @NL80211_ATTR_REQ_IE: (Re)association request information elements as +* sent out by the card, for ROAM and successful CONNECT events. +* @NL80211_ATTR_RESP_IE: (Re)association response information elements as +* sent by peer, for ROAM and successful CONNECT events. +* * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */
@@ -630,6 +674,19 @@ enum nl80211_attrs {NL80211_ATTR_TESTDATA , +NL80211_ATTR_PRIVACY , + +NL80211_ATTR_DISCONNECTED_BY_AP , +NL80211_ATTR_STATUS_CODE , + +NL80211_ATTR_CIPHER_SUITES_PAIRWISE , +NL80211_ATTR_CIPHER_SUITE_GROUP , +NL80211_ATTR_WPA_VERSIONS , +NL80211_ATTR_AKM_SUITES , + +NL80211_ATTR_REQ_IE , +NL80211_ATTR_RESP_IE , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
@@ -640,6 +697,7 @@ enum nl80211_attrs {* Allow user space programs to use #ifdef on new attributes by defining them * here */ +#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
@@ -653,6 +711,10 @@ enum nl80211_attrs {#define NL80211_ATTR_SSID NL80211_ATTR_SSID#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE +#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE +#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP +#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS +#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES#define NL80211_MAX_SUPP_RATES 32#define NL80211_MAX_SUPP_REG_RULES 32
@@ -661,6 +723,9 @@ enum nl80211_attrs {#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24#define NL80211_HT_CAPABILITY_LEN 26 +#define NL80211_MAX_NR_CIPHER_SUITES 5 +#define NL80211_MAX_NR_AKM_SUITES 2 +/** * enum nl80211_iftype - (virtual) interface types *
@@ -1205,12 +1270,22 @@ enum nl80211_bss {* @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) +* @__NL80211_AUTHTYPE_NUM: internal +* @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm +* @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by +* trying multiple times); this is invalid in netlink -- leave out +* the attribute for this on CONNECT commands. */ enum nl80211_auth_type {NL80211_AUTHTYPE_OPEN_SYSTEM ,NL80211_AUTHTYPE_SHARED_KEY ,NL80211_AUTHTYPE_FT ,NL80211_AUTHTYPE_NETWORK_EAP , + +/* keep last */ + __NL80211_AUTHTYPE_NUM, +NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM -1 , +NL80211_AUTHTYPE_AUTOMATIC };/**
@@ -1235,4 +1310,9 @@ enum nl80211_mfp { NL80211_MFP_REQUIRED, }; +enum nl80211_wpa_versions { +NL80211_WPA_VERSION_1 =1 <<0 , +NL80211_WPA_VERSION_2 =1 <<1 , +}; +#endif /* __LINUX_NL80211_H */
include/net/cfg80211.h +129 -6
184 lines not on this page · raw message
net/wireless/Makefile +1 -1
@@ -5,7 +5,7 @@ obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib8 obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o -cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o mlme.o ibss.o +cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o mlme.o ibss.o sme.o cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o
net/wireless/core.h +7 -0
@@ -174,6 +174,13 @@ void cfg80211_clear_ibss(struct net_deviint cfg80211_leave_ibss (struct cfg80211_registered_device *rdev,struct net_device *dev,bool nowext); +/* SME */ +int cfg80211_connect (struct cfg80211_registered_device *rdev, +struct net_device *dev, +struct cfg80211_connect_params *connect); +int cfg80211_disconnect (struct cfg80211_registered_device *rdev, +struct net_device *dev,u16 reason); +/* internal helpers */ int cfg80211_validate_key_settings (struct key_params *params,int key_idx,const u8 *mac_addr);
net/wireless/nl80211.c +361 -7
418 lines not on this page · raw message
net/wireless/sme.c new file +224 -0
224 lines not on this page · raw message
net/wireless/core.c +13 -3
@@ -546,6 +546,7 @@ static int cfg80211_netdev_notifier_call "symlink to netdev!\n"); } wdev->netdev = dev; + wdev->sme_state =CFG80211_SME_IDLE ;#ifdef CONFIG_WIRELESS_EXT wdev->wext.default_key =-1 ; wdev->wext.default_mgmt_key =-1 ;
@@ -553,11 +554,20 @@ static int cfg80211_netdev_notifier_callmutex_unlock (&rdev->devlist_mtx);break ;case NETDEV_GOING_DOWN : -if (wdev->iftype !=NL80211_IFTYPE_ADHOC ) -break ;if (!wdev->ssid_len)break ; -cfg80211_leave_ibss (rdev, dev, true); + +switch (wdev->iftype) { +case NL80211_IFTYPE_ADHOC : +cfg80211_leave_ibss (rdev, dev, true); +break ; +case NL80211_IFTYPE_STATION : +cfg80211_disconnect (rdev, dev, +WLAN_REASON_DEAUTH_LEAVING ); +break ; +default : +break ; + }break ;case NETDEV_UP :#ifdef CONFIG_WIRELESS_EXT
net/wireless/nl80211.h +13 -0
@@ -31,6 +31,19 @@ void nl80211_send_auth_timeout(struct cfvoid nl80211_send_assoc_timeout (struct cfg80211_registered_device *rdev,struct net_device *netdev,const u8 *addr,gfp_t gfp); +void nl80211_send_connect_result (struct cfg80211_registered_device *rdev, +struct net_device *netdev,const u8 *bssid, +const u8 *req_ie,size_t req_ie_len, +const u8 *resp_ie,size_t resp_ie_len, +u16 status,gfp_t gfp); +void nl80211_send_roamed (struct cfg80211_registered_device *rdev, +struct net_device *netdev,const u8 *bssid, +const u8 *req_ie,size_t req_ie_len, +const u8 *resp_ie,size_t resp_ie_len,gfp_t gfp); +void nl80211_send_disconnected (struct cfg80211_registered_device *rdev, +struct net_device *netdev,u16 reason, +u8 *ie,size_t ie_len,bool from_ap,gfp_t gfp); + void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev, struct net_device *netdev, const u8 *addr,
net/mac80211/cfg.c +1 -1
@@ -1262,7 +1262,7 @@ static int ieee80211_assoc(struct wiphy sdata->u.mgd.flags &= ~IEEE80211_STA_MFP_ENABLED ; } -if (req->control_port) +if (req->crypto.control_port) sdata->u.mgd.flags |=IEEE80211_STA_CONTROL_PORT ;else sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT ;
PATCH 1/1 cfg80211: set conn.state properly in the connect() case
We need to set the conn.state to ASSOCIATING for the ->connect() path. By default, it is set to 0, i.e. SCANNING, which causes sme_scan_done() to eventually call conn_do_work(), which then would call assoc() and auth() blindly. That's why we also bug on those hooks not being defined there.
--- net/wireless/sme.c | 3 +++ 1 file changed, 3 insertions(+)
net/wireless/sme.c +3 -0
@@ -103,6 +103,7 @@ static int cfg80211_conn_do_work(struct u.auth_req.ie =NULL ; u.auth_req.ie_len =0 ; wdev->conn.state =CFG80211_CONN_AUTHENTICATING ; +BUG_ON (!drv->ops->auth);return drv->ops->auth (wdev->wiphy, wdev->netdev, &u.auth_req);case CFG80211_CONN_ASSOCIATE_NEXT : u.assoc_req.chan = wdev->conn.params.channel;
@@ -115,6 +116,7 @@ static int cfg80211_conn_do_work(structmemcpy (&u.assoc_req.crypto, &wdev->conn.params.crypto,sizeof (u.assoc_req.crypto)); wdev->conn.state =CFG80211_CONN_ASSOCIATING ; +BUG_ON (!drv->ops->assoc);return drv->ops->assoc (wdev->wiphy, wdev->netdev, &u.assoc_req);default :
@@ -455,6 +457,7 @@ int cfg80211_connect(struct cfg80211_regreturn err; }else { wdev->sme_state =CFG80211_SME_CONNECTING ; + wdev->conn.state =CFG80211_CONN_ASSOCIATING ; err = rdev->ops->connect (&rdev->wiphy, dev, connect);if (err) { wdev->sme_state =CFG80211_SME_IDLE ;
Signature · 13 lines
Intel Open Source Technology Centre http://oss.intel.com/ --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Johannes Berg
maintainerRe: [PATCH] cfg80211: set conn.state properly in the connect() case
Quoted 4 lines · Samuel Ortiz
We need to set the conn.state to ASSOCIATING for the ->connect() path. By default, it is set to 0, i.e. SCANNING, which causes
sme_scan_done()to eventually callconn_do_work(), which then would callassoc()andauth()blindly. That's why we also bug on those hooks not being defined there.
Maybe it would be better to have a default IDLE state for this state machine as well, instead?
johannes
Quoted 33 lines
Signed-off-by Samuel Ortiz <[email protected]>--- net/wireless/sme.c | 3 +++ 1 file changed, 3 insertions(+)Index:
iwm-2.6/net/wireless/sme.c
===================================================================net/wireless/sme.c +3
-0@@ -103,6 +103,7 @@ static int cfg80211_conn_do_work(struct u.auth_req.ie =NULL ; u.auth_req.ie_len =0 ; wdev->conn.state =CFG80211_CONN_AUTHENTICATING ; +BUG_ON (!drv->ops->auth);return drv->ops->auth (wdev->wiphy, wdev->netdev, &u.auth_req);case CFG80211_CONN_ASSOCIATE_NEXT : u.assoc_req.chan = wdev->conn.params.channel;@@ -115,6 +116,7 @@ static int cfg80211_conn_do_work(structmemcpy (&u.assoc_req.crypto, &wdev->conn.params.crypto,sizeof (u.assoc_req.crypto)); wdev->conn.state =CFG80211_CONN_ASSOCIATING ; +BUG_ON (!drv->ops->assoc);return drv->ops->assoc (wdev->wiphy, wdev->netdev, &u.assoc_req);default :@@ -455,6 +457,7 @@ int cfg80211_connect(struct cfg80211_regreturn err; }else { wdev->sme_state =CFG80211_SME_CONNECTING ; + wdev->conn.state =CFG80211_CONN_ASSOCIATING ; err = rdev->ops->connect (&rdev->wiphy, dev, connect);if (err) { wdev->sme_state =CFG80211_SME_IDLE ;
RFC PATCH 1/1 iwmc3200wifi: connect API port
In reply to Johannes BergThis is the iwmc3200wifi port to the new connect API.
With this new API, we basically get rid of the wext entirely, and we'll be able to rip wext.c whenever cfg80211 exports its wext handler array.
--- drivers/net/wireless/iwmc3200wifi/cfg80211.c | 197 ++++++++++++++ drivers/net/wireless/iwmc3200wifi/rx.c | 15 - drivers/net/wireless/iwmc3200wifi/wext.c | 366 --------------------------- 3 files changed, 219 insertions(+), 359 deletions(-)
drivers/net/wireless/iwmc3200wifi/cfg80211.c +197 -0
@@ -305,6 +305,28 @@ static int iwm_cfg80211_set_default_key(return iwm_reset_profile (iwm); } +int iwm_cfg80211_get_station (struct wiphy *wiphy,struct net_device *ndev, +u8 *mac,struct station_info *sinfo) +{ +struct iwm_priv *iwm =ndev_to_iwm (ndev); + +if (memcmp (mac, iwm->bssid,ETH_ALEN )) +return -ENOENT ; + + sinfo->filled |=STATION_INFO_TX_BITRATE ; + sinfo->txrate.flags |=RATE_INFO_FLAGS_MCS ; + sinfo->txrate.legacy = iwm->rate; + +if (!test_bit (IWM_STATUS_ASSOCIATED , &iwm->status)) + sinfo->filled &= ~STATION_INFO_SIGNAL ; +else { + sinfo->filled |=STATION_INFO_SIGNAL ; + sinfo->signal = iwm->wstats.qual.level; + } + +return 0 ; +} +int iwm_cfg80211_inform_bss (struct iwm_priv *iwm) {
@@ -500,6 +522,178 @@ static int iwm_cfg80211_leave_ibss(strucreturn 0 ; } +static int iwm_set_auth_type (struct iwm_priv *iwm, +enum nl80211_auth_type sme_auth_type) +{ +u8 *auth_type = &iwm->umac_profile->sec.auth_type; + +switch (sme_auth_type) { +case NL80211_AUTHTYPE_AUTOMATIC : +case NL80211_AUTHTYPE_OPEN_SYSTEM : +IWM_DBG_WEXT (iwm,DBG ,"OPEN auth\n" ); + *auth_type =UMAC_AUTH_TYPE_OPEN ; +break ; +case NL80211_AUTHTYPE_SHARED_KEY : +if (iwm->umac_profile->sec.flags & + (UMAC_SEC_FLG_WPA_ON_MSK |UMAC_SEC_FLG_RSNA_ON_MSK )) { +IWM_DBG_WEXT (iwm,DBG ,"WPA auth alg\n" ); + *auth_type =UMAC_AUTH_TYPE_RSNA_PSK ; + }else { +IWM_DBG_WEXT (iwm,DBG ,"WEP shared key auth alg\n" ); + *auth_type =UMAC_AUTH_TYPE_LEGACY_PSK ; + } + +break ; +default : +IWM_ERR (iwm,"Unsupported auth alg: 0x%x\n" , sme_auth_type); +return -ENOTSUPP ; + } + +return 0 ; +} + +static int iwm_set_wpa_version (struct iwm_priv *iwm,u32 wpa_version) +{ +if (!wpa_version) { + iwm->umac_profile->sec.flags =UMAC_SEC_FLG_LEGACY_PROFILE ; +return 0 ; + } + +if (wpa_version &NL80211_WPA_VERSION_2 ) + iwm->umac_profile->sec.flags =UMAC_SEC_FLG_RSNA_ON_MSK ; + +if (wpa_version &NL80211_WPA_VERSION_1 ) + iwm->umac_profile->sec.flags |=UMAC_SEC_FLG_WPA_ON_MSK ; + +return 0 ; +} + +static int iwm_set_cipher (struct iwm_priv *iwm,u32 cipher,bool ucast) +{ +u8 *profile_cipher = ucast ? &iwm->umac_profile->sec.ucast_cipher : + &iwm->umac_profile->sec.mcast_cipher; + +if (!cipher) { + *profile_cipher =UMAC_CIPHER_TYPE_NONE ; +return 0 ; + } + +switch (cipher) { +case IW_AUTH_CIPHER_NONE : + *profile_cipher =UMAC_CIPHER_TYPE_NONE ; +break ; +case WLAN_CIPHER_SUITE_WEP40 : + *profile_cipher =UMAC_CIPHER_TYPE_WEP_40 ; +break ; +case WLAN_CIPHER_SUITE_WEP104 : + *profile_cipher =UMAC_CIPHER_TYPE_WEP_104 ; +break ; +case WLAN_CIPHER_SUITE_TKIP : + *profile_cipher =UMAC_CIPHER_TYPE_TKIP ; +break ; +case WLAN_CIPHER_SUITE_CCMP : + *profile_cipher =UMAC_CIPHER_TYPE_CCMP ; +break ; +default : +IWM_ERR (iwm,"Unsupported cipher: 0x%x\n" , cipher); +return -ENOTSUPP ; + } + +return 0 ; +} + +static int iwm_set_key_mgt (struct iwm_priv *iwm,u32 key_mgt) +{ +u8 *auth_type = &iwm->umac_profile->sec.auth_type; + +IWM_DBG_WEXT (iwm,DBG ,"key_mgt: 0x%x\n" , key_mgt); + +if (key_mgt ==WLAN_AKM_SUITE_8021X ) + *auth_type =UMAC_AUTH_TYPE_8021X ; +else if (key_mgt ==WLAN_AKM_SUITE_PSK ) { +if (iwm->umac_profile->sec.flags & + (UMAC_SEC_FLG_WPA_ON_MSK |UMAC_SEC_FLG_RSNA_ON_MSK )) + *auth_type =UMAC_AUTH_TYPE_RSNA_PSK ; +else + *auth_type =UMAC_AUTH_TYPE_LEGACY_PSK ; + }else { +IWM_ERR (iwm,"Invalid key mgt: 0x%x\n" , key_mgt); +return -EINVAL ; + } + +return 0 ; +} + + +static int iwm_cfg80211_connect (struct wiphy *wiphy,struct net_device *dev, +struct cfg80211_connect_params *sme) +{ +struct iwm_priv *iwm =wiphy_to_iwm (wiphy); +struct ieee80211_channel *chan = sme->channel; +int ret; + +if (!test_bit (IWM_STATUS_READY , &iwm->status)) +return -EIO ; + +if (!sme->ssid) +return -EINVAL ; + +if (chan) + iwm->channel = +ieee80211_frequency_to_channel (chan->center_freq); + + iwm->umac_profile->ssid.ssid_len = sme->ssid_len; +memcpy (iwm->umac_profile->ssid.ssid, sme->ssid, sme->ssid_len); +IWM_DBG_WEXT (iwm,DBG ,"SSID: >%s<\n" , iwm->umac_profile->ssid.ssid); + +if (sme->bssid) { +IWM_DBG_WEXT (iwm,DBG ,"BSSID: %pM\n" , sme->bssid); +memcpy (&iwm->umac_profile->bssid[0 ], sme->bssid,ETH_ALEN ); + iwm->umac_profile->bss_num =1 ; + }else { +memset (&iwm->umac_profile->bssid[0 ],0 ,ETH_ALEN ); + iwm->umac_profile->bss_num =0 ; + } + + ret =iwm_set_auth_type (iwm, sme->auth_type); +if (ret <0 ) +return ret; + + ret =iwm_set_wpa_version (iwm, sme->crypto.wpa_versions); +if (ret <0 ) +return ret; + +if (sme->crypto.n_ciphers_pairwise) { + ret =iwm_set_cipher (iwm, sme->crypto.ciphers_pairwise[0 ], + true); +if (ret <0 ) +return ret; + } + + ret =iwm_set_cipher (iwm, sme->crypto.cipher_group, false); +if (ret <0 ) +return ret; + + ret =iwm_set_key_mgt (iwm, sme->crypto.akm_suites[0 ]); +if (ret <0 ) +return ret; + +return iwm_send_mlme_profile (iwm); +} + +static int iwm_cfg80211_disconnect (struct wiphy *wiphy,struct net_device *dev, +u16 reason_code) +{ +struct iwm_priv *iwm =wiphy_to_iwm (wiphy); + +IWM_DBG_WEXT (iwm,DBG ,"Active: %d\n" , iwm->umac_profile_active); + +if (iwm->umac_profile_active) +return iwm_invalidate_mlme_profile (iwm); + +return 0 ; +} +static int iwm_cfg80211_set_txpower (struct wiphy *wiphy,enum tx_power_setting type,int dbm) {
@@ -549,8 +743,11 @@ static struct cfg80211_ops iwm_cfg80211_ .get_key = iwm_cfg80211_get_key, .del_key = iwm_cfg80211_del_key, .set_default_key = iwm_cfg80211_set_default_key, + .get_station = iwm_cfg80211_get_station, .scan = iwm_cfg80211_scan, .set_wiphy_params = iwm_cfg80211_set_wiphy_params, + .connect = iwm_cfg80211_connect, + .disconnect = iwm_cfg80211_disconnect, .join_ibss = iwm_cfg80211_join_ibss, .leave_ibss = iwm_cfg80211_leave_ibss, .set_tx_power = iwm_cfg80211_set_txpower,
drivers/net/wireless/iwmc3200wifi/wext.c +11 -355
408 lines not on this page · raw message
drivers/net/wireless/iwmc3200wifi/rx.c +11 -4
@@ -521,7 +521,12 @@ static int iwm_mlme_assoc_complete(struciwm_link_on (iwm); -memcpy (wrqu.ap_addr.sa_data, complete->bssid,ETH_ALEN ); +if (iwm_to_wdev (iwm)->sme_state !=CFG80211_SME_CONNECTED ) +cfg80211_connect_result (iwm_to_ndev (iwm), + complete->bssid, +NULL ,0 ,NULL ,0 , +WLAN_STATUS_SUCCESS , +GFP_KERNEL );break ;case UMAC_ASSOC_COMPLETE_FAILURE :clear_bit (IWM_STATUS_ASSOCIATED , &iwm->status);
@@ -529,6 +534,11 @@ static int iwm_mlme_assoc_complete(struc iwm->channel =0 ;iwm_link_off (iwm); + +cfg80211_connect_result (iwm_to_ndev (iwm), complete->bssid, +NULL ,0 ,NULL ,0 , +WLAN_STATUS_UNSPECIFIED_FAILURE , +GFP_KERNEL );default :break ; }
@@ -538,9 +548,6 @@ static int iwm_mlme_assoc_complete(strucreturn 0 ; } - wrqu.ap_addr.sa_family =ARPHRD_ETHER ; -wireless_send_event (iwm_to_ndev (iwm),SIOCGIWAP , &wrqu,NULL ); -return 0 ; }
Signature · 13 lines
Intel Open Source Technology Centre http://oss.intel.com/ --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Johannes Berg
maintainerPATCH v3 2/8 cfg80211: emulate connect with auth/assoc
In reply to Johannes BergThis adds code to cfg80211 so that drivers (mac80211 right now) that don't implement connect but rather auth/assoc can still be used with the nl80211 connect command. This will also be necessary for the wext compat code.
--- include/net/cfg80211.h | 18 ++ net/wireless/core.c | 3 net/wireless/core.h | 7 + net/wireless/mlme.c | 114 +++++++++++++++--- net/wireless/nl80211.c | 4 net/wireless/scan.c | 7 + net/wireless/sme.c | 305 +++++++++++++++++++++++++++++++++++++++++++++++-- 7 files changed, 427 insertions(+), 31 deletions(-)
net/wireless/core.h +7 -0
@@ -62,6 +62,8 @@ struct cfg80211_registered_device {struct genl_info *testmode_info;#endif +struct work_struct conn_work; +#ifdef CONFIG_CFG80211_DEBUGFS /* Debugfs entries */ struct wiphy_debugfsdentries {
@@ -181,8 +183,13 @@ int cfg80211_connect(struct cfg80211_regint cfg80211_disconnect (struct cfg80211_registered_device *rdev,struct net_device *dev,u16 reason); +void cfg80211_conn_work (struct work_struct *work); +/* internal helpers */ int cfg80211_validate_key_settings (struct key_params *params,int key_idx,const u8 *mac_addr); +void __cfg80211_disconnected (struct net_device *dev,gfp_t gfp,u8 *ie, +size_t ie_len,u16 reason,bool from_ap); +void cfg80211_sme_scan_done (struct net_device *dev);#endif /* __NET_WIRELESS_CORE_H */
net/wireless/nl80211.c +2 -2
@@ -351,12 +351,12 @@ static int nl80211_send_wiphy(struct sk_#undef CMD -if (dev->ops->connect) { +if (dev->ops->connect || dev->ops->auth) { i++;NLA_PUT_U32 (msg, i,NL80211_CMD_CONNECT ); } -if (dev->ops->disconnect) { +if (dev->ops->disconnect || dev->ops->deauth) { i++;NLA_PUT_U32 (msg, i,NL80211_CMD_DISCONNECT ); }
net/wireless/sme.c +293 -12
363 lines not on this page · raw message
net/wireless/mlme.c +98 -16
156 lines not on this page · raw message
net/wireless/core.c +3 -0
@@ -321,6 +321,7 @@ struct wiphy *wiphy_new(const struct cfg }INIT_WORK (&drv->rfkill_sync, cfg80211_rfkill_sync_work); +INIT_WORK (&drv->conn_work, cfg80211_conn_work);/* * Initialize wiphy parameters to IEEE 802.11 MIB default values.
@@ -481,6 +482,8 @@ void wiphy_unregister(struct wiphy *wiph/* unlock again before freeing */ mutex_unlock (&drv->mtx); +cancel_work_sync (&drv->conn_work); +cfg80211_debugfs_drv_del (drv);/* If this device got a regulatory hint tell core its
include/net/cfg80211.h +17 -1
@@ -1242,9 +1242,25 @@ struct wireless_dev {u8 ssid_len;enum {CFG80211_SME_IDLE , -CFG80211_SME_CONNECTING ,/* ->connect called */ +CFG80211_SME_CONNECTING ,CFG80211_SME_CONNECTED , } sme_state; +struct { +struct cfg80211_connect_params params; +/* these are sub-states of the _CONNECTING sme_state */ +enum { +CFG80211_CONN_SCANNING , +CFG80211_CONN_SCAN_AGAIN , +CFG80211_CONN_AUTHENTICATE_NEXT , +CFG80211_CONN_AUTHENTICATING , +CFG80211_CONN_ASSOCIATE_NEXT , +CFG80211_CONN_ASSOCIATING , + } state; +u8 bssid[ETH_ALEN ]; +u8 *ie; +size_t ie_len; +bool auto_auth; + } conn;#ifdef CONFIG_WIRELESS_EXT /* wext data */
net/wireless/scan.c +7 -0
@@ -30,6 +30,13 @@ void cfg80211_scan_done(struct cfg80211_WARN_ON (request !=wiphy_to_dev (request->wiphy)->scan_req); +/* +* This must be before sending the other events! +* Otherwise, wpa_supplicant gets completely confused with +* wext events. +*/ +cfg80211_sme_scan_done (dev); +if (aborted)nl80211_send_scan_aborted (wiphy_to_dev (request->wiphy), dev);else
Johannes Berg
maintainerPATCH v3 3/8 cfg80211: managed mode wext compatibility
In reply to Johannes BergThis adds code to make it possible to use the cfg80211 connect() API with wireless extensions, and because the previous patch added emulation of that API with auth() and assoc(), by extension also supports wext on that. At the same time, removes code from mac80211 for wext, but doesn't yet clean up mac80211's mlme code more.
--- include/net/cfg80211.h | 36 ++++ net/mac80211/mlme.c | 69 --------- net/mac80211/wext.c | 215 ++--------------------------- net/wireless/Makefile | 2 net/wireless/core.c | 23 ++- net/wireless/core.h | 3 net/wireless/nl80211.c | 2 net/wireless/sme.c | 55 ++++--- net/wireless/wext-compat.c | 230 +++++++++++++++++++++++++------ net/wireless/wext-sme.c | 329 +++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 626 insertions(+), 338 deletions(-)
include/net/cfg80211.h +35 -1
@@ -1265,8 +1265,14 @@ struct wireless_dev {#ifdef CONFIG_WIRELESS_EXT /* wext data */ struct { -struct cfg80211_ibss_params ibss; +union { +struct cfg80211_ibss_params ibss; +struct cfg80211_connect_params connect; + }; +u8 *ie; +size_t ie_len;u8 bssid[ETH_ALEN ]; +u8 ssid[IEEE80211_MAX_SSID_LEN ];s8 default_key, default_mgmt_key; } wext;#endif
@@ -1547,6 +1553,34 @@ int cfg80211_ibss_wext_giwap(struct net_struct iw_request_info *info, struct sockaddr *ap_addr, char *extra); +int cfg80211_mgd_wext_siwfreq (struct net_device *dev, +struct iw_request_info *info, +struct iw_freq *freq,char *extra); +int cfg80211_mgd_wext_giwfreq (struct net_device *dev, +struct iw_request_info *info, +struct iw_freq *freq,char *extra); +int cfg80211_mgd_wext_siwessid (struct net_device *dev, +struct iw_request_info *info, +struct iw_point *data,char *ssid); +int cfg80211_mgd_wext_giwessid (struct net_device *dev, +struct iw_request_info *info, +struct iw_point *data,char *ssid); +int cfg80211_mgd_wext_siwap (struct net_device *dev, +struct iw_request_info *info, +struct sockaddr *ap_addr,char *extra); +int cfg80211_mgd_wext_giwap (struct net_device *dev, +struct iw_request_info *info, +struct sockaddr *ap_addr,char *extra); +int cfg80211_wext_siwgenie (struct net_device *dev, +struct iw_request_info *info, +struct iw_point *data,char *extra); +int cfg80211_wext_siwauth (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *data,char *extra); +int cfg80211_wext_giwauth (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *data,char *extra); +struct ieee80211_channel *cfg80211_wext_freq (struct wiphy *wiphy,struct iw_freq *freq);
net/wireless/Makefile +1 -1
@@ -7,6 +7,6 @@ obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o mlme.o ibss.o sme.o cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o -cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o +cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o wext-sme.o ccflags-y += -D__CHECK_ENDIAN__
net/wireless/wext-sme.c new file +329 -0
329 lines not on this page · raw message
net/wireless/core.c +19 -4
@@ -553,6 +553,7 @@ static int cfg80211_netdev_notifier_call#ifdef CONFIG_WIRELESS_EXT wdev->wext.default_key =-1 ; wdev->wext.default_mgmt_key =-1 ; + wdev->wext.connect.auth_type =NL80211_AUTHTYPE_AUTOMATIC ;#endif mutex_unlock (&rdev->devlist_mtx);break ;
@@ -565,8 +566,13 @@ static int cfg80211_netdev_notifier_callcfg80211_leave_ibss (rdev, dev, true);break ;case NL80211_IFTYPE_STATION : +#ifdef CONFIG_WIRELESS_EXT +kfree (wdev->wext.ie); + wdev->wext.ie =NULL ; + wdev->wext.ie_len =0 ; +#endif cfg80211_disconnect (rdev, dev, -WLAN_REASON_DEAUTH_LEAVING ); +WLAN_REASON_DEAUTH_LEAVING , true);break ;default :break ;
@@ -574,11 +580,20 @@ static int cfg80211_netdev_notifier_callbreak ;case NETDEV_UP :#ifdef CONFIG_WIRELESS_EXT -if (wdev->iftype !=NL80211_IFTYPE_ADHOC ) +switch (wdev->iftype) { +case NL80211_IFTYPE_ADHOC : +if (wdev->wext.ibss.ssid_len) +cfg80211_join_ibss (rdev, dev, + &wdev->wext.ibss);break ; -if (!wdev->wext.ibss.ssid_len) +case NL80211_IFTYPE_STATION : +if (wdev->wext.connect.ssid_len) +cfg80211_connect (rdev, dev, + &wdev->wext.connect); +break ; +default :break ; -cfg80211_join_ibss (rdev, dev, &wdev->wext.ibss); + }#endif break ;case NETDEV_UNREGISTER :
net/mac80211/wext.c +20 -195
295 lines not on this page · raw message
net/mac80211/mlme.c +0 -69
93 lines not on this page · raw message
net/wireless/wext-compat.c +186 -44
239 lines not on this page · raw message
net/wireless/core.h +2 -1
@@ -181,7 +181,8 @@ int cfg80211_connect(struct cfg80211_regstruct net_device *dev, struct cfg80211_connect_params *connect);int cfg80211_disconnect (struct cfg80211_registered_device *rdev, -struct net_device *dev,u16 reason); +struct net_device *dev,u16 reason, +bool wextev);void cfg80211_conn_work (struct work_struct *work);
net/wireless/nl80211.c +1 -1
@@ -3746,7 +3746,7 @@ static int nl80211_disconnect(struct sk_ goto out; } - err =cfg80211_disconnect (drv, dev, reason); + err =cfg80211_disconnect (drv, dev, reason, true); out:cfg80211_put_dev (drv);
net/wireless/sme.c +33 -22
84 lines not on this page · raw message
Johannes Berg
maintainerPATCH v3 4/8 cfg80211: implement iwpower
In reply to Johannes BergJust on/off and timeout, and with a hacky cfg80211 method until we figure out what we want, though this is probably sufficient as we want to use pm_qos for wifi everywhere.
--- drivers/net/wireless/iwmc3200wifi/cfg80211.c | 22 ++++++++ drivers/net/wireless/iwmc3200wifi/wext.c | 47 ------------------ include/net/cfg80211.h | 13 +++++ net/mac80211/Kconfig | 16 ------ net/mac80211/cfg.c | 26 ++++++++++ net/mac80211/mlme.c | 5 - net/mac80211/wext.c | 70 --------------------------- net/wireless/Kconfig | 16 ++++++ net/wireless/core.c | 11 +++- net/wireless/wext-compat.c | 60 +++++++++++++++++++++++ 10 files changed, 151 insertions(+), 135 deletions(-)
include/net/cfg80211.h +13 -0
@@ -1023,6 +1023,10 @@ struct cfg80211_ops {#ifdef CONFIG_NL80211_TESTMODE int (*testmode_cmd)(struct wiphy *wiphy,void *data,int len);#endif + +/* some temporary stuff to finish wext */ +int (*set_power_mgmt)(struct wiphy *wiphy,struct net_device *dev, +bool enabled,int timeout); };/*
@@ -1274,6 +1278,8 @@ struct wireless_dev {u8 bssid[ETH_ALEN ];u8 ssid[IEEE80211_MAX_SSID_LEN ];s8 default_key, default_mgmt_key; +bool ps; + int ps_timeout; } wext;#endif };
@@ -1618,6 +1624,13 @@ int cfg80211_wext_giwtxpower(struct net_struct iw_request_info *info, union iwreq_data *data, char *keybuf); +int cfg80211_wext_siwpower (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *wrq,char *extra); +int cfg80211_wext_giwpower (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *wrq,char *extra); +/* * callbacks for asynchronous cfg80211 methods, notification * functions and BSS handling helpers
net/mac80211/Kconfig +0 -16
@@ -14,22 +14,6 @@ config MAC80211 comment "CFG80211 needs to be enabled for MAC80211" depends on CFG80211=n -config MAC80211_DEFAULT_PS - bool "enable powersave by default" - depends on MAC80211 - default y - help - This option enables powersave mode by default. - - If this causes your applications to misbehave you should fix your - applications instead -- they need to register their network - latency requirement, see Documentation/power/pm_qos_interface.txt. - -config MAC80211_DEFAULT_PS_VALUE - int - default 1 if MAC80211_DEFAULT_PS - default 0 - menu "Rate control algorithm selection" depends on MAC80211 != n
net/mac80211/wext.c +2 -68
82 lines not on this page · raw message
net/wireless/Kconfig +16 -0
@@ -26,6 +26,22 @@ config CFG80211_REG_DEBUG If unsure, say N. +config CFG80211_DEFAULT_PS + bool "enable powersave by default" + depends on CFG80211 + default y + help + This option enables powersave mode by default. + + If this causes your applications to misbehave you should fix your + applications instead -- they need to register their network + latency requirement, see Documentation/power/pm_qos_interface.txt. + +config CFG80211_DEFAULT_PS_VALUE + int + default 1 if CFG80211_DEFAULT_PS + default 0 + config CFG80211_DEBUGFS bool "cfg80211 DebugFS entries" depends on CFG80211 && DEBUG_FS
net/wireless/core.c +10 -1
@@ -550,12 +550,21 @@ static int cfg80211_netdev_notifier_call } wdev->netdev = dev; wdev->sme_state =CFG80211_SME_IDLE ; +mutex_unlock (&rdev->devlist_mtx);#ifdef CONFIG_WIRELESS_EXT wdev->wext.default_key =-1 ; wdev->wext.default_mgmt_key =-1 ; wdev->wext.connect.auth_type =NL80211_AUTHTYPE_AUTOMATIC ; + wdev->wext.ps =CONFIG_CFG80211_DEFAULT_PS_VALUE ; + wdev->wext.ps_timeout =500 ; +if (rdev->ops->set_power_mgmt) +if (rdev->ops->set_power_mgmt (wdev->wiphy, dev, + wdev->wext.ps, + wdev->wext.ps_timeout)) { +/* assume this means it's off */ + wdev->wext.ps = false; + }#endif -mutex_unlock (&rdev->devlist_mtx);break ;case NETDEV_GOING_DOWN :if (!wdev->ssid_len)
net/wireless/wext-compat.c +60 -0
63 lines not on this page · raw message
net/mac80211/cfg.c +26 -0
@@ -1388,6 +1388,31 @@ int ieee80211_testmode_cmd(struct wiphy }#endif +static int ieee80211_set_power_mgmt (struct wiphy *wiphy,struct net_device *dev, +bool enabled,int timeout) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct ieee80211_conf *conf = &local->hw.conf; + +if (!(local->hw.flags &IEEE80211_HW_SUPPORTS_PS )) +return -EOPNOTSUPP ; + +if (enabled == sdata->u.mgd.powersave && + timeout == conf->dynamic_ps_timeout) +return 0 ; + + sdata->u.mgd.powersave = enabled; + conf->dynamic_ps_timeout = timeout; + +if (local->hw.flags &IEEE80211_HW_SUPPORTS_DYNAMIC_PS ) +ieee80211_hw_config (local,IEEE80211_CONF_CHANGE_PS ); + +ieee80211_recalc_ps (local,-1 ); + +return 0 ; +} +struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface,
@@ -1431,4 +1456,5 @@ struct cfg80211_ops mac80211_config_ops .get_tx_power = ieee80211_get_tx_power, .rfkill_poll = ieee80211_rfkill_poll, CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) + .set_power_mgmt = ieee80211_set_power_mgmt, };
net/mac80211/mlme.c +0 -5
@@ -2360,11 +2360,6 @@ void ieee80211_sta_setup_sdata(struct ie ifmgd->flags |=IEEE80211_STA_WMM_ENABLED ; hw_flags = sdata->local->hw.flags; - -if (hw_flags &IEEE80211_HW_SUPPORTS_PS ) { - ifmgd->powersave =CONFIG_MAC80211_DEFAULT_PS_VALUE ; - sdata->local->hw.conf.dynamic_ps_timeout =500 ; - } }/* configuration hooks */
drivers/net/wireless/iwmc3200wifi/cfg80211.c +22 -0
@@ -522,6 +522,27 @@ static int iwm_cfg80211_get_txpower(strureturn 0 ; } +static int iwm_cfg80211_set_power_mgmt (struct wiphy *wiphy, +struct net_device *dev, +bool enabled,int timeout) +{ +struct iwm_priv *iwm =wiphy_to_iwm (wiphy); +u32 power_index; + +if (enabled) + power_index =IWM_POWER_INDEX_DEFAULT ; +else + power_index =IWM_POWER_INDEX_MIN ; + +if (power_index == iwm->conf.power_index) +return 0 ; + + iwm->conf.power_index = power_index; + +return iwm_umac_set_config_fix (iwm,UMAC_PARAM_TBL_CFG_FIX , +CFG_POWER_INDEX , iwm->conf.power_index); +} +static struct cfg80211_ops iwm_cfg80211_ops = { .change_virtual_intf = iwm_cfg80211_change_iface, .add_key = iwm_cfg80211_add_key,
@@ -534,6 +555,7 @@ static struct cfg80211_ops iwm_cfg80211_ .leave_ibss = iwm_cfg80211_leave_ibss, .set_tx_power = iwm_cfg80211_set_txpower, .get_tx_power = iwm_cfg80211_get_txpower, + .set_power_mgmt = iwm_cfg80211_set_power_mgmt, };struct wireless_dev *iwm_wdev_alloc (int sizeof_bus,struct device *dev)
drivers/net/wireless/iwmc3200wifi/wext.c +2 -45
59 lines not on this page · raw message
Johannes Berg
maintainerPATCH v3 5/8 cfg80211: implement IWAP for WDS
In reply to Johannes BergThis implements siocsiwap/giwap for WDS mode.
--- include/net/cfg80211.h | 10 +++++++++ net/mac80211/cfg.c | 11 ++++++++++ net/mac80211/wext.c | 26 +++---------------------- net/wireless/wext-compat.c | 46 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 22 deletions(-)
include/net/cfg80211.h +10 -0
@@ -1018,6 +1018,9 @@ struct cfg80211_ops { enum tx_power_setting type, int dbm);int (*get_tx_power)(struct wiphy *wiphy,int *dbm); +int (*set_wds_peer)(struct wiphy *wiphy,struct net_device *dev, +u8 *addr); +void (*rfkill_poll)(struct wiphy *wiphy);#ifdef CONFIG_NL80211_TESTMODE
@@ -1631,6 +1634,13 @@ int cfg80211_wext_giwpower(struct net_destruct iw_request_info *info, struct iw_param *wrq, char *extra); +int cfg80211_wds_wext_siwap (struct net_device *dev, +struct iw_request_info *info, +struct sockaddr *addr,char *extra); +int cfg80211_wds_wext_giwap (struct net_device *dev, +struct iw_request_info *info, +struct sockaddr *addr,char *extra); +/* * callbacks for asynchronous cfg80211 methods, notification * functions and BSS handling helpers
net/mac80211/wext.c +4 -22
@@ -140,23 +140,8 @@ static int ieee80211_ioctl_siwap(structif (sdata->vif.type ==NL80211_IFTYPE_STATION )return cfg80211_mgd_wext_siwap (dev, info, ap_addr, extra); -if (sdata->vif.type ==NL80211_IFTYPE_WDS ) { -/* -* If it is necessary to update the WDS peer address -* while the interface is running, then we need to do -* more work here, namely if it is running we need to -* add a new and remove the old STA entry, this is -* normally handled by _open() and _stop(). -*/ -if (netif_running (dev)) -return -EBUSY ; - -memcpy (&sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data, -ETH_ALEN ); - -return 0 ; - } - +if (sdata->vif.type ==NL80211_IFTYPE_WDS ) +return cfg80211_wds_wext_siwap (dev, info, ap_addr, extra);return -EOPNOTSUPP ; }
@@ -173,11 +158,8 @@ static int ieee80211_ioctl_giwap(structif (sdata->vif.type ==NL80211_IFTYPE_STATION )return cfg80211_mgd_wext_giwap (dev, info, ap_addr, extra); -if (sdata->vif.type ==NL80211_IFTYPE_WDS ) { - ap_addr->sa_family =ARPHRD_ETHER ; -memcpy (&ap_addr->sa_data, sdata->u.wds.remote_addr,ETH_ALEN ); -return 0 ; - } +if (sdata->vif.type ==NL80211_IFTYPE_WDS ) +return cfg80211_wds_wext_giwap (dev, info, ap_addr, extra);return -EOPNOTSUPP ; }
net/wireless/wext-compat.c +46 -0
49 lines not on this page · raw message
net/mac80211/cfg.c +11 -0
@@ -1369,6 +1369,16 @@ static int ieee80211_get_tx_power(structreturn 0 ; } +static int ieee80211_set_wds_peer (struct wiphy *wiphy,struct net_device *dev, +u8 *addr) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); + +memcpy (&sdata->u.wds.remote_addr, addr,ETH_ALEN ); + +return 0 ; +} +static void ieee80211_rfkill_poll (struct wiphy *wiphy) {struct ieee80211_local *local =wiphy_priv (wiphy);
@@ -1454,6 +1464,7 @@ struct cfg80211_ops mac80211_config_ops .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, + .set_wds_peer = ieee80211_set_wds_peer, .rfkill_poll = ieee80211_rfkill_poll,CFG80211_TESTMODE_CMD (ieee80211_testmode_cmd) .set_power_mgmt = ieee80211_set_power_mgmt,
Johannes Berg
maintainerPATCH v3 6/8 cfg80211: implement IWRATE
In reply to Johannes BergFor now, let's implement that using a very hackish way:
simply mirror the wext API in the cfg80211 API. This will have to be changed later when we implement proper bitrate API.
--- include/net/cfg80211.h | 32 ++++++++++++++++++ net/mac80211/cfg.c | 43 +++++++++++++++++++++++++ net/mac80211/wext.c | 76 +-------------------------------------------- net/wireless/wext-compat.c | 63 +++++++++++++++++++++++++++++++++++++ 4 files changed, 140 insertions(+), 74 deletions(-)
include/net/cfg80211.h +32 -0
@@ -815,6 +815,26 @@ enum tx_power_setting { TX_POWER_FIXED, }; +/* +* cfg80211_bitrate_mask - masks for bitrate control +*/ +struct cfg80211_bitrate_mask { +/* +* As discussed in Berlin, this struct really +* should look like this: + +struct { +u32 legacy; +u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; +} control[IEEE80211_NUM_BANDS]; + +* Since we can always fix in-kernel users, let's keep +* it simpler for now: +*/ +u32 fixed;/* fixed bitrate, 0 == not fixed */ +u32 maxrate;/* in kbps, 0 == no limit */ +}; +/** * struct cfg80211_ops - backend description for wireless configuration *
@@ -1027,6 +1047,11 @@ struct cfg80211_ops {int (*testmode_cmd)(struct wiphy *wiphy,void *data,int len);#endif +int (*set_bitrate_mask)(struct wiphy *wiphy, +struct net_device *dev, +const u8 *peer, +const struct cfg80211_bitrate_mask *mask); +/* some temporary stuff to finish wext */ int (*set_power_mgmt)(struct wiphy *wiphy,struct net_device *dev,bool enabled,int timeout);
@@ -1593,6 +1618,13 @@ int cfg80211_wext_giwauth(struct net_devstruct ieee80211_channel *cfg80211_wext_freq (struct wiphy *wiphy,struct iw_freq *freq); +int cfg80211_wext_siwrate (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *rate,char *extra); +int cfg80211_wext_giwrate (struct net_device *dev, +struct iw_request_info *info, +struct iw_param *rate,char *extra); +int cfg80211_wext_siwrts (struct net_device *dev,struct iw_request_info *info,struct iw_param *rts,char *extra);
net/mac80211/cfg.c +43 -0
53 lines not on this page · raw message
net/mac80211/wext.c +2 -74
88 lines not on this page · raw message
net/wireless/wext-compat.c +63 -0
66 lines not on this page · raw message
Johannes Berg
maintainerPATCH v3 7/8 cfg80211: implement get_wireless_stats
In reply to Johannes BergBy dropping the noise reporting, we can implement wireless stats in cfg80211. We also make the handler return NULL if we have no information, which is possible thanks to the recent wext change.
--- include/net/cfg80211.h | 1 net/mac80211/wext.c | 69 --------------------------------------------- net/wireless/wext-compat.c | 59 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 68 deletions(-)
net/mac80211/wext.c +1 -68
@@ -165,73 +165,6 @@ static int ieee80211_ioctl_giwap(struct } -/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */ -static struct iw_statistics *ieee80211_get_wireless_stats (struct net_device *dev) -{ -struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); -struct iw_statistics *wstats = &local->wstats; -struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); -struct sta_info *sta =NULL ; - -rcu_read_lock (); - -if (sdata->vif.type ==NL80211_IFTYPE_STATION ) - sta =sta_info_get (local, sdata->u.mgd.bssid); - -if (!sta) { - wstats->discard.fragment =0 ; - wstats->discard.misc =0 ; - wstats->qual.qual =0 ; - wstats->qual.level =0 ; - wstats->qual.noise =0 ; - wstats->qual.updated =IW_QUAL_ALL_INVALID ; - }else { - wstats->qual.updated =0 ; -/* -* mirror what cfg80211 does for iwrange/scan results, -* otherwise userspace gets confused. -*/ -if (local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC | -IEEE80211_HW_SIGNAL_DBM )) { - wstats->qual.updated |=IW_QUAL_LEVEL_UPDATED ; - wstats->qual.updated |=IW_QUAL_QUAL_UPDATED ; - }else { - wstats->qual.updated |=IW_QUAL_LEVEL_INVALID ; - wstats->qual.updated |=IW_QUAL_QUAL_INVALID ; - } - -if (local->hw.flags &IEEE80211_HW_SIGNAL_UNSPEC ) { - wstats->qual.level = sta->last_signal; - wstats->qual.qual = sta->last_signal; - }else if (local->hw.flags &IEEE80211_HW_SIGNAL_DBM ) { -int sig = sta->last_signal; - - wstats->qual.updated |=IW_QUAL_DBM ; - wstats->qual.level = sig; -if (sig <-110 ) - sig =-110 ; -else if (sig >-40 ) - sig =-40 ; - wstats->qual.qual = sig +110 ; - } - -if (local->hw.flags &IEEE80211_HW_NOISE_DBM ) { -/* -* This assumes that if driver reports noise, it also -* reports signal in dBm. -*/ - wstats->qual.noise = sta->last_noise; - wstats->qual.updated |=IW_QUAL_NOISE_UPDATED ; - }else { - wstats->qual.updated |=IW_QUAL_NOISE_INVALID ; - } - } - -rcu_read_unlock (); - -return wstats; -} -/* Structures to export the Wireless Handlers */ static const iw_handler ieee80211_handler[] =
@@ -298,5 +231,5 @@ const struct iw_handler_def ieee80211_iw { .num_standard = ARRAY_SIZE(ieee80211_handler), .standard = (iw_handler *) ieee80211_handler, - .get_wireless_stats = ieee80211_get_wireless_stats, + .get_wireless_stats = cfg80211_wireless_stats, };
net/wireless/wext-compat.c +59 -0
62 lines not on this page · raw message
include/net/cfg80211.h +1 -0
@@ -1658,6 +1658,7 @@ int cfg80211_wext_siwtxpower(struct net_int cfg80211_wext_giwtxpower (struct net_device *dev,struct iw_request_info *info,union iwreq_data *data,char *keybuf); +struct iw_statistics *cfg80211_wireless_stats (struct net_device *dev); int cfg80211_wext_siwpower(struct net_device *dev, struct iw_request_info *info,
Johannes Berg
maintainerPATCH v3 8/8 mac80211: re-add HT disabling
In reply to Johannes BergThe IEEE80211_STA_TKIP_WEP_USED flag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.
--- net/mac80211/cfg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +14 -1
@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) {struct ieee80211_sub_if_data *sdata; -int ret; +int ret, i; sdata =IEEE80211_DEV_TO_SUB_IF (dev);
@@ -1236,6 +1236,19 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED))return -ENOLINK ;/* not authenticated */ + sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED ; + +if (req->crypto.cipher_group ==WLAN_CIPHER_SUITE_WEP40 || + req->crypto.cipher_group ==WLAN_CIPHER_SUITE_TKIP || + req->crypto.cipher_group ==WLAN_CIPHER_SUITE_WEP104 ) + sdata->u.mgd.flags |=IEEE80211_STA_TKIP_WEP_USED ; + +for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) +if (req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_WEP40 || + req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_TKIP || + req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_WEP104 ) + sdata->u.mgd.flags |=IEEE80211_STA_TKIP_WEP_USED ; + sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL ; sdata->u.mgd.flags |=IEEE80211_STA_BSSID_SET ;
Re: [PATCH 8/8 v3] mac80211: re-add HT disabling
Quoted 22 lines · Johannes Berg
The
IEEE80211_STA_TKIP_WEP_USEDflag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.Signed-off-by Johannes Berg <[email protected]>--- net/mac80211/cfg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +1
-1@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) { struct ieee80211_sub_if_data *sdata; - int ret; + int ret, i; sdata = IEEE80211_DEV_TO_SUB_IF(dev);
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 static int ieee80211_assoc(struct wiphy · line 1244
Quoted 9 lines
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +6
-0@@ -1236,6 +1236,19 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) return -ENOLINK; /* not authenticated */ + sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; + + if (req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40 || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) + sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;
No, we have to disable HT only when WEP/TKIP is used as pairwise, not used as group cipher.
Vasanth
Johannes Berg
maintainerRe: [PATCH 8/8 v3] mac80211: re-add HT disabling
Quoted 26 lines · Vasanthakumar Thiagarajan
Quoted 25 lines · Johannes Berg
The
IEEE80211_STA_TKIP_WEP_USEDflag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.Signed-off-by Johannes Berg <[email protected]>--- net/mac80211/cfg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +1
-1@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) { struct ieee80211_sub_if_data *sdata; - int ret; + int ret, i; sdata = IEEE80211_DEV_TO_SUB_IF(dev);@@ -1236,6 +1236,19 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) return -ENOLINK; /* not authenticated */
Quoted 9 lines
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 static int ieee80211_assoc(struct wiphy · line 1244
Quoted 6 lines
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +6
-0+ sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; + + if (req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40 || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) + sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;No, we have to disable HT only when WEP/TKIP is used as pairwise, not used as group cipher.
I thought it was both, but I guess group doesn't actually matter. OTOH, this seems to match the standard better (HT STA is not allowed to use TKIP/WEP)?
johannes
Re: [PATCH 8/8 v3] mac80211: re-add HT disabling
Quoted 37 lines · Johannes Berg
Quoted 26 lines · Vasanthakumar Thiagarajan
Quoted 25 lines · Johannes Berg
The
IEEE80211_STA_TKIP_WEP_USEDflag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.Signed-off-by Johannes Berg <[email protected]>--- net/mac80211/cfg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +1
-1@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) { struct ieee80211_sub_if_data *sdata; - int ret; + int ret, i; sdata = IEEE80211_DEV_TO_SUB_IF(dev);@@ -1236,6 +1236,19 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) return -ENOLINK; /* not authenticated */Quoted 9 lines
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 static int ieee80211_assoc(struct wiphy · line 1244
Quoted 6 lines
net/mac80211/cfg.c 2009-06-30 13:25:45.000000000 +0200 renamed from net/mac80211/cfg.c 2009-06-30 13:25:43.000000000 +0200 +6
-0+ sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; + + if (req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP40 || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_TKIP || + req->crypto.cipher_group == WLAN_CIPHER_SUITE_WEP104) + sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED;No, we have to disable HT only when WEP/TKIP is used as pairwise, not used as group cipher.
Quoted 3 lines
I thought it was both, but I guess group doesn't actually matter. OTOH, this seems to match the standard better (HT STA is not allowed to use TKIP/WEP)?
Section 8.1.5 of 11n draft-8.0 says
"An HT STA shall not use either of the pairwise cipher suite
selectors: "Use group cipher suite" or TKIP to communicate with another HT STA".
That seems to only talk about pairwise, I'm missing something here?.
Vasanth
Johannes Berg
maintainerRe: [PATCH 8/8 v3] mac80211: re-add HT disabling
Quoted 10 lines · Vasanthakumar Thiagarajan
Quoted 3 lines
I thought it was both, but I guess group doesn't actually matter. OTOH, this seems to match the standard better (HT STA is not allowed to use TKIP/WEP)?
Section 8.1.5 of 11n draft-8.0 says
"An HT STA shall not use either of the pairwise cipher suite
selectors: "Use group cipher suite" or TKIP to communicate with another HT STA".That seems to only talk about pairwise, I'm missing something here?.
I probably misremembered, sorry. I'll send an updated patch.
johannes
Johannes Berg
maintainerPATCH v3 8/8 mac80211: re-add HT disabling
The IEEE80211_STA_TKIP_WEP_USED flag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.
--- net/mac80211/cfg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +9 -1
@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) {struct ieee80211_sub_if_data *sdata; -int ret; +int ret, i; sdata =IEEE80211_DEV_TO_SUB_IF (dev);
@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED))return -ENOLINK ;/* not authenticated */ + sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED ; + +for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) +if (req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_WEP40 || + req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_TKIP || + req->crypto.ciphers_pairwise[i] ==WLAN_CIPHER_SUITE_WEP104 ) + sdata->u.mgd.flags |=IEEE80211_STA_TKIP_WEP_USED ; + sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL ; sdata->u.mgd.flags |=IEEE80211_STA_BSSID_SET ;
Re: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 23 lines · Johannes Berg
The
IEEE80211_STA_TKIP_WEP_USEDflag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.Signed-off-by Johannes Berg <[email protected]>--- net/mac80211/cfg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 renamed from net/mac80211/cfg.c 2009-07-01 09:01:25.000000000 +0200 +1
-1@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) { struct ieee80211_sub_if_data *sdata; - int ret; + int ret, i; sdata = IEEE80211_DEV_TO_SUB_IF(dev);@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED))
net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 static int ieee80211_assoc(struct wiphy · line 1246
Quoted 10 lines
net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 renamed from net/mac80211/cfg.c 2009-07-01 09:01:25.000000000 +0200 +8
-0return -ENOLINK; /* not authenticated */ + sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; + + for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) + if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 || + req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP || + req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) + sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED; +
for..loop does not seem to be necessary here as it is very unlikely that an assoc req will have more than one cipher suite.
I'm not sure if this patch series will get into 2.6.31-rc, if it does not, we may need a variant of this patch to fix
http://bugzilla.kernel.org/show_bug.cgi?id=13630, I'll work on it. Thanks!.
Vasanth
Johannes Berg
maintainerRe: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 26 lines · Vasanthakumar Thiagarajan
Quoted 25 lines · Johannes Berg
The
IEEE80211_STA_TKIP_WEP_USEDflag is used internally to disable HT when WEP or TKIP are used. Now that cfg80211 is giving us the required information, we can set the flag appropriately again.Signed-off-by Johannes Berg <[email protected]>--- net/mac80211/cfg.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 renamed from net/mac80211/cfg.c 2009-07-01 09:01:25.000000000 +0200 +1
-1@@ -1228,7 +1228,7 @@ static int ieee80211_assoc(struct wiphy struct cfg80211_assoc_request *req) { struct ieee80211_sub_if_data *sdata; - int ret; + int ret, i; sdata = IEEE80211_DEV_TO_SUB_IF(dev);@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy !(sdata->u.mgd.flags & IEEE80211_STA_AUTHENTICATED)) return -ENOLINK; /* not authenticated */
Quoted 11 lines
net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 static int ieee80211_assoc(struct wiphy · line 1246
Quoted 8 lines
net/mac80211/cfg.c 2009-07-01 09:09:01.000000000 +0200 renamed from net/mac80211/cfg.c 2009-07-01 09:01:25.000000000 +0200 +8
-0+ sdata->u.mgd.flags &= ~IEEE80211_STA_TKIP_WEP_USED; + + for (i = 0; i < req->crypto.n_ciphers_pairwise; i++) + if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 || + req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_TKIP || + req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP104) + sdata->u.mgd.flags |= IEEE80211_STA_TKIP_WEP_USED; +for..loop does not seem to be necessary here as it is very unlikely that an assoc req will have more than one cipher suite.
True, but so far we've defined the API that way. Should we redefine the API? I keep forgetting what is valid where. Jouni?
Quoted 4 lines
I'm not sure if this patch series will get into 2.6.31-rc, if it does not, we may need a variant of this patch to fix
http://bugzilla.kernel.org/show_bug.cgi?id=13630, I'll work on it. Thanks!.
I don't think we can. Even the above patch relies on wpa_supplicant to pass us the correct information. Otherwise we would have to parse the IEs, which is somewhat ugly.
johannes
Re: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 11 lines · Johannes Berg
Quoted 7 lines · Vasanthakumar Thiagarajan
net/mac80211/cfg.c static int ieee80211_assoc(struct wiphy · line 1237
Quoted 3 lines · Johannes Berg
net/mac80211/cfg.c +2
-0@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy +for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) + if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||for..loop does not seem to be necessary here as it is very unlikely that an assoc req will have more than one cipher suite.
True, but so far we've defined the API that way. Should we redefine the API? I keep forgetting what is valid where. Jouni?
The (re)association request is only allowed to list one pairwise cipher suite (see IEEE 802.11, 8.4.3). Various other use cases for RSN IE support multiple cipher suites, but this one does not.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 10 lines · Jouni Malinen
Quoted 8 lines · Johannes Berg
Quoted 7 lines · Vasanthakumar Thiagarajan
net/mac80211/cfg.c static int ieee80211_assoc(struct wiphy · line 1237
Quoted 3 lines · Johannes Berg
net/mac80211/cfg.c +2
-0@@ -1236,6 +1236,14 @@ static int ieee80211_assoc(struct wiphy +for (i =0 ; i < req->crypto.n_ciphers_pairwise; i++) + if (req->crypto.ciphers_pairwise[i] == WLAN_CIPHER_SUITE_WEP40 ||for..loop does not seem to be necessary here as it is very unlikely that an assoc req will have more than one cipher suite.
Quoted 6 lines
Quoted 2 lines
True, but so far we've defined the API that way. Should we redefine the API? I keep forgetting what is valid where. Jouni?
The (re)association request is only allowed to list one pairwise cipher suite (see IEEE 802.11, 8.4.3). Various other use cases for RSN IE support multiple cipher suites, but this one does not.
So we have to support multiple for connect() to allow the card/driver to choose, but a single one for associate()?
johannes
Re: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 2 lines · Johannes Berg
So we have to support multiple for
connect()to allow the card/driver to choose, but a single one forassociate()?
Sounds reasonable.. Many drivers might not be able to handle multiple options for connect(), though, so even with that, it may be reasonable to just pass in a single option. Anyway, it would be nice if the multiple options case could be supported.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 8/8 v3.1] mac80211: re-add HT disabling
Quoted 8 lines · Jouni Malinen
Quoted 2 lines · Johannes Berg
So we have to support multiple for
connect()to allow the card/driver to choose, but a single one forassociate()?Sounds reasonable.. Many drivers might not be able to handle multiple options for
connect(), though, so even with that, it may be reasonable to just pass in a single option.
That's something the driver would have to refuse then, I guess.
I'll send a patch to limit it to 1 for assoc()
johannes