瀏覽代碼

qcacmn: Add dispatcher & core APIs for rate2power update response handler

Add API reg_process_r2p_table_update_response to handle the event received
from target in response to rate2power table update cmd. Make a call to
end_r2p_table_update_wait from this API to end the wait timer triggered
for the update cmd. Add end_r2p_table_update_wait to
wlan_lmac_if_reg_tx_ops. Add a dispatcher
tgt_reg_process_r2p_table_update_response for this API and register it as
a rx_ops.

Add register and unregister APIs of rate2power table update response
handler to wlan_lmac_if_reg_tx_ops. Call the register API in
regulatory_psoc_open and unregister in regulatory_psoc_close. Define
struct r2p_table_update_status_obj and its members to receive the
response of rate2power table update cmd from target.

Change-Id: I6909e37620b94dc7fdcd3c7c0915a3fad8fa1cda
CRs-Fixed: 3405417
Amith A 2 年之前
父節點
當前提交
b9bdf95319

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

@@ -1105,6 +1105,12 @@ struct wlan_lmac_if_ftm_rx_ops {
  * @trigger_acs_for_afc: pointer to trigger acs for afc
  * @reg_get_min_psd:
  * @is_chip_11be:
+ * @register_rate2power_table_update_event_handler: pointer to register
+ *			rate2power table update event handler.
+ * @unregister_rate2power_table_update_event_handler: pointer to unregister
+ *			rate2power table update event handler.
+ * @end_r2p_table_update_wait: Call-back function to end the wait on r2p update
+ *			response from fw.
  */
 struct wlan_lmac_if_reg_tx_ops {
 	QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
@@ -1165,6 +1171,15 @@ struct wlan_lmac_if_reg_tx_ops {
 #endif
 	bool (*is_chip_11be)(struct wlan_objmgr_psoc *psoc,
 			     uint16_t phy_id);
+	QDF_STATUS (*register_rate2power_table_update_event_handler)(
+			struct wlan_objmgr_psoc *psoc,
+			void *arg);
+	QDF_STATUS (*unregister_rate2power_table_update_event_handler)(
+			struct wlan_objmgr_psoc *psoc,
+			void *arg);
+	QDF_STATUS (*end_r2p_table_update_wait)(
+			struct wlan_objmgr_psoc *psoc,
+			uint32_t pdev_id);
 };
 
 /**
@@ -1851,6 +1866,8 @@ struct wlan_lmac_if_mgmt_txrx_rx_ops {
  * @reg_get_afc_dev_type:
  * @reg_set_eirp_preferred_support:
  * @reg_get_eirp_preferred_support:
+ * @reg_r2p_table_update_response_handler: function pointer to handle
+ *		rate2power update response from fw.
  */
 struct wlan_lmac_if_reg_rx_ops {
 	QDF_STATUS (*master_list_handler)(struct cur_regulatory_info
@@ -1934,6 +1951,9 @@ struct wlan_lmac_if_reg_rx_ops {
 				struct wlan_objmgr_psoc *psoc,
 				bool *reg_is_eirp_support_preferred);
 #endif
+	QDF_STATUS (*reg_r2p_table_update_response_handler)(
+			struct wlan_objmgr_psoc *psoc,
+			uint32_t pdev_id);
 };
 
 #ifdef CONVERGED_P2P_ENABLE

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

@@ -524,6 +524,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
 	wlan_lmac_if_register_afc_handlers(rx_ops);
 
 	wlan_lmac_if_register_super_chan_display(rx_ops);
+
+	rx_ops->reg_rx_ops.reg_r2p_table_update_response_handler =
+		tgt_reg_process_r2p_table_update_response;
 }
 
 #ifdef CONVERGED_P2P_ENABLE

+ 13 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -10007,3 +10007,16 @@ QDF_STATUS reg_set_afc_power_event_received(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+
+QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc,
+						 uint32_t pdev_id)
+{
+	struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+	reg_tx_ops = reg_get_psoc_tx_ops(psoc);
+	if (reg_tx_ops->end_r2p_table_update_wait)
+		status = reg_tx_ops->end_r2p_table_update_wait(psoc, pdev_id);
+
+	return status;
+}

+ 11 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -2999,4 +2999,15 @@ uint16_t reg_get_max_bw_5G_for_fo(struct wlan_objmgr_pdev *pdev);
 uint8_t
 reg_get_num_rules_of_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
 				 enum reg_6g_ap_type ap_pwr_type);
+
+/**
+ * reg_process_r2p_table_update_response() - Process the response received from
+ * target for the rate2power update cmd
+ * @psoc: Pointer to psoc
+ * @pdev_id: pdev id from target
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc,
+						 uint32_t pdev_id);
 #endif

+ 10 - 0
umac/regulatory/dispatcher/inc/reg_services_public_struct.h

@@ -2344,4 +2344,14 @@ static inline bool reg_is_chan_enum_invalid(enum channel_enum chan_enum)
 {
 	return chan_enum >= INVALID_CHANNEL;
 }
+
+/**
+ * struct r2p_table_update_status_obj
+ * @pdev_id: pdev id from target
+ * @status: rate2power update status
+ */
+struct r2p_table_update_status_obj {
+	uint32_t pdev_id;
+	uint32_t status;
+};
 #endif

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

@@ -213,4 +213,16 @@ QDF_STATUS
 tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
 				   bool *reg_is_eirp_support_preferred);
 #endif
+
+/**
+ * tgt_reg_process_r2p_table_update_response() - process rate2power table update
+ * response
+ * @psoc: pointer to psoc
+ * @pdev_id: pdev id from target
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS tgt_reg_process_r2p_table_update_response(
+						struct wlan_objmgr_psoc *psoc,
+						uint32_t pdev_id);
 #endif

+ 6 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -516,6 +516,9 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc)
 		tx_ops->register_11d_new_cc_handler(psoc, NULL);
 	if (tx_ops->register_ch_avoid_event_handler)
 		tx_ops->register_ch_avoid_event_handler(psoc, NULL);
+	if (tx_ops->register_rate2power_table_update_event_handler)
+		tx_ops->register_rate2power_table_update_event_handler(psoc,
+								       NULL);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -533,6 +536,9 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
 	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);
+	if (tx_ops->unregister_rate2power_table_update_event_handler)
+		tx_ops->unregister_rate2power_table_update_event_handler(psoc,
+									 NULL);
 
 	return QDF_STATUS_SUCCESS;
 }

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

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -179,3 +179,10 @@ tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
 					      reg_is_eirp_support_preferred);
 }
 #endif
+
+QDF_STATUS tgt_reg_process_r2p_table_update_response(
+						struct wlan_objmgr_psoc *psoc,
+						uint32_t pdev_id)
+{
+	return reg_process_r2p_table_update_response(psoc, pdev_id);
+}