From ddcd9fbf2e375ae412d209cb97c762eb32d129df Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Tue, 29 Oct 2019 12:35:42 -0700 Subject: [PATCH] qcacmn: Initialize channel_map at time of regulatory init A component can register callback with regulatory component before channel list is available.Therefore initialize channel map at time of regulatory init. Also, call callback when pdev current channel list is computed, at time of nol channel update. Change-Id: I551e0ea3391710538f694c50fa7dc6f795f3196c CRs-Fixed: 2555403 --- umac/regulatory/core/src/reg_services_common.c | 17 +++++++++++------ umac/regulatory/core/src/reg_services_common.h | 5 +++++ .../dispatcher/src/wlan_reg_services_api.c | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 51584f1d2582..58d3b2d8accd 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -169,7 +169,7 @@ static const enum phy_ch_width get_next_lower_bw[] = { [CH_WIDTH_5MHZ] = CH_WIDTH_INVALID }; -static const struct chan_map channel_map_us[NUM_CHANNELS] = { +const struct chan_map channel_map_us[NUM_CHANNELS] = { [CHAN_ENUM_2412] = {2412, 1, 20, 40}, [CHAN_ENUM_2417] = {2417, 2, 20, 40}, [CHAN_ENUM_2422] = {2422, 3, 20, 40}, @@ -332,7 +332,7 @@ static const struct chan_map channel_map_us[NUM_CHANNELS] = { #endif /* CONFIG_BAND_6GHZ */ }; -static const struct chan_map channel_map_eu[NUM_CHANNELS] = { +const struct chan_map channel_map_eu[NUM_CHANNELS] = { [CHAN_ENUM_2412] = {2412, 1, 20, 40}, [CHAN_ENUM_2417] = {2417, 2, 20, 40}, [CHAN_ENUM_2422] = {2422, 3, 20, 40}, @@ -495,7 +495,7 @@ static const struct chan_map channel_map_eu[NUM_CHANNELS] = { #endif /* CONFIG_BAND_6GHZ */ }; -static const struct chan_map channel_map_jp[NUM_CHANNELS] = { +const struct chan_map channel_map_jp[NUM_CHANNELS] = { [CHAN_ENUM_2412] = {2412, 1, 20, 40}, [CHAN_ENUM_2417] = {2417, 2, 20, 40}, [CHAN_ENUM_2422] = {2422, 3, 20, 40}, @@ -658,7 +658,7 @@ static const struct chan_map channel_map_jp[NUM_CHANNELS] = { #endif /* CONFIG_BAND_6GHZ */ }; -static const struct chan_map channel_map_global[NUM_CHANNELS] = { +const struct chan_map channel_map_global[NUM_CHANNELS] = { [CHAN_ENUM_2412] = {2412, 1, 20, 40}, [CHAN_ENUM_2417] = {2417, 2, 20, 40}, [CHAN_ENUM_2422] = {2422, 3, 20, 40}, @@ -821,7 +821,7 @@ static const struct chan_map channel_map_global[NUM_CHANNELS] = { #endif /* CONFIG_BAND_6GHZ */ }; -static const struct chan_map channel_map_china[NUM_CHANNELS] = { +const struct chan_map channel_map_china[NUM_CHANNELS] = { [CHAN_ENUM_2412] = {2412, 1, 20, 40}, [CHAN_ENUM_2417] = {2417, 2, 20, 40}, [CHAN_ENUM_2422] = {2422, 3, 20, 40}, @@ -3288,6 +3288,7 @@ void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev, enum channel_enum chan_enum; struct regulatory_channel *mas_chan_list; struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj; + struct wlan_objmgr_psoc *psoc; uint16_t i; if (!num_chan || !chan_freq_list) { @@ -3295,9 +3296,11 @@ void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev, return; } + psoc = wlan_pdev_get_psoc(pdev); + pdev_priv_obj = reg_get_pdev_obj(pdev); if (!pdev_priv_obj) { - reg_err("reg psoc private obj is NULL"); + reg_err("reg pdev private obj is NULL"); return; } @@ -3313,6 +3316,8 @@ void reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev, } reg_compute_pdev_current_chan_list(pdev_priv_obj); + + reg_send_scheduler_msg_sb(psoc, pdev); } void reg_update_nol_history_ch_for_freq(struct wlan_objmgr_pdev *pdev, diff --git a/umac/regulatory/core/src/reg_services_common.h b/umac/regulatory/core/src/reg_services_common.h index fac28cdcda32..4dc70312ca01 100644 --- a/umac/regulatory/core/src/reg_services_common.h +++ b/umac/regulatory/core/src/reg_services_common.h @@ -104,6 +104,11 @@ #define COUNTRY_ERD_FLAG 0x8000 extern const struct chan_map *channel_map; +extern const struct chan_map channel_map_us[]; +extern const struct chan_map channel_map_eu[]; +extern const struct chan_map channel_map_jp[]; +extern const struct chan_map channel_map_china[]; +extern const struct chan_map channel_map_global[]; #ifdef CONFIG_CHAN_NUM_API /** diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index f66f67b718d5..13eb907e2a3b 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -344,6 +344,8 @@ QDF_STATUS wlan_regulatory_init(void) reg_debug("regulatory handlers registered with obj mgr"); + channel_map = channel_map_global; + return status; unreg_pdev_create: