Procházet zdrojové kódy

qcacmn: Get and set 6g client and ap parameters

Write disptacher and core functions to set and get the following
6g ap and client power type parameters in regulatory:

1) current 6G AP power type - LPI/SP/VLPI.
2) current 6G client mobility type - Default/Subordinate.
3) RNR Usable.
4) Unspecified AP usable.

Change-Id: I926642d1a3e7d9049772c5c4d2aad7cd472f8bd0
CRs-Fixed: 2825676
Vignesh U před 4 roky
rodič
revize
f443e288cc

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

@@ -177,6 +177,51 @@ reg_reset_unii_5g_bitmap(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
 }
 #endif
 
+#if defined(CONFIG_BAND_6GHZ)
+#if defined(CONFIG_REG_CLIENT)
+/**
+ * reg_init_def_client_type() - Initialize the regulatory 6G client type.
+ *
+ * @pdev_priv_obj: pointer to wlan_regulatory_pdev_priv_obj.
+ *
+ * Return : void
+ */
+static void
+reg_init_def_client_type(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	pdev_priv_obj->reg_cur_6g_client_mobility_type = REG_DEFAULT_CLIENT;
+}
+#else
+static void
+reg_init_def_client_type(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	pdev_priv_obj->reg_cur_6g_client_mobility_type = REG_SUBORDINATE_CLIENT;
+}
+#endif
+
+/**
+ * reg_init_6g_vars() - Initialize the regulatory 6G variables viz.
+ * AP power type, client mobility type, rnr tpe usable and unspecified ap
+ * usable.
+ * @pdev_priv_obj: pointer to wlan_regulatory_pdev_priv_obj.
+ *
+ * Return : void
+ */
+static void
+reg_init_6g_vars(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	pdev_priv_obj->reg_cur_6g_ap_pwr_type = REG_INDOOR_AP;
+	pdev_priv_obj->reg_rnr_tpe_usable = false;
+	pdev_priv_obj->reg_unspecified_ap_usable = false;
+	reg_init_def_client_type(pdev_priv_obj);
+}
+#else
+static void
+reg_init_6g_vars(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+}
+#endif
+
 QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 	struct wlan_objmgr_pdev *pdev, void *arg_list)
 {
@@ -256,6 +301,7 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 	pdev_priv_obj->range_5g_low = range_5g_low;
 	pdev_priv_obj->range_5g_high = range_5g_high;
 	pdev_priv_obj->wireless_modes = reg_cap_ptr->wireless_modes;
+	reg_init_6g_vars(pdev_priv_obj);
 
 	reg_init_pdev_mas_chan_list(pdev_priv_obj,
 				    &psoc_priv_obj->mas_chan_params[phy_id]);

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

@@ -161,6 +161,12 @@ struct wlan_regulatory_psoc_priv_obj {
  * @band_capability: bitmap of bands enabled, using enum reg_wifi_band as the
  *	bit position value
  * @reg_6g_superid: 6Ghz super domain id
+ * @reg_cur_6g_ap_pwr_type: 6G AP type ie VLP/SP/LPI.
+ * @reg_cur_6g_client_mobility_type: 6G client type ie Default/Subordinate.
+ * @reg_rnr_tpe_usable: Indicates whether RNR IE is applicable for current reg
+ * domain.
+ * @reg_unspecified_ap_usable: Indicates if the AP type mentioned is not part of
+ * 802.11 standard.
  */
 struct wlan_regulatory_pdev_priv_obj {
 	struct regulatory_channel cur_chan_list[NUM_CHANNELS];
@@ -200,6 +206,12 @@ struct wlan_regulatory_pdev_priv_obj {
 	qdf_spinlock_t reg_rules_lock;
 	bool chan_list_recvd;
 	bool pdev_opened;
+#if defined(CONFIG_BAND_6GHZ)
+	enum reg_6g_ap_type reg_cur_6g_ap_pwr_type;
+	enum reg_6g_client_type reg_cur_6g_client_mobility_type;
+	bool reg_rnr_tpe_usable;
+	bool reg_unspecified_ap_usable;
+#endif
 };
 
 /**

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

@@ -4248,3 +4248,86 @@ enum band_info reg_band_bitmap_to_band_info(uint32_t band_bitmap)
 		return BAND_UNKNOWN;
 }
 #endif
+
+#if defined(CONFIG_BAND_6GHZ)
+QDF_STATUS
+reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type reg_cur_6g_ap_pwr_type)
+{
+	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 QDF_STATUS_E_FAILURE;
+	}
+
+	if (reg_cur_6g_ap_pwr_type > REG_MAX_SUPP_AP_TYPE) {
+		reg_err("Unsupported 6G AP power type");
+		return QDF_STATUS_E_FAILURE;
+	}
+	/* should we validate the input reg_cur_6g_ap_type? */
+	pdev_priv_obj->reg_cur_6g_ap_pwr_type = reg_cur_6g_ap_pwr_type;
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type)
+{
+	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 QDF_STATUS_E_FAILURE;
+	}
+	*reg_cur_6g_ap_pwr_type = pdev_priv_obj->reg_cur_6g_ap_pwr_type;
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_client_type
+			   *reg_cur_6g_client_mobility_type)
+{
+	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 QDF_STATUS_E_FAILURE;
+	}
+	*reg_cur_6g_client_mobility_type =
+	    pdev_priv_obj->reg_cur_6g_client_mobility_type;
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				  bool *reg_rnr_tpe_usable)
+{
+	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 QDF_STATUS_E_FAILURE;
+	}
+	*reg_rnr_tpe_usable = pdev_priv_obj->reg_rnr_tpe_usable;
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					 bool *reg_unspecified_ap_usable)
+{
+	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 QDF_STATUS_E_FAILURE;
+	}
+	*reg_unspecified_ap_usable = pdev_priv_obj->reg_unspecified_ap_usable;
+	return QDF_STATUS_SUCCESS;
+}
+#endif

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

@@ -1304,5 +1304,102 @@ reg_get_max_phymode(struct wlan_objmgr_pdev *pdev,
  */
 enum band_info reg_band_bitmap_to_band_info(uint32_t band_bitmap);
 #endif
+#if defined(CONFIG_BAND_6GHZ)
+/**
+ * reg_set_cur_6g_ap_pwr_type() - Set the current 6G regulatory AP power type.
+ * @pdev: Pointer to PDEV object.
+ * @reg_6g_ap_type: Regulatory 6G AP type ie VLPI/LPI/SP.
+ *
+ * Return: QDF_STATUS_E_INVAL if unable to set and QDF_STATUS_SUCCESS is set.
+ */
+QDF_STATUS
+reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type reg_cur_6g_ap_pwr_type);
+
+/**
+ * reg_get_cur_6g_ap_pwr_type() - Get the current 6G regulatory AP power type.
+ * @reg_6g_ap_pwr_type: The current regulatory 6G AP type ie VLPI/LPI/SP.
+ * subordinate.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS
+reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type);
+/**
+ * reg_get_cur_6g_client_type() - Get the current 6G regulatory client Type.
+ * @pdev: Pointer to PDEV object.
+ * @reg_cur_6g_client_mobility_type: The current regulatory 6G client type ie.
+ * default/subordinate.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS
+reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_client_type
+			   *reg_cur_6g_client_mobility_type);
+
+/**
+ * reg_get_rnr_tpe_usable() - Tells if RNR IE is applicable for current domain.
+ * @pdev: Pointer to PDEV object.
+ * @reg_rnr_tpe_usable: Pointer to hold the bool value, true if RNR IE is
+ * applicable, else false.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				  bool *reg_rnr_tpe_usable);
 
+/**
+ * reg_get_unspecified_ap_usable() - Tells if AP type unspecified by 802.11 can
+ * be used or not.
+ * @pdev: Pointer to PDEV object.
+ * @reg_unspecified_ap_usable: Pointer to hold the bool value, true if
+ * unspecified AP types can be used in the IE, else false.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					 bool *reg_unspecified_ap_usable);
+#else
+static inline QDF_STATUS
+reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type reg_cur_6g_ap_pwr_type)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type)
+{
+	*reg_cur_6g_ap_pwr_type = REG_MAX_AP_TYPE;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+			   enum reg_6g_client_type
+			   *reg_cur_6g_client_mobility_type)
+{
+	*reg_cur_6g_client_mobility_type = REG_SUBORDINATE_CLIENT;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline
+QDF_STATUS reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				  bool *reg_rnr_tpe_usable)
+{
+	*reg_rnr_tpe_usable = false;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline
+QDF_STATUS reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					 bool *reg_unspecified_ap_usable)
+{
+	*reg_unspecified_ap_usable = false;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 #endif

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

@@ -538,12 +538,15 @@ enum channel_state {
  * enum reg_6g_ap_type - Regulatory AP type for regulatory info subfield.
  * @REG_INDOOR_AP: Indoor AP
  * @REG_STANDARD_POWER_AP: Standard Power AP
+ * @REG_MAX_SUPP_AP_TYPE: Current maximum AP power typer supported in the IEEE
+ * standard.
  * @REG_MAX_AP_TYPE: Maximum value possible for (3 bits) regulatory info
  * sub-field in the 6G HE Operation IE
  */
 enum reg_6g_ap_type {
 	REG_INDOOR_AP = 0,
 	REG_STANDARD_POWER_AP = 1,
+	REG_MAX_SUPP_AP_TYPE = REG_STANDARD_POWER_AP,
 	REG_MAX_AP_TYPE = 7,
 };
 

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

@@ -1600,4 +1600,67 @@ wlan_reg_get_max_phymode(struct wlan_objmgr_pdev *pdev,
 enum band_info wlan_reg_band_bitmap_to_band_info(uint32_t band_bitmap);
 #endif
 
+#if defined(CONFIG_BAND_6GHZ)
+/**
+ * wlan_reg_get_cur_6g_client_type() - Get the current 6G regulatory client
+ * type.
+ * @pdev: Pointer to PDEV object.
+ * @reg_cur_6g_client_mobility_type: The current regulatory 6G client type ie.
+ * default/subordinate.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS
+wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_client_type
+				*reg_cur_6g_client_mobility_type);
+/**
+ * wlan_reg_get_rnr_tpe_usable() - Tells if RNR IE is applicable for current
+ * domain.
+ * @pdev: Pointer to PDEV object.
+ * @reg_rnr_tpe_usable: Pointer to hold the bool value, true if RNR IE is
+ * applicable, else false.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				       bool *reg_rnr_tpe_usable);
+
+/**
+ * wlan_reg_get_unspecified_ap_usable() - Tells if AP type unspecified by 802.11
+ * can be used or not.
+ * @pdev: Pointer to PDEV object.
+ * @reg_unspecified_ap_usable: Pointer to hold the bool value, true if
+ * unspecified AP types can be used in the IE, else false.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS wlan_reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					      bool *reg_unspecified_ap_usable);
+#else
+static inline QDF_STATUS
+wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_client_type
+				*reg_cur_6g_client_mobility_type)
+{
+	*reg_cur_6g_client_mobility_type = REG_SUBORDINATE_CLIENT;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline
+QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				       bool *reg_rnr_tpe_usable)
+{
+	*reg_rnr_tpe_usable = false;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline
+QDF_STATUS wlan_reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					      bool *reg_unspecified_ap_usable)
+{
+	*reg_unspecified_ap_usable = false;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 #endif

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

@@ -416,4 +416,44 @@ ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap)
 }
 #endif
 
+#if defined(CONFIG_BAND_6GHZ)
+/**
+ * ucfg_reg_get_cur_6g_ap_pwr_type() - Get the current 6G regulatory AP power
+ * type.
+ * @pdev: Pointer to PDEV object.
+ * @reg_6g_ap_pwr_type: The current regulatory 6G AP type ie VLPI/LPI/SP.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS
+ucfg_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type);
+
+/**
+ * ucfg_reg_set_cur_6g_ap_pwr_type() - Set the current 6G regulatory AP power
+ * type.
+ * @pdev: Pointer to PDEV object.
+ * @reg_6g_ap_pwr_type: Regulatory 6G AP type ie VLPI/LPI/SP.
+ *
+ * Return: QDF_STATUS_E_INVAL if unable to set and QDF_STATUS_SUCCESS is set.
+ */
+QDF_STATUS
+ucfg_reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type reg_cur_6g_ap_type);
+#else
+static inline QDF_STATUS
+ucfg_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type)
+{
+	*reg_cur_6g_ap_pwr_type = REG_INDOOR_AP;
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+ucfg_reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type reg_cur_6g_ap_type)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 #endif

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

@@ -1260,3 +1260,26 @@ enum band_info wlan_reg_band_bitmap_to_band_info(uint32_t band_bitmap)
 	return reg_band_bitmap_to_band_info(band_bitmap);
 }
 #endif
+
+#if defined(CONFIG_BAND_6GHZ)
+QDF_STATUS wlan_reg_get_rnr_tpe_usable(struct wlan_objmgr_pdev *pdev,
+				       bool *reg_rnr_tpe_usable)
+{
+	return reg_get_rnr_tpe_usable(pdev, reg_rnr_tpe_usable);
+}
+
+QDF_STATUS wlan_reg_get_unspecified_ap_usable(struct wlan_objmgr_pdev *pdev,
+					      bool *reg_unspecified_ap_usable)
+{
+	return reg_get_unspecified_ap_usable(pdev, reg_unspecified_ap_usable);
+}
+
+QDF_STATUS
+wlan_reg_get_cur_6g_client_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_client_type
+				*reg_cur_6g_client_mobility_type)
+{
+	return reg_get_cur_6g_client_type(pdev,
+					  reg_cur_6g_client_mobility_type);
+}
+#endif

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

@@ -348,3 +348,19 @@ ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap)
 	return reg_get_unii_5g_bitmap(pdev, bitmap);
 }
 #endif
+
+#if defined(CONFIG_BAND_6GHZ)
+QDF_STATUS
+ucfg_reg_set_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type reg_cur_6g_ap_pwr_type)
+{
+	return reg_set_cur_6g_ap_pwr_type(pdev, reg_cur_6g_ap_pwr_type);
+}
+
+QDF_STATUS
+ucfg_reg_get_cur_6g_ap_pwr_type(struct wlan_objmgr_pdev *pdev,
+				enum reg_6g_ap_type *reg_cur_6g_ap_pwr_type)
+{
+	return reg_get_cur_6g_ap_pwr_type(pdev, reg_cur_6g_ap_pwr_type);
+}
+#endif