[PATCH v2 2/2] ath10k: refactor radar detection code

Michal Kazior michal.kazior at tieto.com
Tue Apr 8 02:32:58 EDT 2014


On 7 April 2014 16:04, Kalle Valo <kvalo at qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior at tieto.com> writes:
>
>> If 20MHz CAC completed successfully then
>> subsequent CAC with wider bandwidth (40Mhz, 80Mhz)
>> with identical control frequency did not start
>> monitor vdev making it impossible to detect any
>> radar pulses during intended CAC.
>>
>> It also was incorrect to assume ath10k_config() will
>> be called after CAC is finished. Theoretically for
>> non-HT channels nothing changes between CAC and
>> start_ap() (albeit in practice this can be
>> different). The incorrect assumption led to CAC
>> not being stopped on non-HT chandefs leading to
>> all Rx being drooped making it impossible for
>> clients to associate.
>>
>> While at it clean up the code a bit.
>>
>> Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
>
> [...]
>
>> @@ -858,6 +830,11 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
>>               return ret;
>>       }
>>
>> +     if (!WARN_ON(ar->num_started_vdevs == 0)) {
>
> Even though this is correct, I think it's still a bit evil. For example,
> I missed '!' the first time I looked at this. Even this is a line
> longer, I think it would be easier to read:
>
> WARN_ON(ar->num_started_vdevs == 0);
>
> if (ar->num_started_vdevs != 0) {
>         ...
> }

Sound reasonably.


Michał



More information about the ath10k mailing list