diff options
Diffstat (limited to 'sys/dev/rtwn/if_rtwn.c')
| -rw-r--r-- | sys/dev/rtwn/if_rtwn.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index be01ececf307..3b286d9adba9 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -1202,7 +1202,8 @@ rtwn_calc_basicrates(struct rtwn_softc *sc) struct rtwn_vap *rvp; struct ieee80211vap *vap; struct ieee80211_node *ni; - uint32_t rates; + struct ieee80211_htrateset *rs_ht; + uint32_t rates = 0, htrates = 0; rvp = sc->vaps[i]; if (rvp == NULL || rvp->curr_mode == R92C_MSR_NOLINK) @@ -1213,16 +1214,45 @@ rtwn_calc_basicrates(struct rtwn_softc *sc) continue; ni = ieee80211_ref_node(vap->iv_bss); - /* Only fetches basic rates; no need to add HT/VHT here */ - rtwn_get_rates(sc, &ni->ni_rates, NULL, &rates, NULL, NULL, 1); + if (ni->ni_flags & IEEE80211_NODE_HT) + rs_ht = &ni->ni_htrates; + else + rs_ht = NULL; + /* + * Only fetches basic rates; fetch 802.11abg and 11n basic + * rates + */ + rtwn_get_rates(sc, &ni->ni_rates, rs_ht, &rates, &htrates, + NULL, 1); + + /* + * We need at least /an/ OFDM and/or MCS rate for HT + * operation, or the MAC will generate MCS7 ACK/Block-ACK + * frames and thus performance will suffer. + */ + if (ni->ni_flags & IEEE80211_NODE_HT) { + htrates |= 0x01; /* MCS0 */ + rates |= (1 << RTWN_RIDX_OFDM6); + } + basicrates |= rates; + basicrates |= (htrates << RTWN_RIDX_HT_MCS_SHIFT); + + /* Filter out undesired high rates */ + if (ni->ni_chan != IEEE80211_CHAN_ANYC && + IEEE80211_IS_CHAN_5GHZ(ni->ni_chan)) + basicrates &= R92C_RRSR_RATE_MASK_5GHZ; + else + basicrates &= R92C_RRSR_RATE_MASK_2GHZ; + ieee80211_free_node(ni); } + if (basicrates == 0) return; - /* XXX initial RTS rate? */ + /* XXX also set initial RTS rate? */ rtwn_set_basicrates(sc, basicrates); } |
