Commit c05ea151 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

ath9k: Cleanup ath_rc_setvalid_rates

Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ea2771f6
...@@ -516,39 +516,32 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv) ...@@ -516,39 +516,32 @@ static u8 ath_rc_setvalid_rates(struct ath_rate_priv *ath_rc_priv)
{ {
const struct ath_rate_table *rate_table = ath_rc_priv->rate_table; const struct ath_rate_table *rate_table = ath_rc_priv->rate_table;
struct ath_rateset *rateset = &ath_rc_priv->neg_rates; struct ath_rateset *rateset = &ath_rc_priv->neg_rates;
u32 capflag = ath_rc_priv->ht_cap; u32 phy, capflag = ath_rc_priv->ht_cap;
u8 i, j, hi = 0; u16 rate_flags;
u8 i, j, hi = 0, rate, dot11rate, valid_rate_count;
for (i = 0; i < rateset->rs_nrates; i++) { for (i = 0; i < rateset->rs_nrates; i++) {
for (j = 0; j < rate_table->rate_cnt; j++) { for (j = 0; j < rate_table->rate_cnt; j++) {
u32 phy = rate_table->info[j].phy; phy = rate_table->info[j].phy;
u16 rate_flags = rate_table->info[j].rate_flags; rate_flags = rate_table->info[j].rate_flags;
u8 rate = rateset->rs_rates[i]; rate = rateset->rs_rates[i];
u8 dot11rate = rate_table->info[j].dot11rate; dot11rate = rate_table->info[j].dot11rate;
/* We allow a rate only if its valid and the if (rate != dot11rate
* capflag matches one of the validity || ((rate_flags & WLAN_RC_CAP_MODE(capflag)) !=
* (VALID/VALID_20/VALID_40) flags */ WLAN_RC_CAP_MODE(capflag))
|| !(rate_flags & WLAN_RC_CAP_STREAM(capflag))
if ((rate == dot11rate) && || WLAN_RC_PHY_HT(phy))
(rate_flags & WLAN_RC_CAP_MODE(capflag)) == continue;
WLAN_RC_CAP_MODE(capflag) &&
(rate_flags & WLAN_RC_CAP_STREAM(capflag)) &&
!WLAN_RC_PHY_HT(phy)) {
u8 valid_rate_count = 0;
if (!ath_rc_valid_phyrate(phy, capflag, 0))
continue;
valid_rate_count = if (!ath_rc_valid_phyrate(phy, capflag, 0))
ath_rc_priv->valid_phy_ratecnt[phy]; continue;
ath_rc_priv->valid_phy_rateidx[phy] valid_rate_count = ath_rc_priv->valid_phy_ratecnt[phy];
[valid_rate_count] = j; ath_rc_priv->valid_phy_rateidx[phy][valid_rate_count] = j;
ath_rc_priv->valid_phy_ratecnt[phy] += 1; ath_rc_priv->valid_phy_ratecnt[phy] += 1;
ath_rc_set_valid_rate_idx(ath_rc_priv, j, 1); ath_rc_set_valid_rate_idx(ath_rc_priv, j, 1);
hi = max(hi, j); hi = max(hi, j);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment