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 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 55 |
1 files changed, 14 insertions, 41 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 { |