iwlwifi driver 08/15 updates
Subsystems (2)
cover iwlwifi driver 08/15 updates
Hi,
Here are some fix and cleanup for iwlwifi and mac80211. Note mac80211 patches 07~10 are already submitted by Tomas Winkler before.
Thanks,
-yi
[PATCH 01/15] iwlwifi: Added bss_info_changed callback to 3945
[PATCH 02/15] iwlwifi: W/A for the TSF correction in IBSS
[PATCH 03/15] iwlwifi: clean up hw scan handler
[PATCH 04/15] iwlwifi: remove obsolete 4965 forward declarations [PATCH 05/15] iwlwifi: allow consecutive scans in unassociated state [PATCH 06/15] iwlwifi: align set channel with mac80211
[PATCH 07/15] mac80211: filter probes in ieee80211_rx_mgmt_probe_resp [PATCH 08/15] mac80211: cleanup mlme state namespace
[PATCH 09/15] mac80211: change number of pre-assoc scans
[PATCH 10/15] mac80211: add direct probe before association
[PATCH 11/15] iwl3945: fix unbalanced mutex
[PATCH 12/15] iwl3945: replace association and beacon hooks with bss_info_changed cb [PATCH 13/15] iwlwifi: fix hidden ssid discovery in passive channels [PATCH 14/15] iwl3945: removed bg_post_associate work
[PATCH 15/15] iwl3945: avoid redundant iwl3945_get_active_dwell_time
PATCH 1/15 iwlwifi: Added bss_info_changed callback to 3945
From: Abhijeet Kolekar <[email protected]>
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 74 ++++++++++++++++++++++++-- 1 files changed, 68 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +68 -6
@@ -6321,11 +6321,8 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data)#define IWL_DELAY_NEXT_SCAN (HZ*2) -static void iwl3945_bg_post_associate (struct work_struct *data) +static void iwl3945_post_associate (struct iwl3945_priv *priv) { - struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, - post_associate.work); -int rc =0 ;struct ieee80211_conf *conf =NULL ;DECLARE_MAC_BUF (mac);
@@ -6343,8 +6340,6 @@ static void iwl3945_bg_post_associate(struct work_struct *data)if (test_bit (STATUS_EXIT_PENDING , &priv->status))return ; -mutex_lock (&priv->mutex); -if (!priv->vif || !priv->is_open) {mutex_unlock (&priv->mutex);return ;
@@ -6420,6 +6415,15 @@ static void iwl3945_bg_post_associate(struct work_struct *data)/* we have just associated, don't start scan too early */ priv->next_scan_jiffies = jiffies +IWL_DELAY_NEXT_SCAN ; +} + +static void iwl3945_bg_post_associate (struct work_struct *data) +{ + struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, + post_associate.work); + +mutex_lock (&priv->mutex); +iwl3945_post_associate (priv);mutex_unlock (&priv->mutex); }
@@ -6949,6 +6953,63 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,IWL_DEBUG_MAC80211 ("leave\n" ); } +#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) + +static void iwl3945_bss_info_changed (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_bss_conf *bss_conf, +u32 changes) +{ +struct iwl3945_priv *priv = hw->priv; + +IWL_DEBUG_MAC80211 ("changes = 0x%X\n" , changes); + +if (changes &BSS_CHANGED_ERP_PREAMBLE ) { +IWL_DEBUG_MAC80211 ("ERP_PREAMBLE %d\n" , + bss_conf->use_short_preamble); +if (bss_conf->use_short_preamble) + priv->staging_rxon.flags |=RXON_FLG_SHORT_PREAMBLE_MSK ; +else + priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK ; + } + +if (changes &BSS_CHANGED_ERP_CTS_PROT ) { +IWL_DEBUG_MAC80211 ("ERP_CTS %d\n" , bss_conf->use_cts_prot); +if (bss_conf->use_cts_prot && (priv->band !=IEEE80211_BAND_5GHZ )) + priv->staging_rxon.flags |=RXON_FLG_TGG_PROTECT_MSK ; +else + priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK ; + } + +if (changes &BSS_CHANGED_ASSOC ) { +IWL_DEBUG_MAC80211 ("ASSOC %d\n" , bss_conf->assoc); +/* This should never happen as this function should +* never be called from interrupt context. */ +if (WARN_ON_ONCE (in_interrupt ())) +return ; +if (bss_conf->assoc) { + priv->assoc_id = bss_conf->aid; + priv->beacon_int = bss_conf->beacon_int; + priv->timestamp0 = bss_conf->timestamp &0xFFFFFFFF ; + priv->timestamp1 = (bss_conf->timestamp >>32 ) & +0xFFFFFFFF ; + priv->assoc_capability = bss_conf->assoc_capability; + priv->next_scan_jiffies = jiffies + +IWL_DELAY_NEXT_SCAN_AFTER_ASSOC ; +mutex_lock (&priv->mutex); +iwl3945_post_associate (priv); +mutex_unlock (&priv->mutex); + }else { + priv->assoc_id =0 ; +IWL_DEBUG_MAC80211 ("DISASSOC %d\n" , bss_conf->assoc); + } + }else if (changes &&iwl3945_is_associated (priv) && priv->assoc_id) { +IWL_DEBUG_MAC80211 ("Associated Changes %d\n" , changes); +iwl3945_send_rxon_assoc (priv); + } + +} +static int iwl3945_mac_hw_scan (struct ieee80211_hw *hw,u8 *ssid,size_t len) {int rc =0 ;
@@ -7829,6 +7890,7 @@ static struct ieee80211_ops iwl3945_hw_ops = { .conf_tx = iwl3945_mac_conf_tx, .get_tsf = iwl3945_mac_get_tsf, .reset_tsf = iwl3945_mac_reset_tsf, + .bss_info_changed = iwl3945_bss_info_changed, .hw_scan = iwl3945_mac_hw_scan };
Signature · 1 line
1.5.3.6
PATCH 2/15 iwlwifi: W/A for the TSF correction in IBSS
From: Assaf Krauss <[email protected]>
This patch is a W/A for the TSF sync issue, in which the ucode's timestamp is constantly a little behind incoming beacons' timestamps (in IBSS cells). The W/A simply stops the driver from declaring it has a reliable TSF value.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 2 +- drivers/net/wireless/iwlwifi/iwl-rx.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +1 -1
@@ -3579,7 +3579,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk priv->assoc_id =0 ; timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; - priv->timestamp =le64_to_cpu (timestamp) + (priv->beacon_int *1000 ); + priv->timestamp =le64_to_cpu (timestamp);IWL_DEBUG_MAC80211 ("leave\n" );spin_unlock_irqrestore (&priv->lock, flags);
drivers/net/wireless/iwlwifi/iwl-rx.c +4 -1
@@ -1068,7 +1068,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, rx_status.rate_idx -=IWL_FIRST_OFDM_RATE ; rx_status.flag =0 ; - rx_status.flag |=RX_FLAG_TSFT ; + +/* TSF isn't reliable. In order to allow smooth user experience, +* this W/A doesn't propagate it to the mac80211 */ +/*rx_status.flag |= RX_FLAG_TSFT;*/ if ((unlikely (rx_start->cfg_phy_cnt >20 ))) { IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n",
Signature · 1 line
1.5.3.6
PATCH 3/15 iwlwifi: clean up hw scan handler
From: Tomas Winkler <[email protected]>
This patch cleans up iwl_mac_hw_scan handler.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 35 ++++++++++++++----------------- 1 files changed, 16 insertions(+), 19 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +16 -19
@@ -3180,9 +3180,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, } -static int iwl4965_mac_hw_scan (struct ieee80211_hw *hw,u8 *ssid,size_t len) +static int iwl_mac_hw_scan (struct ieee80211_hw *hw,u8 *ssid,size_t ssid_len) { -int rc =0 ; +int ret;unsigned long flags;struct iwl_priv *priv = hw->priv;
@@ -3192,41 +3192,38 @@ static int iwl4965_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)spin_lock_irqsave (&priv->lock, flags);if (!iwl_is_ready_rf (priv)) { - rc = -EIO ; + ret = -EIO ;IWL_DEBUG_MAC80211 ("leave - not ready or exit pending\n" ); goto out_unlock; }if (priv->iw_mode ==IEEE80211_IF_TYPE_AP ) {/* APs don't scan */ - rc = -EIO ; + ret = -EIO ;IWL_ERROR ("ERROR: APs don't scan\n" ); goto out_unlock; }/* we don't schedule scan within next_scan_jiffies period */ if (priv->next_scan_jiffies && -time_after (priv->next_scan_jiffies, jiffies)) { - rc = -EAGAIN ; +time_after (priv->next_scan_jiffies, jiffies)) { + ret = -EAGAIN ; goto out_unlock; }/* if we just finished scan ask for delay */ -if (priv->last_scan_jiffies &&time_after (priv->last_scan_jiffies + -IWL_DELAY_NEXT_SCAN , jiffies)) { - rc = -EAGAIN ; +if (priv->last_scan_jiffies && +time_after (priv->last_scan_jiffies +IWL_DELAY_NEXT_SCAN , jiffies)) { + ret = -EAGAIN ; goto out_unlock; } -if (len) { -IWL_DEBUG_SCAN ("direct scan for %s [%d]\n " , -iwl_escape_essid (ssid, len), (int )len); - +if (ssid_len) { priv->one_direct_scan =1 ; - priv->direct_ssid_len = (u8 ) -min ((u8 ) len, (u8 )IW_ESSID_MAX_SIZE ); + priv->direct_ssid_len =min_t (u8, ssid_len,IW_ESSID_MAX_SIZE );memcpy (priv->direct_ssid, ssid, priv->direct_ssid_len); - }else + }else { priv->one_direct_scan =0 ; + } - rc =iwl_scan_initiate (priv); + ret =iwl_scan_initiate (priv);IWL_DEBUG_MAC80211 ("leave\n" );
@@ -3234,7 +3231,7 @@ out_unlock:spin_unlock_irqrestore (&priv->lock, flags);mutex_unlock (&priv->mutex); -return rc; +return ret; } static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
@@ -4141,7 +4138,7 @@ static struct ieee80211_ops iwl4965_hw_ops = { .reset_tsf = iwl4965_mac_reset_tsf, .bss_info_changed = iwl4965_bss_info_changed, .ampdu_action = iwl4965_mac_ampdu_action, - .hw_scan = iwl4965_mac_hw_scan + .hw_scan = iwl_mac_hw_scan };static int iwl4965_pci_probe (struct pci_dev *pdev,const struct pci_device_id *ent)
Signature · 1 line
1.5.3.6
PATCH 4/15 iwlwifi: remove obsolete 4965 forward declarations
From: Ron Rindjunsky <[email protected]>
This patch removes unused forward declarations functions.
--- drivers/net/wireless/iwlwifi/iwl-dev.h | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/iwl-dev.h +0 -6
@@ -637,12 +637,6 @@ static inline u8 get_cmd_index(struct iwl_queue *q, u32 index, int is_huge)struct iwl_priv ; -/* -* Forward declare iwl-4965.c functions for iwl-base.c -*/ -extern void iwl4965_rf_kill_ct_config (struct iwl_priv *priv); -int iwl4965_check_empty_hw_queue (struct iwl_priv *priv,int sta_id, -u8 tid,int txq_id);/* Structures, enum, and defines specific to the 4965 */
Signature · 1 line
1.5.3.6
PATCH 5/15 iwlwifi: allow consecutive scans in unassociated state
From: Ron Rindjunsky <[email protected]>
This patch allows consecutive scans requests when driver is in unassociated state.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +3 -1
@@ -3206,12 +3206,14 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)/* we don't schedule scan within next_scan_jiffies period */ if (priv->next_scan_jiffies &&time_after (priv->next_scan_jiffies, jiffies)) { +IWL_DEBUG_SCAN ("scan rejected: within next scan period\n" ); ret = -EAGAIN ; goto out_unlock; }/* if we just finished scan ask for delay */ -if (priv->last_scan_jiffies && +if (iwl_is_associated (priv) && priv->last_scan_jiffies &&time_after (priv->last_scan_jiffies +IWL_DELAY_NEXT_SCAN , jiffies)) { +IWL_DEBUG_SCAN ("scan rejected: within previous scan period\n" ); ret = -EAGAIN ; goto out_unlock; }
Signature · 1 line
1.5.3.6
PATCH 6/15 iwlwifi: align set channel with mac80211
From: Tomas Winkler <[email protected]>
This patch makes use of mac80211 defaults for channel and band. Older code that uses G band channel 6 was removed. This patch also changes iwl_set_rxon_channel signature.
--- drivers/net/wireless/iwlwifi/iwl-agn.c | 2 +- drivers/net/wireless/iwlwifi/iwl-core.c | 11 +++++------ drivers/net/wireless/iwlwifi/iwl-core.h | 4 +--- 3 files changed, 7 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn.c +1 -1
@@ -2842,7 +2842,7 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co ) priv->staging_rxon.flags =0 ; -iwl_set_rxon_channel (priv, conf->channel->band, channel); +iwl_set_rxon_channel (priv, conf->channel);iwl_set_flags_for_band (priv, conf->channel->band);
drivers/net/wireless/iwlwifi/iwl-core.c +5 -6
@@ -774,7 +774,7 @@ void iwl_set_rxon_chain(struct iwl_priv *priv)EXPORT_SYMBOL (iwl_set_rxon_chain);/** -* iwlcore_set_rxon_channel - Set the phymode and channel values in staging RXON +* iwl_set_rxon_channel - Set the phymode and channel values in staging RXON * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz * @channel: Any channel valid for the requested phymode
@@ -783,10 +783,11 @@ EXPORT_SYMBOL(iwl_set_rxon_chain);* NOTE: Does not commit to the hardware; it sets appropriate bit fields * in the staging RXON flag structure based on the phymode */ -int iwl_set_rxon_channel (struct iwl_priv *priv, -enum ieee80211_band band, -u16 channel) +int iwl_set_rxon_channel (struct iwl_priv *priv,struct ieee80211_channel *ch) { +enum ieee80211_band band = ch->band; +u16 channel =ieee80211_frequency_to_channel (ch->center_freq); +if (!iwl_get_channel_info (priv, band, channel)) {IWL_DEBUG_INFO ("Could not set channel to %d [%d]\n" , channel, band);
@@ -907,8 +908,6 @@ int iwl_init_drv(struct iwl_priv *priv) priv->qos_data.qos_active =0 ; priv->qos_data.qos_cap.val =0 ; -iwl_set_rxon_channel (priv,IEEE80211_BAND_2GHZ ,6 ); - priv->rates_mask =IWL_RATES_MASK ;/* If power management is turned on, default to AC mode */ priv->power_mode =IWL_POWER_AC ;
drivers/net/wireless/iwlwifi/iwl-core.h +1 -3
@@ -189,9 +189,7 @@ void iwl_clear_stations_table(struct iwl_priv *priv);void iwl_free_calib_results (struct iwl_priv *priv);void iwl_reset_qos (struct iwl_priv *priv);void iwl_set_rxon_chain (struct iwl_priv *priv); -int iwl_set_rxon_channel (struct iwl_priv *priv, -enum ieee80211_band band, -u16 channel); +int iwl_set_rxon_channel (struct iwl_priv *priv,struct ieee80211_channel *ch);void iwl_set_rxon_ht (struct iwl_priv *priv,struct iwl_ht_info *ht_info);u8 iwl_is_fat_tx_allowed (struct iwl_priv *priv,struct ieee80211_ht_info *sta_ht_inf);
Signature · 1 line
1.5.3.6
PATCH 7/15 mac80211: filter probes in ieee80211_rx_mgmt_probe_resp
From: Tomas Winkler <[email protected]>
This patch moves filtering statement from ieee80211_rx_bss_info which is called for both beacon and probe to ieee80211_rx_mgmt_probe_resp and save few cycles in beacon parsing.
--- net/mac80211/mlme.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
net/mac80211/mlme.c +3 -3
@@ -2570,9 +2570,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev,DECLARE_MAC_BUF (mac);DECLARE_MAC_BUF (mac2); -if (!beacon &&memcmp (mgmt->da, dev->dev_addr,ETH_ALEN )) -return ;/* ignore ProbeResp to foreign address */ - beacon_timestamp =le64_to_cpu (mgmt->u.beacon.timestamp); if (ieee80211_vif_is_mesh(&sdata->vif) && elems->mesh_id &&
@@ -2890,6 +2887,9 @@ static void ieee80211_rx_mgmt_probe_resp(struct net_device *dev,size_t baselen;struct ieee802_11_elems elems; +if (memcmp (mgmt->da, dev->dev_addr,ETH_ALEN )) +return ;/* ignore ProbeResp to foreign address */ + baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;if (baselen > len)return ;
Signature · 1 line
1.5.3.6
PATCH 8/15 mac80211: cleanup mlme state namespace
From: Tomas Winkler <[email protected]>
This patch moves STA_MLME to station mlme state defines.
--- net/mac80211/ieee80211_i.h | 34 +++++++++++++------- net/mac80211/main.c | 2 +- net/mac80211/mlme.c | 72 ++++++++++++++++++++++---------------------- net/mac80211/wext.c | 4 +- 4 files changed, 61 insertions(+), 51 deletions(-)
net/mac80211/ieee80211_i.h +22 -12
@@ -300,17 +300,33 @@ struct mesh_config {#define IEEE80211_STA_AUTO_BSSID_SEL BIT(11)#define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12)#define IEEE80211_STA_PRIVACY_INVOKED BIT(13) +/* flags for MLME request*/ +#define IEEE80211_STA_REQ_SCAN 0 +#define IEEE80211_STA_REQ_AUTH 1 +#define IEEE80211_STA_REQ_RUN 2 + +/* flags used for setting mlme state */ +enum ieee80211_sta_mlme_state { +IEEE80211_STA_MLME_DISABLED , +IEEE80211_STA_MLME_AUTHENTICATE , +IEEE80211_STA_MLME_ASSOCIATE , +IEEE80211_STA_MLME_ASSOCIATED , +IEEE80211_STA_MLME_IBSS_SEARCH , +IEEE80211_STA_MLME_IBSS_JOINED , +IEEE80211_STA_MLME_MESH_UP +}; + +/* bitfield of allowed auth algs */ +#define IEEE80211_AUTH_ALG_OPEN BIT(0) +#define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) +#define IEEE80211_AUTH_ALG_LEAP BIT(2) +struct ieee80211_if_sta {struct timer_list timer;struct work_struct work;u8 bssid[ETH_ALEN ], prev_bssid[ETH_ALEN ];u8 ssid[IEEE80211_MAX_SSID_LEN ]; -enum { -IEEE80211_DISABLED ,IEEE80211_AUTHENTICATE , -IEEE80211_ASSOCIATE ,IEEE80211_ASSOCIATED , -IEEE80211_IBSS_SEARCH ,IEEE80211_IBSS_JOINED , -IEEE80211_MESH_UP - } state; +enum ieee80211_sta_mlme_state state;size_t ssid_len;u8 scan_ssid[IEEE80211_MAX_SSID_LEN ];size_t scan_ssid_len;
@@ -360,13 +376,7 @@ struct ieee80211_if_sta {unsigned long last_probe;unsigned int flags; -#define IEEE80211_STA_REQ_SCAN 0 -#define IEEE80211_STA_REQ_AUTH 1 -#define IEEE80211_STA_REQ_RUN 2 -#define IEEE80211_AUTH_ALG_OPEN BIT(0) -#define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) -#define IEEE80211_AUTH_ALG_LEAP BIT(2)unsigned int auth_algs;/* bitfield of allowed auth algs */ int auth_alg;/* currently used IEEE 802.11 authentication algorithm */ int auth_transaction;
net/mac80211/main.c +1 -1
@@ -503,7 +503,7 @@ static int ieee80211_stop(struct net_device *dev)/* fall through */ case IEEE80211_IF_TYPE_STA :case IEEE80211_IF_TYPE_IBSS : - sdata->u.sta.state =IEEE80211_DISABLED ; + sdata->u.sta.state =IEEE80211_STA_MLME_DISABLED ;memset (sdata->u.sta.bssid,0 ,ETH_ALEN );del_timer_sync (&sdata->u.sta.timer);/*
net/mac80211/mlme.c +36 -36
219 lines not on this page · raw message
net/mac80211/wext.c +2 -2
@@ -539,8 +539,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, sdata =IEEE80211_DEV_TO_SUB_IF (dev);if (sdata->vif.type ==IEEE80211_IF_TYPE_STA || sdata->vif.type ==IEEE80211_IF_TYPE_IBSS ) { -if (sdata->u.sta.state ==IEEE80211_ASSOCIATED || - sdata->u.sta.state ==IEEE80211_IBSS_JOINED ) { +if (sdata->u.sta.state ==IEEE80211_STA_MLME_ASSOCIATED || + sdata->u.sta.state ==IEEE80211_STA_MLME_IBSS_JOINED ) { ap_addr->sa_family =ARPHRD_ETHER ;memcpy (&ap_addr->sa_data, sdata->u.sta.bssid,ETH_ALEN );return 0 ;
Signature · 1 line
1.5.3.6
PATCH 9/15 mac80211: change number of pre-assoc scans
From: Ron Rindjunsky <[email protected]>
This patch fixes noticed problem in noisy environments of 50+ APs. That scan fails to find the requested AP on first try, which leads to connection refusal. Second scan has empirically proven to fix this problem in almost all cases.
--- net/mac80211/ieee80211_i.h | 4 +++- net/mac80211/mlme.c | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-)
net/mac80211/ieee80211_i.h +3 -1
@@ -369,7 +369,9 @@ struct ieee80211_if_sta {struct sk_buff_head skb_queue; -int auth_tries, assoc_tries; +int assoc_scan_tries;/* number of scans done pre-association */ +int auth_tries;/* retries for auth req */ +int assoc_tries;/* retries for assoc req */ unsigned long request;
net/mac80211/mlme.c +7 -2
@@ -34,6 +34,7 @@#include "led.h" #include "mesh.h" +#define IEEE80211_ASSOC_SCANS_MAX_TRIES 2#define IEEE80211_AUTH_TIMEOUT (HZ / 5)#define IEEE80211_AUTH_MAX_TRIES 3#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
@@ -599,6 +600,7 @@ static void ieee80211_set_disassoc(struct net_device *dev, {if (deauth) ifsta->auth_tries =0 ; + ifsta->assoc_scan_tries =0 ; ifsta->assoc_tries =0 ;ieee80211_set_associated (dev, ifsta,0 ); }
@@ -3437,7 +3439,9 @@ static void ieee80211_sta_reset_auth(struct net_device *dev, ifsta->auth_alg =WLAN_AUTH_OPEN ; ifsta->auth_transaction =-1 ; ifsta->flags &= ~IEEE80211_STA_ASSOCIATED ; - ifsta->auth_tries = ifsta->assoc_tries =0 ; + ifsta->assoc_scan_tries =0 ; + ifsta->auth_tries =0 ; + ifsta->assoc_tries =0 ;netif_carrier_off (dev); }
@@ -3544,7 +3548,8 @@ static int ieee80211_sta_config_auth(struct net_device *dev,ieee80211_sta_reset_auth (dev, ifsta);return 0 ; }else { -if (ifsta->state !=IEEE80211_STA_MLME_AUTHENTICATE ) { +if (ifsta->assoc_scan_tries <IEEE80211_ASSOC_SCANS_MAX_TRIES ) { + ifsta->assoc_scan_tries++;if (ifsta->flags &IEEE80211_STA_AUTO_SSID_SEL )ieee80211_sta_start_scan (dev,NULL ,0 );else
Signature · 1 line
1.5.3.6
PATCH 10/15 mac80211: add direct probe before association
From: Ron Rindjunsky <[email protected]>
This patch adds a direct probe request as first step in the association flow if data we have is not up to date. Motivation of this step is to make sure that the bss information we have is correct, since last scan could have been done a while ago, and beacons do not fully answer this need as there are potential differences between them and probe responses (e.g. WMM parameter element).
--- net/mac80211/ieee80211_i.h | 9 +++-- net/mac80211/mlme.c | 79 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 15 deletions(-)
net/mac80211/ieee80211_i.h +6 -3
@@ -108,7 +108,7 @@ struct ieee80211_sta_bss {u64 timestamp;int beacon_int; -bool probe_resp; +unsigned long last_probe_resp;unsigned long last_update;/* during assocation, we save an ERP value from a probe response so
@@ -302,12 +302,14 @@ struct mesh_config {#define IEEE80211_STA_PRIVACY_INVOKED BIT(13)/* flags for MLME request*/ #define IEEE80211_STA_REQ_SCAN 0 -#define IEEE80211_STA_REQ_AUTH 1 -#define IEEE80211_STA_REQ_RUN 2 +#define IEEE80211_STA_REQ_DIRECT_PROBE 1 +#define IEEE80211_STA_REQ_AUTH 2 +#define IEEE80211_STA_REQ_RUN 3/* flags used for setting mlme state */ enum ieee80211_sta_mlme_state {IEEE80211_STA_MLME_DISABLED , +IEEE80211_STA_MLME_DIRECT_PROBE ,IEEE80211_STA_MLME_AUTHENTICATE ,IEEE80211_STA_MLME_ASSOCIATE ,IEEE80211_STA_MLME_ASSOCIATED ,
@@ -370,6 +372,7 @@ struct ieee80211_if_sta {struct sk_buff_head skb_queue;int assoc_scan_tries;/* number of scans done pre-association */ +int direct_probe_tries;/* retries for direct probes */ int auth_tries;/* retries for auth req */ int assoc_tries;/* retries for assoc req */
net/mac80211/mlme.c +67 -12
164 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH 11/15 iwl3945: fix unbalanced mutex
From: Abhijeet Kolekar <[email protected]>
The patch removes unlocking of mutex from post_associate.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +2 -3
@@ -6340,10 +6340,9 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)if (test_bit (STATUS_EXIT_PENDING , &priv->status))return ; -if (!priv->vif || !priv->is_open) { -mutex_unlock (&priv->mutex); +if (!priv->vif || !priv->is_open)return ; - } +iwl3945_scan_cancel_timeout (priv,200 ); conf =ieee80211_get_hw_conf (priv->hw);
Signature · 1 line
1.5.3.6
PATCH 12/15 iwl3945: replace association and beacon hooks with bss_info_changed cb
From: Abhijeet Kolekar <[email protected]>
Let mac80211 and bss_info_changed callback handle the association and beacon changes.
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 81 ------------------------------- 1 files changed, 0 insertions(+), 81 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +0 -81
@@ -689,87 +689,6 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,switch (le16_to_cpu (header->frame_control) &IEEE80211_FCTL_FTYPE ) {case IEEE80211_FTYPE_MGMT : -switch (le16_to_cpu (header->frame_control) & -IEEE80211_FCTL_STYPE ) { -case IEEE80211_STYPE_PROBE_RESP : -case IEEE80211_STYPE_BEACON :{ -/* If this is a beacon or probe response for -* our network then cache the beacon -* timestamp */ -if ((((priv->iw_mode ==IEEE80211_IF_TYPE_STA ) - && !compare_ether_addr (header->addr2, - priv->bssid)) || - ((priv->iw_mode ==IEEE80211_IF_TYPE_IBSS ) - && !compare_ether_addr (header->addr3, - priv->bssid)))) { -struct ieee80211_mgmt *mgmt = - (struct ieee80211_mgmt *)header; -__le32 *pos; - pos = (__le32 *)&mgmt->u.beacon. - timestamp; - priv->timestamp0 =le32_to_cpu (pos[0 ]); - priv->timestamp1 =le32_to_cpu (pos[1 ]); - priv->beacon_int =le16_to_cpu ( - mgmt->u.beacon.beacon_int); -if (priv->call_post_assoc_from_beacon && - (priv->iw_mode == -IEEE80211_IF_TYPE_STA )) -queue_work (priv->workqueue, - &priv->post_associate.work); - - priv->call_post_assoc_from_beacon =0 ; - } - -break ; - } - -case IEEE80211_STYPE_ACTION : -/* TODO: Parse 802.11h frames for CSA... */ -break ; - -/* -* TODO: Use the new callback function from -* mac80211 instead of sniffing these packets. -*/ -case IEEE80211_STYPE_ASSOC_RESP : -case IEEE80211_STYPE_REASSOC_RESP :{ -struct ieee80211_mgmt *mgnt = - (struct ieee80211_mgmt *)header; - -/* We have just associated, give some -* time for the 4-way handshake if -* any. Don't start scan too early. */ - priv->next_scan_jiffies = jiffies + -IWL_DELAY_NEXT_SCAN_AFTER_ASSOC ; - - priv->assoc_id = (~((1 <<15 ) | (1 <<14 )) & -le16_to_cpu (mgnt->u. - assoc_resp.aid)); - priv->assoc_capability = -le16_to_cpu (mgnt->u.assoc_resp.capab_info); -if (priv->beacon_int) -queue_work (priv->workqueue, - &priv->post_associate.work); -else - priv->call_post_assoc_from_beacon =1 ; -break ; - } - -case IEEE80211_STYPE_PROBE_REQ :{ -DECLARE_MAC_BUF (mac1); -DECLARE_MAC_BUF (mac2); -DECLARE_MAC_BUF (mac3); -if (priv->iw_mode ==IEEE80211_IF_TYPE_IBSS ) -IWL_DEBUG_DROP - ("Dropping (non network): %s" -", %s, %s\n" , -print_mac (mac1, header->addr1), -print_mac (mac2, header->addr2), -print_mac (mac3, header->addr3)); -return ; - } - } -case IEEE80211_FTYPE_DATA :/* fall through */ default :
Signature · 1 line
1.5.3.6
PATCH 13/15 iwlwifi: fix hidden ssid discovery in passive channels
From: Ron Rindjunsky <[email protected]>
This patch gives the HW the possibility to send direct probes in passive channels (as long as traffic was detected in that channel) if such ssid was requested, so hidden ssid can be found now in those channels as well.
--- drivers/net/wireless/iwlwifi/iwl-scan.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/iwlwifi/iwl-scan.c +1 -1
@@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,else scan_ch->type =SCAN_CHANNEL_TYPE_ACTIVE ; -if ((scan_ch->type &SCAN_CHANNEL_TYPE_ACTIVE ) && n_probes) +if (n_probes) scan_ch->type |=IWL_SCAN_PROBE_MASK (n_probes); scan_ch->active_dwell =cpu_to_le16 (active_dwell);
Signature · 1 line
1.5.3.6
PATCH 14/15 iwl3945: removed bg_post_associate work
From: Abhijeet Kolekar <[email protected]>
This patch removes bg_post_associate work. A direct call iwl3945_post_associate is made to avoid the waiting by userspace programs.
--- drivers/net/wireless/iwlwifi/iwl-3945.h | 1 - drivers/net/wireless/iwlwifi/iwl3945-base.c | 18 +----------------- 2 files changed, 1 insertions(+), 18 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.h +0 -1
@@ -894,7 +894,6 @@ struct iwl3945_priv {struct delayed_work thermal_periodic;struct delayed_work gather_stats;struct delayed_work scan_check; -struct delayed_work post_associate;#define IWL_DEFAULT_TX_POWER 0x0Fs8 user_txpower_limit;
drivers/net/wireless/iwlwifi/iwl3945-base.c +1 -17
@@ -6416,16 +6416,6 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv) priv->next_scan_jiffies = jiffies +IWL_DELAY_NEXT_SCAN ; } -static void iwl3945_bg_post_associate (struct work_struct *data) -{ - struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, - post_associate.work); - -mutex_lock (&priv->mutex); -iwl3945_post_associate (priv); -mutex_unlock (&priv->mutex); -} -static void iwl3945_bg_abort_scan (struct work_struct *work) { struct iwl3945_priv *priv = container_of(work, struct iwl3945_priv, abort_scan);
@@ -6571,7 +6561,6 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)*/ mutex_lock (&priv->mutex);iwl3945_scan_cancel_timeout (priv,100 ); -cancel_delayed_work (&priv->post_associate);mutex_unlock (&priv->mutex); }
@@ -6937,7 +6926,6 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw,if (iwl3945_is_ready_rf (priv)) {iwl3945_scan_cancel_timeout (priv,100 ); -cancel_delayed_work (&priv->post_associate); priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK ;iwl3945_commit_rxon (priv); }
@@ -7241,8 +7229,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)iwl3945_reset_qos (priv); -cancel_delayed_work (&priv->post_associate); -spin_lock_irqsave (&priv->lock, flags); priv->assoc_id =0 ; priv->assoc_capability =0 ;
@@ -7327,7 +7313,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skiwl3945_reset_qos (priv); -queue_work (priv->workqueue, &priv->post_associate.work); +iwl3945_post_associate (priv);mutex_unlock (&priv->mutex);
@@ -7826,7 +7812,6 @@ static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv)INIT_WORK (&priv->rf_kill, iwl3945_bg_rf_kill);INIT_WORK (&priv->beacon_update, iwl3945_bg_beacon_update);INIT_WORK (&priv->set_monitor, iwl3945_bg_set_monitor); -INIT_DELAYED_WORK (&priv->post_associate, iwl3945_bg_post_associate);INIT_DELAYED_WORK (&priv->init_alive_start, iwl3945_bg_init_alive_start);INIT_DELAYED_WORK (&priv->alive_start, iwl3945_bg_alive_start);INIT_DELAYED_WORK (&priv->scan_check, iwl3945_bg_scan_check);
@@ -7844,7 +7829,6 @@ static void iwl3945_cancel_deferred_work(struct iwl3945_priv *priv)cancel_delayed_work_sync (&priv->init_alive_start);cancel_delayed_work (&priv->scan_check);cancel_delayed_work (&priv->alive_start); -cancel_delayed_work (&priv->post_associate);cancel_work_sync (&priv->beacon_update); }
Signature · 1 line
1.5.3.6
PATCH 15/15 iwl3945: avoid redundant iwl3945_get_active_dwell_time
From: Abhijeet Kolekar <[email protected]>
iwl3945_get_active_dwell_time is called twice within the same context. The patch removes one instance.
--- drivers/net/wireless/iwlwifi/iwl3945-base.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl3945-base.c +3 -4
@@ -4815,7 +4815,6 @@ static inline u16 iwl3945_get_active_dwell_time(struct iwl3945_priv *priv,static u16 iwl3945_get_passive_dwell_time (struct iwl3945_priv *priv,enum ieee80211_band band) { -u16 active =iwl3945_get_active_dwell_time (priv, band);u16 passive = (band ==IEEE80211_BAND_2GHZ ) ?IWL_PASSIVE_DWELL_BASE +IWL_PASSIVE_DWELL_TIME_24 :IWL_PASSIVE_DWELL_BASE +IWL_PASSIVE_DWELL_TIME_52 ;
@@ -4830,9 +4829,6 @@ static u16 iwl3945_get_passive_dwell_time(struct iwl3945_priv *priv, passive = (passive *98 ) /100 -IWL_CHANNEL_TUNE_TIME *2 ; } -if (passive <= active) - passive = active +1 ; -return passive; }
@@ -4857,6 +4853,9 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, active_dwell =iwl3945_get_active_dwell_time (priv, band); passive_dwell =iwl3945_get_passive_dwell_time (priv, band); +if (passive_dwell <= active_dwell) + passive_dwell = active_dwell +1 ; +for (i =0 , added =0 ; i < sband->n_channels; i++) {if (channels[i].flags &IEEE80211_CHAN_DISABLED )continue ;
Signature · 1 line
1.5.3.6
Quoted 8 lines · Zhu Yi
Hi,
Here are some fix and cleanup for iwlwifi and mac80211. Note mac80211 patches 07~10 are already submitted by Tomas Winkler before.
Thanks,
-yi
I would just merge everyting into 2.6.27 but here are important changes from my point of view (4965 and 5000)
Quoted 3 lines
[PATCH 01/15] iwlwifi: Added
bss_info_changedcallback to 3945[PATCH 02/15] iwlwifi: W/A for the TSF correction in IBSS
For 2.6.27 -Fixes IBSS connectivity - constant merging
Quoted 1 line
[PATCH 03/15] iwlwifi: clean up hw scan handler
Needed for dependencies.
Quoted 4 lines
[PATCH 04/15] iwlwifi: remove obsolete 4965 forward declarations
[PATCH 05/15] iwlwifi: allow consecutive scans in unassociated state [PATCH 06/15] iwlwifi: align set channel with mac80211
For 2.6.27 (hidden SSID connectivity)
Quoted 4 lines
[PATCH 07/15] mac80211: filter probes in
ieee80211_rx_mgmt_probe_resp[PATCH 08/15] mac80211: cleanup mlme state namespace [PATCH 09/15] mac80211: change number of pre-assoc scans [PATCH 10/15] mac80211: add direct probe before association
For 2.6.27 mac patches - enable hidden SSID connectivity and more robust connection in general
Quoted 4 lines
[PATCH 11/15] iwl3945: fix unbalanced mutex
[PATCH 12/15] iwl3945: replace association and beacon hooks withbss_info_changedcb[PATCH 13/15] iwlwifi: fix hidden ssid discovery in passive channels
For 2.6.27 enable hidden SSID in 5.2 Band
Quoted 7 lines
[PATCH 14/15] iwl3945: removed
bg_post_associatework
[PATCH 15/15] iwl3945: avoid redundantiwl3945_get_active_dwell_time--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks
Tomas