From cc448686052802ec295341d74d8b24dedc22454c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 20 Jul 2017 18:08:01 -0700 Subject: [PATCH] qcacld-3.0: Fix issue in processing VHT caps in vendor IE VHT caps in vendor IE are not parsed if the same vendor IE OUI is present twice with different type values. Check the type in vendor IE to detect the VHT caps in the vendor IE. Change-Id: I4d3fd7d6488719719718b84a2dbea7cda0c8e869 CRs-Fixed: 2080186 --- core/mac/src/cfg/cfgUtil/dot11f.frms | 4 +- core/mac/src/include/dot11f.h | 6 +-- core/mac/src/pe/include/lim_session.h | 2 - core/mac/src/pe/lim/lim_assoc_utils.c | 4 -- .../src/pe/lim/lim_send_frames_host_roam.c | 4 -- .../src/pe/lim/lim_send_management_frames.c | 12 +---- .../mac/src/sys/legacy/src/utils/src/dot11f.c | 52 ++++++++----------- .../src/sys/legacy/src/utils/src/parser_api.c | 21 -------- 8 files changed, 26 insertions(+), 79 deletions(-) diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index 3d9641409107..1c9bca5b309c 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -3306,10 +3306,8 @@ MULTIIE MBO_IE (EID_VENDOR_SPECIFIC) OUI ( 0x50, 0x6F, 0x9A, 0x16 ) OPTIONALTLV reduced_wan_metrics; } -IE vendor_vht_ie (EID_VENDOR_SPECIFIC) OUI (0x00, 0x90, 0x4c) +IE vendor_vht_ie (EID_VENDOR_SPECIFIC) OUI (0x00, 0x90, 0x4c, 0x04, 0x08) { - type, 1; - sub_type, 1; OPTIE IE VHTCaps; OPTIE IE VHTOperation; } diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 8b0dddff7e0c..718fbbe24f7d 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -35,7 +35,7 @@ * * * This file was automatically generated by 'framesc' - * Thu Aug 17 11:37:26 2017 from the following file(s): + * Tue Sep 26 14:44:22 2017 from the following file(s): * * dot11f.frms * @@ -9108,11 +9108,9 @@ uint32_t dot11f_get_packed_ie_vendor_he_op( }; /* End extern "C". */ #endif /* C++ */ -/* EID 221 (0xdd) {OUI 0x00, 0x90, 0x4c} */ +/* EID 221 (0xdd) {OUI 0x00, 0x90, 0x4c, 0x04, 0x08} */ typedef struct sDot11fIEvendor_vht_ie { uint8_t present; - uint8_t type; - uint8_t sub_type; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; } tDot11fIEvendor_vht_ie; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 0b28b1b16d8e..f2ab85979456 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -482,8 +482,6 @@ typedef struct sPESession /* Added to Support BT-AMP */ #endif uint8_t sap_dot11mc; bool is_vendor_specific_vhtcaps; - uint8_t vendor_specific_vht_ie_type; - uint8_t vendor_specific_vht_ie_sub_type; bool vendor_vht_sap; /* HS 2.0 Indication */ tDot11fIEhs20vendor_ie hs20vendor_ie; diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 26d48526e935..2e2030921a86 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3242,10 +3242,6 @@ lim_check_and_announce_join_success(tpAniSirGlobal mac_ctx, if ((IS_DOT11_MODE_VHT(session_entry->dot11mode)) && beacon_probe_rsp->vendor_vht_ie.VHTCaps.present) { session_entry->is_vendor_specific_vhtcaps = true; - session_entry->vendor_specific_vht_ie_type = - beacon_probe_rsp->vendor_vht_ie.type; - session_entry->vendor_specific_vht_ie_sub_type = - beacon_probe_rsp->vendor_vht_ie.sub_type; pe_debug("VHT caps are present in vendor specific IE"); } diff --git a/core/mac/src/pe/lim/lim_send_frames_host_roam.c b/core/mac/src/pe/lim/lim_send_frames_host_roam.c index 22747f045e56..293390a44358 100644 --- a/core/mac/src/pe/lim/lim_send_frames_host_roam.c +++ b/core/mac/src/pe/lim/lim_send_frames_host_roam.c @@ -304,10 +304,6 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session->is_vendor_specific_vhtcaps) { pe_debug("Populate Vendor VHT IEs in Re-Assoc Request"); frm.vendor_vht_ie.present = 1; - frm.vendor_vht_ie.type = - pe_session->vendor_specific_vht_ie_type; - frm.vendor_vht_ie.sub_type = - pe_session->vendor_specific_vht_ie_sub_type; frm.vendor_vht_ie.VHTCaps.present = 1; populate_dot11f_vht_caps(mac_ctx, pe_session, &frm.vendor_vht_ie.VHTCaps); 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 2a677cbc1d8a..45fa672af85f 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1258,14 +1258,11 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx, assoc_req->vendor_vht_ie.VHTCaps.present) { pe_debug("Populate Vendor VHT IEs in Assoc Rsponse"); frm.vendor_vht_ie.present = 1; - frm.vendor_vht_ie.type = - pe_session->vendor_specific_vht_ie_type; - frm.vendor_vht_ie.sub_type = - pe_session->vendor_specific_vht_ie_sub_type; - frm.vendor_vht_ie.VHTCaps.present = 1; populate_dot11f_vht_caps(mac_ctx, pe_session, &frm.vendor_vht_ie.VHTCaps); + populate_dot11f_vht_operation(mac_ctx, pe_session, + &frm.vendor_vht_ie.VHTOperation); is_vht = true; } populate_dot11f_ext_cap(mac_ctx, is_vht, &frm.ExtCap, @@ -1868,11 +1865,6 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session->is_vendor_specific_vhtcaps) { pe_debug("Populate Vendor VHT IEs in Assoc Request"); frm->vendor_vht_ie.present = 1; - frm->vendor_vht_ie.type = - pe_session->vendor_specific_vht_ie_type; - frm->vendor_vht_ie.sub_type = - pe_session->vendor_specific_vht_ie_sub_type; - frm->vendor_vht_ie.VHTCaps.present = 1; populate_dot11f_vht_caps(mac_ctx, pe_session, &frm->vendor_vht_ie.VHTCaps); diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index bd187d92094e..dc84421967c8 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -33,7 +33,7 @@ * * * This file was automatically generated by 'framesc' - * Thu Aug 17 11:37:26 2017 from the following file(s): + * Tue Sep 26 14:44:22 2017 from the following file(s): * * dot11f.frms * @@ -6956,12 +6956,6 @@ uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; - pDst->type = *pBuf; - pBuf += 1; - ielen -= (uint8_t)1; - pDst->sub_type = *pBuf; - pBuf += 1; - ielen -= (uint8_t)1; (void)pCtx; status |= unpack_core(pCtx, pBuf, @@ -7214,8 +7208,8 @@ static const tIEDefn IES_AssocRequest[] = { 4, DOT11F_EID_WFDIEOPAQUE, 0, 0, }, { offsetof(tDot11fAssocRequest, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, @@ -7374,8 +7368,8 @@ static const tIEDefn IES_AssocResponse[] = { 0, DOT11F_EID_FILS_KDE, 7, 0, }, { offsetof(tDot11fAssocResponse, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fAssocResponse, QCN_IE), offsetof(tDot11fIEQCN_IE, present), 0, "QCN_IE", 0, 10, 10, SigIeQCN_IE, {140, 253, 240, 1, 0}, 4, DOT11F_EID_QCN_IE, 0, 0, }, @@ -7649,8 +7643,8 @@ static const tIEDefn IES_Beacon[] = { 3, DOT11F_EID_VENDOR1IE, 0, 0, }, { offsetof(tDot11fBeacon, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fBeacon, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, 0, }, @@ -7879,8 +7873,8 @@ static const tIEDefn IES_Beacon2[] = { 3, DOT11F_EID_VENDOR1IE, 0, 0, }, { offsetof(tDot11fBeacon2, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fBeacon2, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, 0, }, @@ -8105,8 +8099,8 @@ static const tIEDefn IES_BeaconIEs[] = { 3, DOT11F_EID_VENDOR1IE, 0, 0, }, { offsetof(tDot11fBeaconIEs, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fBeaconIEs, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, 0, }, @@ -8749,8 +8743,8 @@ static const tIEDefn IES_ProbeResponse[] = { 3, DOT11F_EID_VENDOR1IE, 0, 0, }, { offsetof(tDot11fProbeResponse, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fProbeResponse, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, 0, }, @@ -9035,8 +9029,8 @@ static const tIEDefn IES_ReAssocRequest[] = { 0, DOT11F_EID_QOSMAPSET, 0, 0, }, { offsetof(tDot11fReAssocRequest, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fReAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, @@ -9176,8 +9170,8 @@ static const tIEDefn IES_ReAssocResponse[] = { 0, DOT11F_EID_QOSMAPSET, 0, 0, }, { offsetof(tDot11fReAssocResponse, vendor_vht_ie), offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", - 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 8}, + 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, { offsetof(tDot11fReAssocResponse, vendor_he_cap), offsetof(tDot11fIEvendor_he_cap, present), 0, "vendor_he_cap", 0, 22, 49, SigIevendor_he_cap, {0, 19, 116, 1, 0}, @@ -13311,8 +13305,6 @@ uint32_t dot11f_get_packed_ie_vendor_vht_ie(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; (void)pCtx; while (pIe->present) { - *pnNeeded += 1; - *pnNeeded += 1; status = get_packed_size_core(pCtx, (uint8_t *)pIe, pnNeeded, IES_vendor_vht_ie); break; @@ -23810,12 +23802,10 @@ uint32_t dot11f_pack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, ++pBuf; --nBuf; ++(*pnConsumed); *pBuf = 0x4c; ++pBuf; --nBuf; ++(*pnConsumed); - *pBuf = pSrc->type; - *pnConsumed += 1; - pBuf += 1; - *pBuf = pSrc->sub_type; - *pnConsumed += 1; - pBuf += 1; + *pBuf = 0x4; + ++pBuf; --nBuf; ++(*pnConsumed); + *pBuf = 0x8; + ++pBuf; --nBuf; ++(*pnConsumed); status = pack_core(pCtx, (uint8_t *)pSrc, pBuf, diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 5039e8e4bd07..623cf7152805 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2565,10 +2565,6 @@ tSirRetStatus sir_convert_probe_frame2_struct(tpAniSirGlobal pMac, pProbeResp->Vendor3IEPresent = pr->Vendor3IE.present; pProbeResp->vendor_vht_ie.present = pr->vendor_vht_ie.present; - if (pr->vendor_vht_ie.present) { - pProbeResp->vendor_vht_ie.type = pr->vendor_vht_ie.type; - pProbeResp->vendor_vht_ie.sub_type = pr->vendor_vht_ie.sub_type; - } if (pr->vendor_vht_ie.VHTCaps.present) { qdf_mem_copy(&pProbeResp->vendor_vht_ie.VHTCaps, &pr->vendor_vht_ie.VHTCaps, @@ -2810,9 +2806,6 @@ sir_convert_assoc_req_frame2_struct(tpAniSirGlobal pMac, pAssocReq->vendor_vht_ie.present = ar->vendor_vht_ie.present; if (ar->vendor_vht_ie.present) { - pAssocReq->vendor_vht_ie.type = ar->vendor_vht_ie.type; - pAssocReq->vendor_vht_ie.sub_type = ar->vendor_vht_ie.sub_type; - if (ar->vendor_vht_ie.VHTCaps.present) { qdf_mem_copy(&pAssocReq->vendor_vht_ie.VHTCaps, &ar->vendor_vht_ie.VHTCaps, @@ -3103,10 +3096,6 @@ sir_convert_assoc_resp_frame2_struct(tpAniSirGlobal pMac, } pAssocRsp->vendor_vht_ie.present = ar->vendor_vht_ie.present; - if (ar->vendor_vht_ie.present) { - pAssocRsp->vendor_vht_ie.type = ar->vendor_vht_ie.type; - pAssocRsp->vendor_vht_ie.sub_type = ar->vendor_vht_ie.sub_type; - } if (ar->OBSSScanParameters.present) { qdf_mem_copy(&pAssocRsp->obss_scanparams, &ar->OBSSScanParameters, @@ -3830,11 +3819,6 @@ sir_parse_beacon_ie(tpAniSirGlobal pMac, pBeaconStruct->Vendor1IEPresent = pBies->Vendor1IE.present; pBeaconStruct->Vendor3IEPresent = pBies->Vendor3IE.present; pBeaconStruct->vendor_vht_ie.present = pBies->vendor_vht_ie.present; - if (pBies->vendor_vht_ie.present) { - pBeaconStruct->vendor_vht_ie.type = pBies->vendor_vht_ie.type; - pBeaconStruct->vendor_vht_ie.sub_type = - pBies->vendor_vht_ie.sub_type; - } if (pBies->vendor_vht_ie.VHTCaps.present) { pBeaconStruct->vendor_vht_ie.VHTCaps.present = 1; @@ -4189,11 +4173,6 @@ sir_convert_beacon_frame2_struct(tpAniSirGlobal pMac, pBeaconStruct->Vendor3IEPresent = pBeacon->Vendor3IE.present; pBeaconStruct->vendor_vht_ie.present = pBeacon->vendor_vht_ie.present; - if (pBeacon->vendor_vht_ie.present) { - pBeaconStruct->vendor_vht_ie.type = pBeacon->vendor_vht_ie.type; - pBeaconStruct->vendor_vht_ie.sub_type = - pBeacon->vendor_vht_ie.sub_type; - } if (pBeacon->vendor_vht_ie.present) pe_debug("Vendor Specific VHT caps present in Beacon Frame!");