diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index b50b6282f9..df9a988beb 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -186,6 +186,8 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, goto exit; target_if_reg_set_offloaded_info(psoc); + target_if_reg_set_6ghz_info(psoc); + if (wmi_service_enabled(wmi_handle, wmi_service_ext_msg)) { target_if_debug("Wait for EXT message"); } else { diff --git a/target_if/regulatory/inc/target_if_reg.h b/target_if/regulatory/inc/target_if_reg.h index ed29484b5a..a1da2388bb 100644 --- a/target_if/regulatory/inc/target_if_reg.h +++ b/target_if/regulatory/inc/target_if_reg.h @@ -50,9 +50,16 @@ QDF_STATUS target_if_register_regulatory_tx_ops( */ QDF_STATUS target_if_reg_set_offloaded_info(struct wlan_objmgr_psoc *psoc); +/** + * target_if_reg_set_6ghz_info() - populate 6ghz enablement info + * @psoc: psoc pointer + * Return: Success or Failure + */ +QDF_STATUS target_if_reg_set_6ghz_info(struct wlan_objmgr_psoc *psoc); + /** * target_if_regulatory_get_rx_ops() - Get regdb rx ops - * @psoc: Pointer to psoc object + * @psoc: pointer to psoc object * * Return: Reg rx_ops */ diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index 8cd570bcb7..59cbe146e4 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -68,6 +68,22 @@ static bool tgt_if_regulatory_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc) return wmi_service_enabled(wmi_handle, wmi_service_regulatory_db); } +/** + * tgt_if_regulatory_is_6ghz_supported() - Check if 6ghz is supported + * @psoc: Pointer to psoc + * + * Return: true if regdb if offloaded, else false + */ +static bool tgt_if_regulatory_is_6ghz_supported(struct wlan_objmgr_psoc *psoc) +{ + wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + + if (!wmi_handle) + return false; + + return wmi_service_enabled(wmi_handle, wmi_service_6ghz_support); +} + /** * tgt_if_regulatory_is_there_serv_ready_extn() - Check for service ready * extension @@ -120,6 +136,24 @@ QDF_STATUS target_if_reg_set_offloaded_info(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS target_if_reg_set_6ghz_info(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_lmac_if_reg_rx_ops *reg_rx_ops; + + reg_rx_ops = target_if_regulatory_get_rx_ops(psoc); + if (!reg_rx_ops) { + target_if_err("reg_rx_ops is NULL"); + return QDF_STATUS_E_FAILURE; + } + + if (reg_rx_ops->reg_set_6ghz_supported) + reg_rx_ops->reg_set_6ghz_supported( + psoc, + tgt_if_regulatory_is_6ghz_supported(psoc)); + + return QDF_STATUS_SUCCESS; +} + /** * tgt_reg_chan_list_update_handler() - Channel list update handler * @handle: scn handle diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 71e7085155..574169824a 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -970,6 +970,8 @@ struct wlan_lmac_if_reg_rx_ops { bool val); QDF_STATUS (*reg_set_11d_offloaded)(struct wlan_objmgr_psoc *psoc, bool val); + QDF_STATUS (*reg_set_6ghz_supported)(struct wlan_objmgr_psoc *psoc, + bool val); QDF_STATUS (*get_dfs_region)(struct wlan_objmgr_pdev *pdev, enum dfs_reg *dfs_reg); QDF_STATUS (*reg_ch_avoid_event_handler)(struct wlan_objmgr_psoc *psoc, diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index 1ef98d250d..40e01e8517 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -291,6 +291,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( rx_ops->reg_rx_ops.reg_set_11d_offloaded = tgt_reg_set_11d_offloaded; + rx_ops->reg_rx_ops.reg_set_6ghz_supported = + tgt_reg_set_6ghz_supported; + rx_ops->reg_rx_ops.get_dfs_region = wlan_reg_get_dfs_region; diff --git a/umac/regulatory/core/src/reg_priv_objs.h b/umac/regulatory/core/src/reg_priv_objs.h index a6b7736e54..5d5b47f708 100644 --- a/umac/regulatory/core/src/reg_priv_objs.h +++ b/umac/regulatory/core/src/reg_priv_objs.h @@ -89,10 +89,12 @@ struct chan_change_cbk_entry { * @world_country_pending: In this array, element[phy_id] is true if any world * country update is pending for pdev (phy_id). * @ignore_fw_reg_offload_ind: Ignore FW reg offload indication + * @six_ghz_supported: whether 6ghz is supported */ struct wlan_regulatory_psoc_priv_obj { struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP]; bool offload_enabled; + bool six_ghz_supported; uint8_t num_phy; char cur_country[REG_ALPHA2_LEN + 1]; char def_country[REG_ALPHA2_LEN + 1]; diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index fe2c58942b..f8e23e246f 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -3433,3 +3433,45 @@ bool reg_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc) return psoc_reg->ignore_fw_reg_offload_ind; } +QDF_STATUS reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc, bool val) +{ + 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->six_ghz_supported = val; + + return QDF_STATUS_SUCCESS; +} + +bool reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, uint8_t op_class) +{ + return ((op_class >= MIN_6GHZ_OPER_CLASS) && + (op_class <= MAX_6GHZ_OPER_CLASS)); +} + +bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_pdev_get_psoc(pdev); + if (!psoc) { + reg_err_rl("psoc is NULL"); + return false; + } + + 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 false; + } + + return psoc_priv_obj->six_ghz_supported; +} diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 4dc70312ca..9e1cba45cb 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -102,6 +102,8 @@ /* EEPROM setting is a country code */ #define COUNTRY_ERD_FLAG 0x8000 +#define MIN_6GHZ_OPER_CLASS 131 +#define MAX_6GHZ_OPER_CLASS 135 extern const struct chan_map *channel_map; extern const struct chan_map channel_map_us[]; @@ -928,4 +930,29 @@ QDF_STATUS reg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc); */ bool reg_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc); +/** + * reg_set_6ghz_supported() - Set if 6ghz is supported + * + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc, + bool val); + +/** + * reg_is_6ghz_op_class() - Check whether 6ghz oper class + * + * @pdev: Pointer to pdev + * @op_class: oper class + */ +bool reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, + uint8_t op_class); + +/** + * reg_is_6ghz_supported() - Whether 6ghz is supported + * + * @pdev: pointer to pdev + */ +bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev); + #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 65a98cdf17..c8afba6891 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -1006,7 +1006,7 @@ wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq); /** - * wlan_reg_set_channel_params_for_freq () - Sets channel parameteres for + * wlan_reg_set_channel_params_for_freq() - Sets channel parameteres for * given bandwidth * @pdev: The physical dev to program country code or regdomain * @freq: channel center frequency. @@ -1045,7 +1045,7 @@ void wlan_reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev, bool nol_ch); /** - * wlan_reg_is_dfs_freq () - Checks the channel state for DFS + * wlan_reg_is_dfs_freq() - Checks the channel state for DFS * @freq: Channel center frequency * * Return: true or false @@ -1053,7 +1053,7 @@ void wlan_reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev, bool wlan_reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq); /** - * wlan_reg_is_dsrc_freq () - Checks if the channel is dsrc channel or not + * wlan_reg_is_dsrc_freq() - Checks if the channel is dsrc channel or not * @freq: Channel center frequency * * Return: true or false @@ -1061,7 +1061,7 @@ bool wlan_reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq); bool wlan_reg_is_dsrc_freq(uint16_t freq); /** - * wlan_reg_is_passive_or_disable_for_freq () - Checks chan state for passive + * wlan_reg_is_passive_or_disable_for_freq() - Checks chan state for passive * and disabled * @pdev: pdev ptr * @freq: Channel center frequency @@ -1072,7 +1072,7 @@ bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq); /** - * wlan_reg_is_disable_for_freq () - Checks chan state for disabled + * wlan_reg_is_disable_for_freq() - Checks chan state for disabled * @pdev: pdev ptr * @freq: Channel center frequency * @@ -1089,21 +1089,21 @@ bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq); enum reg_wifi_band wlan_reg_freq_to_band(uint16_t freq); /** - * wlan_reg_min_chan_freq () - minimum channel frequency supported + * wlan_reg_min_chan_freq() - Minimum channel frequency supported * * Return: frequency */ uint16_t wlan_reg_min_chan_freq(void); /** - * wlan_reg_max_chan_freq () - Checks chan state f + * wlan_reg_max_chan_freq() - Return max. frequency * * Return: frequency */ uint16_t wlan_reg_max_chan_freq(void); /** - * wlan_reg_freq_width_to_chan_op_class () - get op class from freq + * wlan_reg_freq_width_to_chan_op_class() -Get op class from freq * @pdev: pdev ptr * @freq: channel frequency * @chan_width: channel width @@ -1123,7 +1123,7 @@ void wlan_reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev, uint8_t *chan_num); /** - * wlan_reg_freq_to_chan_and_op_class () - converts freq to oper class + * wlan_reg_freq_to_chan_and_op_class() - Converts freq to oper class * @pdev: pdev ptr * @freq: channel frequency * @global_tbl_lookup: whether to look up global table @@ -1143,7 +1143,7 @@ void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev, #endif /*CONFIG_CHAN_FREQ_API */ /** - * wlan_reg_get_op_class_width () - get operating class chan width + * wlan_reg_get_op_class_width() - Get operating class chan width * @pdev: pdev ptr * @freq: channel frequency * @global_tbl_lookup: whether to look up global table @@ -1156,4 +1156,22 @@ uint16_t wlan_reg_get_op_class_width(struct wlan_objmgr_pdev *pdev, uint8_t op_class, bool global_tbl_lookup); +/** + * wlan_reg_is_6ghz_op_class() - Whether 6ghz oper class + * @pdev: pdev ptr + * @op_class: operating class + * + * Return: bool + */ +bool wlan_reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, + uint8_t op_class); + +/** + * wlan_reg_is_6ghz_supported() - Whether 6ghz is supported + * @pdev: pdev ptr + * + * Return: bool + */ +bool wlan_reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev); + #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h index 3ec2aa5381..1014c325e7 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h @@ -69,9 +69,16 @@ QDF_STATUS tgt_reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc, /** * tgt_reg_ignore_fw_reg_offload_ind() - Check whether regdb offload indication * from FW needs to be ignored. - * * @psoc: Pointer to psoc */ bool tgt_reg_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc); +/** + * tgt_reg_set_6ghz_supported() - Whether 6ghz is supported by the chip + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS tgt_reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc, + bool val); + #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index d2ecff9724..23f4b7009a 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -1012,3 +1012,14 @@ uint16_t wlan_reg_get_op_class_width(struct wlan_objmgr_pdev *pdev, return reg_get_op_class_width(pdev, op_class, global_tbl_lookup); } + +bool wlan_reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, + uint8_t op_class) +{ + return reg_is_6ghz_op_class(pdev, op_class); +} + +bool wlan_reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev) +{ + return reg_is_6ghz_supported(pdev); +} diff --git a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c index 1af955d973..ed1ec38a6a 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c @@ -75,3 +75,9 @@ bool tgt_reg_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc) { return reg_get_ignore_fw_reg_offload_ind(psoc); } + +QDF_STATUS tgt_reg_set_6ghz_supported(struct wlan_objmgr_psoc *psoc, + bool val) +{ + return reg_set_6ghz_supported(psoc, val); +} diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 670693c3c0..9a32f42ebb 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -5022,6 +5022,7 @@ typedef enum { wmi_service_sae_roam_support, wmi_service_owe_roam_support, wmi_service_ext2_msg, + wmi_service_6ghz_support, wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index c42080c757..352756c11c 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -13069,6 +13069,8 @@ static void populate_tlv_service(uint32_t *wmi_service) WMI_SERVICE_WPA3_SAE_ROAM_SUPPORT; wmi_service[wmi_service_owe_roam_support] = WMI_SERVICE_WPA3_OWE_ROAM_SUPPORT; + wmi_service[wmi_service_6ghz_support] = + WMI_SERVICE_6GHZ_SUPPORT; } /**