> -----Original Message----- > From: kvalo=codeaurora.org@xxxxxxxxxxxxxxxxx [mailto:kvalo=codeaurora.org@xxxxxxxxxxxxxxxxx] On > Behalf Of Kalle Valo > Sent: Wednesday, November 11, 2020 4:34 PM > To: Pkshih > Cc: tony0620emma@xxxxxxxxx; linux-wireless@xxxxxxxxxxxxxxx > Subject: Re: [PATCH 01/11] rtw88: coex: update TDMA settings for different beacon interval > > <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 '|=' > I'll give proper names and use suggested macros it in v2. Thank you. --- Ping-Ke