Search Linux Wireless

Re: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()

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

 



On Tue, Oct 29, 2013 at 5:19 PM, Shete, Mihir <smihir@xxxxxxxxxxxxxxxx> wrote:
>
>
>> -----Original Message-----
>> From: Luis R. Rodriguez [mailto:mcgrof@xxxxxxxxx] On Behalf Of Luis R.
>> Rodriguez
>> Sent: Monday, October 21, 2013 10:45 PM
>> To: linville@xxxxxxxxxxxxx; johannes@xxxxxxxxxxxxxxxx
>> Cc: linux-wireless@xxxxxxxxxxxxxxx; janusz.dziedzic@xxxxxxxxx; Shete, Mihir;
>> Bhattacharyya, Tushnim; Luis R. Rodriguez
>> Subject: [PATCH 2/5] ath: clean up ath_reg_apply_active_scan_flags()
>>
>> The routine ath_reg_apply_active_scan_flags() can be a bit hard to read, this
>> cleans it up by adding helpers for the two cases of clearing IR flags or adding
>> them. This approach also makes no assumptions on the index of channels 12
>> and 13 so it should be portable accross different drivers.
>>
>> Cc: smihir@xxxxxxxxxxxxxxxx
>> Cc: tushnimb@xxxxxxxxxxxxxxxx
>> Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
>> ---
>>  drivers/net/wireless/ath/regd.c | 101 +++++++++++++++++++++++++-------
>> --------
>>  1 file changed, 63 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/regd.c
>> b/drivers/net/wireless/ath/regd.c index 1b4a532..48e2368 100644
>> --- a/drivers/net/wireless/ath/regd.c
>> +++ b/drivers/net/wireless/ath/regd.c
>> @@ -177,6 +177,47 @@ static bool ath_is_radar_freq(u16 center_freq)
>>       return (center_freq >= 5260 && center_freq <= 5700);  }
>>
>> +static void ath_force_clear_no_ir_chan(struct wiphy *wiphy,
>> +                                    struct ieee80211_channel *ch) {
>> +     const struct ieee80211_reg_rule *reg_rule;
>> +
>> +     reg_rule = freq_reg_info(wiphy, ch->center_freq);
>
> Do we not require to provide the frequency in KHZ here?

Good catch! This has been beautifully broken for eons. And guess, what
all those other drivers that copied the code also have this broken.
I'll just send a follow up patch to fix this on top of this patch for
each driver as they're all broken. In a way this seems to be begging
to just share a reg_notifier between drivers as a few drivers copied
the same behaviour from ath9k.

  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