diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index fc4dc8b5ce..0ea66fdae1 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -312,6 +312,10 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle, target_if_regulatory_set_ext_tpc(psoc); + target_if_reg_set_lower_6g_edge_ch_info(psoc); + + target_if_reg_set_disable_upper_6g_edge_ch_info(psoc); + /* send init command */ init_deinit_set_send_init_cmd(psoc, tgt_hdl); diff --git a/target_if/regulatory/inc/target_if_reg.h b/target_if/regulatory/inc/target_if_reg.h index 634663ccf0..db8ea0171f 100644 --- a/target_if/regulatory/inc/target_if_reg.h +++ b/target_if/regulatory/inc/target_if_reg.h @@ -100,4 +100,36 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc); */ struct wlan_lmac_if_reg_tx_ops * target_if_regulatory_get_tx_ops(struct wlan_objmgr_psoc *psoc); + +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +/** + * target_if_reg_set_lower_6g_edge_ch_info() - populate lower 6ghz edge channel + * enablement info + * @psoc: psoc pointer + * Return: Success or Failure + */ +QDF_STATUS +target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc); + +/** + * target_if_reg_set_disable_upper_6g_edge_ch_info() - populate upper 6ghz + * edge channel disablement info + * @psoc: psoc pointer + * Return: Success or Failure + */ +QDF_STATUS +target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc); +#else +static inline QDF_STATUS +target_if_reg_set_lower_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_E_FAILURE; +} + +static inline QDF_STATUS +target_if_reg_set_disable_upper_6g_edge_ch_info(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_E_FAILURE; +} +#endif #endif /* __TARGET_IF_REG_H__ */ diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index a540b645e7..666324cab1 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -723,7 +723,8 @@ tgt_if_regulatory_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc) if (!wmi_handle) return false; - return wmi_service_enabled(wmi_handle, wmi_service_ext_tpc_reg_support); + return wmi_service_enabled(wmi_handle, + wmi_service_ext_tpc_reg_support); } QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc) @@ -744,6 +745,96 @@ QDF_STATUS target_if_regulatory_set_ext_tpc(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +/** + * tgt_if_regulatory_is_lower_6g_edge_ch_supp() - Check if lower 6ghz + * edge channel (5935MHz) is supported + * @psoc: Pointer to psoc + * + * Return: true if channel is supported, else false + */ +static bool +tgt_if_regulatory_is_lower_6g_edge_ch_supp(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_lower_6g_edge_ch_supp); +} + +/** + * tgt_if_regulatory_is_upper_6g_edge_ch_disabled() - Check if upper + * 6ghz edge channel (7115MHz) is disabled + * @psoc: Pointer to psoc + * + * Return: true if channel is disabled, else false + */ +static bool +tgt_if_regulatory_is_upper_6g_edge_ch_disabled(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_disable_upper_6g_edge_ch_supp); +} + +QDF_STATUS +target_if_reg_set_lower_6g_edge_ch_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_lower_6g_edge_ch_supp) + reg_rx_ops->reg_set_lower_6g_edge_ch_supp( + psoc, + tgt_if_regulatory_is_lower_6g_edge_ch_supp(psoc)); + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +target_if_reg_set_disable_upper_6g_edge_ch_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_disable_upper_6g_edge_ch_supp) + reg_rx_ops->reg_set_disable_upper_6g_edge_ch_supp( + psoc, + tgt_if_regulatory_is_upper_6g_edge_ch_disabled(psoc)); + + return QDF_STATUS_SUCCESS; +} +#else +static inline bool +tgt_if_regulatory_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc) +{ + return false; +} + +static inline bool +tgt_if_regulatory_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc) +{ + return false; +} +#endif + QDF_STATUS target_if_register_regulatory_tx_ops( struct wlan_lmac_if_tx_ops *tx_ops) { 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 719e26bdb5..293a63f445 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 @@ -1249,6 +1249,14 @@ struct wlan_lmac_if_reg_rx_ops { uint8_t *bitmap); QDF_STATUS (*reg_set_ext_tpc_supported)(struct wlan_objmgr_psoc *psoc, bool val); +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) + QDF_STATUS + (*reg_set_lower_6g_edge_ch_supp)(struct wlan_objmgr_psoc *psoc, + bool val); + QDF_STATUS + (*reg_set_disable_upper_6g_edge_ch_supp)(struct wlan_objmgr_psoc *psoc, + bool val); +#endif }; #ifdef CONVERGED_P2P_ENABLE 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 2f48a614f1..8d8d85fb1b 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 @@ -303,6 +303,23 @@ static inline void wlan_lmac_if_register_master_list_ext_handler( } #endif +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +static void wlan_lmac_if_register_6g_edge_chan_supp( + struct wlan_lmac_if_rx_ops *rx_ops) +{ + rx_ops->reg_rx_ops.reg_set_lower_6g_edge_ch_supp = + tgt_reg_set_lower_6g_edge_ch_supp; + + rx_ops->reg_rx_ops.reg_set_disable_upper_6g_edge_ch_supp = + tgt_reg_set_disable_upper_6g_edge_ch_supp; +} +#else +static inline void wlan_lmac_if_register_6g_edge_chan_supp( + struct wlan_lmac_if_rx_ops *rx_ops) +{ +} +#endif + static void wlan_lmac_if_umac_reg_rx_ops_register( struct wlan_lmac_if_rx_ops *rx_ops) { @@ -373,6 +390,8 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( rx_ops->reg_rx_ops.reg_set_ext_tpc_supported = tgt_reg_set_ext_tpc_supported; + + wlan_lmac_if_register_6g_edge_chan_supp(rx_ops); } #ifdef CONVERGED_P2P_ENABLE diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index 096be659de..e48e40b242 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -845,6 +845,50 @@ reg_modify_chan_list_for_5dot9_ghz_channels(struct wlan_objmgr_pdev *pdev, } } +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +/** + * reg_modify_chan_list_for_6g_edge_channels() - Modify 6 GHz edge channels + * + * @pdev: Pointer to pdev object + * @chan_list: Current channel list + * + * This function disables lower 6G edge channel (5935MHz) if service bit + * wmi_service_lower_6g_edge_ch_supp is not set. If service bit is set + * the channels remain enabled. It disables upper 6G edge channel (7115MHz) + * if the service bit wmi_service_disable_upper_6g_edge_ch_supp is set, it + * is enabled by default. + * + */ +static void +reg_modify_chan_list_for_6g_edge_channels(struct wlan_objmgr_pdev *pdev, + struct regulatory_channel + *chan_list) +{ + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_pdev_get_psoc(pdev); + + if (!reg_is_lower_6g_edge_ch_supp(psoc)) { + chan_list[CHAN_ENUM_5935].state = CHANNEL_STATE_DISABLE; + chan_list[CHAN_ENUM_5935].chan_flags |= + REGULATORY_CHAN_DISABLED; + } + + if (reg_is_upper_6g_edge_ch_disabled(psoc)) { + chan_list[CHAN_ENUM_7115].state = CHANNEL_STATE_DISABLE; + chan_list[CHAN_ENUM_7115].chan_flags |= + REGULATORY_CHAN_DISABLED; + } +} +#else +static inline void +reg_modify_chan_list_for_6g_edge_channels(struct wlan_objmgr_pdev *pdev, + struct regulatory_channel + *chan_list) +{ +} +#endif + #ifdef DISABLE_UNII_SHARED_BANDS /** * reg_is_reg_unii_band_1_set() - Check UNII bitmap @@ -1065,6 +1109,10 @@ void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj reg_modify_chan_list_for_max_chwidth(pdev_priv_obj->pdev_ptr, pdev_priv_obj->cur_chan_list); + + reg_modify_chan_list_for_6g_edge_channels(pdev_priv_obj->pdev_ptr, + pdev_priv_obj-> + cur_chan_list); } void reg_reset_reg_rules(struct reg_rule_info *reg_rules) diff --git a/umac/regulatory/core/src/reg_priv_objs.h b/umac/regulatory/core/src/reg_priv_objs.h index 2a65742f63..79d3f521a7 100644 --- a/umac/regulatory/core/src/reg_priv_objs.h +++ b/umac/regulatory/core/src/reg_priv_objs.h @@ -105,6 +105,10 @@ struct chan_change_cbk_entry { * @domain_code_6g_ap: domain code for 6G AP * @domain_code_6g_client: domain code for 6G client * @is_ext_tpc_supported: Whether FW supports new WMI command for TPC + * @is_lower_6g_edge_ch_supported: whether lower 6ghz edge channel 5935MHz is + * supported + * @is_upper_6g_edge_ch_disabled: whether upper 6ghz edge channel 7115MHz is + * disabled */ struct wlan_regulatory_psoc_priv_obj { struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP]; @@ -162,6 +166,10 @@ struct wlan_regulatory_psoc_priv_obj { uint8_t domain_code_6g_client[REG_CURRENT_MAX_AP_TYPE][REG_MAX_CLIENT_TYPE]; #endif bool is_ext_tpc_supported; +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) + bool is_lower_6g_edge_ch_supported; + bool is_upper_6g_edge_ch_disabled; +#endif }; /** diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index fe4c5d8de7..5f1dd504d7 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -4531,3 +4531,67 @@ bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc) return psoc_priv_obj->is_ext_tpc_supported; } + +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +QDF_STATUS +reg_set_lower_6g_edge_ch_supp(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->is_lower_6g_edge_ch_supported = val; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +reg_set_disable_upper_6g_edge_ch_supp(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->is_upper_6g_edge_ch_disabled = val; + + return QDF_STATUS_SUCCESS; +} + +bool reg_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc) +{ + 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 false; + } + + return psoc_priv_obj->is_lower_6g_edge_ch_supported; +} + +bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc) +{ + 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 false; + } + + return psoc_priv_obj->is_upper_6g_edge_ch_disabled; +} +#endif diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index e81476e6dd..e482f6f45f 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -1614,4 +1614,45 @@ bool reg_is_ext_tpc_supported(struct wlan_objmgr_psoc *psoc); */ const struct bonded_channel_freq * reg_get_bonded_chan_entry(qdf_freq_t freq, enum phy_ch_width chwidth); + +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +/** + * reg_set_lower_6g_edge_ch_supp() - Set if lower 6ghz edge channel is + * supported by FW + * + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val); + +/** + * reg_set_disable_upper_6g_edge_ch_supp() - Set if upper 6ghz edge channel is + * disabled by FW + * + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS +reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val); + +/** + * reg_is_lower_6g_edge_ch_supp() - Check whether 6GHz lower edge channel + * (5935 MHz) is supported. + * @psoc: pointer to psoc + * + * Return: true if edge channels are supported, else false + */ +bool reg_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc); + +/** + * reg_is_upper_6g_edge_ch_disabled() - Check whether 6GHz upper edge + * channel (7115 MHz) is disabled. + * @psoc: pointer to psoc + * + * Return: true if edge channels are supported, else false + */ +bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc); +#endif #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h index 944e8feb8c..fdc5293dab 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h @@ -116,4 +116,39 @@ QDF_STATUS tgt_reg_set_5dot9_ghz_supported(struct wlan_objmgr_psoc *psoc, QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc, bool val); +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +/** + * tgt_reg_set_lower_6g_edge_ch_supp() - Assign the value set by FW for lower + * 6ghz edge channel (5935 MHz) support + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val); + +/** + * tgt_reg_set_disable_upper_6g_edge_ch_supp() - Assign the value set by FW + * for upper 6G edge channel {7115MHz) disablement + * @psoc: Pointer to psoc + * @val: value + */ +QDF_STATUS +tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val); +#else +static inline +QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val) +{ + return QDF_STATUS_E_FAILURE; +} + +static inline QDF_STATUS +tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val) + +{ + return QDF_STATUS_E_FAILURE; +} +#endif #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c index 6b96ca70f1..9101746b15 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c @@ -123,3 +123,18 @@ QDF_STATUS tgt_reg_set_ext_tpc_supported(struct wlan_objmgr_psoc *psoc, { return reg_set_ext_tpc_supported(psoc, val); } + +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) +QDF_STATUS tgt_reg_set_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val) +{ + return reg_set_lower_6g_edge_ch_supp(psoc, val); +} + +QDF_STATUS +tgt_reg_set_disable_upper_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc, + bool val) +{ + return reg_set_disable_upper_6g_edge_ch_supp(psoc, val); +} +#endif diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index bf34c0e384..58990f4eb7 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -5109,6 +5109,10 @@ typedef enum { wmi_service_ext_tpc_reg_support, wmi_service_ndi_txbf_support, wmi_service_reg_cc_ext_event_support, +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) + wmi_service_lower_6g_edge_ch_supp, + wmi_service_disable_upper_6g_edge_ch_supp, +#endif 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 7d565d8246..03c1555d95 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -15768,6 +15768,12 @@ static void populate_tlv_service(uint32_t *wmi_service) WMI_SERVICE_NDI_TXBF_SUPPORT; wmi_service[wmi_service_reg_cc_ext_event_support] = WMI_SERVICE_REG_CC_EXT_EVENT_SUPPORT; +#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_REG_CLIENT) + wmi_service[wmi_service_lower_6g_edge_ch_supp] = + WMI_SERVICE_ENABLE_LOWER_6G_EDGE_CH_SUPP; + wmi_service[wmi_service_disable_upper_6g_edge_ch_supp] = + WMI_SERVICE_DISABLE_UPPER_6G_EDGE_CH_SUPP; +#endif } /**