소스 검색

qcacmn: Implement the 6G AFC power event processing

Add regulatory functions to handle the WMI_AFC_EVENTID. This
includes processing the AFC power information received from the FW,
and constructing the AFC channel list in the regulatory component.

Change-Id: I5da8fc7faae847476f88ff35b20e6444115af7f1
CRs-Fixed: 3023789
Hariharan Basuthkar 4 년 전
부모
커밋
258d7f4c16

+ 163 - 0
target_if/regulatory/src/target_if_reg.c

@@ -488,6 +488,127 @@ static QDF_STATUS tgt_if_regulatory_unregister_master_list_ext_handler(
 	return wmi_unified_unregister_event_handler(
 			wmi_handle, wmi_reg_chan_list_cc_ext_event_id);
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+/**
+ * tgt_afc_event_handler() - Handler for AFC Event
+ * @handle: scn handle
+ * @event_buf: pointer to event buffer
+ * @len: buffer length
+ *
+ * Return: 0 on success
+ */
+static int
+tgt_afc_event_handler(ol_scn_t handle, uint8_t *event_buf, uint32_t len)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_lmac_if_reg_rx_ops *reg_rx_ops;
+	struct afc_regulatory_info *afc_info;
+	QDF_STATUS status;
+	struct wmi_unified *wmi_handle;
+	int ret_val = 0;
+
+	TARGET_IF_ENTER();
+
+	psoc = target_if_get_psoc_from_scn_hdl(handle);
+	if (!psoc) {
+		target_if_err("psoc ptr is NULL");
+		return -EINVAL;
+	}
+
+	reg_rx_ops = target_if_regulatory_get_rx_ops(psoc);
+	if (!reg_rx_ops) {
+		target_if_err("reg_rx_ops is NULL");
+		return -EINVAL;
+	}
+
+	if (!reg_rx_ops->afc_event_handler) {
+		target_if_err("afc_event_handler is NULL");
+		return -EINVAL;
+	}
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("invalid wmi handle");
+		return -EINVAL;
+	}
+
+	afc_info = qdf_mem_malloc(sizeof(*afc_info));
+	if (!afc_info)
+		return -ENOMEM;
+
+	status = wmi_extract_afc_event(wmi_handle, event_buf, afc_info, len);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		target_if_err("Extraction of AFC event failed");
+		ret_val = -EFAULT;
+		goto clean;
+	}
+
+	if (afc_info->phy_id >= PSOC_MAX_PHY_REG_CAP) {
+		target_if_err_rl("phy_id %d is out of bounds",
+				 afc_info->phy_id);
+		ret_val = -EFAULT;
+		goto clean;
+	}
+
+	afc_info->psoc = psoc;
+
+	status = reg_rx_ops->afc_event_handler(afc_info);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		target_if_err("Failed to process AFC event handler");
+		ret_val = -EFAULT;
+		goto clean;
+	}
+
+clean:
+	qdf_mem_free(afc_info);
+	TARGET_IF_EXIT();
+
+	return ret_val;
+}
+
+/**
+ * tgt_if_regulatory_register_afc_event_handler() - Register AFC event
+ * handler
+ * @psoc: Pointer to psoc
+ * @arg: Pointer to argument list
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS tgt_if_regulatory_register_afc_event_handler(
+	struct wlan_objmgr_psoc *psoc, void *arg)
+{
+	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+
+	if (!wmi_handle)
+		return QDF_STATUS_E_FAILURE;
+
+	return wmi_unified_register_event_handler(
+			wmi_handle, wmi_afc_event_id,
+			tgt_afc_event_handler, WMI_RX_WORK_CTX);
+}
+
+/**
+ * tgt_if_regulatory_unregister_afc_event_handler() - Unregister AFC event
+ * handler
+ * @psoc: Pointer to psoc
+ * @arg: Pointer to argument list
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+tgt_if_regulatory_unregister_afc_event_handler(struct wlan_objmgr_psoc *psoc,
+					       void *arg)
+{
+	wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+
+	if (!wmi_handle)
+		return QDF_STATUS_E_FAILURE;
+
+	return wmi_unified_unregister_event_handler(
+			wmi_handle, wmi_afc_event_id);
+}
+#endif
 #endif
 
 /**
@@ -687,11 +808,49 @@ static void target_if_register_master_ext_handler(
 	reg_ops->unregister_master_ext_handler =
 		tgt_if_regulatory_unregister_master_list_ext_handler;
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+static void target_if_register_afc_event_handler(
+				struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+	reg_ops->register_afc_event_handler =
+		tgt_if_regulatory_register_afc_event_handler;
+
+	reg_ops->unregister_afc_event_handler =
+		tgt_if_regulatory_unregister_afc_event_handler;
+}
+
+static void target_if_register_acs_trigger_for_afc
+				(struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+	reg_ops->trigger_acs_for_afc = NULL;
+}
+#else
+static void target_if_register_afc_event_handler(
+				struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+}
+
+static void target_if_register_acs_trigger_for_afc
+				(struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+}
+#endif
 #else
 static inline void
 target_if_register_master_ext_handler(struct wlan_lmac_if_reg_tx_ops *reg_ops)
 {
 }
+
+static void target_if_register_afc_event_handler(
+				struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+}
+
+static void target_if_register_acs_trigger_for_afc
+				(struct wlan_lmac_if_reg_tx_ops *reg_ops)
+{
+}
 #endif
 
 static QDF_STATUS
@@ -883,12 +1042,16 @@ QDF_STATUS target_if_register_regulatory_tx_ops(
 
 	target_if_register_master_ext_handler(reg_ops);
 
+	target_if_register_afc_event_handler(reg_ops);
+
 	reg_ops->set_country_code = tgt_if_regulatory_set_country_code;
 
 	reg_ops->fill_umac_legacy_chanlist = NULL;
 
 	reg_ops->set_country_failed = NULL;
 
+	target_if_register_acs_trigger_for_afc(reg_ops);
+
 	reg_ops->register_11d_new_cc_handler =
 		tgt_if_regulatory_register_11d_new_cc_handler;
 

+ 11 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -903,6 +903,9 @@ struct wlan_lmac_if_ftm_rx_ops {
  * @send_ctl_info: call-back function to send CTL info to firmware
  * @set_tpc_power: send transmit power control info to firmware
  * @send_afc_ind: send AFC indication info to firmware.
+ * @register_afc_event_handler: pointer to register afc event handler
+ * @unregister_afc_event_handler: pointer to unregister afc event handler
+ * @trigger_acs_for_afc: pointer to trigger acs for afc
  */
 struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
@@ -947,6 +950,11 @@ struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*send_afc_ind)(struct wlan_objmgr_psoc *psoc,
 				   uint8_t pdev_id,
 				   struct reg_afc_resp_rx_ind_info *param);
+	QDF_STATUS (*register_afc_event_handler)(struct wlan_objmgr_psoc *psoc,
+						 void *arg);
+	QDF_STATUS (*unregister_afc_event_handler)
+				(struct wlan_objmgr_psoc *psoc, void *arg);
+	QDF_STATUS (*trigger_acs_for_afc)(struct wlan_objmgr_pdev *pdev);
 #endif
 };
 
@@ -1315,6 +1323,9 @@ struct wlan_lmac_if_reg_rx_ops {
 #ifdef CONFIG_BAND_6GHZ
 	QDF_STATUS (*master_list_ext_handler)(struct cur_regulatory_info
 					      *reg_info);
+#ifdef CONFIG_AFC_SUPPORT
+	QDF_STATUS (*afc_event_handler)(struct afc_regulatory_info *afc_info);
+#endif
 #endif
 	QDF_STATUS (*reg_11d_new_cc_handler)(struct wlan_objmgr_psoc *psoc,
 			struct reg_11d_new_country *reg_11d_new_cc);

+ 21 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -300,11 +300,30 @@ static void wlan_lmac_if_register_master_list_ext_handler(
 	rx_ops->reg_rx_ops.master_list_ext_handler =
 		tgt_reg_process_master_chan_list_ext;
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+static void wlan_lmac_if_register_afc_event_handler(
+					struct wlan_lmac_if_rx_ops *rx_ops)
+{
+	rx_ops->reg_rx_ops.afc_event_handler = tgt_reg_process_afc_event;
+}
+#else
+static void wlan_lmac_if_register_afc_event_handler(
+					struct wlan_lmac_if_rx_ops *rx_ops)
+{
+}
+#endif
+
 #else
 static inline void wlan_lmac_if_register_master_list_ext_handler(
 					struct wlan_lmac_if_rx_ops *rx_ops)
 {
 }
+
+static void wlan_lmac_if_register_afc_event_handler(
+					struct wlan_lmac_if_rx_ops *rx_ops)
+{
+}
 #endif
 
 #if defined(CONFIG_BAND_6GHZ)
@@ -396,6 +415,8 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
 		tgt_reg_set_ext_tpc_supported;
 
 	wlan_lmac_if_register_6g_edge_chan_supp(rx_ops);
+
+	wlan_lmac_if_register_afc_event_handler(rx_ops);
 }
 
 #ifdef CONVERGED_P2P_ENABLE

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

@@ -518,7 +518,8 @@ static void reg_find_low_limit_chan_enum(
  * Return: None
  */
 static void reg_find_high_limit_chan_enum(
-		struct regulatory_channel *chan_list, qdf_freq_t high_freq,
+		struct regulatory_channel *chan_list,
+		qdf_freq_t high_freq,
 		uint32_t *high_limit)
 {
 	enum channel_enum chan_enum;
@@ -2352,6 +2353,506 @@ QDF_STATUS reg_process_master_chan_list_ext(
 
 	return QDF_STATUS_SUCCESS;
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+static void reg_disable_afc_mas_chan_list_channels(
+		struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	struct regulatory_channel *afc_mas_chan_list;
+	enum channel_enum chan_idx;
+
+	afc_mas_chan_list = pdev_priv_obj->mas_chan_list_6g_afc;
+
+	for (chan_idx = 0; chan_idx < NUM_6GHZ_CHANNELS; chan_idx++) {
+		if (afc_mas_chan_list[chan_idx].state == CHANNEL_STATE_ENABLE) {
+			afc_mas_chan_list[chan_idx].state =
+							CHANNEL_STATE_DISABLE;
+			afc_mas_chan_list[chan_idx].chan_flags |=
+						REGULATORY_CHAN_DISABLED;
+			afc_mas_chan_list[chan_idx].psd_eirp = 0;
+			afc_mas_chan_list[chan_idx].tx_power = 0;
+		}
+	}
+}
+
+static void reg_free_expiry_afc_info(struct afc_regulatory_info *afc_info)
+{
+	qdf_mem_free(afc_info->expiry_info);
+	qdf_mem_free(afc_info);
+}
+
+/**
+ * reg_process_afc_expiry_event() - Process the afc expiry event and get the
+ * afc request id
+ * @afc_info: Pointer to afc info
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+reg_process_afc_expiry_event(struct afc_regulatory_info *afc_info)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	uint8_t phy_id;
+	uint8_t pdev_id;
+	struct wlan_objmgr_psoc *psoc;
+	struct wlan_regulatory_psoc_priv_obj *soc_reg;
+	struct wlan_objmgr_pdev *pdev;
+	struct wlan_lmac_if_reg_tx_ops *tx_ops;
+	wlan_objmgr_ref_dbgid dbg_id;
+
+	psoc = afc_info->psoc;
+	soc_reg = reg_get_psoc_obj(psoc);
+
+	if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	phy_id = afc_info->phy_id;
+	tx_ops = reg_get_psoc_tx_ops(psoc);
+
+	if (soc_reg->offload_enabled)
+		dbg_id = WLAN_REGULATORY_NB_ID;
+	else
+		dbg_id = WLAN_REGULATORY_SB_ID;
+
+	if (tx_ops->get_pdev_id_from_phy_id)
+		tx_ops->get_pdev_id_from_phy_id(psoc, phy_id, &pdev_id);
+	else
+		pdev_id = phy_id;
+
+	pdev = wlan_objmgr_get_pdev_by_id(psoc, pdev_id, dbg_id);
+
+	if (!pdev) {
+		reg_err("pdev is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("reg pdev priv obj is NULL");
+		wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	reg_debug("AFC event subtype: %d",
+		  afc_info->expiry_info->event_subtype);
+	switch (afc_info->expiry_info->event_subtype) {
+	case REG_AFC_EXPIRY_EVENT_START:
+	case REG_AFC_EXPIRY_EVENT_RENEW:
+		pdev_priv_obj->afc_request_id =
+					afc_info->expiry_info->request_id;
+		pdev_priv_obj->is_6g_afc_expiry_event_received = true;
+		reg_afc_start(pdev, pdev_priv_obj->afc_request_id);
+		break;
+	case REG_AFC_EXPIRY_EVENT_SWITCH_TO_LPI:
+		reg_disable_afc_mas_chan_list_channels(pdev_priv_obj);
+		if (tx_ops->trigger_acs_for_afc)
+			tx_ops->trigger_acs_for_afc(pdev);
+		break;
+	default:
+		reg_err_rl("Invalid event subtype");
+	};
+
+	wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+	reg_free_expiry_afc_info(afc_info);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * reg_fill_min_max_bw_for_afc_list() - Fill min and max bw in afc list from
+ * from the SP AFC list
+ * @pdev_priv_obj: Pointer to pdev_priv_obj
+ * @afc_chan_list: Pointer to afc_chan_list
+ *
+ * Return: void
+ */
+static void
+reg_fill_min_max_bw_for_afc_list(
+		struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj,
+		struct regulatory_channel *afc_chan_list)
+{
+	uint8_t chan_idx;
+
+	for (chan_idx = 0; chan_idx < NUM_6GHZ_CHANNELS; chan_idx++) {
+		afc_chan_list[chan_idx].min_bw = MIN_AFC_BW;
+		afc_chan_list[chan_idx].max_bw = MAX_AFC_BW;
+	}
+}
+
+/**
+ * reg_get_subchannels_for_opclass() - Get the list of subchannels based on the
+ * the channel frequency index and opclass.
+ * @cfi: Channel frequency index
+ * @opclass: Operating class
+ * @subchannels: Pointer to list of subchannels
+ *
+ * Return: void
+ */
+static uint8_t reg_get_subchannels_for_opclass(uint8_t cfi,
+					       uint8_t opclass,
+					       uint8_t *subchannels)
+{
+	uint8_t nchans;
+
+	switch (opclass) {
+	case 131:
+	case 136:
+		nchans = 1;
+		subchannels[0] = cfi;
+		break;
+	case 132:
+		nchans = 2;
+		subchannels[0] = cfi - 2;
+		subchannels[1] = cfi + 2;
+		break;
+	case 133:
+		nchans = 4;
+		subchannels[0] = cfi - 6;
+		subchannels[1] = cfi - 2;
+		subchannels[2] = cfi + 2;
+		subchannels[3] = cfi + 6;
+		break;
+	case 134:
+		nchans = 8;
+		subchannels[0] = cfi - 14;
+		subchannels[1] = cfi - 10;
+		subchannels[2] = cfi - 6;
+		subchannels[3] = cfi - 2;
+		subchannels[4] = cfi + 2;
+		subchannels[5] = cfi + 6;
+		subchannels[6] = cfi + 10;
+		subchannels[7] = cfi + 14;
+		break;
+	default:
+		nchans = 0;
+		break;
+	}
+
+	return nchans;
+}
+
+/**
+ * reg_search_afc_power_info_for_freq() - Search the chan_eirp object for the
+ * eirp power for a given frequency
+ * @pdev: Pointer to pdev
+ * @afc_info: Pointer to afc_info
+ * @freq: Channel frequency
+ * @eirp_power: Pointer to eirp_power
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+reg_search_afc_power_info_for_freq(
+		struct wlan_objmgr_pdev *pdev,
+		struct afc_regulatory_info *afc_info,
+		qdf_freq_t freq,
+		uint16_t *eirp_power)
+{
+	struct reg_fw_afc_power_event *power_info;
+	uint8_t i;
+
+	if (!afc_info->power_info) {
+		reg_err("afc_info->power_info is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!afc_info->power_info->num_chan_objs) {
+		reg_err("num chan objs cannot be zero");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	power_info = afc_info->power_info;
+
+	*eirp_power = 0;
+	for (i = 0; i < power_info->num_chan_objs; i++) {
+		uint8_t j;
+		struct afc_chan_obj *chan_obj = &power_info->afc_chan_info[i];
+
+		if (!chan_obj->num_chans) {
+			reg_err("num chans cannot be zero");
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		for (j = 0; j < chan_obj->num_chans; j++) {
+			uint8_t k;
+			struct chan_eirp_obj *eirp_obj =
+						&chan_obj->chan_eirp_info[j];
+			uint8_t opclass = chan_obj->global_opclass;
+			uint8_t subchannels[REG_MAX_20M_SUB_CH];
+			uint8_t nchans;
+
+			nchans =
+			reg_get_subchannels_for_opclass(eirp_obj->cfi,
+							opclass, subchannels);
+
+			for (k = 0; k < nchans; k++) {
+				if (reg_chan_band_to_freq(pdev,
+							  subchannels[k],
+							  BIT(REG_BAND_6G)) ==
+							  freq)
+					*eirp_power = eirp_obj->eirp_power;
+					break;
+			}
+		}
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * reg_fill_eirp_pwr_in_afc_chan_list() - Fill max eirp power in the afc master
+ * chan list
+ * @pdev: Pointer to pdev
+ * @afc_chan_list: Pointer to afc_chan_list
+ * @afc_info: Pointer to afc_info
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS reg_fill_eirp_pwr_in_afc_chan_list(
+		struct wlan_objmgr_pdev *pdev,
+		struct regulatory_channel *afc_chan_list,
+		struct afc_regulatory_info *afc_info)
+
+{
+	uint8_t chan_idx;
+	uint16_t eirp_power;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	for (chan_idx = 0; chan_idx < NUM_6GHZ_CHANNELS; chan_idx++) {
+		status =
+		reg_search_afc_power_info_for_freq(pdev,
+						   afc_info,
+						   afc_chan_list[chan_idx].
+						   center_freq,
+						   &eirp_power);
+		/*
+		 * The eirp_power is divided by 100 because the target
+		 * sends the EIRP in the units of 0.01 dbm.
+		 */
+		if (QDF_IS_STATUS_SUCCESS(status))
+			afc_chan_list[chan_idx].tx_power = eirp_power / 100;
+	}
+
+	return status;
+}
+
+/**
+ * reg_find_chan_enum_for_6g() - Find 6G channel enum for a given frequency
+ * in the input channel list
+ * @chan_list: Pointer to regulatory channel list.
+ * @freq: Channel frequency.
+ * @channel_enum: pointer to output channel enum.
+ *
+ * Return: None
+ */
+static void reg_find_chan_enum_for_6g(
+		struct regulatory_channel *chan_list, qdf_freq_t freq,
+		uint32_t *channel_enum)
+{
+	enum channel_enum chan_enum;
+	uint16_t min_bw;
+	uint16_t max_bw;
+	qdf_freq_t center_freq;
+
+	for (chan_enum = 0; chan_enum < NUM_6GHZ_CHANNELS; chan_enum++) {
+		min_bw = chan_list[chan_enum].min_bw;
+		max_bw = chan_list[chan_enum].max_bw;
+		center_freq = chan_list[chan_enum].center_freq;
+
+		if ((center_freq - min_bw / 2) >= freq) {
+			if ((center_freq - max_bw / 2) < freq) {
+				if (max_bw <= 20)
+					max_bw = ((center_freq - freq) * 2);
+				if (max_bw < min_bw)
+					max_bw = min_bw;
+				chan_list[chan_enum].max_bw = max_bw;
+			}
+			*channel_enum = chan_enum;
+			break;
+		}
+	}
+}
+
+/**
+ * reg_fill_max_psd_in_afc_chan_list() - Fill max_psd in the afc master chan
+ * list
+ * @pdev_priv_obj: Pointer to pdev_priv_obj
+ * @afc_chan_list: Pointer to afc_chan_list
+ * @power_info: Pointer to power_info
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS reg_fill_max_psd_in_afc_chan_list(
+		struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj,
+		struct regulatory_channel *afc_chan_list,
+		struct reg_fw_afc_power_event *power_info)
+{
+	uint8_t i;
+
+	if (!power_info) {
+		reg_err("power_info is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!power_info->num_freq_objs) {
+		reg_err("num freq objs cannot be zero");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	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;
+		uint8_t j;
+
+		reg_find_chan_enum_for_6g(afc_chan_list, freq_obj->low_freq,
+					  &low_limit_enum);
+		reg_find_chan_enum_for_6g(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 &=
+						~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;
+		}
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * 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.
+ * @afc_info: Pointer to afc info
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS
+reg_process_afc_power_event(struct afc_regulatory_info *afc_info)
+{
+	struct wlan_objmgr_psoc *psoc;
+	uint8_t phy_id;
+	uint8_t pdev_id;
+	wlan_objmgr_ref_dbgid dbg_id;
+	struct wlan_objmgr_pdev *pdev;
+	struct mas_chan_params *this_mchan_params;
+	struct wlan_lmac_if_reg_tx_ops *tx_ops;
+	struct regulatory_channel *afc_mas_chan_list;
+	struct wlan_regulatory_psoc_priv_obj *soc_reg;
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	uint32_t size_of_6g_chan_list =
+		NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel);
+	QDF_STATUS status;
+
+	if (afc_info->power_info->fw_status_code !=
+	    REG_FW_AFC_POWER_EVENT_SUCCESS) {
+		reg_err_rl("AFC Power event failure status code %d",
+			   afc_info->power_info->fw_status_code);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	psoc = afc_info->psoc;
+	soc_reg = reg_get_psoc_obj(psoc);
+
+	if (!IS_VALID_PSOC_REG_OBJ(soc_reg)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	tx_ops = reg_get_psoc_tx_ops(psoc);
+	phy_id = afc_info->phy_id;
+
+	if (tx_ops->get_pdev_id_from_phy_id)
+		tx_ops->get_pdev_id_from_phy_id(psoc, phy_id, &pdev_id);
+	else
+		pdev_id = phy_id;
+
+	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;
+	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);
+
+	if (!pdev) {
+		reg_err("pdev is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("reg pdev priv obj is NULL");
+		wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	/* Free the old power_info event if it was allocated */
+	if (pdev_priv_obj->power_info)
+		reg_free_afc_pwr_info(pdev_priv_obj);
+
+	pdev_priv_obj->power_info = afc_info->power_info;
+	reg_fill_min_max_bw_for_afc_list(pdev_priv_obj,
+					 afc_mas_chan_list);
+	status = reg_fill_max_psd_in_afc_chan_list(pdev_priv_obj,
+						   afc_mas_chan_list,
+						   afc_info->power_info);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		reg_err("Error in filling max_psd in AFC chan list");
+		wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+		return status;
+	}
+
+	status = reg_fill_eirp_pwr_in_afc_chan_list(pdev,
+						    afc_mas_chan_list,
+						    afc_info);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		reg_err("Error in filling EIRP power in AFC chan list");
+		wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	qdf_mem_copy(pdev_priv_obj->mas_chan_list_6g_afc,
+		     afc_mas_chan_list,
+		     size_of_6g_chan_list);
+	pdev_priv_obj->is_6g_afc_power_event_received =
+	soc_reg->mas_chan_params[phy_id].is_6g_afc_power_event_received;
+
+	if (tx_ops->trigger_acs_for_afc)
+		tx_ops->trigger_acs_for_afc(pdev);
+
+	wlan_objmgr_pdev_release_ref(pdev, dbg_id);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * reg_process_afc_event() - Process the afc event received from the target.
+ * @afc_info: Pointer to afc_info
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+reg_process_afc_event(struct afc_regulatory_info *afc_info)
+{
+	switch (afc_info->event_type) {
+	case REG_AFC_EVENT_POWER_INFO:
+		return reg_process_afc_power_event(afc_info);
+	case REG_AFC_EVENT_TIMER_EXPIRY:
+		return reg_process_afc_expiry_event(afc_info);
+	default:
+		reg_err_rl("Invalid event type");
+		return QDF_STATUS_E_FAILURE;
+	}
+}
+#endif /* CONFIG_AFC_SUPPORT */
 #endif /* CONFIG_BAND_6GHZ */
 
 QDF_STATUS reg_process_master_chan_list(

+ 17 - 0
umac/regulatory/core/src/reg_build_chan_list.h

@@ -28,6 +28,11 @@
 
 #define CHAN_12_CENT_FREQ 2467
 #define CHAN_13_CENT_FREQ 2472
+#define REG_MAX_20M_SUB_CH   8
+#ifdef CONFIG_AFC_SUPPORT
+#define MIN_AFC_BW 2
+#define MAX_AFC_BW 160
+#endif
 
 /**
  * reg_reset_reg_rules() - provides the reg domain rules info
@@ -88,6 +93,18 @@ void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc,
  */
 QDF_STATUS
 reg_process_master_chan_list_ext(struct cur_regulatory_info *reg_info);
+
+#ifdef CONFIG_AFC_SUPPORT
+/**
+ * reg_process_afc_event() - Process the afc event and compute the 6G AFC
+ * channel list based on the frequency range and channel frequency indices set.
+ * @reg_info: Pointer to regulatory info
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+reg_process_afc_event(struct afc_regulatory_info *afc_info);
+#endif
 #endif
 /**
  * reg_process_master_chan_list() - Compute master channel list based on the

+ 47 - 0
umac/regulatory/core/src/reg_priv_objs.c

@@ -380,6 +380,52 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 	return status;
 }
 
+#ifdef CONFIG_AFC_SUPPORT
+/**
+ * reg_free_chan_obj() - Free the AFC chan object and chan eirp object
+ * information
+ * @afc_chan_info: Pointer to afc_chan_info
+ *
+ * Return: void
+ */
+static void reg_free_chan_obj(struct afc_chan_obj *afc_chan_info)
+{
+	if (afc_chan_info->chan_eirp_info)
+		qdf_mem_free(afc_chan_info->chan_eirp_info);
+}
+
+/**
+ * reg_free_afc_pwr_info() - Free the AFC power information object
+ * @pdev_priv_obj: Pointer to pdev_priv_obj
+ *
+ * Return: void
+ */
+void
+reg_free_afc_pwr_info(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	struct reg_fw_afc_power_event *power_info;
+	uint8_t i;
+
+	power_info = pdev_priv_obj->power_info;
+	if (!power_info)
+		return;
+
+	if (power_info->afc_freq_info)
+		qdf_mem_free(power_info->afc_freq_info);
+
+	if (!power_info->afc_chan_info)
+		return;
+
+	for (i = 0; i < power_info->num_chan_objs; i++)
+		reg_free_chan_obj(&power_info->afc_chan_info[i]);
+
+	if (power_info->afc_chan_info)
+		qdf_mem_free(power_info->afc_chan_info);
+
+	qdf_mem_free(power_info);
+}
+#endif
+
 QDF_STATUS wlan_regulatory_pdev_obj_destroyed_notification(
 		struct wlan_objmgr_pdev *pdev, void *arg_list)
 {
@@ -406,6 +452,7 @@ QDF_STATUS wlan_regulatory_pdev_obj_destroyed_notification(
 	if (!psoc_priv_obj->is_11d_offloaded)
 		reg_11d_host_scan_deinit(wlan_pdev_get_psoc(pdev));
 
+	reg_free_afc_pwr_info(pdev_priv_obj);
 	pdev_priv_obj->pdev_ptr = NULL;
 
 	status = wlan_objmgr_pdev_component_obj_detach(

+ 32 - 16
umac/regulatory/core/src/reg_priv_objs.h

@@ -188,15 +188,6 @@ struct wlan_regulatory_psoc_priv_obj {
  * situations
  * @mas_chan_list: master channel list
  * from the firmware.
- * @is_6g_afc_power_event_received: indicates if the AFC power event is
- * received
- * @is_6g_afc_expiry_event_received: indicates if the AFC exipiry event is
- * received
- * @afc_chan_list: Intersection of AFC master and Standard power channel list
- * @mas_chan_list_6g_afc: AFC master channel list constructed from the AFC
- * server response.
- * @power_info: pointer to AFC power information received from the AFC event
- * sent by the target
  * @is_6g_channel_list_populated: indicates the channel lists are populated
  * @mas_chan_list_6g_ap: master channel list for 6G AP, includes all power types
  * @mas_chan_list_6g_client: master channel list for 6G client, includes
@@ -216,6 +207,16 @@ struct wlan_regulatory_psoc_priv_obj {
  * @avoid_chan_ext_list: the extended avoid frequency list.
  * @afc_cb_lock: The spinlock to synchronize afc callbacks
  * @afc_cb_obj: The object containing the callback function and opaque argument
+ * @afc_request_id: The last AFC request id received from FW/halphy
+ * @is_6g_afc_power_event_received: indicates if the AFC power event is
+ * received
+ * @is_6g_afc_expiry_event_received: indicates if the AFC exipiry event is
+ * received
+ * @afc_chan_list: Intersection of AFC master and Standard power channel list
+ * @mas_chan_list_6g_afc: AFC master channel list constructed from the AFC
+ * server response.
+ * @power_info: pointer to AFC power information received from the AFC event
+ * sent by the target
  */
 struct wlan_regulatory_pdev_priv_obj {
 	struct regulatory_channel cur_chan_list[NUM_CHANNELS];
@@ -224,13 +225,6 @@ struct wlan_regulatory_pdev_priv_obj {
 #endif
 	struct regulatory_channel mas_chan_list[NUM_CHANNELS];
 #ifdef CONFIG_BAND_6GHZ
-#ifdef CONFIG_AFC_SUPPORT
-	bool is_6g_afc_power_event_received;
-	bool is_6g_afc_expiry_event_received;
-	struct regulatory_channel afc_chan_list[NUM_6GHZ_CHANNELS];
-	struct regulatory_channel mas_chan_list_6g_afc[NUM_6GHZ_CHANNELS];
-	struct reg_fw_afc_power_event *power_info;
-#endif
 	bool is_6g_channel_list_populated;
 	struct regulatory_channel mas_chan_list_6g_ap[REG_CURRENT_MAX_AP_TYPE][NUM_6GHZ_CHANNELS];
 	struct regulatory_channel mas_chan_list_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE][NUM_6GHZ_CHANNELS];
@@ -286,6 +280,12 @@ struct wlan_regulatory_pdev_priv_obj {
 #ifdef CONFIG_AFC_SUPPORT
 	qdf_spinlock_t afc_cb_lock;
 	struct afc_cb_handler afc_cb_obj;
+	uint64_t afc_request_id;
+	bool is_6g_afc_power_event_received;
+	bool is_6g_afc_expiry_event_received;
+	struct regulatory_channel afc_chan_list[NUM_6GHZ_CHANNELS];
+	struct regulatory_channel mas_chan_list_6g_afc[NUM_6GHZ_CHANNELS];
+	struct reg_fw_afc_power_event *power_info;
 #endif
 };
 
@@ -358,4 +358,20 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
  */
 QDF_STATUS wlan_regulatory_pdev_obj_destroyed_notification(
 		struct wlan_objmgr_pdev *pdev, void *arg_list);
+
+#ifdef CONFIG_AFC_SUPPORT
+/**
+ * reg_free_afc_pwr_info() - Free the AFC power information object
+ * @pdev_priv_obj: Pointer to pdev_priv_obj
+ *
+ * Return: void
+ */
+void
+reg_free_afc_pwr_info(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj);
+#else
+static inline void
+reg_free_afc_pwr_info(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+}
+#endif
 #endif

+ 2 - 2
umac/regulatory/core/src/reg_services_common.c

@@ -5648,7 +5648,7 @@ QDF_STATUS reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS
+QDF_STATUS
 reg_find_txpower_from_6g_list(qdf_freq_t freq,
 			      struct regulatory_channel *chan_list,
 			      uint16_t *txpower)
@@ -5694,7 +5694,7 @@ bool reg_is_6g_psd_power(struct wlan_objmgr_pdev *pdev)
 	return false;
 }
 
-static QDF_STATUS
+QDF_STATUS
 reg_get_6g_chan_psd_eirp_power(qdf_freq_t freq,
 			       struct regulatory_channel *mas_chan_list,
 			       uint16_t *eirp_psd_power)

+ 49 - 1
umac/regulatory/core/src/reg_services_common.h

@@ -1258,6 +1258,7 @@ QDF_STATUS reg_afc_start(struct wlan_objmgr_pdev *pdev, uint64_t req_id);
  * reg_get_partial_afc_req_info() - Get the AFC partial request information
  * @pdev: Pointer to pdev
  * @afc_req: Address of AFC request pointer
+ * @req_id: AFC request ID.
  *
  * NOTE:- The memory for AFC request is allocated by the function must be
  *        freed by the caller.
@@ -1265,7 +1266,8 @@ QDF_STATUS reg_afc_start(struct wlan_objmgr_pdev *pdev, uint64_t req_id);
  */
 QDF_STATUS
 reg_get_partial_afc_req_info(struct wlan_objmgr_pdev *pdev,
-			     struct wlan_afc_host_partial_request **afc_req);
+			     struct wlan_afc_host_partial_request **afc_req,
+			     uint64_t req_id);
 
 /**
  * reg_print_partial_afc_req_info() - Print the AFC partial request
@@ -1425,6 +1427,34 @@ QDF_STATUS reg_get_client_power_for_6ghz_ap(struct wlan_objmgr_pdev *pdev,
  */
 QDF_STATUS reg_set_ap_pwr_and_update_chan_list(struct wlan_objmgr_pdev *pdev,
 					       enum reg_6g_ap_type ap_pwr_type);
+
+/**
+ * reg_get_6g_chan_psd_eirp_power() - For a given frequency, get the max PSD
+ * from the mas_chan_list
+ * @freq: Channel frequency
+ * @mas_chan_list: Pointer to mas_chan_list
+ * @reg_psd: Pointer to reg_psd
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+reg_get_6g_chan_psd_eirp_power(qdf_freq_t freq,
+			       struct regulatory_channel *mas_chan_list,
+			       uint16_t *reg_psd);
+
+/**
+ * reg_find_txpower_from_6g_list() - For a given frequency, get the max EIRP
+ * from the mas_chan_list
+ * @freq: Channel frequency
+ * @mas_chan_list: Pointer to mas_chan_list
+ * @reg_eirp: Pointer to reg_eirp
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+reg_find_txpower_from_6g_list(qdf_freq_t freq,
+			      struct regulatory_channel *chan_list,
+			      uint16_t *reg_eirp);
 #else
 static inline QDF_STATUS
 reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
@@ -1517,6 +1547,24 @@ QDF_STATUS reg_set_ap_pwr_and_update_chan_list(struct wlan_objmgr_pdev *pdev,
 {
 	return QDF_STATUS_E_NOSUPPORT;
 }
+
+static inline QDF_STATUS
+reg_get_6g_chan_psd_eirp_power(qdf_freq_t freq,
+			       struct regulatory_channel *mas_chan_list,
+			       uint16_t *eirp_psd_power)
+{
+	*eirp_psd_power = 0;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+reg_find_txpower_from_6g_list(qdf_freq_t freq,
+			      struct regulatory_channel *chan_list,
+			      uint16_t *reg_eirp)
+{
+	*reg_eirp = 0;
+	return QDF_STATUS_E_NOSUPPORT;
+}
 #endif
 
 #ifdef CONFIG_HOST_FIND_CHAN

+ 11 - 0
umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h

@@ -44,6 +44,17 @@ QDF_STATUS tgt_reg_process_master_chan_list(struct cur_regulatory_info
  */
 QDF_STATUS tgt_reg_process_master_chan_list_ext(struct cur_regulatory_info
 						*reg_info);
+
+#ifdef CONFIG_AFC_SUPPORT
+/**
+ * tgt_reg_process_afc_event() - process the AFC event
+ * @afc_info: AFC regulatory info
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+tgt_reg_process_afc_event(struct afc_regulatory_info *afc_info);
+#endif
 #endif
 
 /**

+ 6 - 3
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -331,12 +331,15 @@ QDF_STATUS ucfg_reg_unregister_afc_req_rx_callback(struct wlan_objmgr_pdev *pdev
  * opclass + channel ranges. This is partial because in the AFC request there
  * are a few more parameters: Longitude, Latitude a few other information
  * @pdev: Pointer to PDEV object.
+ * @afc_req: Address of AFC request pointer.
+ * @req_id: AFC request ID.
  *
  * Return: QDF_STATUS_E_INVAL if unable to set and QDF_STATUS_SUCCESS is set.
  */
-QDF_STATUS
-ucfg_reg_get_partial_afc_req_info(struct wlan_objmgr_pdev *pdev,
-				  struct wlan_afc_host_partial_request **afc_req);
+QDF_STATUS ucfg_reg_get_partial_afc_req_info(
+		struct wlan_objmgr_pdev *pdev,
+		struct wlan_afc_host_partial_request **afc_req,
+		uint64_t req_id);
 #endif
 
 /**

+ 46 - 2
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -396,16 +396,58 @@ regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
 	if (tx_ops->unregister_master_ext_handler)
 		tx_ops->unregister_master_ext_handler(psoc, NULL);
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+static void regulatory_assign_register_afc_event_handler(
+		struct wlan_objmgr_psoc *psoc,
+		struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+	if (tx_ops->register_afc_event_handler)
+		tx_ops->register_afc_event_handler(psoc, NULL);
+}
+
+static void regulatory_assign_unregister_afc_event_handler(
+		struct wlan_objmgr_psoc *psoc,
+		struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+	if (tx_ops->unregister_afc_event_handler)
+		tx_ops->unregister_afc_event_handler(psoc, NULL);
+}
+#else
+static void regulatory_assign_register_afc_event_handler(
+		struct wlan_objmgr_psoc *psoc,
+		struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+}
+
+static void regulatory_assign_unregister_afc_event_handler(
+		struct wlan_objmgr_psoc *psoc,
+		struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+}
+#endif
 #else
 static inline void
 regulatory_assign_register_master_ext_handler(struct wlan_objmgr_psoc *psoc,
-					struct wlan_lmac_if_reg_tx_ops *tx_ops)
+					      struct wlan_lmac_if_reg_tx_ops *tx_ops)
 {
 }
 
 static inline void
 regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
-					struct wlan_lmac_if_reg_tx_ops *tx_ops)
+						struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+}
+
+static void
+regulatory_assign_register_afc_event_handler(struct wlan_objmgr_psoc *psoc,
+					     struct wlan_lmac_if_reg_tx_ops *tx_ops)
+{
+}
+
+static void
+regulatory_assign_unregister_afc_event_handler(struct wlan_objmgr_psoc *psoc,
+					       struct wlan_lmac_if_reg_tx_ops *tx_ops)
 {
 }
 #endif
@@ -418,6 +460,7 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc)
 	if (tx_ops->register_master_handler)
 		tx_ops->register_master_handler(psoc, NULL);
 	regulatory_assign_register_master_ext_handler(psoc, tx_ops);
+	regulatory_assign_register_afc_event_handler(psoc, tx_ops);
 	if (tx_ops->register_11d_new_cc_handler)
 		tx_ops->register_11d_new_cc_handler(psoc, NULL);
 	if (tx_ops->register_ch_avoid_event_handler)
@@ -436,6 +479,7 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
 	if (tx_ops->unregister_master_handler)
 		tx_ops->unregister_master_handler(psoc, NULL);
 	regulatory_assign_unregister_master_ext_handler(psoc, tx_ops);
+	regulatory_assign_unregister_afc_event_handler(psoc, tx_ops);
 	if (tx_ops->unregister_ch_avoid_event_handler)
 		tx_ops->unregister_ch_avoid_event_handler(psoc, NULL);
 

+ 8 - 0
umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c

@@ -75,6 +75,14 @@ QDF_STATUS tgt_reg_process_master_chan_list_ext(struct cur_regulatory_info
 
 	return reg_process_master_chan_list_ext(reg_info);
 }
+
+#ifdef CONFIG_AFC_SUPPORT
+QDF_STATUS
+tgt_reg_process_afc_event(struct afc_regulatory_info *afc_info)
+{
+	return reg_process_afc_event(afc_info);
+}
+#endif
 #endif
 
 QDF_STATUS tgt_reg_process_11d_new_country(struct wlan_objmgr_psoc *psoc,

+ 5 - 4
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c

@@ -257,11 +257,12 @@ QDF_STATUS ucfg_reg_unregister_afc_req_rx_callback(struct wlan_objmgr_pdev *pdev
 	return reg_unregister_afc_req_rx_callback(pdev, cbf);
 }
 
-QDF_STATUS
-ucfg_reg_get_partial_afc_req_info(struct wlan_objmgr_pdev *pdev,
-				  struct wlan_afc_host_partial_request **afc_req)
+QDF_STATUS ucfg_reg_get_partial_afc_req_info(
+		struct wlan_objmgr_pdev *pdev,
+		struct wlan_afc_host_partial_request **afc_req,
+		uint64_t req_id)
 {
-	return reg_get_partial_afc_req_info(pdev, afc_req);
+	return reg_get_partial_afc_req_info(pdev, afc_req, req_id);
 }
 #endif