qcacmn: Fix wrong MLO 2 GHz link CCFS1 in response to get_channel

2 GHz link CCFS may not filled correctly in vht/he op, wrong CCFS0
is got from util_scan_sec_chan_freq_from_htinfo and passed to kernel,
regulatory check failed, disconnect will happen.

To fix it, add new API util_scan_ccfs0_from_htinfo, and get CCFS0 by it.

Change-Id: I0e8879f13cff37b85cffb6446cc15c60c05465d2
CRs-Fixed: 3739815
This commit is contained in:
Jianmin Zhu
2024-02-27 09:50:39 +08:00
committed by Ravindra Konda
parent a9c79a17ae
commit bf97803ce8

View File

@@ -728,13 +728,13 @@ util_scan_get_phymode_6g(struct wlan_objmgr_pdev *pdev,
#endif #endif
static inline static inline
uint32_t util_scan_sec_chan_freq_from_htinfo(struct wlan_ie_htinfo_cmn *htinfo, uint32_t util_scan_ccfs0_from_htinfo(struct wlan_ie_htinfo_cmn *htinfo,
uint32_t primary_chan_freq) uint32_t primary_chan_freq)
{ {
if (htinfo->hi_extchoff == WLAN_HTINFO_EXTOFFSET_ABOVE) if (htinfo->hi_extchoff == WLAN_HTINFO_EXTOFFSET_ABOVE)
return primary_chan_freq + WLAN_CHAN_SPACING_20MHZ; return primary_chan_freq + WLAN_CHAN_SPACING_20MHZ / 2;
else if (htinfo->hi_extchoff == WLAN_HTINFO_EXTOFFSET_BELOW) else if (htinfo->hi_extchoff == WLAN_HTINFO_EXTOFFSET_BELOW)
return primary_chan_freq - WLAN_CHAN_SPACING_20MHZ; return primary_chan_freq - WLAN_CHAN_SPACING_20MHZ / 2;
return 0; return 0;
} }
@@ -771,8 +771,8 @@ util_scan_get_phymode_5g(struct wlan_objmgr_pdev *pdev,
phymode = WLAN_PHYMODE_11NA_HT20; phymode = WLAN_PHYMODE_11NA_HT20;
scan_params->channel.cfreq0 = scan_params->channel.cfreq0 =
util_scan_sec_chan_freq_from_htinfo(htinfo, util_scan_ccfs0_from_htinfo(htinfo,
scan_params->channel.chan_freq); scan_params->channel.chan_freq);
if (util_scan_entry_vhtcap(scan_params) && vhtop) { if (util_scan_entry_vhtcap(scan_params) && vhtop) {
switch (vhtop->vht_op_chwidth) { switch (vhtop->vht_op_chwidth) {
@@ -923,8 +923,8 @@ util_scan_get_phymode_2g(struct scan_cache_entry *scan_params)
return phymode; return phymode;
scan_params->channel.cfreq0 = scan_params->channel.cfreq0 =
util_scan_sec_chan_freq_from_htinfo(htinfo, util_scan_ccfs0_from_htinfo(htinfo,
scan_params->channel.chan_freq); scan_params->channel.chan_freq);
if (util_scan_entry_vhtcap(scan_params) && vhtop) { if (util_scan_entry_vhtcap(scan_params) && vhtop) {
switch (vhtop->vht_op_chwidth) { switch (vhtop->vht_op_chwidth) {