diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 39f0f2d014bd..10b6c72a8331 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -463,6 +463,25 @@ typedef enum { #define CFG_REST_TIME_CONC_MAX (10000) #define CFG_REST_TIME_CONC_DEFAULT (100) +/* Mininum time spent on home channel before moving to a new channel to scan */ +#define CFG_MIN_REST_TIME_NAME "gMinRestTimeConc" +#define CFG_MIN_REST_TIME_MIN (0) +#define CFG_MIN_REST_TIME_MAX (50) +#define CFG_MIN_REST_TIME_DEFAULT (50) + +/* Data inactivity time in msec on bss channel that will be used + * by scan engine in firmware. + * for example if this value is 25ms then firmware will check for + * data inactivity every 25ms till gRestTimeConc is reached. + * If inactive then scan engine will move from home channel to + * scan the next frequency. + */ +#define CFG_IDLE_TIME_NAME "gIdleTimeConc" +#define CFG_IDLE_TIME_MIN (0) +#define CFG_IDLE_TIME_MAX (25) +#define CFG_IDLE_TIME_DEFAULT (25) + + #define CFG_NUM_STA_CHAN_COMBINED_CONC_NAME "gNumStaChanCombinedConc" #define CFG_NUM_STA_CHAN_COMBINED_CONC_MIN (1) #define CFG_NUM_STA_CHAN_COMBINED_CONC_MAX (255) @@ -3111,6 +3130,10 @@ struct hdd_config { uint32_t nActiveMinChnTimeConc; /* in units of milliseconds */ uint32_t nActiveMaxChnTimeConc; /* in units of milliseconds */ uint32_t nRestTimeConc; /* in units of milliseconds */ + /* In units of milliseconds */ + uint32_t min_rest_time_conc; + /* In units of milliseconds */ + uint32_t idle_time_conc; uint8_t nNumStaChanCombinedConc; /* number of channels combined for */ /* STA in each split scan operation */ uint8_t nNumP2PChanCombinedConc; /* number of channels combined for */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 6cf3949a18dc..e5a3164a9443 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -803,6 +803,20 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_REST_TIME_CONC_MIN, CFG_REST_TIME_CONC_MAX), + REG_VARIABLE(CFG_MIN_REST_TIME_NAME, WLAN_PARAM_Integer, + struct hdd_config, min_rest_time_conc, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_MIN_REST_TIME_DEFAULT, + CFG_MIN_REST_TIME_MIN, + CFG_MIN_REST_TIME_MAX), + + REG_VARIABLE(CFG_IDLE_TIME_NAME , WLAN_PARAM_Integer, + struct hdd_config, idle_time_conc, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_IDLE_TIME_DEFAULT, + CFG_IDLE_TIME_MIN, + CFG_IDLE_TIME_MAX) , + REG_VARIABLE(CFG_NUM_STA_CHAN_COMBINED_CONC_NAME, WLAN_PARAM_Integer, struct hdd_config, nNumStaChanCombinedConc, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5378,6 +5392,13 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%u]", CFG_ROAM_DENSE_MIN_APS, pHddCtx->config->roam_dense_min_aps); + hdd_info("Name = [%s] Value = [%u]", + CFG_MIN_REST_TIME_NAME, + pHddCtx->config->min_rest_time_conc); + hdd_info("Name = [%s] Value = [%u]", + CFG_IDLE_TIME_NAME, + pHddCtx->config->idle_time_conc); + } @@ -6649,6 +6670,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) smeConfig->csrConfig.nPassiveMinChnTimeConc = pConfig->nPassiveMinChnTimeConc; smeConfig->csrConfig.nRestTimeConc = pConfig->nRestTimeConc; + smeConfig->csrConfig.min_rest_time_conc = pConfig->min_rest_time_conc; + smeConfig->csrConfig.idle_time_conc = pConfig->idle_time_conc; smeConfig->csrConfig.nNumStaChanCombinedConc = pConfig->nNumStaChanCombinedConc; smeConfig->csrConfig.nNumP2PChanCombinedConc = diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 0a58715270b2..7cb2188783c3 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -778,6 +778,10 @@ typedef struct sSirSmeScanReq { */ /* in units of milliseconds, ignored when not connected */ uint32_t restTime; + /*in units of milliseconds, ignored when not connected*/ + uint32_t min_rest_time; + /*in units of milliseconds, ignored when not connected*/ + uint32_t idle_time; uint8_t returnAfterFirstMatch; /** @@ -3583,6 +3587,10 @@ typedef struct sSirScanOffloadReq { uint32_t scan_requestor_id; /* in units of milliseconds, ignored when not connected */ uint32_t restTime; + /*in units of milliseconds, ignored when not connected*/ + uint32_t min_rest_time; + /*in units of milliseconds, ignored when not connected*/ + uint32_t idle_time; tSirP2pScanType p2pScanType; uint16_t uIEFieldLen; uint16_t uIEFieldOffset; diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index be7feaeb14da..7e34ab80affe 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -1298,6 +1298,8 @@ static QDF_STATUS lim_send_hal_start_scan_offload_req(tpAniSirGlobal pMac, pScanOffloadReq->minChannelTime = pScanReq->minChannelTime; pScanOffloadReq->maxChannelTime = pScanReq->maxChannelTime; pScanOffloadReq->restTime = pScanReq->restTime; + pScanOffloadReq->min_rest_time = pScanReq->min_rest_time; + pScanOffloadReq->idle_time = pScanReq->idle_time; /* for normal scan, the value for p2pScanType should be 0 always */ diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 3b74d5ef9a08..802afc321f1d 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -270,7 +270,12 @@ typedef struct tagCsrScanRequest { tCsrChannelInfo ChannelInfo; uint32_t minChnTime; /* in units of milliseconds */ uint32_t maxChnTime; /* in units of milliseconds */ - uint32_t restTime; /* in units of milliseconds */ + /* In units of milliseconds, ignored when not connected */ + uint32_t restTime; + /* In units of milliseconds, ignored when not connected */ + uint32_t min_rest_time; + /* In units of milliseconds, ignored when not connected */ + uint32_t idle_time; uint32_t uIEFieldLen; uint8_t *pIEField; eCsrRequestType requestType; /* 11d scan or full scan */ @@ -1094,6 +1099,11 @@ typedef struct tagCsrConfigParam { /* number of channels combined for P2P in each split scan operation */ uint8_t nNumP2PChanCombinedConc; #endif + /*In units of milliseconds*/ + uint32_t min_rest_time_conc; + /*In units of milliseconds*/ + uint32_t idle_time_conc; + /* * in dBm, the maximum TX power The actual TX power is the lesser of * this value and 11d. If 11d is disable, the lesser of this and diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 4ed2c5597b42..17c806f2c585 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -283,7 +283,12 @@ typedef struct tagCsrChannel { typedef struct tagScanProfile { uint32_t minChnTime; uint32_t maxChnTime; - uint32_t restTime; /* This is ignored if not associated */ + /* In units of milliseconds, ignored when not connected */ + uint32_t restTime; + /* In units of milliseconds, ignored when not connected */ + uint32_t min_rest_time; + /* In units of milliseconds, ignored when not connected */ + uint32_t idle_time; uint32_t numOfChannels; uint8_t *pChannelList; tSirScanType scanType; @@ -545,6 +550,11 @@ typedef struct tagCsrConfig { uint32_t nActiveMinChnTimeConc; /* in units of milliseconds */ uint32_t nActiveMaxChnTimeConc; /* in units of milliseconds */ uint32_t nRestTimeConc; /* in units of milliseconds */ + /* In units of milliseconds */ + uint32_t min_rest_time_conc; + /* In units of milliseconds */ + uint32_t idle_time_conc; + /* number of channels combined for Sta in each split scan operation */ uint8_t nNumStaChanCombinedConc; /* number of channels combined for P2P in each split scan operation */ diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 4e921b45b316..0326f313a30c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1292,6 +1292,8 @@ static void init_config_param(tpAniSirGlobal pMac) pMac->roam.configParam.nPassiveMinChnTimeConc = CSR_PASSIVE_MIN_CHANNEL_TIME_CONC; pMac->roam.configParam.nRestTimeConc = CSR_REST_TIME_CONC; + pMac->roam.configParam.min_rest_time_conc = CSR_MIN_REST_TIME_CONC; + pMac->roam.configParam.idle_time_conc = CSR_IDLE_TIME_CONC; pMac->roam.configParam.nNumStaChanCombinedConc = CSR_NUM_STA_CHAN_COMBINED_CONC; pMac->roam.configParam.nNumP2PChanCombinedConc = @@ -2057,10 +2059,11 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.nPassiveMinChnTimeConc = pParam->nPassiveMinChnTimeConc; } - if (pParam->nRestTimeConc) { - pMac->roam.configParam.nRestTimeConc = - pParam->nRestTimeConc; - } + pMac->roam.configParam.nRestTimeConc = pParam->nRestTimeConc; + pMac->roam.configParam.min_rest_time_conc = + pParam->min_rest_time_conc; + pMac->roam.configParam.idle_time_conc = pParam->idle_time_conc; + if (pParam->nNumStaChanCombinedConc) { pMac->roam.configParam.nNumStaChanCombinedConc = pParam->nNumStaChanCombinedConc; @@ -2400,6 +2403,8 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->nPassiveMaxChnTimeConc = cfg_params->nPassiveMaxChnTimeConc; pParam->nPassiveMinChnTimeConc = cfg_params->nPassiveMinChnTimeConc; pParam->nRestTimeConc = cfg_params->nRestTimeConc; + pParam->min_rest_time_conc = cfg_params->min_rest_time_conc; + pParam->idle_time_conc = cfg_params->idle_time_conc; pParam->nNumStaChanCombinedConc = cfg_params->nNumStaChanCombinedConc; pParam->nNumP2PChanCombinedConc = cfg_params->nNumP2PChanCombinedConc; #endif diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index dd76c63f3ebc..299fb641d367 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -256,6 +256,11 @@ static void csr_set_default_scan_timing(tpAniSirGlobal pMac, tSirScanType scanTy } pScanRequest->restTime = pMac->roam.configParam.nRestTimeConc; + pScanRequest->min_rest_time = + pMac->roam.configParam.min_rest_time_conc; + pScanRequest->idle_time = + pMac->roam.configParam.idle_time_conc; + /* Return so that fields set above will not be overwritten. */ return; } @@ -278,8 +283,12 @@ static void csr_set_default_scan_timing(tpAniSirGlobal pMac, tSirScanType scanTy pMac->roam.configParam.nPassiveMinChnTime; } #ifdef WLAN_AP_STA_CONCURRENCY - /* No rest time if no sessions are connected. */ + + /* No rest time/Idle time if no sessions are connected. */ pScanRequest->restTime = 0; + pScanRequest->min_rest_time = 0; + pScanRequest->idle_time = 0; + #endif } @@ -546,9 +555,14 @@ QDF_STATUS csr_scan_request(tpAniSirGlobal pMac, uint16_t sessionId, scan_req->minChnTime, scan_req->maxChnTime); } #ifdef WLAN_AP_STA_CONCURRENCY - /* Need to set restTime only if at least one session is connected */ + /* + * Need to set restTime/min_Ret_time/idle_time + * only if at least one session is connected + */ if (scan_req->restTime == 0 && csr_is_any_session_connected(pMac)) { scan_req->restTime = cfg_prm->nRestTimeConc; + scan_req->min_rest_time = cfg_prm->min_rest_time_conc; + scan_req->idle_time = cfg_prm->idle_time_conc; if (scan_req->scanType == eSIR_ACTIVE_SCAN) { scan_req->maxChnTime = cfg_prm->nActiveMaxChnTimeConc; scan_req->minChnTime = cfg_prm->nActiveMinChnTimeConc; @@ -4984,8 +4998,12 @@ QDF_STATUS csr_send_mb_scan_req(tpAniSirGlobal pMac, uint16_t sessionId, pMsg->maxChannelTime = maxChnTime; /* hidden SSID option */ pMsg->hiddenSsid = pScanReqParam->hiddenSsid; - /* rest time */ + /* maximum rest time */ pMsg->restTime = pScanReq->restTime; + /* Minimum rest time */ + pMsg->min_rest_time = pScanReq->min_rest_time; + /* Idle time */ + pMsg->idle_time = pScanReq->idle_time; pMsg->returnAfterFirstMatch = pScanReqParam->bReturnAfter1stMatch; /* All the scan results caching will be done by Roaming */ /* We do not want LIM to do any caching of scan results, */ diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index 829c4f604b64..5537bf317f39 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -53,6 +53,8 @@ #define CSR_ACTIVE_MIN_CHANNEL_TIME_CONC 20 #define CSR_REST_TIME_CONC 100 +#define CSR_MIN_REST_TIME_CONC 50 +#define CSR_IDLE_TIME_CONC 25 #define CSR_NUM_STA_CHAN_COMBINED_CONC 3 #define CSR_NUM_P2P_CHAN_COMBINED_CONC 1 diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 49523a706044..841b04e8acb8 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -239,19 +239,21 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cmd->repeat_probe_time = cmd->dwell_time_active / WMA_SCAN_NPROBES_DEFAULT; - /* CSR sends only one value restTime for staying on home channel - * to continue data traffic. Rome fw has facility to monitor the traffic - * and move to next channel. Stay on the channel for at least half - * of the requested time and then leave if there is no traffic. + /* CSR sends min_rest_Time, max_rest_time and idle_time + * for staying on home channel to continue data traffic. + * Rome fw has facility to monitor the traffic + * and move to next channel. Stay on the channel for min_rest_time + * and then leave if there is no traffic. */ - cmd->min_rest_time = scan_req->restTime / 2; + cmd->min_rest_time = scan_req->min_rest_time; cmd->max_rest_time = scan_req->restTime; /* Check for traffic at idle_time interval after min_rest_time. * Default value is 25 ms to allow full use of max_rest_time * when voice packets are running at 20 ms interval. */ - cmd->idle_time = WMA_SCAN_IDLE_TIME_DEFAULT; + cmd->idle_time = scan_req->idle_time; + /* Large timeout value for full scan cycle, 30 seconds */ cmd->max_scan_time = WMA_HW_DEF_SCAN_MAX_DURATION;