aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-06-02 06:23:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-04 16:00:39 -0400
commit6debecad452d3bbe5affc0a21bc0bb452f867cd8 (patch)
treef1e7d1b0c66d46dcdd52beccb88e5db5f4bcc74e /drivers
parent61389f3ed49968746327aef0454b2f27e88e0f8d (diff)
ath9k_htc: Setup HT capabilites for 2-stream devices
The supported MCS rate set has to be setup properly for 2-stream devices. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index ff6c0807b502..acd9cb934311 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -398,6 +398,10 @@ static const struct ath_bus_ops ath9k_usb_bus_ops = {
398static void setup_ht_cap(struct ath9k_htc_priv *priv, 398static void setup_ht_cap(struct ath9k_htc_priv *priv,
399 struct ieee80211_sta_ht_cap *ht_info) 399 struct ieee80211_sta_ht_cap *ht_info)
400{ 400{
401 struct ath_common *common = ath9k_hw_common(priv->ah);
402 u8 tx_streams, rx_streams;
403 int i;
404
401 ht_info->ht_supported = true; 405 ht_info->ht_supported = true;
402 ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | 406 ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
403 IEEE80211_HT_CAP_SM_PS | 407 IEEE80211_HT_CAP_SM_PS |
@@ -413,7 +417,24 @@ static void setup_ht_cap(struct ath9k_htc_priv *priv,
413 ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; 417 ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
414 418
415 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); 419 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
416 ht_info->mcs.rx_mask[0] = 0xff; 420
421 /* ath9k_htc supports only 1 or 2 stream devices */
422 tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, 2);
423 rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, 2);
424
425 ath_print(common, ATH_DBG_CONFIG,
426 "TX streams %d, RX streams: %d\n",
427 tx_streams, rx_streams);
428
429 if (tx_streams != rx_streams) {
430 ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
431 ht_info->mcs.tx_params |= ((tx_streams - 1) <<
432 IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
433 }
434
435 for (i = 0; i < rx_streams; i++)
436 ht_info->mcs.rx_mask[i] = 0xff;
437
417 ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; 438 ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
418} 439}
419 440