From 7bb1e74744da8d8f4dc96809fb193d8a4aa8295e Mon Sep 17 00:00:00 2001 From: gaolez Date: Tue, 21 Mar 2017 16:37:38 +0800 Subject: [PATCH] qcacld-3.0: Add ecsa capability record qcacld-2.0 to qcacld-3.0 propagation Add eCSA capability record of STAs which associated to SAP. Change-Id: I1d7892bb1dc4e490a587e8372a4bdc7f419e8b36 CRs-Fixed: 1094958 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_hostapd.c | 28 +++++++++++-------- core/mac/inc/sir_api.h | 2 ++ core/mac/src/include/dph_global.h | 2 ++ core/mac/src/pe/include/lim_session.h | 2 ++ core/mac/src/pe/lim/lim_assoc_utils.c | 11 ++++++++ .../src/pe/lim/lim_process_assoc_req_frame.c | 11 ++++++++ .../src/pe/lim/lim_process_mlm_rsp_messages.c | 1 + .../src/pe/lim/lim_send_management_frames.c | 3 ++ core/mac/src/pe/lim/lim_types.h | 2 ++ core/sap/inc/sap_api.h | 2 ++ core/sap/src/sap_fsm.c | 2 ++ core/sme/inc/csr_api.h | 4 +++ core/sme/src/csr/csr_api_roam.c | 5 ++++ 14 files changed, 65 insertions(+), 12 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 77f88a4d7e9e..d6993d13c546 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -752,6 +752,8 @@ typedef struct { /** Rate Flags for this connection */ uint32_t rate_flags; + /** Extended CSA */ + uint8_t ecsa_capable; } hdd_station_info_t; struct hdd_ap_ctx_s { diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 791b0630f690..f5dd3b3a65cc 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1186,6 +1186,9 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, } } + pHostapdAdapter->aStaInfo[staId].ecsa_capable = pSapEvent-> + sapevt.sapStationAssocReassocCompleteEvent.ecsa_capable; + if (hdd_ipa_is_enabled(pHddCtx)) { status = hdd_ipa_wlan_evt(pHostapdAdapter, pHddApCtx->uBCStaId, @@ -5127,18 +5130,19 @@ QDF_STATUS hdd_softap_get_sta_info(hdd_adapter_t *pAdapter, uint8_t *pBuf, maxSta = hdd_ctx->config->maxNumberOfPeers; for (i = 0; i <= maxSta; i++) { - if (pAdapter->aStaInfo[i].isUsed) { - len = - scnprintf(pBuf, buf_len, - "%5d .%02x:%02x:%02x:%02x:%02x:%02x", - pAdapter->aStaInfo[i].ucSTAId, - pAdapter->aStaInfo[i].macAddrSTA.bytes[0], - pAdapter->aStaInfo[i].macAddrSTA.bytes[1], - pAdapter->aStaInfo[i].macAddrSTA.bytes[2], - pAdapter->aStaInfo[i].macAddrSTA.bytes[3], - pAdapter->aStaInfo[i].macAddrSTA.bytes[4], - pAdapter->aStaInfo[i].macAddrSTA. - bytes[5]); + hdd_station_info_t *sta_info_ptr = &pAdapter->aStaInfo[i]; + + if (sta_info_ptr->isUsed) { + len = scnprintf(pBuf, buf_len, + "%d %x:%x:%x:%x:%x:%x \t ecsa=%d\n", + sta_info_ptr->ucSTAId, + sta_info_ptr->macAddrSTA.bytes[0], + sta_info_ptr->macAddrSTA.bytes[1], + sta_info_ptr->macAddrSTA.bytes[2], + sta_info_ptr->macAddrSTA.bytes[3], + sta_info_ptr->macAddrSTA.bytes[4], + sta_info_ptr->macAddrSTA.bytes[5], + sta_info_ptr->ecsa_capable); pBuf += len; buf_len -= len; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 048db4e6a24e..98527c6698c9 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1341,6 +1341,8 @@ typedef struct sSirSmeAssocInd { uint8_t max_mcs_idx; uint8_t rx_mcs_map; uint8_t tx_mcs_map; + /* Extended CSA capability of station */ + uint8_t ecsa_capable; } tSirSmeAssocInd, *tpSirSmeAssocInd; /* / Definition for Association confirm */ diff --git a/core/mac/src/include/dph_global.h b/core/mac/src/include/dph_global.h index 35f2a34497fc..ae8770020c1a 100644 --- a/core/mac/src/include/dph_global.h +++ b/core/mac/src/include/dph_global.h @@ -265,6 +265,8 @@ typedef struct sDphHashNode { int8_t del_sta_ctx_rssi; bool sta_deletion_in_progress; struct parsed_ies parsed_ies; + /* Flag indicating connected STA doesn't support ECSA */ + uint8_t non_ecsa_capable; #ifdef WLAN_FEATURE_11AX tDot11fIEvendor_he_cap he_config; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index df499f27ec84..cd8d8355200f 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -503,6 +503,8 @@ typedef struct sPESession /* Added to Support BT-AMP */ bool ignore_assoc_disallowed; bool send_p2p_conf_frame; bool process_ho_fail; + /* Number of STAs that do not support ECSA capability */ + uint8_t lim_non_ecsa_cap_num; #ifdef WLAN_FEATURE_11AX bool he_capable; tDot11fIEvendor_he_cap he_config; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index da6e9dde4f1b..cf8bb777963d 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3031,6 +3031,17 @@ lim_delete_dph_hash_entry(tpAniSirGlobal mac_ctx, tSirMacAddr sta_addr, sta_ds, &beacon_params, session_entry); } + if (sta_ds->non_ecsa_capable) { + if (session_entry->lim_non_ecsa_cap_num == 0) { + pe_debug("NonECSA sta 0, id %d is ecsa", + sta_id); + } else { + session_entry->lim_non_ecsa_cap_num--; + pe_debug("reducing the non ECSA num to %d", + session_entry->lim_non_ecsa_cap_num); + } + } + if (LIM_IS_IBSS_ROLE(session_entry)) lim_ibss_decide_protection_on_delete(mac_ctx, sta_ds, &beacon_params, session_entry); diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index 9c39b71e694a..82f9da0176e7 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -1368,6 +1368,13 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, (uint8_t) vht_caps->ldpcCodingCap; } + if (assoc_req->ExtCap.present) + sta_ds->non_ecsa_capable = + !((struct s_ext_cap *)assoc_req->ExtCap.bytes)-> + ext_chan_switch; + else + sta_ds->non_ecsa_capable = 1; + if (!assoc_req->wmeInfoPresent) { sta_ds->mlmStaContext.htCapability = 0; sta_ds->mlmStaContext.vhtCapability = 0; @@ -2390,6 +2397,10 @@ void lim_send_mlm_assoc_ind(tpAniSirGlobal mac_ctx, assoc_ind->max_mcs_idx = maxidx; } fill_mlm_assoc_ind_vht(assoc_req, sta_ds, assoc_ind); + if (assoc_req->ExtCap.present) + assoc_ind->ecsa_capable = + ((struct s_ext_cap *)assoc_req->ExtCap.bytes)-> + ext_chan_switch; /* updates VHT information in assoc indication */ lim_fill_assoc_ind_vht_info(mac_ctx, session_entry, assoc_req, 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 602f74bd972f..89e7bd37b36b 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 @@ -783,6 +783,7 @@ lim_fill_assoc_ind_params(tpAniSirGlobal mac_ctx, sme_assoc_ind->max_mcs_idx = assoc_ind->max_mcs_idx; sme_assoc_ind->rx_mcs_map = assoc_ind->rx_mcs_map; sme_assoc_ind->tx_mcs_map = assoc_ind->tx_mcs_map; + sme_assoc_ind->ecsa_capable = assoc_ind->ecsa_capable; } /** diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 15b835552a24..85cc05f8c9f7 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1306,6 +1306,9 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx, lim_decide_ap_protection(mac_ctx, peer_addr, &beacon_params, pe_session); + if (LIM_IS_AP_ROLE(pe_session) && sta->non_ecsa_capable) + pe_session->lim_non_ecsa_cap_num++; + lim_update_short_preamble(mac_ctx, peer_addr, &beacon_params, pe_session); lim_update_short_slot_time(mac_ctx, peer_addr, &beacon_params, diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 4cfa3d749e0a..ab14ea733195 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -277,6 +277,7 @@ typedef struct sLimMlmAssocInd { uint8_t max_mcs_idx; uint8_t rx_mcs_map; uint8_t tx_mcs_map; + uint8_t ecsa_capable; } tLimMlmAssocInd, *tpLimMlmAssocInd; typedef struct sLimMlmReassocReq { @@ -314,6 +315,7 @@ typedef struct sLimMlmReassocInd { uint8_t *beaconPtr; uint32_t assocReqLength; uint8_t *assocReqPtr; + uint8_t ecsa_capable; } tLimMlmReassocInd, *tpLimMlmReassocInd; typedef struct sLimMlmAuthCnf { diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index b3e29fff298e..09191bf0ba1a 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -266,6 +266,7 @@ typedef struct sap_StationAssocIndication_s { eCsrEncryptionType negotiatedUCEncryptionType; eCsrEncryptionType negotiatedMCEncryptionType; bool fAuthRequired; + uint8_t ecsa_capable; } tSap_StationAssocIndication; typedef struct sap_StationAssocReassocCompleteEvent_s { @@ -298,6 +299,7 @@ typedef struct sap_StationAssocReassocCompleteEvent_s { uint8_t max_mcs_idx; uint8_t rx_mcs_map; uint8_t tx_mcs_map; + uint8_t ecsa_capable; } tSap_StationAssocReassocCompleteEvent; typedef struct sap_StationDisassocCompleteEvent_s { diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 5cfd69c8f60e..6b926c693625 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2322,6 +2322,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, assoc_ind->assocReqLength = csr_roaminfo->assocReqLength; assoc_ind->assocReqPtr = csr_roaminfo->assocReqPtr; assoc_ind->fWmmEnabled = csr_roaminfo->wmmEnabledSta; + assoc_ind->ecsa_capable = csr_roaminfo->ecsa_capable; if (csr_roaminfo->u.pConnectedProfile != NULL) { assoc_ind->negotiatedAuthType = csr_roaminfo->u.pConnectedProfile->AuthType; @@ -2462,6 +2463,7 @@ QDF_STATUS sap_signal_hdd_event(ptSapContext sap_ctx, reassoc_complete->max_mcs_idx = csr_roaminfo->max_mcs_idx; reassoc_complete->rx_mcs_map = csr_roaminfo->rx_mcs_map; reassoc_complete->tx_mcs_map = csr_roaminfo->tx_mcs_map; + reassoc_complete->ecsa_capable = csr_roaminfo->ecsa_capable; break; case eSAP_STA_DISASSOC_EVENT: diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 02bf47c49784..ea9634f35d2c 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1462,6 +1462,8 @@ typedef struct tagCsrRoamInfo { uint8_t max_mcs_idx; uint8_t rx_mcs_map; uint8_t tx_mcs_map; + /* Extended capabilities of STA */ + uint8_t ecsa_capable; } tCsrRoamInfo; typedef struct tagCsrFreqScanInfo { @@ -1500,6 +1502,8 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf { uint8_t max_mcs_idx; uint8_t rx_mcs_map; uint8_t tx_mcs_map; + /* Extended capabilities of STA */ + uint8_t ecsa_capable; } tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf; typedef struct tagCsrSummaryStatsInfo { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 846b90fc401e..53e38a8e7408 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -9868,6 +9868,7 @@ void csr_roam_joined_state_msg_processor(tpAniSirGlobal pMac, void *pMsgBuf) pRoamInfo->max_mcs_idx = pUpperLayerAssocCnf->max_mcs_idx; pRoamInfo->rx_mcs_map = pUpperLayerAssocCnf->rx_mcs_map; pRoamInfo->tx_mcs_map = pUpperLayerAssocCnf->tx_mcs_map; + pRoamInfo->ecsa_capable = pUpperLayerAssocCnf->ecsa_capable; if (CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile)) { pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED; @@ -10619,6 +10620,7 @@ csr_roam_chk_lnk_assoc_ind(tpAniSirGlobal mac_ctx, tSirSmeRsp *msg_ptr) sizeof(struct qdf_mac_addr)); roam_info_ptr->wmmEnabledSta = pAssocInd->wmmEnabledSta; roam_info_ptr->timingMeasCap = pAssocInd->timingMeasCap; + roam_info_ptr->ecsa_capable = pAssocInd->ecsa_capable; qdf_mem_copy(&roam_info_ptr->chan_info, &pAssocInd->chan_info, sizeof(tSirSmeChanInfo)); @@ -15278,6 +15280,9 @@ QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(tpAniSirGlobal pMac, pBuf = (uint8_t *)&pMsg->tx_mcs_map; *pBuf = pAssocInd->tx_mcs_map; + pBuf = (uint8_t *)&pMsg->ecsa_capable; + *pBuf = pAssocInd->ecsa_capable; + msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF; msgQ.bodyptr = pMsg; msgQ.bodyval = 0;