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 c7dd2b3c18..9bb9540c2b 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 @@ -1105,6 +1105,12 @@ struct wlan_lmac_if_ftm_rx_ops { * @trigger_acs_for_afc: pointer to trigger acs for afc * @reg_get_min_psd: * @is_chip_11be: + * @register_rate2power_table_update_event_handler: pointer to register + * rate2power table update event handler. + * @unregister_rate2power_table_update_event_handler: pointer to unregister + * rate2power table update event handler. + * @end_r2p_table_update_wait: Call-back function to end the wait on r2p update + * response from fw. */ struct wlan_lmac_if_reg_tx_ops { QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc, @@ -1165,6 +1171,15 @@ struct wlan_lmac_if_reg_tx_ops { #endif bool (*is_chip_11be)(struct wlan_objmgr_psoc *psoc, uint16_t phy_id); + QDF_STATUS (*register_rate2power_table_update_event_handler)( + struct wlan_objmgr_psoc *psoc, + void *arg); + QDF_STATUS (*unregister_rate2power_table_update_event_handler)( + struct wlan_objmgr_psoc *psoc, + void *arg); + QDF_STATUS (*end_r2p_table_update_wait)( + struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id); }; /** @@ -1851,6 +1866,8 @@ struct wlan_lmac_if_mgmt_txrx_rx_ops { * @reg_get_afc_dev_type: * @reg_set_eirp_preferred_support: * @reg_get_eirp_preferred_support: + * @reg_r2p_table_update_response_handler: function pointer to handle + * rate2power update response from fw. */ struct wlan_lmac_if_reg_rx_ops { QDF_STATUS (*master_list_handler)(struct cur_regulatory_info @@ -1934,6 +1951,9 @@ struct wlan_lmac_if_reg_rx_ops { struct wlan_objmgr_psoc *psoc, bool *reg_is_eirp_support_preferred); #endif + QDF_STATUS (*reg_r2p_table_update_response_handler)( + struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id); }; #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 d9aac0ceda..98203d28df 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 @@ -524,6 +524,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( wlan_lmac_if_register_afc_handlers(rx_ops); wlan_lmac_if_register_super_chan_display(rx_ops); + + rx_ops->reg_rx_ops.reg_r2p_table_update_response_handler = + tgt_reg_process_r2p_table_update_response; } #ifdef CONVERGED_P2P_ENABLE diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 0ba42da23d..8f3e0cf3f8 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -10007,3 +10007,16 @@ QDF_STATUS reg_set_afc_power_event_received(struct wlan_objmgr_pdev *pdev, return QDF_STATUS_SUCCESS; } #endif + +QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id) +{ + struct wlan_lmac_if_reg_tx_ops *reg_tx_ops; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + reg_tx_ops = reg_get_psoc_tx_ops(psoc); + if (reg_tx_ops->end_r2p_table_update_wait) + status = reg_tx_ops->end_r2p_table_update_wait(psoc, pdev_id); + + return status; +} diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 12b5926fa6..1c4cbd89ef 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -2999,4 +2999,15 @@ uint16_t reg_get_max_bw_5G_for_fo(struct wlan_objmgr_pdev *pdev); uint8_t reg_get_num_rules_of_ap_pwr_type(struct wlan_objmgr_pdev *pdev, enum reg_6g_ap_type ap_pwr_type); + +/** + * reg_process_r2p_table_update_response() - Process the response received from + * target for the rate2power update cmd + * @psoc: Pointer to psoc + * @pdev_id: pdev id from target + * + * Return: QDF_STATUS + */ +QDF_STATUS reg_process_r2p_table_update_response(struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id); #endif diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 8496ddd9e6..512ac3d7e8 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -2344,4 +2344,14 @@ static inline bool reg_is_chan_enum_invalid(enum channel_enum chan_enum) { return chan_enum >= INVALID_CHANNEL; } + +/** + * struct r2p_table_update_status_obj + * @pdev_id: pdev id from target + * @status: rate2power update status + */ +struct r2p_table_update_status_obj { + uint32_t pdev_id; + uint32_t status; +}; #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h index 21ba171c39..fc32a119be 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_tgt_api.h @@ -213,4 +213,16 @@ QDF_STATUS tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc, bool *reg_is_eirp_support_preferred); #endif + +/** + * tgt_reg_process_r2p_table_update_response() - process rate2power table update + * response + * @psoc: pointer to psoc + * @pdev_id: pdev id from target + * + * Return: QDF_STATUS + */ +QDF_STATUS tgt_reg_process_r2p_table_update_response( + struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id); #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index e148da9ce0..ea57b75a49 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -516,6 +516,9 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc) tx_ops->register_11d_new_cc_handler(psoc, NULL); if (tx_ops->register_ch_avoid_event_handler) tx_ops->register_ch_avoid_event_handler(psoc, NULL); + if (tx_ops->register_rate2power_table_update_event_handler) + tx_ops->register_rate2power_table_update_event_handler(psoc, + NULL); return QDF_STATUS_SUCCESS; } @@ -533,6 +536,9 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc) regulatory_assign_unregister_afc_event_handler(psoc, tx_ops); if (tx_ops->unregister_ch_avoid_event_handler) tx_ops->unregister_ch_avoid_event_handler(psoc, NULL); + if (tx_ops->unregister_rate2power_table_update_event_handler) + tx_ops->unregister_rate2power_table_update_event_handler(psoc, + NULL); return QDF_STATUS_SUCCESS; } diff --git a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c index 9644e1b08e..92b0aec013 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_tgt_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -179,3 +179,10 @@ tgt_reg_get_eirp_preferred_support(struct wlan_objmgr_psoc *psoc, reg_is_eirp_support_preferred); } #endif + +QDF_STATUS tgt_reg_process_r2p_table_update_response( + struct wlan_objmgr_psoc *psoc, + uint32_t pdev_id) +{ + return reg_process_r2p_table_update_response(psoc, pdev_id); +}