diff --git a/umac/regulatory/core/src/reg_priv_objs.c b/umac/regulatory/core/src/reg_priv_objs.c index 8279df919038..beea4cfd89e6 100644 --- a/umac/regulatory/core/src/reg_priv_objs.c +++ b/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]); diff --git a/umac/regulatory/core/src/reg_priv_objs.h b/umac/regulatory/core/src/reg_priv_objs.h index f40a7a76e754..a914f0d2908e 100644 --- a/umac/regulatory/core/src/reg_priv_objs.h +++ b/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 }; /** diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 81a2cab2ab4a..2e6df0702bd0 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -4229,3 +4229,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 diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 90a433a35a4d..53290e9ff0a2 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -1294,5 +1294,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 diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 30d0af2c074b..6a1d51facdb8 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -526,12 +526,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, }; diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 55721cf4b56b..0f6e64aba8de 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -1584,4 +1584,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 diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h index 4583f0d7b9f5..869ad7b2f16c 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/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 diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index 1e3ac7e0fa91..be1689fc82e4 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -1258,3 +1258,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 diff --git a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c index 3be545f80ecf..249769049588 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c +++ b/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