瀏覽代碼

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
Hariharan Basuthkar 3 年之前
父節點
當前提交
006d4dc049
共有 1 個文件被更改,包括 15 次插入8 次删除
  1. 15 8
      umac/regulatory/core/src/reg_build_chan_list.c

+ 15 - 8
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;
+			}
 		}
 	}