From f318f04a8390f5df1f71686d985ad7b3db974202 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Wed, 1 Aug 2018 13:41:46 -0700 Subject: [PATCH] qcacmn: Enable 11d in WORLD mode In WORLD mode, there can be urgency to discover the current country since WORLD mode restricts the channel and TX power availability. Therefore, enhance 11d state machine to enable 11d in world mode. Use INI configuration parameter enable_11d_in_world_mode to decide whether to enable 11d in world mode automatically. CRs-Fixed: 2289358 Change-Id: I8a4e1f6c74acb5ac1faec8f98840bf66c3d9a3f7 --- umac/regulatory/core/src/reg_priv.h | 1 + umac/regulatory/core/src/reg_services.c | 20 +++++++++++++++---- .../inc/reg_services_public_struct.h | 2 ++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/umac/regulatory/core/src/reg_priv.h b/umac/regulatory/core/src/reg_priv.h index 89f6dbb2f9..5966fcce30 100644 --- a/umac/regulatory/core/src/reg_priv.h +++ b/umac/regulatory/core/src/reg_priv.h @@ -88,6 +88,7 @@ struct wlan_regulatory_psoc_priv_obj { reg_cap[PSOC_MAX_PHY_REG_CAP]; bool force_ssc_disable_indoor_channel; bool enable_srd_chan_in_master_mode; + bool enable_11d_in_world_mode; qdf_spinlock_t cbk_list_lock; }; diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 1afa81ea1d..26b3b9dcec 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -2962,6 +2962,7 @@ static void reg_run_11d_state_machine(struct wlan_objmgr_psoc *psoc) { bool temp_11d_support; struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + bool world_mode; psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_REGULATORY); @@ -2970,10 +2971,14 @@ static void reg_run_11d_state_machine(struct wlan_objmgr_psoc *psoc) return; } + world_mode = reg_is_world_alpha2(psoc_priv_obj->cur_country); + temp_11d_support = psoc_priv_obj->enable_11d_supp; - if (((psoc_priv_obj->user_ctry_set) && - (psoc_priv_obj->user_ctry_priority)) || - (psoc_priv_obj->master_vdev_cnt)) + if ((psoc_priv_obj->enable_11d_in_world_mode) && (world_mode)) + psoc_priv_obj->enable_11d_supp = true; + else if (((psoc_priv_obj->user_ctry_set) && + (psoc_priv_obj->user_ctry_priority)) || + (psoc_priv_obj->master_vdev_cnt)) psoc_priv_obj->enable_11d_supp = false; else psoc_priv_obj->enable_11d_supp = @@ -3142,15 +3147,19 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info soc_reg->new_11d_ctry_pending = false; soc_reg->cc_src = SOURCE_11D; soc_reg->user_ctry_set = false; + reg_run_11d_state_machine(psoc); } else if (soc_reg->world_country_pending == true) { soc_reg->world_country_pending = false; soc_reg->cc_src = SOURCE_CORE; soc_reg->user_ctry_set = false; + reg_run_11d_state_machine(psoc); } else { soc_reg->cc_src = SOURCE_DRIVER; - if (reg_is_world_alpha2(regulat_info->alpha2)) + if (reg_is_world_alpha2(regulat_info->alpha2)) { soc_reg->cc_src = SOURCE_CORE; + reg_run_11d_state_machine(psoc); + } qdf_mem_copy(soc_reg->mas_chan_params[phy_id].default_country, regulat_info->alpha2, @@ -3216,6 +3225,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification( soc_reg_obj->vdev_cnt_11d = 0; soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART; soc_reg_obj->enable_srd_chan_in_master_mode = false; + soc_reg_obj->enable_11d_in_world_mode = true; for (i = 0; i < MAX_STA_VDEV_CNT; i++) soc_reg_obj->vdev_ids_11d[i] = INVALID_VDEV_ID; @@ -3954,6 +3964,8 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc, psoc_priv_obj->restart_beaconing = config_vars.restart_beaconing; psoc_priv_obj->enable_srd_chan_in_master_mode = config_vars.enable_srd_chan_in_master_mode; + psoc_priv_obj->enable_11d_in_world_mode = + config_vars.enable_11d_in_world_mode; status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID); if (QDF_IS_STATUS_ERROR(status)) { diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 69d55350cf..86f6539298 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -857,6 +857,7 @@ enum restart_beaconing_on_ch_avoid_rule { * @restart_beaconing: control the beaconing entity to move * away from active LTE channels * @enable_srd_chan_in_master_mode: SRD channel support in master mode + * @enable_11d_in_world_mode: enable 11d in world mode */ struct reg_config_vars { uint32_t enable_11d_support; @@ -868,6 +869,7 @@ struct reg_config_vars { uint32_t force_ssc_disable_indoor_channel; enum restart_beaconing_on_ch_avoid_rule restart_beaconing; bool enable_srd_chan_in_master_mode; + bool enable_11d_in_world_mode; }; /**