From 006d4dc0497997dbfae7e10647771e3a242a2f47 Mon Sep 17 00:00:00 2001 From: Hariharan Basuthkar Date: Tue, 28 Sep 2021 13:40:56 +0530 Subject: [PATCH] qcacmn: Check in SP channel list before enabling in AFC master list When the AFC dummy server sends the frequency range with only the UNII-6 channels, the AP still moves to SP and comes up on the UNII-6 channel. In reg_fill_max_psd_in_afc_chan_list, the channels are enabled in the AFC master channel list only based on the frequency ranges present in the AFC frequency object. There is no condition present to check if the channels are supported by the reg_rules sent by the target in the WMI_REG_CHAN_LIST_CC_EXT_EVENT. To fix this issue, before enabling the channel in AFC master channel list, check if the channel is also enabled in the SP AP master channel list. Change-Id: I2cbe69acf13bff57662f77eeab70e3f3a3240196 CRs-Fixed: 3042428 --- .../regulatory/core/src/reg_build_chan_list.c | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index eade4a4d67..5f5da83ed9 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -2844,6 +2844,7 @@ static QDF_STATUS reg_fill_max_psd_in_afc_chan_list( struct reg_fw_afc_power_event *power_info) { uint8_t i; + struct regulatory_channel *sp_chan_list; if (!power_info) { reg_err("power_info is NULL"); @@ -2855,6 +2856,8 @@ static QDF_STATUS reg_fill_max_psd_in_afc_chan_list( return QDF_STATUS_E_FAILURE; } + sp_chan_list = + pdev_priv_obj->mas_chan_list_6g_ap[REG_STANDARD_POWER_AP]; for (i = 0; i < power_info->num_freq_objs; i++) { struct afc_freq_obj *freq_obj = &power_info->afc_freq_info[i]; uint32_t low_limit_enum, high_limit_enum; @@ -2867,15 +2870,19 @@ static QDF_STATUS reg_fill_max_psd_in_afc_chan_list( freq_obj->high_freq, &high_limit_enum); for (j = low_limit_enum; j <= high_limit_enum; j++) { - afc_chan_list[j].state = CHANNEL_STATE_ENABLE; - afc_chan_list[j].chan_flags &= + if (sp_chan_list[j].state == CHANNEL_STATE_ENABLE) { + afc_chan_list[j].state = CHANNEL_STATE_ENABLE; + afc_chan_list[j].chan_flags &= ~REGULATORY_CHAN_DISABLED; - /* - * The max_psd is divided by 100 because the target - * sends the PSD in the units of 0.01 dbm/MHz. - */ - afc_chan_list[j].psd_eirp = freq_obj->max_psd / 100; - afc_chan_list[j].psd_flag = true; + /* + * The max_psd is divided by 100 because the + * target sends the PSD in the units of + * 0.01 dbm/MHz. + */ + afc_chan_list[j].psd_eirp = + freq_obj->max_psd / 100; + afc_chan_list[j].psd_flag = true; + } } }