On Thu, Apr 11, 2013 at 12:02:31PM +0200, Johannes Berg wrote: > On Fri, 2013-04-05 at 12:06 +0200, Karl Beldan wrote: > > From: Karl Beldan <karl.beldan@xxxxxxxxxxxxxxxx> > > > > When the 1st rate control entry is a pre-HT rate we want to set > > rts_cts_rate_idx "as the fastest basic rate that is not faster than the > > data rate"(code comments). > > But in case some bss allowed rate indexes are lower than the lowest bss > > basic rate, if the rate control selects a rate among the formers for its > > 1st rate control entry, rts_cts_rate_idx remains 0 and is not a basic > > rate index. > > This commit sets rts_cts_rate_idx to the lowest bss basic rate index in > > this situation. > > Ok after reviewing this again I applied it. > > > > if (!(info->control.rates[0].flags & IEEE80211_TX_RC_MCS)) { > > - s8 baserate = 0; > > + u32 basic_rates = tx->sdata->vif.bss_conf.basic_rates; > > + s8 baserate = basic_rates ? ffs(basic_rates - 1) : 0; > > Note that this also assumes that rate 0 is a mandatory rate, which > presumably will always be true. > basic_rates == 0 should not happen so it's more a defensive fallback in case there are no basic rates programmed (which should not happen) to prevent out of bonds accesses via rts_cts_rate_idx. Karl -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html