From 72697bdc049280c6e46ef0b98e867443b577e07e Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Wed, 20 Dec 2017 09:24:25 +0800 Subject: [PATCH] qcacld-3.0: Add ini hostscan_adaptive_dwell_mode_no_conn This ini will set the algo used in dwell time optimization during host scan without connection. Change-Id: Ie81636d32b6c42651aa9b5de52889970c17f6aca CRs-Fixed: 2159656 --- core/hdd/inc/wlan_hdd_cfg.h | 41 +++++++++++++++++++++++++++++---- core/hdd/src/wlan_hdd_cfg.c | 12 ++++++++++ core/sme/inc/csr_api.h | 1 + core/sme/inc/csr_internal.h | 1 + core/sme/src/csr/csr_api_roam.c | 4 ++++ core/sme/src/csr/csr_api_scan.c | 8 ++++++- 6 files changed, 62 insertions(+), 5 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index bb8922db4c88..f6e7cb10eb8c 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1309,13 +1309,14 @@ enum hdd_dot11_mode { /* * * hostscan_adaptive_dwell_mode - Enable adaptive dwell mode - * during host scan + * during host scan with conneciton * @Min: 0 * @Max: 4 - * @Default: 1 + * @Default: 2 * * This ini will set the algo used in dwell time optimization - * during host scan. see enum wmi_dwelltime_adaptive_mode. + * during host scan with connection. + * See enum wmi_dwelltime_adaptive_mode. * Acceptable values for this: * 0: Default (Use firmware default mode) * 1: Conservative optimization @@ -1334,7 +1335,38 @@ enum hdd_dot11_mode { #define CFG_ADAPTIVE_SCAN_DWELL_MODE_NAME "hostscan_adaptive_dwell_mode" #define CFG_ADAPTIVE_SCAN_DWELL_MODE_MIN (0) #define CFG_ADAPTIVE_SCAN_DWELL_MODE_MAX (4) -#define CFG_ADAPTIVE_SCAN_DWELL_MODE_DEFAULT (1) +#define CFG_ADAPTIVE_SCAN_DWELL_MODE_DEFAULT (2) + +/* + * + * hostscan_adaptive_dwell_mode_no_conn - Enable adaptive dwell mode + * during host scan without connection + * @Min: 0 + * @Max: 4 + * @Default: 1 + * + * This ini will set the algo used in dwell time optimization + * during host scan without connection. + * See enum wmi_dwelltime_adaptive_mode. + * Acceptable values for this: + * 0: Default (Use firmware default mode) + * 1: Conservative optimization + * 2: Moderate optimization + * 3: Aggressive optimization + * 4: Static + * + * Related: None + * + * Supported Feature: Scan + * + * Usage: External + * + * + */ +#define CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_NAME "hostscan_adaptive_dwell_mode_no_conn" +#define CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_MIN (0) +#define CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_MAX (4) +#define CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_DEFAULT (1) /* * @@ -14626,6 +14658,7 @@ struct hdd_config { uint8_t dp_trace_config[DP_TRACE_CONFIG_STRING_LENGTH]; bool adaptive_dwell_mode_enabled; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; + enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode extscan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode pnoscan_adaptive_dwell_mode; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index e70265b21f05..d0773913fc95 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4272,6 +4272,13 @@ struct reg_table_entry g_registry_table[] = { CFG_ADAPTIVE_SCAN_DWELL_MODE_MIN, CFG_ADAPTIVE_SCAN_DWELL_MODE_MAX), + REG_VARIABLE(CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_NAME, WLAN_PARAM_Integer, + struct hdd_config, scan_adaptive_dwell_mode_nc, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_DEFAULT, + CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_MIN, + CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_MAX), + REG_VARIABLE(CFG_ADAPTIVE_ROAMSCAN_DWELL_MODE_NAME, WLAN_PARAM_Integer, struct hdd_config, roamscan_adaptive_dwell_mode, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -6966,6 +6973,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_debug("Name = [%s] Value = [%u]", CFG_ADAPTIVE_SCAN_DWELL_MODE_NAME, hdd_ctx->config->scan_adaptive_dwell_mode); + hdd_debug("Name = [%s] Value = [%u]", + CFG_ADAPTIVE_SCAN_DWELL_MODE_NC_NAME, + hdd_ctx->config->scan_adaptive_dwell_mode_nc); hdd_debug("Name = [%s] Value = [%u]", CFG_ADAPTIVE_ROAMSCAN_DWELL_MODE_NAME, hdd_ctx->config->roamscan_adaptive_dwell_mode); @@ -8942,6 +8952,8 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) pConfig->enable_fatal_event; smeConfig->csrConfig.scan_adaptive_dwell_mode = hdd_ctx->config->scan_adaptive_dwell_mode; + smeConfig->csrConfig.scan_adaptive_dwell_mode_nc = + hdd_ctx->config->scan_adaptive_dwell_mode_nc; smeConfig->csrConfig.roamscan_adaptive_dwell_mode = hdd_ctx->config->roamscan_adaptive_dwell_mode; diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 2bfb05bd1ec7..d55199c758d9 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1328,6 +1328,7 @@ typedef struct tagCsrConfigParam { uint32_t edca_be_aifs; bool enable_fatal_event; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; + enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy_params; uint32_t tx_aggregation_size; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 7a37304f2620..bde799d7fc42 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -610,6 +610,7 @@ struct csr_config { bool enable_fatal_event; bool vendor_vht_sap; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; + enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy; uint32_t tx_aggregation_size; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 070bb0d9008f..9a570596eaf6 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2857,6 +2857,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.scan_adaptive_dwell_mode = pParam->scan_adaptive_dwell_mode; + pMac->roam.configParam.scan_adaptive_dwell_mode_nc = + pParam->scan_adaptive_dwell_mode_nc; pMac->roam.configParam.roamscan_adaptive_dwell_mode = pParam->roamscan_adaptive_dwell_mode; @@ -3124,6 +3126,8 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->scan_adaptive_dwell_mode = cfg_params->scan_adaptive_dwell_mode; + pParam->scan_adaptive_dwell_mode_nc = + cfg_params->scan_adaptive_dwell_mode_nc; pParam->roamscan_adaptive_dwell_mode = cfg_params->roamscan_adaptive_dwell_mode; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index eb879c3900cb..86e63976ffb1 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -571,7 +571,13 @@ QDF_STATUS csr_scan_request(tpAniSirGlobal pMac, uint16_t sessionId, sme_debug("updating dwell time for first scan %u", scan_req->maxChnTime); } - scan_req->scan_adaptive_dwell_mode = cfg_prm->scan_adaptive_dwell_mode; + + if (csr_is_conn_state_disconnected(pMac, sessionId)) + scan_req->scan_adaptive_dwell_mode = + cfg_prm->scan_adaptive_dwell_mode_nc; + else + scan_req->scan_adaptive_dwell_mode = + cfg_prm->scan_adaptive_dwell_mode; status = csr_scan_copy_request(pMac, &scan_cmd->u.scanCmd.u.scanRequest, scan_req);