浏览代码

qcacmn: Add dispatcher APIs for AFC in the regulatory

1) Add an ucfg dispatcher for reg_afc_start.
2) Add an API wlan_reg_get_afc_req_id, to fetch AFC request id.
3) Add an API wlan_reg_is_afc_expiry_event_received, to check if the AFC
   expiry event is received from the target.

Change-Id: I45841706c500e74632b60546d945cde4d634a5d2
CRs-Fixed: 3011675
Hariharan Basuthkar 3 年之前
父节点
当前提交
0b8e97ac32

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

@@ -5869,4 +5869,33 @@ bool reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev)
 
 	return pdev_priv_obj->is_6g_afc_power_event_received;
 }
+
+QDF_STATUS reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev, uint64_t *req_id)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	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");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*req_id = pdev_priv_obj->afc_request_id;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("pdev reg component is NULL");
+		return false;
+	}
+
+	return pdev_priv_obj->is_6g_afc_expiry_event_received;
+}
 #endif

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

@@ -1706,5 +1706,24 @@ QDF_STATUS reg_send_afc_cmd(struct wlan_objmgr_pdev *pdev,
  * Return: true if AFC power event is received from the FW or false otherwise
  */
 bool reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * reg_get_afc_req_id() - Get the AFC request ID
+ * @pdev: pdev pointer
+ * @req_id: Pointer to request id
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev, uint64_t *req_id);
+
+/**
+ * reg_is_afc_expiry_event_received() - Checks if AFC power event is
+ * received from the FW.
+ *
+ * @pdev: pdev ptr
+ *
+ * Return: true if AFC expiry event is received from the FW or false otherwise
+ */
+bool reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev);
 #endif
 #endif

+ 20 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -600,6 +600,26 @@ QDF_STATUS wlan_reg_psd_2_eirp(struct wlan_objmgr_pdev *pdev,
  * Return: true if AFC power event is received from the FW or false otherwise
  */
 bool wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_reg_get_afc_req_id() - Get the AFC request ID
+ * @pdev: pdev pointer
+ * @req_id: Pointer to request id
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev,
+				   uint64_t *req_id);
+
+/**
+ * wlan_reg_is_afc_expiry_event_received() - Checks if AFC power event is
+ * received from the FW.
+ *
+ * @pdev: pdev ptr
+ *
+ * Return: true if AFC exipry event is received from the FW or false otherwise
+ */
+bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev);
 #else
 static inline bool
 wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev)

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

@@ -517,5 +517,15 @@ ucfg_reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
 QDF_STATUS
 ucfg_reg_send_afc_resp_rx_ind(struct wlan_objmgr_pdev *pdev,
 			      struct reg_afc_resp_rx_ind_info *afc_ind_obj);
+
+/**
+ * ucfg_reg_afc_start() - Start the AFC request from regulatory. This finally
+ *                   sends the request to registered callbacks
+ * @pdev: Pointer to pdev
+ * @req_id: The AFC request ID
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_reg_afc_start(struct wlan_objmgr_pdev *pdev, uint64_t req_id);
 #endif
 #endif

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

@@ -1346,4 +1346,19 @@ bool wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev)
 }
 
 qdf_export_symbol(wlan_reg_is_afc_power_event_received);
+
+QDF_STATUS wlan_reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev,
+				   uint64_t *req_id)
+{
+	return reg_get_afc_req_id(pdev, req_id);
+}
+
+qdf_export_symbol(wlan_reg_get_afc_req_id);
+
+bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev)
+{
+	return reg_is_afc_expiry_event_received(pdev);
+}
+
+qdf_export_symbol(wlan_reg_is_afc_expiry_event_received);
 #endif

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

@@ -393,4 +393,10 @@ ucfg_reg_send_afc_resp_rx_ind(struct wlan_objmgr_pdev *pdev,
 {
 	return reg_send_afc_cmd(pdev, afc_ind_obj);
 }
+
+QDF_STATUS
+ucfg_reg_afc_start(struct wlan_objmgr_pdev *pdev, uint64_t req_id)
+{
+	return reg_afc_start(pdev, req_id);
+}
 #endif