1
0

qcacmn: Rectify the API wlan_reg_is_6ghz_psc_chan_freq

While checking if a channel frequency is 6Ghz PSC frequency within
wlan_reg_is_6ghz_psc_chan_freq, check the remainder of the expression,
instead of quotient.

Change-Id: Ia40d7cd8485f9f8eb90222f9a3454d46e681681b
CRs-Fixed: 2572914
Este cometimento está contido em:
Hariharan Basuthkar
2019-11-26 10:21:57 +05:30
cometido por nshrivas
ascendente aa6ca443db
cometimento 4050a850ac

Ver ficheiro

@@ -2365,19 +2365,17 @@ uint16_t reg_max_6ghz_chan_freq(void)
bool reg_is_6ghz_psc_chan_freq(uint16_t freq)
{
uint8_t count;
if (!REG_IS_6GHZ_FREQ(freq)) {
reg_debug(" Channel frequency is not a 6GHz frequency");
return false;
}
for (count = 1; count <= NUM_PSC_FREQ; count++) {
if (count ==
(((freq - SIXG_STARTING_FREQ) + (FREQ_LEFT_SHIFT)) /
(FREQ_TO_CHAN_SCALE * NUM_80MHZ_BAND_IN_6G)))
return true;
if (!(((freq - SIXG_STARTING_FREQ) + (FREQ_LEFT_SHIFT)) %
(FREQ_TO_CHAN_SCALE * NUM_80MHZ_BAND_IN_6G))) {
return true;
}
reg_debug(" Channel frequency is not a 6GHz PSC frequency");
reg_debug_rl("Channel freq %d MHz is not a 6GHz PSC frequency", freq);
return false;
}