aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/rc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath9k/rc.c')
-rw-r--r--drivers/net/wireless/ath9k/rc.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index 824ccbb8b7b8..a6933ccab483 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -524,7 +524,7 @@ static u8 ath_rc_init_validrates(struct ath_rate_priv *ath_rc_priv,
524 u32 valid; 524 u32 valid;
525 525
526 for (i = 0; i < rate_table->rate_cnt; i++) { 526 for (i = 0; i < rate_table->rate_cnt; i++) {
527 valid = (ath_rc_priv->single_stream ? 527 valid = (!(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG) ?
528 rate_table->info[i].valid_single_stream : 528 rate_table->info[i].valid_single_stream :
529 rate_table->info[i].valid); 529 rate_table->info[i].valid);
530 if (valid == 1) { 530 if (valid == 1) {
@@ -557,9 +557,9 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv,
557 for (i = 0; i < rateset->rs_nrates; i++) { 557 for (i = 0; i < rateset->rs_nrates; i++) {
558 for (j = 0; j < rate_table->rate_cnt; j++) { 558 for (j = 0; j < rate_table->rate_cnt; j++) {
559 u32 phy = rate_table->info[j].phy; 559 u32 phy = rate_table->info[j].phy;
560 u32 valid = (ath_rc_priv->single_stream ? 560 u32 valid = (!(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG) ?
561 rate_table->info[j].valid_single_stream : 561 rate_table->info[j].valid_single_stream :
562 rate_table->info[j].valid); 562 rate_table->info[j].valid);
563 u8 rate = rateset->rs_rates[i]; 563 u8 rate = rateset->rs_rates[i];
564 u8 dot11rate = rate_table->info[j].dot11rate; 564 u8 dot11rate = rate_table->info[j].dot11rate;
565 565
@@ -603,7 +603,7 @@ static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv,
603 for (i = 0; i < rateset->rs_nrates; i++) { 603 for (i = 0; i < rateset->rs_nrates; i++) {
604 for (j = 0; j < rate_table->rate_cnt; j++) { 604 for (j = 0; j < rate_table->rate_cnt; j++) {
605 u32 phy = rate_table->info[j].phy; 605 u32 phy = rate_table->info[j].phy;
606 u32 valid = (ath_rc_priv->single_stream ? 606 u32 valid = (!(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG) ?
607 rate_table->info[j].valid_single_stream : 607 rate_table->info[j].valid_single_stream :
608 rate_table->info[j].valid); 608 rate_table->info[j].valid);
609 u8 rate = rateset->rs_rates[i]; 609 u8 rate = rateset->rs_rates[i];
@@ -740,9 +740,10 @@ static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
740 if (rate > (ath_rc_priv->rate_table_size - 1)) 740 if (rate > (ath_rc_priv->rate_table_size - 1))
741 rate = ath_rc_priv->rate_table_size - 1; 741 rate = ath_rc_priv->rate_table_size - 1;
742 742
743 ASSERT((rate_table->info[rate].valid && !ath_rc_priv->single_stream) || 743 ASSERT((rate_table->info[rate].valid &&
744 (ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)) ||
744 (rate_table->info[rate].valid_single_stream && 745 (rate_table->info[rate].valid_single_stream &&
745 ath_rc_priv->single_stream)); 746 !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)));
746 747
747 return rate; 748 return rate;
748} 749}
@@ -1422,9 +1423,6 @@ static void ath_rc_init(struct ath_softc *sc,
1422 } 1423 }
1423 ath_rc_priv->rc_phy_mode = ath_rc_priv->ht_cap & WLAN_RC_40_FLAG; 1424 ath_rc_priv->rc_phy_mode = ath_rc_priv->ht_cap & WLAN_RC_40_FLAG;
1424 1425
1425 /* Set stream capability */
1426 ath_rc_priv->single_stream = (ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG) ? 0 : 1;
1427
1428 if (!rateset->rs_nrates) { 1426 if (!rateset->rs_nrates) {
1429 /* No working rate, just initialize valid rates */ 1427 /* No working rate, just initialize valid rates */
1430 hi = ath_rc_init_validrates(ath_rc_priv, rate_table, 1428 hi = ath_rc_init_validrates(ath_rc_priv, rate_table,