aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2009-06-24 09:26:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:24 -0400
commit140add21356528fc76ad276fd32b2e7abb945325 (patch)
treed056ec608bcf0b54a224114186f139cff27d1cad
parente5f0921a9593365b506f69daa3cfd19c0ed1340b (diff)
ath9k: Handle different TX and RX streams properly.
This patch fixes an issue when the TX and RX streams are different. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 52dfa43bc529..961b0ce6ef3e 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -889,6 +889,7 @@ static void setup_ht_cap(struct ath_softc *sc,
889{ 889{
890#define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3 /* 2 ^ 16 */ 890#define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3 /* 2 ^ 16 */
891#define ATH9K_HT_CAP_MPDUDENSITY_8 0x6 /* 8 usec */ 891#define ATH9K_HT_CAP_MPDUDENSITY_8 0x6 /* 8 usec */
892 u8 tx_streams, rx_streams;
892 893
893 ht_info->ht_supported = true; 894 ht_info->ht_supported = true;
894 ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | 895 ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
@@ -901,21 +902,22 @@ static void setup_ht_cap(struct ath_softc *sc,
901 902
902 /* set up supported mcs set */ 903 /* set up supported mcs set */
903 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); 904 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
905 tx_streams = !(sc->tx_chainmask & (sc->tx_chainmask - 1)) ? 1 : 2;
906 rx_streams = !(sc->rx_chainmask & (sc->rx_chainmask - 1)) ? 1 : 2;
904 907
905 switch(sc->rx_chainmask) { 908 if (tx_streams != rx_streams) {
906 case 1: 909 DPRINTF(sc, ATH_DBG_CONFIG, "TX streams %d, RX streams: %d\n",
907 ht_info->mcs.rx_mask[0] = 0xff; 910 tx_streams, rx_streams);
908 break; 911 ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
909 case 3: 912 ht_info->mcs.tx_params |= ((tx_streams - 1) <<
910 case 5: 913 IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
911 case 7:
912 default:
913 ht_info->mcs.rx_mask[0] = 0xff;
914 ht_info->mcs.rx_mask[1] = 0xff;
915 break;
916 } 914 }
917 915
918 ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; 916 ht_info->mcs.rx_mask[0] = 0xff;
917 if (rx_streams >= 2)
918 ht_info->mcs.rx_mask[1] = 0xff;
919
920 ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
919} 921}
920 922
921static void ath9k_bss_assoc_info(struct ath_softc *sc, 923static void ath9k_bss_assoc_info(struct ath_softc *sc,