diff options
| author | Deepak Dhamdhere <ddhamdhe@qca.qualcomm.com> | 2014-02-27 15:44:01 -0800 |
|---|---|---|
| committer | Nandini Suresh <snandini@qca.qualcomm.com> | 2014-03-07 19:21:13 -0800 |
| commit | 89fb3a552f86948ef7742978637cc79648df9f01 (patch) | |
| tree | bee0fdf69988134871d8f0e37d589008e1d5f825 | |
| parent | 0ce22c095774d329498bacba284164d79b0945bf (diff) | |
qcacld: Add ini file parameters for beacon miss counts
Add WCNSS_qcom_cfg.ini file parameters for tuning the
beacon miss detection logic in Rome firmware.
gRoamBmissFirstBcnt - First beacon miss count threshold. Firmware
will perform opportunistic scan. Default value 10.
gRoamBmissFinalBcnt - Final beacon miss count threshold. Firmware
will scan all channels. Default value 10 (after first bmiss).
gRoamBeaconRssiWeight - Weight given for rssi of current beacon
in computing the average. Maximum is 16. Default weight
is 14 (approx. 87%).
Use the above parameters in WMI commands sent for scan
and roam configuration.
Change-Id: I805e51c18d6a12772633185ad593bacce1c718e0
CRs-Fixed: 621893
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 18 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 60 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 3 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 57 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 3 | ||||
| -rw-r--r-- | CORE/SME/inc/csrInternal.h | 3 | ||||
| -rw-r--r-- | CORE/SME/inc/csrNeighborRoam.h | 18 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 74 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 12 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrNeighborRoam.c | 182 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 153 |
11 files changed, 575 insertions, 8 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 047b8cbe8df1..f873aea88175 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1266,6 +1266,21 @@ typedef enum #define CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN (0) #define CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX (60000) #define CFG_EMPTY_SCAN_REFRESH_PERIOD_DEFAULT (0) + +#define CFG_ROAM_BMISS_FIRST_BCNT_NAME "gRoamBmissFirstBcnt" +#define CFG_ROAM_BMISS_FIRST_BCNT_MIN (5) +#define CFG_ROAM_BMISS_FIRST_BCNT_MAX (100) +#define CFG_ROAM_BMISS_FIRST_BCNT_DEFAULT (10) + +#define CFG_ROAM_BMISS_FINAL_BCNT_NAME "gRoamBmissFinalBcnt" +#define CFG_ROAM_BMISS_FINAL_BCNT_MIN (5) +#define CFG_ROAM_BMISS_FINAL_BCNT_MAX (100) +#define CFG_ROAM_BMISS_FINAL_BCNT_DEFAULT (10) + +#define CFG_ROAM_BEACON_RSSI_WEIGHT_NAME "gRoamBeaconRssiWeight" +#define CFG_ROAM_BEACON_RSSI_WEIGHT_MIN (0) +#define CFG_ROAM_BEACON_RSSI_WEIGHT_MAX (16) +#define CFG_ROAM_BEACON_RSSI_WEIGHT_DEFAULT (14) #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ #define CFG_QOS_WMM_BURST_SIZE_DEFN_NAME "burstSizeDefinition" @@ -2374,6 +2389,9 @@ typedef struct v_U16_t nMaxNeighborReqTries; v_U16_t nNeighborResultsRefreshPeriod; v_U16_t nEmptyScanRefreshPeriod; + v_U8_t nRoamBmissFirstBcnt; + v_U8_t nRoamBmissFinalBcnt; + v_U8_t nRoamBeaconRssiWeight; #endif //Additional Handoff params diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index ed84829dae7c..0f5a5e32f911 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -216,6 +216,30 @@ static void cbNotifySetNeighborScanMaxChanTime(hdd_context_t *pHddCtx, unsigned { sme_setNeighborScanMaxChanTime((tHalHandle)(pHddCtx->hHal), pHddCtx->cfg_ini->nNeighborScanMaxChanTime); } +static void cbNotifySetRoamBmissFirstBcnt(hdd_context_t *pHddCtx, + unsigned long NotifyId) +{ + /* + * at the point this routine is called, the value in the cfg_ini table + * has already been updated + */ + sme_SetRoamBmissFirstBcnt((tHalHandle)(pHddCtx->hHal), + pHddCtx->cfg_ini->nRoamBmissFirstBcnt); +} + +static void cbNotifySetRoamBmissFinalBcnt(hdd_context_t *pHddCtx, + unsigned long NotifyId) +{ + sme_SetRoamBmissFinalBcnt((tHalHandle)(pHddCtx->hHal), + pHddCtx->cfg_ini->nRoamBmissFinalBcnt); +} + +static void cbNotifySetRoamBeaconRssiWeight(hdd_context_t *pHddCtx, + unsigned long NotifyId) +{ + sme_SetRoamBeaconRssiWeight((tHalHandle)(pHddCtx->hHal), + pHddCtx->cfg_ini->nRoamBeaconRssiWeight); +} #endif static void cbNotifySetEnableSSR(hdd_context_t *pHddCtx, unsigned long NotifyId) @@ -1941,6 +1965,30 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_EMPTY_SCAN_REFRESH_PERIOD_MIN, CFG_EMPTY_SCAN_REFRESH_PERIOD_MAX, cbNotifySetEmptyScanRefreshPeriod, 0 ), + + REG_DYNAMIC_VARIABLE( CFG_ROAM_BMISS_FIRST_BCNT_NAME, WLAN_PARAM_Integer, + hdd_config_t, nRoamBmissFirstBcnt, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_BMISS_FIRST_BCNT_DEFAULT, + CFG_ROAM_BMISS_FIRST_BCNT_MIN, + CFG_ROAM_BMISS_FIRST_BCNT_MAX, + cbNotifySetRoamBmissFirstBcnt, 0 ), + + REG_DYNAMIC_VARIABLE( CFG_ROAM_BMISS_FINAL_BCNT_NAME, WLAN_PARAM_Integer, + hdd_config_t, nRoamBmissFinalBcnt, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_BMISS_FINAL_BCNT_DEFAULT, + CFG_ROAM_BMISS_FINAL_BCNT_MIN, + CFG_ROAM_BMISS_FINAL_BCNT_MAX, + cbNotifySetRoamBmissFinalBcnt, 0 ), + + REG_DYNAMIC_VARIABLE( CFG_ROAM_BEACON_RSSI_WEIGHT_NAME, WLAN_PARAM_Integer, + hdd_config_t, nRoamBeaconRssiWeight, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ROAM_BEACON_RSSI_WEIGHT_DEFAULT, + CFG_ROAM_BEACON_RSSI_WEIGHT_MIN, + CFG_ROAM_BEACON_RSSI_WEIGHT_MAX, + cbNotifySetRoamBeaconRssiWeight, 0 ), #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */ REG_VARIABLE( CFG_QOS_WMM_BURST_SIZE_DEFN_NAME , WLAN_PARAM_Integer, @@ -3443,6 +3491,15 @@ static void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [nNeighborScanPeriod] Value = [%u] ",pHddCtx->cfg_ini->nNeighborScanPeriod); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [nNeighborScanResultsRefreshPeriod] Value = [%u] ",pHddCtx->cfg_ini->nNeighborResultsRefreshPeriod); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [nEmptyScanRefreshPeriod] Value = [%u] ",pHddCtx->cfg_ini->nEmptyScanRefreshPeriod); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [nRoamBmissFirstBcnt] Value = [%u] ", + pHddCtx->cfg_ini->nRoamBmissFirstBcnt); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [nRoamBmissFinalBcnt] Value = [%u] ", + pHddCtx->cfg_ini->nRoamBmissFinalBcnt); + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "Name = [nRoamBeaconRssiWeight] Value = [%u] ", + pHddCtx->cfg_ini->nRoamBeaconRssiWeight); #endif VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [burstSizeDefinition] Value = [0x%x] ",pHddCtx->cfg_ini->burstSizeDefinition); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [tsInfoAckPolicy] Value = [0x%x] ",pHddCtx->cfg_ini->tsInfoAckPolicy); @@ -5146,6 +5203,9 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig.csrConfig.neighborRoamConfig.neighborScanChanList.channelList, &smeConfig.csrConfig.neighborRoamConfig.neighborScanChanList.numChannels, WNI_CFG_VALID_CHANNEL_LIST_LEN ); + smeConfig.csrConfig.neighborRoamConfig.nRoamBmissFirstBcnt = pConfig->nRoamBmissFirstBcnt; + smeConfig.csrConfig.neighborRoamConfig.nRoamBmissFinalBcnt = pConfig->nRoamBmissFinalBcnt; + smeConfig.csrConfig.neighborRoamConfig.nRoamBeaconRssiWeight = pConfig->nRoamBeaconRssiWeight; #endif smeConfig.csrConfig.addTSWhenACMIsOff = pConfig->AddTSWhenACMIsOff; diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 9f0df6aa94f0..a7860b14deb2 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -3848,6 +3848,9 @@ typedef struct sSirRoamOffloadScanReq tSirRoamNetworkType ConnectedNetwork; tSirMobilityDomainInfo MDID; tANI_U8 sessionId; + tANI_U8 RoamBmissFirstBcnt; + tANI_U8 RoamBmissFinalBcnt; + tANI_U8 RoamBeaconRssiWeight; } tSirRoamOffloadScanReq, *tpSirRoamOffloadScanReq; #endif //WLAN_FEATURE_ROAM_SCAN_OFFLOAD diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 479c182d0fd7..e8058ac538f5 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -4906,6 +4906,32 @@ error: return vos_status; } +VOS_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle, + A_INT32 first_bcnt, A_UINT32 final_bcnt) +{ + int status = 0; + + WMA_LOGI("%s: first_bcnt=%d, final_bcnt=%d", __func__, first_bcnt, final_bcnt); + + status = wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, wma_handle->roam_offload_vdev_id, + WMI_VDEV_PARAM_BMISS_FIRST_BCNT, first_bcnt); + if (status != EOK) { + WMA_LOGE("wmi_unified_vdev_set_param_send WMI_VDEV_PARAM_BMISS_FIRST_BCNT returned Error %d", + status); + return VOS_STATUS_E_FAILURE; + } + + status = wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, wma_handle->roam_offload_vdev_id, + WMI_VDEV_PARAM_BMISS_FINAL_BCNT, final_bcnt); + if (status != EOK) { + WMA_LOGE("wmi_unified_vdev_set_param_send WMI_VDEV_PARAM_BMISS_FINAL_BCNT returned Error %d", + status); + return VOS_STATUS_E_FAILURE; + } + + return VOS_STATUS_SUCCESS; +} + /* function : wma_roam_scan_offload_init_connect * Descriptin : Rome firmware requires that roam scan engine is configured prior to * : sending VDEV_UP command to firmware. This routine configures it @@ -4926,11 +4952,9 @@ VOS_STATUS wma_roam_scan_offload_init_connect(tp_wma_handle wma_handle) /* first program the parameters to conservative values so that roaming scan won't be * triggered before association completes */ - wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, wma_handle->roam_offload_vdev_id, - WMI_VDEV_PARAM_BMISS_FIRST_BCNT, WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT); + vos_status = wma_roam_scan_bmiss_cnt(wma_handle, + WMA_ROAM_BMISS_FIRST_BCNT_DEFAULT, WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT); - wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, wma_handle->roam_offload_vdev_id, - WMI_VDEV_PARAM_BMISS_FINAL_BCNT, WMA_ROAM_BMISS_FINAL_BCNT_DEFAULT); /* rssi_thresh = 10 is low enough */ vos_status = wma_roam_scan_offload_rssi_thresh(wma_handle, WMA_ROAM_LOW_RSSI_TRIGGER_VERYLOW, pMac->roam.configParam.neighborRoamConfig.nOpportunisticThresholdDiff); @@ -5011,6 +5035,12 @@ VOS_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle, if (vos_status != VOS_STATUS_SUCCESS) { break; } + vos_status = wma_roam_scan_bmiss_cnt(wma_handle, + roam_req->RoamBmissFirstBcnt, roam_req->RoamBmissFinalBcnt); + if (vos_status != VOS_STATUS_SUCCESS) { + break; + } + /* Opportunistic scan runs on a timer, value set by EmptyRefreshScanPeriod. * Age out the entries after 3 such cycles. */ @@ -5031,7 +5061,7 @@ VOS_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle, */ vos_status = wma_roam_scan_offload_rssi_change(wma_handle, roam_req->RoamRescanRssiDiff, - WMA_ROAM_BEACON_WEIGHT_DEFAULT); + roam_req->RoamBeaconRssiWeight); if (vos_status != VOS_STATUS_SUCCESS) { break; } @@ -5092,6 +5122,12 @@ VOS_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle, break; } + vos_status = wma_roam_scan_bmiss_cnt(wma_handle, + roam_req->RoamBmissFirstBcnt, roam_req->RoamBmissFinalBcnt); + if (vos_status != VOS_STATUS_SUCCESS) { + break; + } + /* * Runtime (after association) changes to rssi thresholds and other parameters. */ @@ -5124,7 +5160,7 @@ VOS_STATUS wma_process_roam_scan_req(tp_wma_handle wma_handle, vos_status = wma_roam_scan_offload_rssi_change(wma_handle, roam_req->RoamRescanRssiDiff, - WMA_ROAM_BEACON_WEIGHT_DEFAULT); + roam_req->RoamBeaconRssiWeight); if (vos_status != VOS_STATUS_SUCCESS) { break; } @@ -6052,10 +6088,15 @@ VOS_STATUS wma_roam_preauth_chan_set(tp_wma_handle wma_handle, wma_handle->roam_preauth_chan_context = params; wma_handle->roam_preauth_chanfreq = vos_chan_to_freq(params->channelNumber); + /* set the state in advance before calling wma_start_scan and be ready + * to handle scan events from firmware. Otherwise print statments + * in wma_start_can create a race condition. + */ + wma_handle->roam_preauth_scan_state = WMA_ROAM_PREAUTH_CHAN_REQUESTED; vos_status = wma_start_scan(wma_handle, &scan_req, WDA_CHNL_SWITCH_REQ); - wma_handle->roam_preauth_scan_state = (vos_status == VOS_STATUS_SUCCESS) ? - WMA_ROAM_PREAUTH_CHAN_REQUESTED : WMA_ROAM_PREAUTH_CHAN_NONE; + if (vos_status != VOS_STATUS_SUCCESS) + wma_handle->roam_preauth_scan_state = WMA_ROAM_PREAUTH_CHAN_NONE; return vos_status; } diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 9644107b3c7b..41947da0221b 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -973,6 +973,9 @@ typedef struct tagCsrNeighborRoamConfigParams tANI_U16 nEmptyScanRefreshPeriod; tANI_U8 nOpportunisticThresholdDiff; tANI_U8 nRoamRescanRssiDiff; + tANI_U8 nRoamBmissFirstBcnt; + tANI_U8 nRoamBmissFinalBcnt; + tANI_U8 nRoamBeaconRssiWeight; }tCsrNeighborRoamConfigParams; #endif diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index a9d23672894d..d2784584de32 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -514,6 +514,9 @@ typedef struct tagCsrNeighborRoamConfig tANI_U16 nEmptyScanRefreshPeriod; tANI_U8 nOpportunisticThresholdDiff; tANI_U8 nRoamRescanRssiDiff; + tANI_U8 nRoamBmissFirstBcnt; + tANI_U8 nRoamBmissFinalBcnt; + tANI_U8 nRoamBeaconRssiWeight; }tCsrNeighborRoamConfig; #endif diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h index 6d53331f84a6..2bb1f5ce1e8c 100644 --- a/CORE/SME/inc/csrNeighborRoam.h +++ b/CORE/SME/inc/csrNeighborRoam.h @@ -71,6 +71,9 @@ typedef struct sCsrNeighborRoamCfgParams tANI_U16 emptyScanRefreshPeriod; tANI_U8 nOpportunisticThresholdDiff; tANI_U8 nRoamRescanRssiDiff; + tANI_U8 nRoamBmissFirstBcnt; + tANI_U8 nRoamBmissFinalBcnt; + tANI_U8 nRoamBeaconRssiWeight; } tCsrNeighborRoamCfgParams, *tpCsrNeighborRoamCfgParams; #define CSR_NEIGHBOR_ROAM_INVALID_CHANNEL_INDEX 255 @@ -205,6 +208,9 @@ typedef struct sCsrNeighborRoamControlInfo #endif tSmeFastRoamTrigger cfgRoamEn; tSirMacAddr cfgRoambssId; + tANI_U8 currentRoamBmissFirstBcnt; + tANI_U8 currentRoamBmissFinalBcnt; + tANI_U8 currentRoamBeaconRssiWeight; } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo; @@ -236,6 +242,15 @@ csrNeighborRoamSetOpportunisticScanThresholdDiff(tpAniSirGlobal pMac, VOS_STATUS csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, v_U8_t nRoamRescanRssiDiff); +VOS_STATUS +csrNeighborRoamSetRoamBmissFirstBcnt(tpAniSirGlobal pMac, + v_U8_t nRoamBmissFirstBcnt); +VOS_STATUS +csrNeighborRoamSetRoamBmissFinalBcnt(tpAniSirGlobal pMac, + v_U8_t nRoamBmissFinalBcnt); +VOS_STATUS +csrNeighborRoamSetRoamBeaconRssiWeight(tpAniSirGlobal pMac, + v_U8_t nRoamBeaconRssiWeight); VOS_STATUS csrNeighborRoamUpdateFastRoamingEnabled(tpAniSirGlobal pMac, const v_BOOL_t fastRoamEnabled); VOS_STATUS csrNeighborRoamUpdateCcxModeEnabled(tpAniSirGlobal pMac, const v_BOOL_t ccxMode); VOS_STATUS csrNeighborRoamChannelsFilterByCurrentBand( @@ -280,6 +295,9 @@ VOS_STATUS csrNeighborRoamMergeChannelLists(tpAniSirGlobal pMac, #define REASON_SCAN_HOME_TIME_CHANGED 17 #define REASON_OPPORTUNISTIC_THRESH_DIFF_CHANGED 18 #define REASON_ROAM_RESCAN_RSSI_DIFF_CHANGED 19 +#define REASON_ROAM_BMISS_FIRST_BCNT_CHANGED 20 +#define REASON_ROAM_BMISS_FINAL_BCNT_CHANGED 21 +#define REASON_ROAM_BEACON_RSSI_WEIGHT_CHANGED 22 eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reason); eHalStatus csrNeighborRoamCandidateFoundIndHdlr(tpAniSirGlobal pMac, void* pMsg); eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg); diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index d82b056271c9..b518293c17ff 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -2908,6 +2908,80 @@ eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborSca -------------------------------------------------------------------------*/ v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal); +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBmissFirstBcnt + \brief Update Roam count for first beacon miss + This function is called through dynamic setConfig callback function + to configure nRoamBmissFirstBcnt + \param hHal - HAL handle for device + \param nRoamBmissFirstBcnt - Roam first bmiss count + \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFirstBcnt + successfully. + else SME is failed to update nRoamBmissFirstBcnt + -------------------------------------------------------------------------*/ + +eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, + const v_U8_t nRoamBmissFirstBcnt); + +/*-------------------------------------------------------------------------- + \fn sme_GetRoamBmissFirstBcnt + \brief gets Roam count for first beacon miss + This is a synchronous call + \param hHal - The handle returned by macOpen + \return v_U8_t - nRoamBmissFirstBcnt + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBmissFirstBcnt(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBmissFinalBcnt + \brief Update Roam count for final beacon miss + This function is called through dynamic setConfig callback function + to configure nRoamBmissFinalBcnt + \param hHal - HAL handle for device + \param nRoamBmissFinalBcnt - Roam final bmiss count + \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFinalBcnt + successfully. + else SME is failed to update nRoamBmissFinalBcnt + -------------------------------------------------------------------------*/ + +eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, + const v_U8_t nRoamBmissFinalBcnt); + +/*-------------------------------------------------------------------------- + \fn sme_GetRoamBmissFinalBcnt + \brief gets Roam count for final beacon miss + This is a synchronous call + \param hHal - The handle returned by macOpen + \return v_U8_t - nRoamBmissFinalBcnt + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBmissFinalBcnt(tHalHandle hHal); + +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBeaconRssiWeight + \brief Update Roam beacon rssi weight + This function is called through dynamic setConfig callback function + to configure nRoamBeaconRssiWeight + \param hHal - HAL handle for device + \param nRoamBeaconRssiWeight - Roam beacon rssi weight + \return eHAL_STATUS_SUCCESS - SME update nRoamBeaconRssiWeight config + successfully. + else SME is failed to update nRoamBeaconRssiWeight + -------------------------------------------------------------------------*/ + +eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, + const v_U8_t nRoamBeaconRssiWeight); + +/*-------------------------------------------------------------------------- + \fn sme_GetRoamBeaconRssiWeight + \brief gets Roam beacon rssi weight + This is a synchronous call + \param hHal - The handle returned by macOpen + \return v_U8_t - nRoamBeaconRssiWeight + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBeaconRssiWeight(tHalHandle hHal); #endif #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index ecf1968b3644..896ff1cc080a 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -1099,6 +1099,9 @@ static void initConfigParam(tpAniSirGlobal pMac) pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList[2] = 11; pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = 20000; //20 seconds pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = 0; + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt = 10; + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt = 10; + pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight = 14; #endif #ifdef WLAN_FEATURE_11AC pMac->roam.configParam.nVhtChannelWidth = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ + 1; @@ -1779,6 +1782,9 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa smsLog( pMac, LOG1, "%d ", pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList[i] ); } } + smsLog( pMac, LOG1, "nRoamBmissFirstBcnt = %d", pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt); + smsLog( pMac, LOG1, "nRoamBmissFinalBcnt = %d", pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt); + smsLog( pMac, LOG1, "nRoamBeaconRssiWeight = %d", pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight); #endif pMac->roam.configParam.addTSWhenACMIsOff = pParam->addTSWhenACMIsOff; pMac->scan.fValidateList = pParam->fValidateList; @@ -15855,6 +15861,12 @@ eHalStatus csrRoamOffloadScan(tpAniSirGlobal pMac, tANI_U8 command, tANI_U8 reas pNeighborRoamInfo->cfgParams.maxChannelScanTime; pRequestBuf->EmptyRefreshScanPeriod = pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod; + pRequestBuf->RoamBmissFirstBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt; + pRequestBuf->RoamBmissFinalBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt; + pRequestBuf->RoamBeaconRssiWeight = + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight; /* MAWC feature */ pRequestBuf->MAWCEnabled = pMac->roam.configParam.MAWCEnabled; diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c index 5c7abaef9025..5841e665f3f0 100644 --- a/CORE/SME/src/csr/csrNeighborRoam.c +++ b/CORE/SME/src/csr/csrNeighborRoam.c @@ -619,6 +619,164 @@ csrNeighborRoamSetRoamRescanRssiDiff(tpAniSirGlobal pMac, return vosStatus; } +VOS_STATUS +csrNeighborRoamSetRoamBmissFirstBcnt(tpAniSirGlobal pMac, + v_U8_t nRoamBmissFirstBcnt) +{ + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + + if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in CONNECTED state, so deregister" + " all and re-register for DOWN event again")); + + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt = + nRoamBmissFirstBcnt; + pMac->roam.neighborRoamInfo.currentRoamBmissFirstBcnt = + nRoamBmissFirstBcnt; + + /* De-register existing lookup UP/DOWN, Rssi indications */ +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (pMac->roam.configParam.isRoamOffloadScanEnabled) + { + csrRoamOffloadScan(pMac, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_BMISS_FIRST_BCNT_CHANGED); + } +#endif + } + else if (eCSR_NEIGHBOR_ROAM_STATE_INIT + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in INIT state, safe to set" + " roam rescan rssi diff")); + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt = + nRoamBmissFirstBcnt; + pMac->roam.neighborRoamInfo.currentRoamBmissFirstBcnt = + nRoamBmissFirstBcnt; + } + else + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOGE, + FL("Unexpected state %d" + " returning failure"), + pMac->roam.neighborRoamInfo.neighborRoamState); + vosStatus = VOS_STATUS_E_FAILURE; + } + return vosStatus; +} + +VOS_STATUS +csrNeighborRoamSetRoamBmissFinalBcnt(tpAniSirGlobal pMac, + v_U8_t nRoamBmissFinalBcnt) +{ + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + + if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in CONNECTED state, so deregister" + " all and re-register for DOWN event again")); + + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt = + nRoamBmissFinalBcnt; + pMac->roam.neighborRoamInfo.currentRoamBmissFinalBcnt = + nRoamBmissFinalBcnt; + + /* De-register existing lookup UP/DOWN, Rssi indications */ +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (pMac->roam.configParam.isRoamOffloadScanEnabled) + { + csrRoamOffloadScan(pMac, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_BMISS_FINAL_BCNT_CHANGED); + } +#endif + } + else if (eCSR_NEIGHBOR_ROAM_STATE_INIT + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in INIT state, safe to set" + " roam rescan rssi diff")); + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt = + nRoamBmissFinalBcnt; + pMac->roam.neighborRoamInfo.currentRoamBmissFinalBcnt = + nRoamBmissFinalBcnt; + } + else + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOGE, + FL("Unexpected state %d" + " returning failure"), + pMac->roam.neighborRoamInfo.neighborRoamState); + vosStatus = VOS_STATUS_E_FAILURE; + } + return vosStatus; +} + +VOS_STATUS +csrNeighborRoamSetRoamBeaconRssiWeight(tpAniSirGlobal pMac, + v_U8_t nRoamBeaconRssiWeight) +{ + VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; + + if (eCSR_NEIGHBOR_ROAM_STATE_CONNECTED + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in CONNECTED state, so deregister" + " all and re-register for DOWN event again")); + + pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight = + nRoamBeaconRssiWeight; + pMac->roam.neighborRoamInfo.currentRoamBeaconRssiWeight = + nRoamBeaconRssiWeight; + + /* De-register existing lookup UP/DOWN, Rssi indications */ +#ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD + if (pMac->roam.configParam.isRoamOffloadScanEnabled) + { + csrRoamOffloadScan(pMac, + ROAM_SCAN_OFFLOAD_UPDATE_CFG, + REASON_ROAM_BEACON_RSSI_WEIGHT_CHANGED); + } +#endif + } + else if (eCSR_NEIGHBOR_ROAM_STATE_INIT + == pMac->roam.neighborRoamInfo.neighborRoamState) + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOG2, + FL("Currently in INIT state, safe to set" + " roam rescan rssi diff")); + pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight = + nRoamBeaconRssiWeight; + pMac->roam.neighborRoamInfo.currentRoamBeaconRssiWeight = + nRoamBeaconRssiWeight; + } + else + { + NEIGHBOR_ROAM_DEBUG(pMac, + LOGE, + FL("Unexpected state %d" + " returning failure"), + pMac->roam.neighborRoamInfo.neighborRoamState); + vosStatus = VOS_STATUS_E_FAILURE; + } + return vosStatus; +} /* --------------------------------------------------------------------------- \fn csrNeighborRoamReassocIndCallback @@ -821,6 +979,12 @@ static void csrNeighborRoamDeregAllRssiIndication(tpAniSirGlobal pMac) pNeighborRoamInfo->cfgParams.nOpportunisticThresholdDiff; pNeighborRoamInfo->currentRoamRescanRssiDiff = pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff; + pNeighborRoamInfo->currentRoamBmissFirstBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt; + pNeighborRoamInfo->currentRoamBmissFinalBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt; + pNeighborRoamInfo->currentRoamBeaconRssiWeight = + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight; #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->uEmptyScanCount = 0; pNeighborRoamInfo->lookupDOWNRssi = 0; @@ -4259,6 +4423,12 @@ eHalStatus csrNeighborRoamIndicateConnect(tpAniSirGlobal pMac, tANI_U8 sessionId pNeighborRoamInfo->cfgParams.nOpportunisticThresholdDiff; pNeighborRoamInfo->currentRoamRescanRssiDiff = pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff; + pNeighborRoamInfo->currentRoamBmissFirstBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt; + pNeighborRoamInfo->currentRoamBmissFinalBcnt = + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt; + pNeighborRoamInfo->currentRoamBeaconRssiWeight = + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight; #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->uEmptyScanCount = 0; pNeighborRoamInfo->lookupDOWNRssi = 0; @@ -4448,6 +4618,12 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) pMac->roam.configParam.neighborRoamConfig.nOpportunisticThresholdDiff; pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff = pMac->roam.configParam.neighborRoamConfig.nRoamRescanRssiDiff; + pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt = + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt; + pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt = + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt; + pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight = + pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight; pNeighborRoamInfo->cfgParams.neighborReassocThreshold = pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold; pNeighborRoamInfo->cfgParams.neighborScanPeriod = pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod; pNeighborRoamInfo->cfgParams.neighborResultsRefreshPeriod = pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; @@ -4476,6 +4652,12 @@ eHalStatus csrNeighborRoamInit(tpAniSirGlobal pMac) pMac->roam.neighborRoamInfo.cfgParams.nOpportunisticThresholdDiff; pNeighborRoamInfo->currentRoamRescanRssiDiff = pMac->roam.neighborRoamInfo.cfgParams.nRoamRescanRssiDiff; + pNeighborRoamInfo->currentRoamBmissFirstBcnt = + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFirstBcnt; + pNeighborRoamInfo->currentRoamBmissFinalBcnt = + pMac->roam.neighborRoamInfo.cfgParams.nRoamBmissFinalBcnt; + pNeighborRoamInfo->currentRoamBeaconRssiWeight = + pMac->roam.neighborRoamInfo.cfgParams.nRoamBeaconRssiWeight; #ifdef FEATURE_WLAN_LFR pNeighborRoamInfo->lookupDOWNRssi = 0; pNeighborRoamInfo->uEmptyScanCount = 0; diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 4470324c606b..e781723ecff8 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -9403,6 +9403,159 @@ v_U8_t sme_GetRoamRescanRssiDiff(tHalHandle hHal) return pMac->roam.configParam.neighborRoamConfig.nRoamRescanRssiDiff; } +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBmissFirstBcnt + \brief Update Roam count for first beacon miss + This function is called through dynamic setConfig callback function + to configure nRoamBmissFirstBcnt + \param hHal - HAL handle for device + \param nRoamBmissFirstBcnt - Roam first bmiss count + \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFirstBcnt + successfully. + else SME is failed to update nRoamBmissFirstBcnt + -------------------------------------------------------------------------*/ +eHalStatus sme_SetRoamBmissFirstBcnt(tHalHandle hHal, + const v_U8_t nRoamBmissFirstBcnt) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + status = csrNeighborRoamSetRoamBmissFirstBcnt(pMac, nRoamBmissFirstBcnt); + if (HAL_STATUS_SUCCESS(status)) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "LFR runtime successfully set " + "beacon miss first beacon count to %d" + " - old value is %d - roam state is %d", + nRoamBmissFirstBcnt, + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt, + pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt = + nRoamBmissFirstBcnt; + } + sme_ReleaseGlobalLock(&pMac->sme); + } + return status; +} + +/* --------------------------------------------------------------------------- + \fn sme_getNeighborScanPeriod + \brief get neighbor scan period + \param hHal - The handle returned by macOpen. + \return v_U16_t - neighbor scan period + -------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBmissFirstBcnt(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + return pMac->roam.configParam.neighborRoamConfig.nRoamBmissFirstBcnt; +} + +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBmissFinalBcnt + \brief Update Roam count for final beacon miss + This function is called through dynamic setConfig callback function + to configure nRoamBmissFinalBcnt + \param hHal - HAL handle for device + \param nRoamBmissFinalBcnt - Roam final bmiss count + \return eHAL_STATUS_SUCCESS - SME update nRoamBmissFinalBcnt + successfully. + else SME is failed to update nRoamBmissFinalBcnt + -------------------------------------------------------------------------*/ +eHalStatus sme_SetRoamBmissFinalBcnt(tHalHandle hHal, + const v_U8_t nRoamBmissFinalBcnt) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + status = csrNeighborRoamSetRoamBmissFinalBcnt(pMac, nRoamBmissFinalBcnt); + if (HAL_STATUS_SUCCESS(status)) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "LFR runtime successfully set " + "beacon miss final beacon count to %d" + " - old value is %d - roam state is %d", + nRoamBmissFinalBcnt, + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt, + pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt = + nRoamBmissFinalBcnt; + } + sme_ReleaseGlobalLock(&pMac->sme); + } + return status; +} + +/*-------------------------------------------------------------------------- + \fn sme_GetRoamBmissFinalBcnt + \brief gets Roam count for final beacon miss + This is a synchronous call + \param hHal - The handle returned by macOpen + \return v_U8_t - nRoamBmissFinalBcnt + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBmissFinalBcnt(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + return pMac->roam.configParam.neighborRoamConfig.nRoamBmissFinalBcnt; +} + +/* --------------------------------------------------------------------------- + \fn sme_SetRoamBeaconRssiWeight + \brief Update Roam beacon rssi weight + This function is called through dynamic setConfig callback function + to configure nRoamBeaconRssiWeight + \param hHal - HAL handle for device + \param nRoamBeaconRssiWeight - Roam beacon rssi weight + \return eHAL_STATUS_SUCCESS - SME update nRoamBeaconRssiWeight config + successfully. + else SME is failed to update nRoamBeaconRssiWeight + -------------------------------------------------------------------------*/ +eHalStatus sme_SetRoamBeaconRssiWeight(tHalHandle hHal, + const v_U8_t nRoamBeaconRssiWeight) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + eHalStatus status = eHAL_STATUS_SUCCESS; + + status = sme_AcquireGlobalLock( &pMac->sme ); + if ( HAL_STATUS_SUCCESS( status ) ) + { + status = csrNeighborRoamSetRoamBeaconRssiWeight(pMac, nRoamBeaconRssiWeight); + if (HAL_STATUS_SUCCESS(status)) + { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, + "LFR runtime successfully set " + "beacon miss final beacon count to %d" + " - old value is %d - roam state is %d", + nRoamBeaconRssiWeight, + pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight, + pMac->roam.neighborRoamInfo.neighborRoamState); + pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight = + nRoamBeaconRssiWeight; + } + sme_ReleaseGlobalLock(&pMac->sme); + } + return status; +} + +/*-------------------------------------------------------------------------- + \fn sme_GetRoamBeaconRssiWeight + \brief gets Roam beacon rssi weight + This is a synchronous call + \param hHal - The handle returned by macOpen + \return v_U8_t - nRoamBeaconRssiWeight + \sa + --------------------------------------------------------------------------*/ +v_U8_t sme_GetRoamBeaconRssiWeight(tHalHandle hHal) +{ + tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); + return pMac->roam.configParam.neighborRoamConfig.nRoamBeaconRssiWeight; +} /*-------------------------------------------------------------------------- \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold This is a synchronous call |
