Currently, in the calculation of the index of the primary channel,
the best frequency, which is the primary channel frequency, is
always greater than the frequency of the first channel in
the bandwidth. As a result, the computed value of the index of
the primary channel would be negative, which is incorrect.
Fix bug in the calculation of the index of the primary channel.
Fixes: 627b67f29b1e ("ACS: Fix primary channel puncturing in ACS")
Signed-off-by: Suraj P Kizhakkethil <suraj.kizhakkethil@oss.qualcomm.com>
chan->interference_factor,
best->interference_factor);
#ifdef CONFIG_IEEE80211BE
- index_primary = (chan->freq - best->freq) / 20;
+ index_primary = (best->freq - chan->freq) / 20;
#endif /* CONFIG_IEEE80211BE */
chan = best;
}