From a7db8ce9a150f0da5e588ee8dbb2c3c28219fd69 Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Mon, 18 Dec 2017 15:35:08 +0530 Subject: [PATCH] qcacmn: Add function pointers to get regdb information Add function pointers to set/get chan 144 support, program country code and get current regdomain information from regdb component. These information is used by WIN offload and lmac layers. Change-Id: I6344260a7761e958eeee9e5d7faf091812ed4ed2 CRs-Fixed: 2160593 --- .../lmac_if/inc/wlan_lmac_if_def.h | 7 +++++++ .../lmac_if/src/wlan_lmac_if.c | 13 +++++++++++++ .../dispatcher/inc/wlan_reg_services_api.h | 8 +++++++- umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h | 9 ++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) 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 f397d1b36f4e..f5d930501658 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 @@ -672,6 +672,13 @@ struct wlan_lmac_if_reg_rx_ops { struct ch_avoid_ind_type *ch_avoid_ind); uint32_t (*reg_freq_to_chan)(struct wlan_objmgr_pdev *pdev, uint32_t freq); + QDF_STATUS (*reg_set_chan_144)(struct wlan_objmgr_pdev *pdev, + bool enable_ch_144); + bool (*reg_get_chan_144)(struct wlan_objmgr_pdev *pdev); + QDF_STATUS (*reg_program_default_cc)(struct wlan_objmgr_pdev *pdev, + uint16_t regdmn); + QDF_STATUS (*reg_get_current_regdomain)(struct wlan_objmgr_pdev *pdev, + struct cur_regdmn_info *cur_regdmn); }; #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 054b0d60e1a5..01bad7990717 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 @@ -23,6 +23,7 @@ #include "wlan_mgmt_txrx_tgt_api.h" #include "wlan_scan_tgt_api.h" #include +#include #ifdef WLAN_ATF_ENABLE #include "wlan_atf_tgt_api.h" #endif @@ -219,6 +220,18 @@ static void wlan_lmac_if_umac_reg_rx_ops_register( rx_ops->reg_rx_ops.reg_freq_to_chan = wlan_reg_freq_to_chan; + + rx_ops->reg_rx_ops.reg_set_chan_144 = + ucfg_reg_modify_chan_144; + + rx_ops->reg_rx_ops.reg_get_chan_144 = + ucfg_reg_get_en_chan_144; + + rx_ops->reg_rx_ops.reg_program_default_cc = + ucfg_reg_program_default_cc; + + rx_ops->reg_rx_ops.reg_get_current_regdomain = + wlan_reg_get_curr_regdomain; } #ifdef CONVERGED_P2P_ENABLE diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index 4ce923b86046..ce73b50ec446 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -96,6 +96,7 @@ enum channel_state wlan_reg_get_channel_state(struct wlan_objmgr_pdev *pdev, /** * wlan_reg_get_5g_bonded_channel_state() - Get 5G bonded channel state + * @pdev: The physical dev to program country code or regdomain * @ch: channel number. * @bw: channel band width * @@ -107,7 +108,9 @@ enum channel_state wlan_reg_get_5g_bonded_channel_state( /** * wlan_reg_get_2g_bonded_channel_state() - Get 2G bonded channel state + * @pdev: The physical dev to program country code or regdomain * @ch: channel number. + * @sec_ch: Secondary channel. * @bw: channel band width * * Return: channel state @@ -118,7 +121,9 @@ enum channel_state wlan_reg_get_2g_bonded_channel_state( /** * wlan_reg_set_channel_params () - Sets channel parameteres for given bandwidth + * @pdev: The physical dev to program country code or regdomain * @ch: channel number. + * @sec_ch_2g: Secondary channel. * @ch_params: pointer to the channel parameters. * * Return: None @@ -325,6 +330,7 @@ bool wlan_reg_is_disable_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan); /** * wlan_reg_freq_to_chan () - convert channel freq to channel number + * @pdev: The physical dev to set current country for * @freq: frequency * * Return: true or false diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h index e889fa8d326e..29affaae22b7 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -129,6 +129,13 @@ QDF_STATUS ucfg_reg_program_default_cc(struct wlan_objmgr_pdev *pdev, QDF_STATUS ucfg_reg_program_cc(struct wlan_objmgr_pdev *pdev, struct cc_regdmn_s *rd); +/** + * ucfg_reg_get_current_cc() - get current country code or regdomain + * @pdev: The physical dev to program country code or regdomain + * @rd: Pointer to country code or regdomain + * + * Return: QDF_STATUS + */ QDF_STATUS ucfg_reg_get_current_cc(struct wlan_objmgr_pdev *pdev, struct cc_regdmn_s *rd);