소스 검색

qcacmn: Trigger ACS only if AFC master chan list is non-empty

When the AFC response has a disjoint set of CFIs and frequency range,
the ACS trigger is called even though the AFC master channel list is
empty.

Due to this, ACS happens even though the AP's destination power
mode is LPI.

To fix this issue, call ACS trigger only if the AFC master channel list
is non-empty.

Change-Id: I217d23827b34ac577649b82b278a203bf01fa1f6
CRs-Fixed: 3052805
Hariharan Basuthkar 3 년 전
부모
커밋
ef0a6ab42b
1개의 변경된 파일24개의 추가작업 그리고 1개의 파일을 삭제
  1. 24 1
      umac/regulatory/core/src/reg_build_chan_list.c

+ 24 - 1
umac/regulatory/core/src/reg_build_chan_list.c

@@ -2904,6 +2904,26 @@ static QDF_STATUS reg_fill_max_psd_in_afc_chan_list(
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * reg_is_afc_mas_chan_list_valid() - Check if the AFC master channel list
+ * is non-empty
+ * @afc_mas_chan_list: Pointer to afc_mas_chan_list.
+ *
+ * Return: True, if atleast one channel has the state "CHANNEL_STATE_ENABLE",
+ * else false.
+ */
+static bool
+reg_is_afc_mas_chan_list_valid(struct regulatory_channel *afc_mas_chan_list)
+{
+	uint8_t i;
+
+	for (i = 0; i < NUM_6GHZ_CHANNELS; i++)
+		if (afc_mas_chan_list[i].state == CHANNEL_STATE_ENABLE)
+			return true;
+
+	return false;
+}
+
 /**
  * reg_process_afc_power_event() - Process the afc event and compute the 6G AFC
  * channel list based on the frequency range and channel frequency indice set.
@@ -2962,6 +2982,8 @@ reg_process_afc_power_event(struct afc_regulatory_info *afc_info)
 	reg_debug("process reg afc master chan list");
 	this_mchan_params = &soc_reg->mas_chan_params[phy_id];
 	afc_mas_chan_list = this_mchan_params->mas_chan_list_6g_afc;
+	qdf_mem_zero(afc_mas_chan_list,
+		     NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel));
 	reg_init_6g_master_chan(afc_mas_chan_list, soc_reg);
 	soc_reg->mas_chan_params[phy_id].is_6g_afc_power_event_received = true;
 	pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, dbg_id);
@@ -3004,7 +3026,8 @@ reg_process_afc_power_event(struct afc_regulatory_info *afc_info)
 	reg_modify_6g_afc_chan_list(pdev_priv_obj);
 
 	if (tx_ops->trigger_acs_for_afc &&
-	    !wlan_reg_is_noaction_on_afc_pwr_evt(pdev))
+	    !wlan_reg_is_noaction_on_afc_pwr_evt(pdev) &&
+	    reg_is_afc_mas_chan_list_valid(pdev_priv_obj->mas_chan_list_6g_afc))
 		tx_ops->trigger_acs_for_afc(pdev);
 
 	wlan_objmgr_pdev_release_ref(pdev, dbg_id);