Search Linux Wireless

Re: [PATCH v2 3.7 1/2] cfg80211: fix antenna gain handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 9, 2012 at 2:49 AM, Felix Fietkau <nbd@xxxxxxxxxxx> wrote:
> On 2012-10-09 3:00 AM, Luis R. Rodriguez wrote:
>> I never followed up but we should see if we can get this but I'll
>> use this as a prelude to work on this.
>
> Well, the regulatory related variable seem like a pretty bad place to
> store the embedded antenna gain. Some drivers even share the
> ieee80211_channel array between multiple instances...

True, specially no need to have it for each channel.

>> The antenna gain nomenclature came from the HAL but that's just baggage.  The
>> antenna gain stuff remained a puzzle for a central regulatory code base due to
>> the fact that as far as I am concerned only ath9k was exposing the antenna gain
>> value from EEPROM and using it.
>
> No, ath9k was (and still is) not filling anything EEPROM related into
> chan->max_antenna_gain. And that's a good thing, because putting the
> EEPROM value in there would have made the whole thing even more wrong
> and confused than it already is.

Heh, OK. Then forget my ramblings as its eroded brain cache.

>> How about just adding a check for now:
>>
>> -       chan->max_antenna_gain = min(chan->orig_mag,
>> -               (int) MBI_TO_DBI(power_rule->max_antenna_gain));
>> +     if (chan->orig_mag)
>> +             chan->max_antenna_gain =
>> +                     min(chan->orig_mag, (int) MBI_TO_DBI(power_rule->max_antenna_gain));
>> +     else
>> +             chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
>> +
>>
>> Then we can go ahead and clarify usage of these values.
>
> No, because 0 is a valid value too, it does not indicate 'not present'.
> I don't want to add fragile checks that will not do anything useful for
> *any* current driver and are not useful for future changes either.

Alright, its obvious I'm rusty with antenna gain review here and
you've already thought out some kinks, this change is fine by me then
provided we also then proceed to clarify its usage more than what we
have.

  Luis
--
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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux