Переглянути джерело

qcacmn: Add Regulatory support for EIRP preference

Add regulatory support for giving preference to fill EIRP power
in the WMI_VDEV_SET_TPC_CMD_ID.

Change-Id: Iab28306b15d74109519629cb0b815cd110254d56
CRs-Fixed: 3307372
Hariharan Basuthkar 2 роки тому
батько
коміт
1773c16687

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

@@ -1753,6 +1753,14 @@ struct wlan_lmac_if_reg_rx_ops {
 	(*reg_get_afc_dev_type)(struct wlan_objmgr_psoc *psoc,
 				enum reg_afc_dev_deploy_type
 				*reg_afc_dev_type);
+	QDF_STATUS
+	(*reg_set_eirp_preferred_support)(
+				struct wlan_objmgr_psoc *psoc,
+				bool reg_is_eirp_support_preferred);
+	QDF_STATUS
+	(*reg_get_eirp_preferred_support)(
+				struct wlan_objmgr_psoc *psoc,
+				bool *reg_is_eirp_support_preferred);
 #endif
 };
 

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

@@ -378,6 +378,10 @@ static void wlan_lmac_if_register_afc_handlers(
 	rx_ops->reg_rx_ops.afc_event_handler = tgt_reg_process_afc_event;
 	rx_ops->reg_rx_ops.reg_set_afc_dev_type = tgt_reg_set_afc_dev_type;
 	rx_ops->reg_rx_ops.reg_get_afc_dev_type = tgt_reg_get_afc_dev_type;
+	rx_ops->reg_rx_ops.reg_set_eirp_preferred_support =
+				tgt_reg_set_eirp_preferred_support;
+	rx_ops->reg_rx_ops.reg_get_eirp_preferred_support =
+				tgt_reg_get_eirp_preferred_support;
 }
 #else
 static inline void wlan_lmac_if_register_afc_handlers(

+ 3 - 0
umac/regulatory/core/src/reg_priv_objs.h

@@ -136,6 +136,8 @@ struct ctry_change_cbk_entry {
  * @coex_unsafe_chan_reg_disable: To disable reg channels for received coex
  * unsafe channels list
  * @reg_afc_dev_type: AFC device deployment type from BDF
+ * @reg_is_eirp_support_preferred: Whether target prefers EIRP format for
+ * WMI Set TPC command
  * @sta_sap_scc_on_indoor_channel: Value of sap+sta scc on indoor support
  * @fcc_rules_ptr : Value of fcc channel frequency and tx_power list received
  * from firmware
@@ -210,6 +212,7 @@ struct wlan_regulatory_psoc_priv_obj {
 #endif
 #ifdef CONFIG_AFC_SUPPORT
 	enum reg_afc_dev_deploy_type reg_afc_dev_type;
+	bool reg_is_eirp_support_preferred;
 #endif
 	bool sta_sap_scc_on_indoor_channel;
 #ifdef CONFIG_REG_CLIENT

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

@@ -7600,6 +7600,44 @@ reg_get_afc_soc_dev_type(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+reg_set_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+			       bool reg_is_eirp_support_preferred)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	psoc_priv_obj->reg_is_eirp_support_preferred =
+					reg_is_eirp_support_preferred;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+			       bool *reg_is_eirp_support_preferred)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*reg_is_eirp_support_preferred =
+			psoc_priv_obj->reg_is_eirp_support_preferred;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #endif /* CONFIG_AFC_SUPPORT */
 
 QDF_STATUS

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

@@ -1692,6 +1692,31 @@ reg_is_sta_connect_allowed(struct wlan_objmgr_pdev *pdev,
 QDF_STATUS
 reg_get_afc_soc_dev_type(struct wlan_objmgr_psoc *psoc,
 			 enum reg_afc_dev_deploy_type *reg_afc_dev_type);
+
+/**
+ * reg_set_eirp_preferred_support() - Set EIRP as the preferred
+ * support for TPC power command
+ * @psoc: psoc pointer
+ * @reg_is_eirp_support_preferred: Boolean to indicate if target prefers EIRP
+ * support for TPC power command
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS
+reg_set_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+			       bool reg_is_eirp_support_preferred);
+
+/**
+ * reg_get_eirp_preferred_support() - Check if is EIRP support is
+ * preferred by the target for TPC power command
+ * @psoc: psoc pointer
+ * @reg_is_eirp_support_preferred: Pointer to reg_is_eirp_support_preferred
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS
+reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+			       bool *reg_is_eirp_support_preferred);
 #endif /* CONFIG_AFC_SUPPORT */
 
 /**

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

@@ -185,5 +185,30 @@ tgt_reg_set_afc_dev_type(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 tgt_reg_get_afc_dev_type(struct wlan_objmgr_psoc *psoc,
 			 enum reg_afc_dev_deploy_type *reg_afc_dev_type);
+
+/**
+ * tgt_reg_set_eirp_preferred_support() - Set EIRP as the preferred
+ * support for TPC power command
+ * @psoc: psoc pointer
+ * @reg_is_eirp_support_preferred: Boolean to indicate if target prefers EIRP
+ * support for TPC power command
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS
+tgt_reg_set_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+				   bool reg_is_eirp_support_preferred);
+
+/**
+ * tgt_reg_get_eirp_preferred_support() - Check if is EIRP support is
+ * preferred by the target for TPC power command
+ * @psoc: psoc pointer
+ * @reg_is_eirp_support_preferred: Pointer to reg_is_eirp_support_preferred
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS
+tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+				   bool *reg_is_eirp_support_preferred);
 #endif
 #endif

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

@@ -162,4 +162,20 @@ QDF_STATUS tgt_reg_get_afc_dev_type(struct wlan_objmgr_psoc *psoc,
 {
 	return reg_get_afc_soc_dev_type(psoc, reg_afc_dev_type);
 }
+
+QDF_STATUS
+tgt_reg_set_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+				   bool reg_is_eirp_support_preferred)
+{
+	return reg_set_eirp_preferred_support(psoc,
+					      reg_is_eirp_support_preferred);
+}
+
+QDF_STATUS
+tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc,
+				   bool *reg_is_eirp_support_preferred)
+{
+	return reg_get_eirp_preferred_support(psoc,
+					      reg_is_eirp_support_preferred);
+}
 #endif