Re: [PATCH 2/2] mac80211: minstrel try all rates

Adam Wozniak
2009-11-24T17:55:18Z

Johannes Berg wrote:
> On Tue, 2009-11-24 at 09:17 -0800, Adam Wozniak wrote:
>
>> I do not believe 1/2 was a hack. It really was possible to get to the
>> end of that function and use that variable without it being assigned the
>> correct value. Also, it is important to reinitialize the rate control
>> layer when the list of usable rates changes.
>>
> Ah, indeed. But I still don't think the rate control _init() function
> should be called again.
>
My first thought was to use rate_control_ops.rate_update (via rate.h's
rate_control_rate_update() function).

However, neither minstrel nor pid_algo implement it, and the only place
it is actually used is from ieee80211_enable_ht() (in mlme.c) when the
channel type changes.

So the only way (currently) to "update" is call _init() again.

Unless you want to make rate_control_rate_update() do this:

if (ref->ops->rate_update)
ref->ops->rate_update(ref->priv, sband, ista, priv_sta,
changed);
else if (ref->ops->rate_init)
ref->ops->rate_update(ref->priv, sband, ista, priv_sta);

But that seems equally distasteful.