Search Linux Wireless

Re: [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon interval

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

 



<pkshih@xxxxxxxxxxx> writes:

> From: Ching-Te Ku <ku920601@xxxxxxxxxxx>
>
> Add considering for different WLAN beacon interval in coexistence
> mechanism.
> Because the WLAN beacon period may be not 100 ms, so it's necessary
> to consider any beacon period and set timer according to the interval.
>
> Signed-off-by: Ching-Te Ku <ku920601@xxxxxxxxxxx>
> Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>

[...]

> +	} else if (tbtt_interval < 80 && tbtt_interval > 0) {
> +		para[1] = (100 / tbtt_interval);
> +
> +		if (100 % tbtt_interval != 0)
> +			para[1] = para[1] + 1;
> +
> +		para[1] = para[1] & 0x3f;
> +	} else if (tbtt_interval >= 180) {
> +		para[1] = (tbtt_interval / 100);
> +
> +		if (tbtt_interval % 100 <= 80)
> +			para[1] = para[1] - 1;
> +
> +		para[1] = para[1] & 0x3f;
> +		para[1] = para[1] | 0x80;

Magic numbers 0x3f and 0x80, GENMASK() & FIELD_PREP() is the modern way
to handle bitmasks like these. And there's also the operator '|='

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



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

  Powered by Linux