aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-03-28 19:33:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 15:05:56 -0400
commit3109ece1114293b8201d9c140d02d7ce9a9fa387 (patch)
treefd04ee3aab9fde3d0b93633263bc0504d73aa418 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent21c0cbe760ca6b5d4c6927c3ec1352a843a8c11c (diff)
iwlwifi: Eliminate association from beacon
This patch removes association from beacon using bss_info_change handler for association Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c73
1 files changed, 44 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 826c912aea9a..f995af682233 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -901,7 +901,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
901 * an RXON_ASSOC and the new config wants the associated mask enabled, 901 * an RXON_ASSOC and the new config wants the associated mask enabled,
902 * we must clear the associated from the active configuration 902 * we must clear the associated from the active configuration
903 * before we apply the new config */ 903 * before we apply the new config */
904 if (iwl4965_is_associated(priv) && 904 if (iwl_is_associated(priv) &&
905 (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK)) { 905 (priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK)) {
906 IWL_DEBUG_INFO("Toggling associated bit on current RXON\n"); 906 IWL_DEBUG_INFO("Toggling associated bit on current RXON\n");
907 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 907 active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
@@ -967,7 +967,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
967 967
968 /* If we have set the ASSOC_MSK and we are in BSS mode then 968 /* If we have set the ASSOC_MSK and we are in BSS mode then
969 * add the IWL_AP_ID to the station rate table */ 969 * add the IWL_AP_ID to the station rate table */
970 if (iwl4965_is_associated(priv) && 970 if (iwl_is_associated(priv) &&
971 (priv->iw_mode == IEEE80211_IF_TYPE_STA)) { 971 (priv->iw_mode == IEEE80211_IF_TYPE_STA)) {
972 if (iwl4965_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1) 972 if (iwl4965_rxon_add_station(priv, priv->active_rxon.bssid_addr, 1)
973 == IWL_INVALID_STATION) { 973 == IWL_INVALID_STATION) {
@@ -1319,7 +1319,7 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
1319 const u8 *dest, int left) 1319 const u8 *dest, int left)
1320{ 1320{
1321 1321
1322 if (!iwl4965_is_associated(priv) || !priv->ibss_beacon || 1322 if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
1323 ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && 1323 ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
1324 (priv->iw_mode != IEEE80211_IF_TYPE_AP))) 1324 (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
1325 return 0; 1325 return 0;
@@ -1582,7 +1582,7 @@ static void iwl4965_activate_qos(struct iwl_priv *priv, u8 force)
1582 1582
1583 spin_unlock_irqrestore(&priv->lock, flags); 1583 spin_unlock_irqrestore(&priv->lock, flags);
1584 1584
1585 if (force || iwl4965_is_associated(priv)) { 1585 if (force || iwl_is_associated(priv)) {
1586 IWL_DEBUG_QOS("send QoS cmd with Qos active=%d FLAGS=0x%X\n", 1586 IWL_DEBUG_QOS("send QoS cmd with Qos active=%d FLAGS=0x%X\n",
1587 priv->qos_data.qos_active, 1587 priv->qos_data.qos_active,
1588 priv->qos_data.def_qos_parm.qos_flags); 1588 priv->qos_data.def_qos_parm.qos_flags);
@@ -1921,13 +1921,13 @@ static void iwl4965_setup_rxon_timing(struct iwl_priv *priv)
1921 conf = ieee80211_get_hw_conf(priv->hw); 1921 conf = ieee80211_get_hw_conf(priv->hw);
1922 1922
1923 spin_lock_irqsave(&priv->lock, flags); 1923 spin_lock_irqsave(&priv->lock, flags);
1924 priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp1); 1924 priv->rxon_timing.timestamp.dw[1] = cpu_to_le32(priv->timestamp >> 32);
1925 priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp0); 1925 priv->rxon_timing.timestamp.dw[0] =
1926 cpu_to_le32(priv->timestamp & 0xFFFFFFFF);
1926 1927
1927 priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL; 1928 priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL;
1928 1929
1929 tsf = priv->timestamp1; 1930 tsf = priv->timestamp;
1930 tsf = ((tsf << 32) | priv->timestamp0);
1931 1931
1932 beacon_int = priv->beacon_int; 1932 beacon_int = priv->beacon_int;
1933 spin_unlock_irqrestore(&priv->lock, flags); 1933 spin_unlock_irqrestore(&priv->lock, flags);
@@ -2374,10 +2374,10 @@ static int iwl4965_tx_skb(struct iwl_priv *priv,
2374 2374
2375 /* drop all data frame if we are not associated */ 2375 /* drop all data frame if we are not associated */
2376 if (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && 2376 if (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) &&
2377 (!iwl4965_is_associated(priv) || 2377 (!iwl_is_associated(priv) ||
2378 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) || 2378 ((priv->iw_mode == IEEE80211_IF_TYPE_STA) && !priv->assoc_id) ||
2379 !priv->assoc_station_added)) { 2379 !priv->assoc_station_added)) {
2380 IWL_DEBUG_DROP("Dropping - !iwl4965_is_associated\n"); 2380 IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n");
2381 goto drop_unlock; 2381 goto drop_unlock;
2382 } 2382 }
2383 2383
@@ -2838,7 +2838,7 @@ static int iwl4965_get_measurement(struct iwl_priv *priv,
2838 int spectrum_resp_status; 2838 int spectrum_resp_status;
2839 int duration = le16_to_cpu(params->duration); 2839 int duration = le16_to_cpu(params->duration);
2840 2840
2841 if (iwl4965_is_associated(priv)) 2841 if (iwl_is_associated(priv))
2842 add_time = 2842 add_time =
2843 iwl4965_usecs_to_beacons( 2843 iwl4965_usecs_to_beacons(
2844 le64_to_cpu(params->start_time) - priv->last_tsf, 2844 le64_to_cpu(params->start_time) - priv->last_tsf,
@@ -2853,7 +2853,7 @@ static int iwl4965_get_measurement(struct iwl_priv *priv,
2853 cmd.len = sizeof(spectrum); 2853 cmd.len = sizeof(spectrum);
2854 spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len)); 2854 spectrum.len = cpu_to_le16(cmd.len - sizeof(spectrum.len));
2855 2855
2856 if (iwl4965_is_associated(priv)) 2856 if (iwl_is_associated(priv))
2857 spectrum.start_time = 2857 spectrum.start_time =
2858 iwl4965_add_beacon_time(priv->last_beacon_time, 2858 iwl4965_add_beacon_time(priv->last_beacon_time,
2859 add_time, 2859 add_time,
@@ -4504,7 +4504,7 @@ static void iwl4965_irq_handle_error(struct iwl_priv *priv)
4504 IWL_DEBUG(IWL_DL_INFO | IWL_DL_FW_ERRORS, 4504 IWL_DEBUG(IWL_DL_INFO | IWL_DL_FW_ERRORS,
4505 "Restarting adapter due to uCode error.\n"); 4505 "Restarting adapter due to uCode error.\n");
4506 4506
4507 if (iwl4965_is_associated(priv)) { 4507 if (iwl_is_associated(priv)) {
4508 memcpy(&priv->recovery_rxon, &priv->active_rxon, 4508 memcpy(&priv->recovery_rxon, &priv->active_rxon,
4509 sizeof(priv->recovery_rxon)); 4509 sizeof(priv->recovery_rxon));
4510 priv->error_recovering = 1; 4510 priv->error_recovering = 1;
@@ -4790,7 +4790,7 @@ static u16 iwl4965_get_passive_dwell_time(struct iwl_priv *priv,
4790 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 : 4790 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
4791 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52; 4791 IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
4792 4792
4793 if (iwl4965_is_associated(priv)) { 4793 if (iwl_is_associated(priv)) {
4794 /* If we're associated, we clamp the maximum passive 4794 /* If we're associated, we clamp the maximum passive
4795 * dwell time to be 98% of the beacon interval (minus 4795 * dwell time to be 98% of the beacon interval (minus
4796 * 2 * channel tune time) */ 4796 * 2 * channel tune time) */
@@ -4830,7 +4830,7 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
4830 for (i = 0, added = 0; i < sband->n_channels; i++) { 4830 for (i = 0, added = 0; i < sband->n_channels; i++) {
4831 if (ieee80211_frequency_to_channel(channels[i].center_freq) == 4831 if (ieee80211_frequency_to_channel(channels[i].center_freq) ==
4832 le16_to_cpu(priv->active_rxon.channel)) { 4832 le16_to_cpu(priv->active_rxon.channel)) {
4833 if (iwl4965_is_associated(priv)) { 4833 if (iwl_is_associated(priv)) {
4834 IWL_DEBUG_SCAN 4834 IWL_DEBUG_SCAN
4835 ("Skipping current channel %d\n", 4835 ("Skipping current channel %d\n",
4836 le16_to_cpu(priv->active_rxon.channel)); 4836 le16_to_cpu(priv->active_rxon.channel));
@@ -5711,7 +5711,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
5711 5711
5712 iwl4965_send_power_mode(priv, IWL_POWER_LEVEL(priv->power_mode)); 5712 iwl4965_send_power_mode(priv, IWL_POWER_LEVEL(priv->power_mode));
5713 5713
5714 if (iwl4965_is_associated(priv)) { 5714 if (iwl_is_associated(priv)) {
5715 struct iwl4965_rxon_cmd *active_rxon = 5715 struct iwl4965_rxon_cmd *active_rxon =
5716 (struct iwl4965_rxon_cmd *)(&priv->active_rxon); 5716 (struct iwl4965_rxon_cmd *)(&priv->active_rxon);
5717 5717
@@ -6129,7 +6129,7 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
6129 scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH; 6129 scan->quiet_plcp_th = IWL_PLCP_QUIET_THRESH;
6130 scan->quiet_time = IWL_ACTIVE_QUIET_TIME; 6130 scan->quiet_time = IWL_ACTIVE_QUIET_TIME;
6131 6131
6132 if (iwl4965_is_associated(priv)) { 6132 if (iwl_is_associated(priv)) {
6133 u16 interval = 0; 6133 u16 interval = 0;
6134 u32 extra; 6134 u32 extra;
6135 u32 suspend_time = 100; 6135 u32 suspend_time = 100;
@@ -6166,7 +6166,7 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
6166 memcpy(scan->direct_scan[0].ssid, 6166 memcpy(scan->direct_scan[0].ssid,
6167 priv->direct_ssid, priv->direct_ssid_len); 6167 priv->direct_ssid, priv->direct_ssid_len);
6168 direct_mask = 1; 6168 direct_mask = 1;
6169 } else if (!iwl4965_is_associated(priv) && priv->essid_len) { 6169 } else if (!iwl_is_associated(priv) && priv->essid_len) {
6170 scan->direct_scan[0].id = WLAN_EID_SSID; 6170 scan->direct_scan[0].id = WLAN_EID_SSID;
6171 scan->direct_scan[0].len = priv->essid_len; 6171 scan->direct_scan[0].len = priv->essid_len;
6172 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 6172 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
@@ -6999,6 +6999,7 @@ static inline void iwl4965_ht_conf(struct iwl_priv *priv,
6999} 6999}
7000#endif 7000#endif
7001 7001
7002#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
7002static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, 7003static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
7003 struct ieee80211_vif *vif, 7004 struct ieee80211_vif *vif,
7004 struct ieee80211_bss_conf *bss_conf, 7005 struct ieee80211_bss_conf *bss_conf,
@@ -7006,7 +7007,11 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
7006{ 7007{
7007 struct iwl_priv *priv = hw->priv; 7008 struct iwl_priv *priv = hw->priv;
7008 7009
7010 IWL_DEBUG_MAC80211("changes = 0x%X\n", changes);
7011
7009 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 7012 if (changes & BSS_CHANGED_ERP_PREAMBLE) {
7013 IWL_DEBUG_MAC80211("ERP_PREAMBLE %d\n",
7014 bss_conf->use_short_preamble);
7010 if (bss_conf->use_short_preamble) 7015 if (bss_conf->use_short_preamble)
7011 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 7016 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
7012 else 7017 else
@@ -7014,6 +7019,7 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
7014 } 7019 }
7015 7020
7016 if (changes & BSS_CHANGED_ERP_CTS_PROT) { 7021 if (changes & BSS_CHANGED_ERP_CTS_PROT) {
7022 IWL_DEBUG_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot);
7017 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) 7023 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
7018 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; 7024 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
7019 else 7025 else
@@ -7021,19 +7027,30 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
7021 } 7027 }
7022 7028
7023 if (changes & BSS_CHANGED_HT) { 7029 if (changes & BSS_CHANGED_HT) {
7030 IWL_DEBUG_MAC80211("HT %d\n", bss_conf->assoc_ht);
7024 iwl4965_ht_conf(priv, bss_conf); 7031 iwl4965_ht_conf(priv, bss_conf);
7025 iwl4965_set_rxon_chain(priv); 7032 iwl4965_set_rxon_chain(priv);
7026 } 7033 }
7027 7034
7028 if (changes & BSS_CHANGED_ASSOC) { 7035 if (changes & BSS_CHANGED_ASSOC) {
7029 /* 7036 IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc);
7030 * TODO: 7037 if (bss_conf->assoc) {
7031 * do stuff instead of sniffing assoc resp 7038 priv->assoc_id = bss_conf->aid;
7032 */ 7039 priv->beacon_int = bss_conf->beacon_int;
7040 priv->timestamp = bss_conf->timestamp;
7041 priv->assoc_capability = bss_conf->assoc_capability;
7042 priv->next_scan_jiffies = jiffies +
7043 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
7044 queue_work(priv->workqueue, &priv->post_associate.work);
7045 } else {
7046 priv->assoc_id = 0;
7047 IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc);
7048 }
7049 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
7050 IWL_DEBUG_MAC80211("Associated Changes %d\n", changes);
7051 iwl4965_send_rxon_assoc(priv);
7033 } 7052 }
7034 7053
7035 if (iwl4965_is_associated(priv))
7036 iwl4965_send_rxon_assoc(priv);
7037} 7054}
7038 7055
7039static int iwl4965_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) 7056static int iwl4965_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
@@ -7166,7 +7183,7 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
7166 7183
7167 /* FIXME: need to differenciate between static and dynamic key 7184 /* FIXME: need to differenciate between static and dynamic key
7168 * in the level of mac80211 */ 7185 * in the level of mac80211 */
7169 static_key = !iwl4965_is_associated(priv); 7186 static_key = !iwl_is_associated(priv);
7170 7187
7171 if (!static_key) { 7188 if (!static_key) {
7172 sta_id = iwl4965_hw_find_station(priv, addr); 7189 sta_id = iwl4965_hw_find_station(priv, addr);
@@ -7247,7 +7264,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
7247 mutex_lock(&priv->mutex); 7264 mutex_lock(&priv->mutex);
7248 if (priv->iw_mode == IEEE80211_IF_TYPE_AP) 7265 if (priv->iw_mode == IEEE80211_IF_TYPE_AP)
7249 iwl4965_activate_qos(priv, 1); 7266 iwl4965_activate_qos(priv, 1);
7250 else if (priv->assoc_id && iwl4965_is_associated(priv)) 7267 else if (priv->assoc_id && iwl_is_associated(priv))
7251 iwl4965_activate_qos(priv, 0); 7268 iwl4965_activate_qos(priv, 0);
7252 7269
7253 mutex_unlock(&priv->mutex); 7270 mutex_unlock(&priv->mutex);
@@ -7330,7 +7347,6 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
7330 spin_lock_irqsave(&priv->lock, flags); 7347 spin_lock_irqsave(&priv->lock, flags);
7331 priv->assoc_id = 0; 7348 priv->assoc_id = 0;
7332 priv->assoc_capability = 0; 7349 priv->assoc_capability = 0;
7333 priv->call_post_assoc_from_beacon = 0;
7334 priv->assoc_station_added = 0; 7350 priv->assoc_station_added = 0;
7335 7351
7336 /* new association get rid of ibss beacon skb */ 7352 /* new association get rid of ibss beacon skb */
@@ -7340,8 +7356,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
7340 priv->ibss_beacon = NULL; 7356 priv->ibss_beacon = NULL;
7341 7357
7342 priv->beacon_int = priv->hw->conf.beacon_int; 7358 priv->beacon_int = priv->hw->conf.beacon_int;
7343 priv->timestamp1 = 0; 7359 priv->timestamp = 0;
7344 priv->timestamp0 = 0;
7345 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA)) 7360 if ((priv->iw_mode == IEEE80211_IF_TYPE_STA))
7346 priv->beacon_int = 0; 7361 priv->beacon_int = 0;
7347 7362