diff options
| author | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-01-27 15:23:43 -0800 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2015-02-03 16:04:47 +0530 |
| commit | f488c2ed11aee11fec70d0cf6dc211bafd7ea891 (patch) | |
| tree | 5c89908867edfd5f551a1b5bc7966cbb05836a62 | |
| parent | 180f32844b05ef5e439710935aab476380706ee5 (diff) | |
qcacld: Enhance DFS master mode test mode
When a radar is injected in test mode, add support for including
CSA IE in the beacons with next channel as current channel itself.
Clear the CSA IE after 5 beacons have been transmitted and still
remain on same channel.
Change-Id: I856111fce9cf7660553b6410816cd5319ad0194a
CRs-Fixed: 790103
| -rw-r--r-- | CORE/SAP/inc/sapApi.h | 6 | ||||
| -rw-r--r-- | CORE/SAP/src/sapApiLinkCntl.c | 28 | ||||
| -rw-r--r-- | CORE/SAP/src/sapFsm.c | 13 | ||||
| -rw-r--r-- | CORE/SAP/src/sapModule.c | 8 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 9 |
5 files changed, 51 insertions, 13 deletions
diff --git a/CORE/SAP/inc/sapApi.h b/CORE/SAP/inc/sapApi.h index 4b43fd4c96bd..17b79241d80f 100644 --- a/CORE/SAP/inc/sapApi.h +++ b/CORE/SAP/inc/sapApi.h @@ -617,6 +617,12 @@ typedef struct sSapDfsInfo * operating DFS channel. */ v_U8_t sap_operating_chan_preferred_location; + + /* + * Flag to indicate if DFS test mode is enabled and + * channel switch is disabled. + */ + v_U8_t disable_dfs_ch_switch; } tSapDfsInfo; typedef struct tagSapCtxList diff --git a/CORE/SAP/src/sapApiLinkCntl.c b/CORE/SAP/src/sapApiLinkCntl.c index 1750b7064d0e..e1a6df6a00e4 100644 --- a/CORE/SAP/src/sapApiLinkCntl.c +++ b/CORE/SAP/src/sapApiLinkCntl.c @@ -552,6 +552,7 @@ WLANSAP_RoamCallback eHalStatus halStatus = eHAL_STATUS_SUCCESS; tHalHandle hHal = VOS_GET_HAL_CB(sapContext->pvosGCtx); tpAniSirGlobal pMac = NULL; + tANI_U8 dfs_beacon_start_req = 0; if (NULL == hHal) { @@ -986,14 +987,13 @@ WLANSAP_RoamCallback break; case eCSR_ROAM_RESULT_DFS_RADAR_FOUND_IND: - if (sapContext->csrRoamProfile.disableDFSChSwitch) - { - VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, - "sapdfs: DFS channel switch disabled"); - break; - } if (eSAP_DFS_CAC_WAIT == sapContext->sapsMachine) { + if (sapContext->csrRoamProfile.disableDFSChSwitch) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "sapdfs: DFS channel switch disabled"); + break; + } if (VOS_TRUE == pMac->sap.SapDfsInfo.sap_radar_found_status) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_MED, @@ -1051,6 +1051,22 @@ WLANSAP_RoamCallback { eCsrPhyMode phyMode = sapContext->csrRoamProfile.phyMode; + if (sapContext->csrRoamProfile.disableDFSChSwitch) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + "sapdfs: DFS channel switch disabled"); + /* + * Send a beacon start request to PE. CSA IE required + * flag from beacon template will be cleared by now. + * A new beacon template with no CSA IE will be sent + * to firmware. + */ + dfs_beacon_start_req = VOS_TRUE; + halStatus = sme_RoamStartBeaconReq( hHal, + sapContext->bssid, + dfs_beacon_start_req); + break; + } + /* Both success and failure cases are handled intentionally handled * together. Irrespective of whether the channel switch IE was * sent out successfully or not, SAP should still vacate the diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index 6aff358d637b..dfcb8d22712b 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -4469,6 +4469,13 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event) return 0; } + /* + * SAP needs to generate Channel Switch IE + * if the radar is found in the STARTED state + */ + if (eSAP_STARTED == sapContext->sapsMachine) + pMac->sap.SapDfsInfo.csaIERequired = VOS_TRUE; + if (sapContext->csrRoamProfile.disableDFSChSwitch) { return sapContext->channel; @@ -4477,12 +4484,6 @@ v_U8_t sapIndicateRadar(ptSapContext sapContext, tSirSmeDfsEventInd *dfs_event) /* set the Radar Found flag in SapDfsInfo */ pMac->sap.SapDfsInfo.sap_radar_found_status = VOS_TRUE; - /* We need to generate Channel Switch IE if the radar is found in the - * operating state - */ - if (eSAP_STARTED == sapContext->sapsMachine) - pMac->sap.SapDfsInfo.csaIERequired = VOS_TRUE; - sapGet5GHzChannelList(sapContext); if (dfs_event->chan_list.nchannels > SIR_DFS_MAX_20M_SUB_CH) { diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index 5872dddac10c..a05c93610dce 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -812,6 +812,7 @@ WLANSAP_StartBss ptSapContext pSapCtx = NULL; tANI_BOOLEAN restartNeeded; tHalHandle hHal; + tpAniSirGlobal pmac = NULL; int ret; /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ @@ -906,6 +907,13 @@ WLANSAP_StartBss } } + pmac = PMAC_STRUCT( hHal ); + /* + * Copy the DFS Test Mode setting to pmac for + * access in lower layers + */ + pmac->sap.SapDfsInfo.disable_dfs_ch_switch = + pConfig->disableDFSChSwitch; // Copy MAC filtering settings to sap context pSapCtx->eSapMacAddrAclMode = pConfig->SapMacaddr_acl; vos_mem_copy(pSapCtx->acceptMacList, pConfig->accept_mac, sizeof(pConfig->accept_mac)); diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 19b3b82ffd02..18efc5ba21b5 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -28474,6 +28474,7 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, struct wma_dfs_radar_indication *radar_event; struct hdd_dfs_radar_ind hdd_radar_event; void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); + tpAniSirGlobal pmac = NULL; wma = (tp_wma_handle) vos_get_context(VOS_MODULE_ID_WDA, vos_context); @@ -28484,6 +28485,9 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, } hdd_ctx = vos_get_context(VOS_MODULE_ID_HDD,wma->vos_context); + pmac = (tpAniSirGlobal) + vos_get_context(VOS_MODULE_ID_PE, wma->vos_context); + if (wma->dfs_ic != ic) { WMA_LOGE("%s:DFS- Invalid WMA handle",__func__); @@ -28499,8 +28503,11 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, /* * Do not post multiple Radar events on the same channel. + * But, when DFS test mode is enabled, allow multiple dfs + * radar events to be posted on the same channel. */ - if ( ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan) ) + if ((ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan)) || + ( pmac->sap.SapDfsInfo.disable_dfs_ch_switch == VOS_TRUE) ) { wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee; /* Indicate the radar event to HDD to stop the netif Tx queues*/ |
