aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:41 -0400
commit5bbe233b9bafabc08a5404d54b9fa086e8390fc7 (patch)
treef0a4a015d2429d9b2aac4c198543e483494d9214 /drivers/net/wireless/iwlwifi/iwl-agn.c
parentde2b3e864aa908e613dd9912def88af7877d85f3 (diff)
iwl3945: use iwl_bss_info_changed
3945 can use iwl_bss_info_changed. A new lib op is created for post_assoicate to distinguish between 3945 and iwlwifi's post_associate operations. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c138
1 files changed, 2 insertions, 136 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 1f5ee55778f1..d14146fa751f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -531,76 +531,6 @@ int iwl_hw_tx_queue_init(struct iwl_priv *priv,
531 * 531 *
532 ******************************************************************************/ 532 ******************************************************************************/
533 533
534static void iwl_ht_conf(struct iwl_priv *priv,
535 struct ieee80211_bss_conf *bss_conf)
536{
537 struct ieee80211_sta_ht_cap *ht_conf;
538 struct iwl_ht_info *iwl_conf = &priv->current_ht_config;
539 struct ieee80211_sta *sta;
540
541 IWL_DEBUG_MAC80211(priv, "enter: \n");
542
543 if (!iwl_conf->is_ht)
544 return;
545
546
547 /*
548 * It is totally wrong to base global information on something
549 * that is valid only when associated, alas, this driver works
550 * that way and I don't know how to fix it.
551 */
552
553 rcu_read_lock();
554 sta = ieee80211_find_sta(priv->hw, priv->bssid);
555 if (!sta) {
556 rcu_read_unlock();
557 return;
558 }
559 ht_conf = &sta->ht_cap;
560
561 if (ht_conf->cap & IEEE80211_HT_CAP_SGI_20)
562 iwl_conf->sgf |= HT_SHORT_GI_20MHZ;
563 if (ht_conf->cap & IEEE80211_HT_CAP_SGI_40)
564 iwl_conf->sgf |= HT_SHORT_GI_40MHZ;
565
566 iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD);
567 iwl_conf->max_amsdu_size =
568 !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU);
569
570 iwl_conf->supported_chan_width =
571 !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40);
572
573 /*
574 * XXX: The HT configuration needs to be moved into iwl_mac_config()
575 * to be done there correctly.
576 */
577
578 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
579 if (conf_is_ht40_minus(&priv->hw->conf))
580 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
581 else if (conf_is_ht40_plus(&priv->hw->conf))
582 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
583
584 /* If no above or below channel supplied disable FAT channel */
585 if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE &&
586 iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW)
587 iwl_conf->supported_chan_width = 0;
588
589 iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
590
591 memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16);
592
593 iwl_conf->tx_chan_width = iwl_conf->supported_chan_width != 0;
594 iwl_conf->ht_protection =
595 bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
596 iwl_conf->non_GF_STA_present =
597 !!(bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
598
599 rcu_read_unlock();
600
601 IWL_DEBUG_MAC80211(priv, "leave\n");
602}
603
604#define MAX_UCODE_BEACON_INTERVAL 4096 534#define MAX_UCODE_BEACON_INTERVAL 4096
605 535
606static u16 iwl_adjust_beacon_interval(u16 beacon_val) 536static u16 iwl_adjust_beacon_interval(u16 beacon_val)
@@ -1911,7 +1841,7 @@ static void iwl_bg_rx_replenish(struct work_struct *data)
1911 1841
1912#define IWL_DELAY_NEXT_SCAN (HZ*2) 1842#define IWL_DELAY_NEXT_SCAN (HZ*2)
1913 1843
1914static void iwl_post_associate(struct iwl_priv *priv) 1844void iwl_post_associate(struct iwl_priv *priv)
1915{ 1845{
1916 struct ieee80211_conf *conf = NULL; 1846 struct ieee80211_conf *conf = NULL;
1917 int ret = 0; 1847 int ret = 0;
@@ -2482,70 +2412,6 @@ static void iwl_mac_remove_interface(struct ieee80211_hw *hw,
2482 2412
2483} 2413}
2484 2414
2485#define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6)
2486static void iwl_bss_info_changed(struct ieee80211_hw *hw,
2487 struct ieee80211_vif *vif,
2488 struct ieee80211_bss_conf *bss_conf,
2489 u32 changes)
2490{
2491 struct iwl_priv *priv = hw->priv;
2492
2493 IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes);
2494
2495 if (changes & BSS_CHANGED_ERP_PREAMBLE) {
2496 IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n",
2497 bss_conf->use_short_preamble);
2498 if (bss_conf->use_short_preamble)
2499 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
2500 else
2501 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
2502 }
2503
2504 if (changes & BSS_CHANGED_ERP_CTS_PROT) {
2505 IWL_DEBUG_MAC80211(priv, "ERP_CTS %d\n", bss_conf->use_cts_prot);
2506 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
2507 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK;
2508 else
2509 priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK;
2510 }
2511
2512 if (changes & BSS_CHANGED_HT) {
2513 iwl_ht_conf(priv, bss_conf);
2514 iwl_set_rxon_chain(priv);
2515 }
2516
2517 if (changes & BSS_CHANGED_ASSOC) {
2518 IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc);
2519 /* This should never happen as this function should
2520 * never be called from interrupt context. */
2521 if (WARN_ON_ONCE(in_interrupt()))
2522 return;
2523 if (bss_conf->assoc) {
2524 priv->assoc_id = bss_conf->aid;
2525 priv->beacon_int = bss_conf->beacon_int;
2526 priv->power_data.dtim_period = bss_conf->dtim_period;
2527 priv->timestamp = bss_conf->timestamp;
2528 priv->assoc_capability = bss_conf->assoc_capability;
2529
2530 /* we have just associated, don't start scan too early
2531 * leave time for EAPOL exchange to complete
2532 */
2533 priv->next_scan_jiffies = jiffies +
2534 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
2535 mutex_lock(&priv->mutex);
2536 iwl_post_associate(priv);
2537 mutex_unlock(&priv->mutex);
2538 } else {
2539 priv->assoc_id = 0;
2540 IWL_DEBUG_MAC80211(priv, "DISASSOC %d\n", bss_conf->assoc);
2541 }
2542 } else if (changes && iwl_is_associated(priv) && priv->assoc_id) {
2543 IWL_DEBUG_MAC80211(priv, "Associated Changes %d\n", changes);
2544 iwl_send_rxon_assoc(priv);
2545 }
2546
2547}
2548
2549static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, 2415static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw,
2550 struct ieee80211_key_conf *keyconf, const u8 *addr, 2416 struct ieee80211_key_conf *keyconf, const u8 *addr,
2551 u32 iv32, u16 *phase1key) 2417 u32 iv32, u16 *phase1key)
@@ -2825,7 +2691,7 @@ static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
2825 2691
2826 iwl_reset_qos(priv); 2692 iwl_reset_qos(priv);
2827 2693
2828 iwl_post_associate(priv); 2694 priv->cfg->ops->lib->post_associate(priv);
2829 2695
2830 2696
2831 return 0; 2697 return 0;