From 949eaa7aab04ba871d2418cdc37161128095233b Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Thu, 17 Dec 2015 18:43:52 -0800 Subject: [PATCH] qcacld-3.0: SAP DFS CAC Support in 80+80MHz mode Add support to perform CAC when SAP comes up in 160MHz or 80+80MHz with any of the 80MHz band is DFS band. Change-Id: If24d6cd325f747934195598ffe0f456eea939026 CRs-Fixed: 964262 --- core/mac/inc/sir_api.h | 1 + .../src/pe/lim/lim_process_mlm_rsp_messages.c | 24 +++++++++++++++---- core/sap/src/sap_fsm.c | 24 +++++++++++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 31ae9a21c696..56963efe916e 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3845,6 +3845,7 @@ typedef struct sSirChAvoidIndType { #endif /* FEATURE_WLAN_CH_AVOID || FEATURE_WLAN_FORCE_SAP_SCC */ #define SIR_DFS_MAX_20M_SUB_CH 8 +#define SIR_80MHZ_START_CENTER_CH_DIFF 6 typedef struct sSirSmeDfsChannelList { uint32_t nchannels; diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index bf4f3a6c3761..611161efe83c 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -225,6 +225,7 @@ void lim_process_mlm_start_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf) uint8_t smesessionId; uint16_t smetransactionId; uint8_t channelId; + uint8_t send_bcon_ind = false; if (pMsgBuf == NULL) { PELOGE(lim_log(pMac, LOGE, FL("Buffer is Pointing to NULL"));) @@ -294,10 +295,25 @@ void lim_process_mlm_start_cnf(tpAniSirGlobal pMac, uint32_t *pMsgBuf) * request from upper layers to start the beacon transmission */ - if (LIM_IS_IBSS_ROLE(psessionEntry) || - (LIM_IS_AP_ROLE(psessionEntry) && - (cds_get_channel_state(channelId) != - CHANNEL_STATE_DFS))) { + if (!(LIM_IS_IBSS_ROLE(psessionEntry) || + (LIM_IS_AP_ROLE(psessionEntry)))) + return; + if (psessionEntry->ch_width == CH_WIDTH_160MHZ) { + send_bcon_ind = false; + } else if (psessionEntry->ch_width == CH_WIDTH_80P80MHZ) { + if ((cds_get_channel_state(channelId) != + CHANNEL_STATE_DFS) && + (cds_get_channel_state(psessionEntry-> + ch_center_freq_seg1 - + SIR_80MHZ_START_CENTER_CH_DIFF) != + CHANNEL_STATE_DFS)) + send_bcon_ind = true; + } else { + if (cds_get_channel_state(channelId) != + CHANNEL_STATE_DFS) + send_bcon_ind = true; + } + if (send_bcon_ind) { /* Configure beacon and send beacons to HAL */ QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, FL("Start Beacon with ssid %s Ch %d"), diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index c4c53feb48fe..42fa493790bc 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -3433,6 +3433,7 @@ static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx, tCsrRoamInfo *roam_info = (tCsrRoamInfo *) (sap_event->params); tSapDfsInfo *sap_dfs_info; QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; + uint8_t is_dfs = false; if (msg == eSAP_MAC_START_BSS_SUCCESS) { /* @@ -3440,8 +3441,9 @@ static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx, * (both without substates) */ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, - FL("from state channel = %d %s => %s"), - sap_ctx->channel, "eSAP_STARTING", "eSAP_STARTED"); + FL("from state channel = %d %s => %s ch_width %d"), + sap_ctx->channel, "eSAP_STARTING", "eSAP_STARTED", + sap_ctx->ch_params.ch_width); sap_ctx->sapsMachine = eSAP_STARTED; /* Action code for transition */ @@ -3454,8 +3456,22 @@ static QDF_STATUS sap_fsm_state_starting(ptSapContext sap_ctx, * running, however, the AP is still not beaconing, until * CAC is done if the operating channel is DFS */ - if (CHANNEL_STATE_DFS == - cds_get_channel_state(sap_ctx->channel)) { + if (sap_ctx->ch_params.ch_width == CH_WIDTH_160MHZ) { + is_dfs = true; + } else if (sap_ctx->ch_params.ch_width == CH_WIDTH_80P80MHZ) { + if (cds_get_channel_state(sap_ctx->channel) == + CHANNEL_STATE_DFS || + cds_get_channel_state(sap_ctx-> + ch_params.center_freq_seg1 - + SIR_80MHZ_START_CENTER_CH_DIFF) == + CHANNEL_STATE_DFS) + is_dfs = true; + } else { + if (cds_get_channel_state(sap_ctx->channel) == + CHANNEL_STATE_DFS) + is_dfs = true; + } + if (is_dfs) { sap_dfs_info = &mac_ctx->sap.SapDfsInfo; if ((false == sap_dfs_info->ignore_cac) && (eSAP_DFS_DO_NOT_SKIP_CAC ==