diff options
author | Zhu Yi <yi.zhu@intel.com> | 2007-09-26 23:27:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:21 -0400 |
commit | 556f8db74809a435195c840f495fd1bf855dfadb (patch) | |
tree | 707ac85c06b443207a7eff8afb9353de8a70a943 | |
parent | e1493deb74d22b005769e6ecbd24a00106941c6c (diff) |
[PATCH] iwlwifi: clear station table in rxon unconditionally
This patch clears stations table for every rxon command.
It removes iwl_rxon_add_station function in 3945.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 55 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 24 |
2 files changed, 21 insertions, 58 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 2077f26e3e85..dacf55ba0b7b 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -407,6 +407,7 @@ const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | |||
407 | */ | 407 | */ |
408 | 408 | ||
409 | /**************************************************************/ | 409 | /**************************************************************/ |
410 | #if 0 /* temparary disable till we add real remove station */ | ||
410 | static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap) | 411 | static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap) |
411 | { | 412 | { |
412 | int index = IWL_INVALID_STATION; | 413 | int index = IWL_INVALID_STATION; |
@@ -442,7 +443,7 @@ out: | |||
442 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 443 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
443 | return 0; | 444 | return 0; |
444 | } | 445 | } |
445 | 446 | #endif | |
446 | static void iwl_clear_stations_table(struct iwl_priv *priv) | 447 | static void iwl_clear_stations_table(struct iwl_priv *priv) |
447 | { | 448 | { |
448 | unsigned long flags; | 449 | unsigned long flags; |
@@ -835,25 +836,6 @@ int iwl_send_statistics_request(struct iwl_priv *priv) | |||
835 | } | 836 | } |
836 | 837 | ||
837 | /** | 838 | /** |
838 | * iwl_rxon_add_station - add station into station table. | ||
839 | * | ||
840 | * there is only one AP station with id= IWL_AP_ID | ||
841 | * NOTE: mutex must be held before calling the this fnction | ||
842 | */ | ||
843 | static int iwl_rxon_add_station(struct iwl_priv *priv, | ||
844 | const u8 *addr, int is_ap) | ||
845 | { | ||
846 | u8 rc; | ||
847 | |||
848 | /* Remove this station if it happens to already exist */ | ||
849 | iwl_remove_station(priv, addr, is_ap); | ||
850 | |||
851 | rc = iwl_add_station(priv, addr, is_ap, 0); | ||
852 | |||
853 | return rc; | ||
854 | } | ||
855 | |||
856 | /** | ||
857 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON | 839 | * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON |
858 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz | 840 | * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz |
859 | * @channel: Any channel valid for the requested phymode | 841 | * @channel: Any channel valid for the requested phymode |
@@ -1123,16 +1105,6 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1123 | "configuration (%d).\n", rc); | 1105 | "configuration (%d).\n", rc); |
1124 | return rc; | 1106 | return rc; |
1125 | } | 1107 | } |
1126 | |||
1127 | /* The RXON bit toggling will have cleared out the | ||
1128 | * station table in the uCode, so blank it in the driver | ||
1129 | * as well */ | ||
1130 | iwl_clear_stations_table(priv); | ||
1131 | } else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) { | ||
1132 | /* When switching from non-associated to associated, the | ||
1133 | * uCode clears out the station table; so clear it in the | ||
1134 | * driver as well */ | ||
1135 | iwl_clear_stations_table(priv); | ||
1136 | } | 1108 | } |
1137 | 1109 | ||
1138 | IWL_DEBUG_INFO("Sending RXON\n" | 1110 | IWL_DEBUG_INFO("Sending RXON\n" |
@@ -1154,6 +1126,8 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1154 | 1126 | ||
1155 | memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); | 1127 | memcpy(active_rxon, &priv->staging_rxon, sizeof(*active_rxon)); |
1156 | 1128 | ||
1129 | iwl_clear_stations_table(priv); | ||
1130 | |||
1157 | /* If we issue a new RXON command which required a tune then we must | 1131 | /* If we issue a new RXON command which required a tune then we must |
1158 | * send a new TXPOWER command or we won't be able to Tx any frames */ | 1132 | * send a new TXPOWER command or we won't be able to Tx any frames */ |
1159 | rc = iwl_hw_reg_send_txpower(priv); | 1133 | rc = iwl_hw_reg_send_txpower(priv); |
@@ -1163,7 +1137,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1163 | } | 1137 | } |
1164 | 1138 | ||
1165 | /* Add the broadcast address so we can send broadcast frames */ | 1139 | /* Add the broadcast address so we can send broadcast frames */ |
1166 | if (iwl_rxon_add_station(priv, BROADCAST_ADDR, 0) == | 1140 | if (iwl_add_station(priv, BROADCAST_ADDR, 0, 0) == |
1167 | IWL_INVALID_STATION) { | 1141 | IWL_INVALID_STATION) { |
1168 | IWL_ERROR("Error adding BROADCAST address for transmit.\n"); | 1142 | IWL_ERROR("Error adding BROADCAST address for transmit.\n"); |
1169 | return -EIO; | 1143 | return -EIO; |
@@ -1173,7 +1147,7 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1173 | * add the IWL_AP_ID to the station rate table */ | 1147 | * add the IWL_AP_ID to the station rate table */ |
1174 | if (iwl_is_associated(priv) && | 1148 | if (iwl_is_associated(priv) && |
1175 | (priv->iw_mode == IEEE80211_IF_TYPE_STA)) | 1149 | (priv->iw_mode == IEEE80211_IF_TYPE_STA)) |
1176 | if (iwl_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1) | 1150 | if (iwl_add_station(priv, priv->active_rxon.bssid_addr, 1, 0) |
1177 | == IWL_INVALID_STATION) { | 1151 | == IWL_INVALID_STATION) { |
1178 | IWL_ERROR("Error adding AP address for transmit.\n"); | 1152 | IWL_ERROR("Error adding AP address for transmit.\n"); |
1179 | return -EIO; | 1153 | return -EIO; |
@@ -4658,7 +4632,7 @@ static void iwl_error_recovery(struct iwl_priv *priv) | |||
4658 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | 4632 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; |
4659 | iwl_commit_rxon(priv); | 4633 | iwl_commit_rxon(priv); |
4660 | 4634 | ||
4661 | iwl_rxon_add_station(priv, priv->bssid, 1); | 4635 | iwl_add_station(priv, priv->bssid, 1, 0); |
4662 | 4636 | ||
4663 | spin_lock_irqsave(&priv->lock, flags); | 4637 | spin_lock_irqsave(&priv->lock, flags); |
4664 | priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id); | 4638 | priv->assoc_id = le16_to_cpu(priv->staging_rxon.assoc_id); |
@@ -6804,8 +6778,8 @@ static void iwl_bg_post_associate(struct work_struct *data) | |||
6804 | /* clear out the station table */ | 6778 | /* clear out the station table */ |
6805 | iwl_clear_stations_table(priv); | 6779 | iwl_clear_stations_table(priv); |
6806 | 6780 | ||
6807 | iwl_rxon_add_station(priv, BROADCAST_ADDR, 0); | 6781 | iwl_add_station(priv, BROADCAST_ADDR, 0, 0); |
6808 | iwl_rxon_add_station(priv, priv->bssid, 0); | 6782 | iwl_add_station(priv, priv->bssid, 0, 0); |
6809 | iwl3945_sync_sta(priv, IWL_STA_ID, | 6783 | iwl3945_sync_sta(priv, IWL_STA_ID, |
6810 | (priv->phymode == MODE_IEEE80211A)? | 6784 | (priv->phymode == MODE_IEEE80211A)? |
6811 | IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP, | 6785 | IWL_RATE_6M_PLCP : IWL_RATE_1M_PLCP, |
@@ -7092,10 +7066,9 @@ static void iwl_config_ap(struct iwl_priv *priv) | |||
7092 | /* restore RXON assoc */ | 7066 | /* restore RXON assoc */ |
7093 | priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; | 7067 | priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; |
7094 | iwl_commit_rxon(priv); | 7068 | iwl_commit_rxon(priv); |
7095 | iwl_rxon_add_station(priv, BROADCAST_ADDR, 0); | 7069 | iwl_add_station(priv, BROADCAST_ADDR, 0, 0); |
7096 | iwl_send_beacon_cmd(priv); | 7070 | } |
7097 | } else | 7071 | iwl_send_beacon_cmd(priv); |
7098 | iwl_send_beacon_cmd(priv); | ||
7099 | 7072 | ||
7100 | /* FIXME - we need to add code here to detect a totally new | 7073 | /* FIXME - we need to add code here to detect a totally new |
7101 | * configuration, reset the AP, unassoc, rxon timing, assoc, | 7074 | * configuration, reset the AP, unassoc, rxon timing, assoc, |
@@ -7186,8 +7159,8 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, int if_id, | |||
7186 | RXON_FILTER_ASSOC_MSK; | 7159 | RXON_FILTER_ASSOC_MSK; |
7187 | rc = iwl_commit_rxon(priv); | 7160 | rc = iwl_commit_rxon(priv); |
7188 | if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) | 7161 | if ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && rc) |
7189 | iwl_rxon_add_station( | 7162 | iwl_add_station(priv, |
7190 | priv, priv->active_rxon.bssid_addr, 1); | 7163 | priv->active_rxon.bssid_addr, 1, 0); |
7191 | } | 7164 | } |
7192 | 7165 | ||
7193 | } else { | 7166 | } else { |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index fac130d0e9e5..c663288a675e 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -407,6 +407,7 @@ const u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | |||
407 | 407 | ||
408 | /**************************************************************/ | 408 | /**************************************************************/ |
409 | 409 | ||
410 | #if 0 /* temparary disable till we add real remove station */ | ||
410 | static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap) | 411 | static u8 iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap) |
411 | { | 412 | { |
412 | int index = IWL_INVALID_STATION; | 413 | int index = IWL_INVALID_STATION; |
@@ -442,6 +443,7 @@ out: | |||
442 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 443 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
443 | return 0; | 444 | return 0; |
444 | } | 445 | } |
446 | #endif | ||
445 | 447 | ||
446 | static void iwl_clear_stations_table(struct iwl_priv *priv) | 448 | static void iwl_clear_stations_table(struct iwl_priv *priv) |
447 | { | 449 | { |
@@ -852,16 +854,12 @@ int iwl_send_statistics_request(struct iwl_priv *priv) | |||
852 | static int iwl_rxon_add_station(struct iwl_priv *priv, | 854 | static int iwl_rxon_add_station(struct iwl_priv *priv, |
853 | const u8 *addr, int is_ap) | 855 | const u8 *addr, int is_ap) |
854 | { | 856 | { |
855 | u8 rc; | 857 | u8 sta_id; |
856 | |||
857 | /* Remove this station if it happens to already exist */ | ||
858 | iwl_remove_station(priv, addr, is_ap); | ||
859 | |||
860 | rc = iwl_add_station(priv, addr, is_ap, 0); | ||
861 | 858 | ||
859 | sta_id = iwl_add_station(priv, addr, is_ap, 0); | ||
862 | iwl4965_add_station(priv, addr, is_ap); | 860 | iwl4965_add_station(priv, addr, is_ap); |
863 | 861 | ||
864 | return rc; | 862 | return sta_id; |
865 | } | 863 | } |
866 | 864 | ||
867 | /** | 865 | /** |
@@ -1149,16 +1147,6 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1149 | "configuration (%d).\n", rc); | 1147 | "configuration (%d).\n", rc); |
1150 | return rc; | 1148 | return rc; |
1151 | } | 1149 | } |
1152 | |||
1153 | /* The RXON bit toggling will have cleared out the | ||
1154 | * station table in the uCode, so blank it in the driver | ||
1155 | * as well */ | ||
1156 | iwl_clear_stations_table(priv); | ||
1157 | } else if (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) { | ||
1158 | /* When switching from non-associated to associated, the | ||
1159 | * uCode clears out the station table; so clear it in the | ||
1160 | * driver as well */ | ||
1161 | iwl_clear_stations_table(priv); | ||
1162 | } | 1150 | } |
1163 | 1151 | ||
1164 | IWL_DEBUG_INFO("Sending RXON\n" | 1152 | IWL_DEBUG_INFO("Sending RXON\n" |
@@ -1178,6 +1166,8 @@ static int iwl_commit_rxon(struct iwl_priv *priv) | |||
1178 | return rc; | 1166 | return rc; |
1179 | } | 1167 | } |
1180 | 1168 | ||
1169 | iwl_clear_stations_table(priv); | ||
1170 | |||
1181 | #ifdef CONFIG_IWLWIFI_SENSITIVITY | 1171 | #ifdef CONFIG_IWLWIFI_SENSITIVITY |
1182 | if (!priv->error_recovering) | 1172 | if (!priv->error_recovering) |
1183 | priv->start_calib = 0; | 1173 | priv->start_calib = 0; |