From f8d599b48d3d4b130bf2dc2bad54c7ec2c079761 Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Mon, 2 Mar 2020 12:24:24 +0530 Subject: [PATCH] qcacld-3.0: Add INI support for DFS Channel Ageout Time Add ini support for DFS Channel Ageout Time, the time upto which DFS channel information such as beacon found is remembered. This ini is used to set the ageout timer value from host to FW. If not set, FW will disable ageout time. This value is sent as a WMI_PDEV_PARAM_SET_DFS_CHAN_AGEOUT_TIME as part of WMI_PDEV_SET_PARAM_CMDID. Change-Id: I99553fa87a4025f03c52b4b387a414ba06c2c457 CRs-Fixed: 2625996 --- components/mlme/core/src/wlan_mlme_main.c | 2 ++ .../mlme/dispatcher/inc/cfg_mlme_generic.h | 28 +++++++++++++++++-- .../mlme/dispatcher/inc/wlan_mlme_api.h | 11 ++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ .../mlme/dispatcher/src/wlan_mlme_api.c | 19 +++++++++++++ core/hdd/src/wlan_hdd_main.c | 12 +++++++- 6 files changed, 71 insertions(+), 3 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index bae4e4a849c19..7f56e30bdb0e7 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -321,6 +321,8 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc, gen->enable_ring_buffer = cfg_get(psoc, CFG_ENABLE_RING_BUFFER); gen->enable_peer_unmap_conf_support = cfg_get(psoc, CFG_DP_ENABLE_PEER_UMAP_CONF_SUPPORT); + gen->dfs_chan_ageout_time = + cfg_get(psoc, CFG_DFS_CHAN_AGEOUT_TIME); } static void mlme_init_edca_ani_cfg(struct wlan_mlme_edca_params *edca_params) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index e302f690b3982..08dfba2ee7d0a 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 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 @@ -687,6 +687,29 @@ 1, \ "To Enable Ring Buffer") +/* + * + * dfs_chan_ageout_time - Set DFS Channel ageout time(in seconds) + * @Min: 0 + * @Max: 8 + * Default: 0 + * + * Ageout time is the time upto which DFS channel information such as beacon + * found is remembered. So that Firmware performs Active scan instead of the + * Passive to reduce the Dwell time. + * This ini Parameter used to set ageout timer value from host to FW. + * If not set, Firmware will disable ageout time. + * + * Supported Feature: STA scan in DFS channels + * + * Usage: External + * + * + */ +#define CFG_DFS_CHAN_AGEOUT_TIME CFG_INI_UINT("dfs_chan_ageout_time", \ + 0, 8, 0, CFG_VALUE_OR_DEFAULT, \ + "Set DFS Channel ageout time from host to firmware") + #define CFG_GENERIC_ALL \ CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \ CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \ @@ -716,5 +739,6 @@ CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD) \ CFG(CFG_MGMT_RETRY_MAX) \ CFG(CFG_BMISS_SKIP_FULL_SCAN) \ - CFG(CFG_ENABLE_RING_BUFFER) + CFG(CFG_ENABLE_RING_BUFFER) \ + CFG(CFG_DFS_CHAN_AGEOUT_TIME) #endif /* __CFG_MLME_GENERIC_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 086bc5bf33f73..73c83a2a822cb 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2476,4 +2476,15 @@ uint32_t wlan_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc) } #endif +/** + * wlan_mlme_get_dfs_chan_ageout_time() - Get the DFS Channel ageout time + * @psoc: pointer to psoc object + * @dfs_chan_ageout_time: output pointer to hold configured value of DFS + * Channel ageout time + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_dfs_chan_ageout_time(struct wlan_objmgr_psoc *psoc, + uint8_t *dfs_chan_ageout_time); #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 39f08a1f0c776..3b9cd188debd3 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1129,6 +1129,7 @@ struct wlan_mlme_chainmask { * candidate is found in partial scan based on channel map * @enable_ring_buffer: Decide to enable/disable ring buffer for bug report * @enable_peer_unmap_conf_support: Indicate whether to send conf for peer unmap + * @dfs_chan_ageout_time: Set DFS Channel ageout time */ struct wlan_mlme_generic { enum band_info band_capability; @@ -1164,6 +1165,7 @@ struct wlan_mlme_generic { bool bmiss_skip_full_scan; bool enable_ring_buffer; bool enable_peer_unmap_conf_support; + uint8_t dfs_chan_ageout_time; }; /* diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 2407a772b77e4..931ab4f24472b 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3865,3 +3865,22 @@ uint32_t wlan_mlme_get_roaming_triggers(struct wlan_objmgr_psoc *psoc) return mlme_obj->cfg.lfr.roam_trigger_bitmap; } #endif + +QDF_STATUS +wlan_mlme_get_dfs_chan_ageout_time(struct wlan_objmgr_psoc *psoc, + uint8_t *dfs_chan_ageout_time) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + + if (!mlme_obj) { + *dfs_chan_ageout_time = + cfg_default(CFG_DFS_CHAN_AGEOUT_TIME); + return QDF_STATUS_E_FAILURE; + } + + *dfs_chan_ageout_time = mlme_obj->cfg.gen.dfs_chan_ageout_time; + + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 973f8687c1a42..c8e3e21a73645 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5505,7 +5505,7 @@ int hdd_set_fw_params(struct hdd_adapter *adapter) QDF_STATUS status; struct hdd_context *hdd_ctx; bool bval = false; - uint8_t enable_tx_sch_delay; + uint8_t enable_tx_sch_delay, dfs_chan_ageout_time; uint32_t dtim_sel_diversity, enable_secondary_rate; hdd_enter_dev(adapter->dev); @@ -5567,6 +5567,16 @@ int hdd_set_fw_params(struct hdd_adapter *adapter) goto error; } + wlan_mlme_get_dfs_chan_ageout_time(hdd_ctx->psoc, + &dfs_chan_ageout_time); + ret = sme_cli_set_command(adapter->vdev_id, + WMI_PDEV_PARAM_SET_DFS_CHAN_AGEOUT_TIME, + dfs_chan_ageout_time, PDEV_CMD); + if (ret) { + hdd_err("Failed to set DFS_CHAN_AGEOUT_TIME"); + goto error; + } + if (adapter->device_mode == QDF_STA_MODE) { status = ucfg_get_upper_brssi_thresh(hdd_ctx->psoc, &upper_brssi_thresh);