From 399ef175ce7d264d08548c2f69351c2c43170194 Mon Sep 17 00:00:00 2001 From: Priyadarshnee S Date: Thu, 28 Nov 2019 11:40:19 +0530 Subject: [PATCH] qcacmn: Add regulatory APIs to retrieve "unii_5g_bitmap" mask Add regulatory APIs reg_get_unii_5g_bitmap and ucfg_reg_get_unii_5g_bitmap to retrieve the value of "unii_5g_bitmap" stored in regulatory pdev private object. CRs-Fixed: 2574642 Change-Id: Iffb004b7fc9d9fbcf1972eb6f527529024e49c70 --- .../lmac_if/inc/wlan_lmac_if_def.h | 2 ++ .../lmac_if/src/wlan_lmac_if.c | 3 +++ .../regulatory/core/src/reg_services_common.c | 17 +++++++++++++++++ .../regulatory/core/src/reg_services_common.h | 12 ++++++++++++ .../dispatcher/inc/wlan_reg_ucfg_api.h | 19 +++++++++++++++++++ .../dispatcher/src/wlan_reg_ucfg_api.c | 8 ++++++++ 6 files changed, 61 insertions(+) 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 a16df17faac1..815356d42a4c 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 @@ -992,6 +992,8 @@ struct wlan_lmac_if_reg_rx_ops { QDF_STATUS (*reg_disable_chan_coex)(struct wlan_objmgr_pdev *pdev, uint8_t unii_5g_bitmap); bool (*reg_ignore_fw_reg_offload_ind)(struct wlan_objmgr_psoc *psoc); + QDF_STATUS (*reg_get_unii_5g_bitmap)(struct wlan_objmgr_pdev *pdev, + uint8_t *bitmap); }; #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 d4e22dcd16c4..4c8359dec7ef 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 @@ -326,6 +326,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( rx_ops->reg_rx_ops.reg_disable_chan_coex = wlan_reg_disable_chan_coex; + + rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap = + ucfg_reg_get_unii_5g_bitmap; } #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 6c5db0149961..3a65f47b9964 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -3544,3 +3544,20 @@ bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev) return psoc_priv_obj->six_ghz_supported; } + +#ifdef DISABLE_UNII_SHARED_BANDS +QDF_STATUS +reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap) +{ + 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_rl("pdev reg component is NULL"); + return QDF_STATUS_E_FAILURE; + } + *bitmap = pdev_priv_obj->unii_5g_bitmap; + + 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 43d70c084df8..71e5c65d132c 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -968,4 +968,16 @@ bool reg_is_6ghz_op_class(struct wlan_objmgr_pdev *pdev, */ bool reg_is_6ghz_supported(struct wlan_objmgr_pdev *pdev); +/** + * reg_get_unii_5g_bitmap() - get unii_5g_bitmap value + * @pdev: pdev pointer + * @bitmap: Pointer to retrieve the unii_5g_bitmap of enum reg_unii_band + * + * Return: QDF_STATUS + */ +#ifdef DISABLE_UNII_SHARED_BANDS +QDF_STATUS +reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap); +#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 05b003d7f2a5..c98f728f186d 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h @@ -380,4 +380,23 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_reg_get_unii_5g_bitmap() - get unii_5g_bitmap value + * @pdev: pdev pointer + * @bitmap: Pointer to retrieve unii_5g_bitmap of enum reg_unii_band. + * + * Return: QDF_STATUS + */ +#ifdef DISABLE_UNII_SHARED_BANDS +QDF_STATUS +ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap); +#else +static inline QDF_STATUS +ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap) +{ + *bitmap = 0; + return QDF_STATUS_SUCCESS; +} +#endif + #endif diff --git a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c index 8ed6fb2cffa8..c500982a266f 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c @@ -333,3 +333,11 @@ QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc) { return reg_set_ignore_fw_reg_offload_ind(psoc); } + +#ifdef DISABLE_UNII_SHARED_BANDS +QDF_STATUS +ucfg_reg_get_unii_5g_bitmap(struct wlan_objmgr_pdev *pdev, uint8_t *bitmap) +{ + return reg_get_unii_5g_bitmap(pdev, bitmap); +} +#endif