From 4a452b5de648f1ad12492600ada05be60f798efa Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Wed, 13 May 2020 20:57:08 +0530 Subject: [PATCH] qcacmn: Update 11AX wireless modes in reg psoc structure FW advertises the 11AX wireless modes in service ready ext2 event. Add a regulatory API to update these modes in regulatory psoc private object. Change-Id: I51e781f6819dabf2b98e129a996213a7eecbf8b2 CRs-Fixed: 2650136 --- .../regulatory/core/src/reg_services_common.c | 22 +++++++++++++++++++ .../regulatory/core/src/reg_services_common.h | 11 ++++++++++ .../dispatcher/inc/wlan_reg_ucfg_api.h | 11 ++++++++++ .../dispatcher/src/wlan_reg_ucfg_api.c | 10 ++++++++- 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 3080989df77f..5da213fff0e0 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -2268,6 +2268,28 @@ QDF_STATUS reg_set_hal_reg_cap( return QDF_STATUS_SUCCESS; } +QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc, + uint32_t wireless_modes, uint8_t phy_id) +{ + struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + + if (!psoc) { + reg_err("psoc is null"); + return QDF_STATUS_E_FAILURE; + } + + 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->reg_cap[phy_id].wireless_modes |= wireless_modes; + + return QDF_STATUS_SUCCESS; +} + bool reg_chan_in_range(struct regulatory_channel *chan_list, qdf_freq_t low_freq_2g, qdf_freq_t high_freq_2g, qdf_freq_t low_freq_5g, qdf_freq_t high_freq_5g, diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index 5e8f8473211e..86d45c4d3bd6 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -462,6 +462,17 @@ QDF_STATUS reg_set_hal_reg_cap( struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap, uint16_t phy_cnt); +/** + * reg_update_hal_reg_cap() - Update HAL REG capabilities + * @psoc: psoc pointer + * @wireless_modes: 11AX wireless modes + * @phy_id: phy id + * + * Return: QDF_STATUS + */ +QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc, + uint32_t wireless_modes, uint8_t phy_id); + /** * reg_chan_in_range() - Check if the given channel is in pdev's channel range * @chan_list: Pointer to regulatory channel list. diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h index 71b04c3f71d0..52703f9a1c0c 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h @@ -374,6 +374,17 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc, struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap, uint16_t phy_cnt); +/** + * ucfg_reg_update_hal_reg_cap() - update hal reg cap + * @psoc: psoc ptr + * @wireless_modes: 11AX wireless modes + * @phy_id: phy id + * + * Return: QDF_STATUS + */ +QDF_STATUS ucfg_reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc, + uint32_t wireless_modes, uint8_t phy_id); + /** * ucfg_set_ignore_fw_reg_offload_ind() - API to set ignore regdb offload ind * @psoc: psoc ptr diff --git a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c index c500982a266f..3a002b52bc70 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -286,6 +286,14 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc, } qdf_export_symbol(ucfg_reg_set_hal_reg_cap); +QDF_STATUS ucfg_reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc, + uint32_t wireless_modes, uint8_t phy_id) +{ + return reg_update_hal_reg_cap(psoc, wireless_modes, phy_id); +} + +qdf_export_symbol(ucfg_reg_update_hal_reg_cap); + #ifdef DISABLE_CHANNEL_LIST #ifdef CONFIG_CHAN_FREQ_API /**