aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorDaniel C Halperin <daniel.c.halperin@intel.com>2009-08-13 16:30:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:33:10 -0400
commit7869b0eaed0447a989d8672eed27a358aa5dde0c (patch)
treeeaebb37db5923567ded86e7f837c7b6fe1f47e00 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parentbe2527654fab254beda8612cbd6bc927dc98fbee (diff)
iwlwifi: include HT configuration when adding stations through rs_rate_init
Driver's first notification of a new station from mac80211 can be through rate selection API. This patch fixes a bug where, in this code path, the HT capabilities of the new station were ignored. Signed-off-by: Daniel C Halperin <daniel.c.halperin@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-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 1bd7cd4dd809..551c4ba3f178 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2522,6 +2522,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2522 struct ieee80211_supported_band *sband = txrc->sband; 2522 struct ieee80211_supported_band *sband = txrc->sband;
2523 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 2523 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
2524 struct ieee80211_conf *conf = &priv->hw->conf; 2524 struct ieee80211_conf *conf = &priv->hw->conf;
2525 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
2525 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 2526 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2526 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 2527 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
2527 struct iwl_lq_sta *lq_sta = priv_sta; 2528 struct iwl_lq_sta *lq_sta = priv_sta;
@@ -2554,7 +2555,7 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta,
2554 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", 2555 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n",
2555 hdr->addr1); 2556 hdr->addr1);
2556 sta_id = iwl_add_station(priv, hdr->addr1, 2557 sta_id = iwl_add_station(priv, hdr->addr1,
2557 false, CMD_ASYNC, NULL); 2558 false, CMD_ASYNC, ht_cap);
2558 } 2559 }
2559 if ((sta_id != IWL_INVALID_STATION)) { 2560 if ((sta_id != IWL_INVALID_STATION)) {
2560 lq_sta->lq.sta_id = sta_id; 2561 lq_sta->lq.sta_id = sta_id;
@@ -2623,6 +2624,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2623 int i, j; 2624 int i, j;
2624 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 2625 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
2625 struct ieee80211_conf *conf = &priv->hw->conf; 2626 struct ieee80211_conf *conf = &priv->hw->conf;
2627 struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
2626 struct iwl_lq_sta *lq_sta = priv_sta; 2628 struct iwl_lq_sta *lq_sta = priv_sta;
2627 u16 mask_bit = 0; 2629 u16 mask_bit = 0;
2628 int count; 2630 int count;
@@ -2651,7 +2653,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2651 if (sta_id == IWL_INVALID_STATION) { 2653 if (sta_id == IWL_INVALID_STATION) {
2652 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", sta->addr); 2654 IWL_DEBUG_RATE(priv, "LQ: ADD station %pM\n", sta->addr);
2653 sta_id = iwl_add_station(priv, sta->addr, false, 2655 sta_id = iwl_add_station(priv, sta->addr, false,
2654 CMD_ASYNC, NULL); 2656 CMD_ASYNC, ht_cap);
2655 } 2657 }
2656 if ((sta_id != IWL_INVALID_STATION)) { 2658 if ((sta_id != IWL_INVALID_STATION)) {
2657 lq_sta->lq.sta_id = sta_id; 2659 lq_sta->lq.sta_id = sta_id;
@@ -2672,19 +2674,19 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2672 * active_siso_rate mask includes 9 MBits (bit 5), and CCK (bits 0-3), 2674 * active_siso_rate mask includes 9 MBits (bit 5), and CCK (bits 0-3),
2673 * supp_rates[] does not; shift to convert format, force 9 MBits off. 2675 * supp_rates[] does not; shift to convert format, force 9 MBits off.
2674 */ 2676 */
2675 lq_sta->active_siso_rate = sta->ht_cap.mcs.rx_mask[0] << 1; 2677 lq_sta->active_siso_rate = ht_cap->mcs.rx_mask[0] << 1;
2676 lq_sta->active_siso_rate |= sta->ht_cap.mcs.rx_mask[0] & 0x1; 2678 lq_sta->active_siso_rate |= ht_cap->mcs.rx_mask[0] & 0x1;
2677 lq_sta->active_siso_rate &= ~((u16)0x2); 2679 lq_sta->active_siso_rate &= ~((u16)0x2);
2678 lq_sta->active_siso_rate <<= IWL_FIRST_OFDM_RATE; 2680 lq_sta->active_siso_rate <<= IWL_FIRST_OFDM_RATE;
2679 2681
2680 /* Same here */ 2682 /* Same here */
2681 lq_sta->active_mimo2_rate = sta->ht_cap.mcs.rx_mask[1] << 1; 2683 lq_sta->active_mimo2_rate = ht_cap->mcs.rx_mask[1] << 1;
2682 lq_sta->active_mimo2_rate |= sta->ht_cap.mcs.rx_mask[1] & 0x1; 2684 lq_sta->active_mimo2_rate |= ht_cap->mcs.rx_mask[1] & 0x1;
2683 lq_sta->active_mimo2_rate &= ~((u16)0x2); 2685 lq_sta->active_mimo2_rate &= ~((u16)0x2);
2684 lq_sta->active_mimo2_rate <<= IWL_FIRST_OFDM_RATE; 2686 lq_sta->active_mimo2_rate <<= IWL_FIRST_OFDM_RATE;
2685 2687
2686 lq_sta->active_mimo3_rate = sta->ht_cap.mcs.rx_mask[2] << 1; 2688 lq_sta->active_mimo3_rate = ht_cap->mcs.rx_mask[2] << 1;
2687 lq_sta->active_mimo3_rate |= sta->ht_cap.mcs.rx_mask[2] & 0x1; 2689 lq_sta->active_mimo3_rate |= ht_cap->mcs.rx_mask[2] & 0x1;
2688 lq_sta->active_mimo3_rate &= ~((u16)0x2); 2690 lq_sta->active_mimo3_rate &= ~((u16)0x2);
2689 lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE; 2691 lq_sta->active_mimo3_rate <<= IWL_FIRST_OFDM_RATE;
2690 2692