diff --git a/sys/dev/rtwn/if_rtwn_ridx.h b/sys/dev/rtwn/if_rtwn_ridx.h --- a/sys/dev/rtwn/if_rtwn_ridx.h +++ b/sys/dev/rtwn/if_rtwn_ridx.h @@ -95,7 +95,9 @@ case 4: return 1; case 11: return 2; case 22: return 3; - default: return RTWN_RIDX_UNKNOWN; + default: + printf("%s: called; unknown rate (%d)\n", __func__, rate); + return RTWN_RIDX_UNKNOWN; } } @@ -108,10 +110,23 @@ /* Check if we are using MCS rate. */ KASSERT(RTWN_RATE_IS_HT(ridx), ("bad mcs rate index %d", ridx)); - rate = (ridx - RTWN_RIDX_HT_MCS(0)) | IEEE80211_RATE_MCS; + rate = RTWN_RIDX_TO_MCS(ridx) | IEEE80211_RATE_MCS; cix = rt->info[rt->rateCodeToIndex[rate]].ctlRateIndex; KASSERT(cix != (uint8_t)-1, ("rate %d (%d) has no info", rate, ridx)); return rt->info[cix].dot11Rate; } +/* VHT version of rtwn_ctl_mcsrate */ +/* XXX TODO: also should move this to net80211 */ +static __inline__ uint8_t +rtwn_ctl_vhtrate(const struct ieee80211_rate_table *rt, uint8_t ridx) +{ + + /* Check if we are using VHT MCS rate. */ + KASSERT(RTWN_RATE_IS_VHT(ridx), ("bad mcs rate index %d", ridx)); + + /* TODO: there's no VHT tables, so for now just stick to OFDM12 */ + return 24; +} + #endif /* IF_RTWN_RIDX_H */