diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.h b/components/tdls/core/src/wlan_tdls_cmds_process.h index 56a06164f9..b6d7387988 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.h +++ b/components/tdls/core/src/wlan_tdls_cmds_process.h @@ -29,47 +29,6 @@ ((TDLS_SETUP_REQUEST <= action) && \ (TDLS_SETUP_CONFIRM >= action)) -/** - * struct tdls_add_sta_req - TDLS request struct TDLS module --> PE - * same as struct tSirTdlsAddStaReq; - * @message_type: eWNI_SME_TDLS_ADD_STA_REQ - * @length: message length - * @session_id: session id - * @transaction_id: transaction id for cmd - * @bssid: bssid - * @tdls_oper: add peer type - * @peermac: MAC address for TDLS peer - * @capability: mac capability as sSirMacCapabilityInfo - * @extn_capability: extent capability - * @supported_rates_length: rates length - * @supported_rates: supported rates - * @htcap_present: ht capability present - * @ht_cap: ht capability - * @vhtcap_present: vht capability present - * @vht_cap: vht capability - * @uapsd_queues: uapsd queue as sSirMacQosInfoStation - * @max_sp: maximum service period - */ -struct tdls_add_sta_req { - uint16_t message_type; - uint16_t length; - uint8_t session_id; - uint16_t transaction_id; - struct qdf_mac_addr bssid; - enum tdls_add_oper tdls_oper; - struct qdf_mac_addr peermac; - uint16_t capability; - uint8_t extn_capability[WLAN_MAC_MAX_EXTN_CAP]; - uint8_t supported_rates_length; - uint8_t supported_rates[WLAN_MAC_MAX_SUPP_RATES]; - uint8_t htcap_present; - struct htcap_cmn_ie ht_cap; - uint8_t vhtcap_present; - struct vhtcap vht_cap; - uint8_t uapsd_queues; - uint8_t max_sp; -}; - /** * struct tdls_del_sta_req - TDLS Request struct TDLS module --> PE * same as sSirTdlsDelStaReq diff --git a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h index d98831e564..2f17b2c7ce 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h @@ -1248,4 +1248,44 @@ struct tdls_send_mgmt_request { uint8_t add_ie[1]; }; +/** + * struct tdls_add_sta_req - TDLS request struct TDLS module --> PE + * @message_type: eWNI_SME_TDLS_ADD_STA_REQ + * @length: message length + * @session_id: session id + * @transaction_id: transaction id for cmd + * @bssid: bssid + * @tdls_oper: add peer type + * @peermac: MAC address for TDLS peer + * @capability: mac capability as sSirMacCapabilityInfo + * @extn_capability: extent capability + * @supported_rates_length: rates length + * @supported_rates: supported rates + * @htcap_present: ht capability present + * @ht_cap: ht capability + * @vhtcap_present: vht capability present + * @vht_cap: vht capability + * @uapsd_queues: uapsd queue as sSirMacQosInfoStation + * @max_sp: maximum service period + */ +struct tdls_add_sta_req { + uint16_t message_type; + uint16_t length; + uint8_t session_id; + uint16_t transaction_id; + struct qdf_mac_addr bssid; + enum tdls_add_oper tdls_oper; + struct qdf_mac_addr peermac; + uint16_t capability; + uint8_t extn_capability[WLAN_MAC_MAX_EXTN_CAP]; + uint8_t supported_rates_length; + uint8_t supported_rates[WLAN_MAC_MAX_SUPP_RATES]; + uint8_t htcap_present; + struct htcap_cmn_ie ht_cap; + uint8_t vhtcap_present; + struct vhtcap vht_cap; + uint8_t uapsd_queues; + uint8_t max_sp; +}; + #endif diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 4d3a362809..aa3eb13a18 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2518,28 +2518,6 @@ struct sir_antenna_mode_resp { }; #ifdef FEATURE_WLAN_TDLS -/* TDLS Request struct SME-->PE */ -typedef struct sSirTdlsAddStaReq { - uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */ - uint16_t length; - uint8_t sessionId; /* Session ID */ - uint16_t transactionId; /* Transaction ID for cmd */ - /* For multi-session, for PE to locate peSession ID */ - struct qdf_mac_addr bssid; - enum tdls_add_oper tdlsAddOper; - struct qdf_mac_addr peermac; - uint16_t capability; - uint8_t extn_capability[SIR_MAC_MAX_EXTN_CAP]; - uint8_t supported_rates_length; - uint8_t supported_rates[SIR_MAC_MAX_SUPP_RATES]; - uint8_t htcap_present; - struct htcap_cmn_ie htCap; - uint8_t vhtcap_present; - tSirVHTCap vhtCap; - uint8_t uapsd_queues; - uint8_t max_sp; -} tSirTdlsAddStaReq, *tpSirSmeTdlsAddStaReq; - /* TDLS Request struct SME-->PE */ typedef struct sSirTdlsDelStaReq { uint16_t messageType; /* eWNI_SME_TDLS_DISCOVERY_START_REQ */ diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 863de4857a..2244e8623b 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -85,9 +85,6 @@ #define MIN_VENDOR_SPECIFIC_IE_SIZE 5 #endif -static QDF_STATUS lim_tdls_setup_add_sta(struct mac_context *mac, - tSirTdlsAddStaReq * pAddStaReq, struct pe_session *pe_session); - /* * TDLS data frames will go out/come in as non-qos data. * so, eth_890d_header will be aligned access.. @@ -2000,14 +1997,15 @@ QDF_STATUS lim_send_tdls_link_setup_cnf_frame(struct mac_context *mac, return QDF_STATUS_SUCCESS; } -/* This Function is similar to populate_dot11f_ht_caps, except that the HT Capabilities - * are considered from the AddStaReq rather from the cfg.dat as in populate_dot11f_ht_caps +/* This Function is similar to populate_dot11f_ht_caps, except that + * the HT Capabilities are considered from the AddStaReq rather from + * the cfg.dat as in populate_dot11f_ht_caps */ -static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, - struct pe_session *pe_session, - tSirTdlsAddStaReq * - pTdlsAddStaReq, - tDot11fIEHTCaps *pDot11f) +static QDF_STATUS +lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, + struct pe_session *pe_session, + struct tdls_add_sta_req *add_sta_req, + tDot11fIEHTCaps *pDot11f) { uint32_t nCfgValue; uint8_t nCfgValue8; @@ -2021,7 +2019,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; tSirMacASCapabilityInfo *pASCapabilityInfo; - nCfgValue = pTdlsAddStaReq->htCap.hc_cap; + nCfgValue = add_sta_req->ht_cap.hc_cap; uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; @@ -2070,7 +2068,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->shortGI40MHz, pDot11f->dsssCckMode40MHz); - nCfgValue = pTdlsAddStaReq->htCap.ampdu_param; + nCfgValue = add_sta_req->ht_cap.ampdu_param; nCfgValue8 = (uint8_t) nCfgValue; pHTParametersInfo = (tSirMacHTParametersInfo *) &nCfgValue8; @@ -2080,10 +2078,10 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->reserved1 = pHTParametersInfo->reserved; pe_debug("AMPDU Param: %x", nCfgValue); - qdf_mem_copy(pDot11f->supportedMCSSet, pTdlsAddStaReq->htCap.mcsset, + qdf_mem_copy(pDot11f->supportedMCSSet, add_sta_req->ht_cap.mcsset, SIZE_OF_SUPPORTED_MCS_SET); - nCfgValue = pTdlsAddStaReq->htCap.extcap; + nCfgValue = add_sta_req->ht_cap.extcap; uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; @@ -2091,7 +2089,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->transitionTime = uHTCapabilityInfo.extHtCapInfo.transitionTime; pDot11f->mcsFeedback = uHTCapabilityInfo.extHtCapInfo.mcsFeedback; - nCfgValue = pTdlsAddStaReq->htCap.txbf_cap; + nCfgValue = add_sta_req->ht_cap.txbf_cap; pTxBFCapabilityInfo = (tSirMacTxBFCapabilityInfo *) &nCfgValue; pDot11f->txBF = pTxBFCapabilityInfo->txBF; @@ -2116,7 +2114,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->compressedSteeringMatrixBFAntennae = pTxBFCapabilityInfo->compressedSteeringMatrixBFAntennae; - nCfgValue = pTdlsAddStaReq->htCap.antenna; + nCfgValue = add_sta_req->ht_cap.antenna; nCfgValue8 = (uint8_t) nCfgValue; @@ -2132,7 +2130,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, pDot11f->rxAS = pASCapabilityInfo->rxAS; pDot11f->txSoundingPPDUs = pASCapabilityInfo->txSoundingPPDUs; - pDot11f->present = pTdlsAddStaReq->htcap_present; + pDot11f->present = add_sta_req->htcap_present; return QDF_STATUS_SUCCESS; @@ -2140,7 +2138,7 @@ static QDF_STATUS lim_tdls_populate_dot11f_ht_caps(struct mac_context *mac, static QDF_STATUS lim_tdls_populate_dot11f_vht_caps(struct mac_context *mac, - tSirTdlsAddStaReq *pTdlsAddStaReq, + struct tdls_add_sta_req *add_sta_req, tDot11fIEVHTCaps *pDot11f) { uint32_t nCfgValue = 0; @@ -2154,9 +2152,9 @@ lim_tdls_populate_dot11f_vht_caps(struct mac_context *mac, tSirMacVHTRxSupDataRateInfo vhtRxsupDataRateInfo; } uVHTSupDataRateInfo; - pDot11f->present = pTdlsAddStaReq->vhtcap_present; + pDot11f->present = add_sta_req->vhtcap_present; - nCfgValue = pTdlsAddStaReq->vhtCap.vhtCapInfo; + nCfgValue = add_sta_req->vht_cap.vht_capinfo; uVHTCapabilityInfo.nCfgValue32 = nCfgValue; pDot11f->maxMPDULen = uVHTCapabilityInfo.vhtCapInfo.maxMPDULen; @@ -2184,16 +2182,16 @@ lim_tdls_populate_dot11f_vht_caps(struct mac_context *mac, pDot11f->txAntPattern = uVHTCapabilityInfo.vhtCapInfo.txAntPattern; pDot11f->reserved1 = uVHTCapabilityInfo.vhtCapInfo.reserved1; - pDot11f->rxMCSMap = pTdlsAddStaReq->vhtCap.suppMcs.rxMcsMap; + pDot11f->rxMCSMap = add_sta_req->vht_cap.supp_mcs.rx_mcs_map; - nCfgValue = pTdlsAddStaReq->vhtCap.suppMcs.rxHighest; + nCfgValue = add_sta_req->vht_cap.supp_mcs.rx_highest; uVHTSupDataRateInfo.nCfgValue16 = nCfgValue & 0xffff; pDot11f->rxHighSupDataRate = uVHTSupDataRateInfo.vhtRxsupDataRateInfo.rxSupDataRate; - pDot11f->txMCSMap = pTdlsAddStaReq->vhtCap.suppMcs.txMcsMap; + pDot11f->txMCSMap = add_sta_req->vht_cap.supp_mcs.tx_mcs_map; - nCfgValue = pTdlsAddStaReq->vhtCap.suppMcs.txHighest; + nCfgValue = add_sta_req->vht_cap.supp_mcs.tx_highest; uVHTSupDataRateInfo.nCfgValue16 = nCfgValue & 0xffff; pDot11f->txSupDataRate = uVHTSupDataRateInfo.vhtTxSupDataRateInfo.txSupDataRate; @@ -2409,7 +2407,7 @@ lim_tdls_populate_matching_rate_set(struct mac_context *mac_ctx, */ static void lim_tdls_update_hash_node_info(struct mac_context *mac, tDphHashNode *sta, - tSirTdlsAddStaReq *pTdlsAddStaReq, + struct tdls_add_sta_req *add_sta_req, struct pe_session *pe_session) { tDot11fIEHTCaps htCap = {0,}; @@ -2419,10 +2417,11 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac, tDot11fIEVHTCaps vhtCap; uint8_t cbMode; - if (pTdlsAddStaReq->tdlsAddOper == TDLS_OPER_ADD) { + if (add_sta_req->tdls_oper == TDLS_OPER_ADD) { populate_dot11f_ht_caps(mac, pe_session, &htCap); - } else if (pTdlsAddStaReq->tdlsAddOper == TDLS_OPER_UPDATE) { - lim_tdls_populate_dot11f_ht_caps(mac, NULL, pTdlsAddStaReq, &htCap); + } else if (add_sta_req->tdls_oper == TDLS_OPER_UPDATE) { + lim_tdls_populate_dot11f_ht_caps(mac, NULL, + add_sta_req, &htCap); } htCaps = &htCap; if (htCaps->present) { @@ -2458,11 +2457,11 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac, rxHighestDataRate, htCaps->supportedMCSSet); sta->baPolicyFlag = 0xFF; - sta->ht_caps = pTdlsAddStaReq->htCap.hc_cap; + sta->ht_caps = add_sta_req->ht_cap.hc_cap; } else { sta->mlmStaContext.htCapability = 0; } - lim_tdls_populate_dot11f_vht_caps(mac, pTdlsAddStaReq, &vhtCap); + lim_tdls_populate_dot11f_vht_caps(mac, add_sta_req, &vhtCap); pVhtCaps = &vhtCap; if (pVhtCaps->present) { sta->mlmStaContext.vhtCapability = 1; @@ -2486,12 +2485,12 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac, sta->vhtLdpcCapable = pVhtCaps->ldpcCodingCap; sta->vhtBeamFormerCapable = 0; - pVhtCaps_txbf = (tDot11fIEVHTCaps *) (&pTdlsAddStaReq->vhtCap); + pVhtCaps_txbf = (tDot11fIEVHTCaps *) (&add_sta_req->vht_cap); pVhtCaps_txbf->suBeamformeeCap = 0; pVhtCaps_txbf->suBeamFormerCap = 0; pVhtCaps_txbf->muBeamformerCap = 0; pVhtCaps_txbf->muBeamformeeCap = 0; - sta->vht_caps = pTdlsAddStaReq->vhtCap.vhtCapInfo; + sta->vht_caps = add_sta_req->vht_cap.vht_capinfo; } else { sta->mlmStaContext.vhtCapability = 0; sta->vhtSupportedChannelWidthSet = @@ -2514,31 +2513,29 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac, sta->htSecondaryChannelOffset = cbMode; } /* Lets enable QOS parameter */ - sta->qosMode = (pTdlsAddStaReq->capability & CAPABILITIES_QOS_OFFSET) - || pTdlsAddStaReq->htcap_present; + sta->qosMode = (add_sta_req->capability & CAPABILITIES_QOS_OFFSET) + || add_sta_req->htcap_present; sta->wmeEnabled = 1; sta->lleEnabled = 0; /* TDLS Dummy AddSTA does not have qosInfo , is it OK ?? */ sta->qos.capability.qosInfo = - (*(tSirMacQosInfoStation *) &pTdlsAddStaReq->uapsd_queues); + (*(tSirMacQosInfoStation *) &add_sta_req->uapsd_queues); /* populate matching rate set */ /* TDLS Dummy AddSTA does not have HTCap,VHTCap,Rates info , is it OK ?? */ lim_tdls_populate_matching_rate_set(mac, sta, - pTdlsAddStaReq->supported_rates, - pTdlsAddStaReq-> - supported_rates_length, - (uint8_t *)pTdlsAddStaReq-> - htCap.mcsset, + add_sta_req->supported_rates, + add_sta_req->supported_rates_length, + add_sta_req->ht_cap.mcsset, pe_session, pVhtCaps); /* TDLS Dummy AddSTA does not have right capability , is it OK ?? */ sta->mlmStaContext.capabilityInfo = - (*(tSirMacCapabilityInfo *) &pTdlsAddStaReq->capability); + (*(tSirMacCapabilityInfo *) &add_sta_req->capability); return; } @@ -2547,7 +2544,7 @@ static void lim_tdls_update_hash_node_info(struct mac_context *mac, * Add STA for TDLS setup procedure */ static QDF_STATUS lim_tdls_setup_add_sta(struct mac_context *mac, - tSirTdlsAddStaReq *pAddStaReq, + struct tdls_add_sta_req *pAddStaReq, struct pe_session *pe_session) { tpDphHashNode sta = NULL; @@ -2557,7 +2554,7 @@ static QDF_STATUS lim_tdls_setup_add_sta(struct mac_context *mac, sta = dph_lookup_hash_entry(mac, pAddStaReq->peermac.bytes, &aid, &pe_session->dph.dphHashTable); - if (sta && pAddStaReq->tdlsAddOper == TDLS_OPER_ADD) { + if (sta && pAddStaReq->tdls_oper == TDLS_OPER_ADD) { pe_err("TDLS entry for peer: "MAC_ADDRESS_STR " already exist, cannot add new entry", MAC_ADDR_ARRAY(pAddStaReq->peermac.bytes)); return QDF_STATUS_E_FAILURE; @@ -2610,7 +2607,7 @@ static QDF_STATUS lim_tdls_setup_add_sta(struct mac_context *mac, status = lim_add_sta(mac, sta, - (pAddStaReq->tdlsAddOper == + (pAddStaReq->tdls_oper == TDLS_OPER_UPDATE) ? true : false, pe_session); if (QDF_STATUS_SUCCESS != status) { @@ -2964,24 +2961,20 @@ static QDF_STATUS lim_send_sme_tdls_del_sta_rsp(struct mac_context *mac, return ret; } -/* - * Process Send Mgmt Request from SME and transmit to AP. - */ QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac, - uint32_t *pMsgBuf) + void *msg) { - /* get all discovery request parameters */ - tSirTdlsAddStaReq *pAddStaReq = (tSirTdlsAddStaReq *) pMsgBuf; + struct tdls_add_sta_req *add_sta_req = msg; struct pe_session *pe_session; - uint8_t sessionId; + uint8_t session_id; pe_debug("TDLS Add STA Request Received"); pe_session = - pe_find_session_by_bssid(mac, pAddStaReq->bssid.bytes, - &sessionId); + pe_find_session_by_bssid(mac, add_sta_req->bssid.bytes, + &session_id); if (pe_session == NULL) { pe_err("PE Session does not exist for given sme sessionId: %d", - pAddStaReq->sessionId); + add_sta_req->session_id); goto lim_tdls_add_sta_error; } @@ -2994,7 +2987,7 @@ QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac, if (lim_is_roam_synch_in_progress(pe_session)) { pe_err("roaming in progress, reject add sta! for session %d", - pAddStaReq->sessionId); + add_sta_req->session_id); goto lim_tdls_add_sta_error; } @@ -3011,16 +3004,16 @@ QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac, /* To start with, send add STA request to HAL */ - if (QDF_STATUS_E_FAILURE == lim_tdls_setup_add_sta(mac, pAddStaReq, pe_session)) { + if (QDF_STATUS_E_FAILURE == lim_tdls_setup_add_sta(mac, add_sta_req, pe_session)) { pe_err("Add TDLS Station request failed"); goto lim_tdls_add_sta_error; } return QDF_STATUS_SUCCESS; lim_tdls_add_sta_error: lim_send_sme_tdls_add_sta_rsp(mac, - pAddStaReq->sessionId, - pAddStaReq->peermac.bytes, - (pAddStaReq->tdlsAddOper == TDLS_OPER_UPDATE), + add_sta_req->session_id, + add_sta_req->peermac.bytes, + (add_sta_req->tdls_oper == TDLS_OPER_UPDATE), NULL, QDF_STATUS_E_FAILURE); return QDF_STATUS_SUCCESS; diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 00c5581b5f..0128381477 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -606,8 +606,18 @@ void lim_init_tdls_data(struct mac_context *, struct pe_session *); QDF_STATUS lim_process_sme_tdls_mgmt_send_req(struct mac_context *mac_ctx, void *msg); +/** + * lim_process_sme_tdls_add_sta_req() - process TDLS Add STA + * @mac_ctx: global mac context + * @msg: message buffer received from SME. + * + * Process TDLS Add Station request + * + * Return: QDF_STATUS_SUCCESS on success, error code otherwise + */ QDF_STATUS lim_process_sme_tdls_add_sta_req(struct mac_context *mac, - uint32_t *pMsgBuf); + void *msg); + QDF_STATUS lim_process_sme_tdls_del_sta_req(struct mac_context *mac, uint32_t *pMsgBuf); void lim_send_sme_mgmt_tx_completion(