From 81722635e9a24573516dbc0ad5ea776c3c4b4e28 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Tue, 26 Sep 2017 12:11:43 -0700 Subject: [PATCH] qcacld-3.0: Do not check sub type in vendor VHT IE parsing Vendor VHT IE carries different sub type values from different devices hence vendor VHT IE parsing fails if sub type value is considered to check IE presence. Do not check for sub type value in vendor VHT IE parsing Change-Id: I50a8916214c17c1873fd90b65d29e48f1fa13994 CRs-Fixed: 2115113 --- core/mac/src/cfg/cfgUtil/dot11f.frms | 3 +- core/mac/src/include/dot11f.h | 5 ++- core/mac/src/pe/include/lim_session.h | 1 + core/mac/src/pe/lim/lim_assoc_utils.c | 2 + .../src/pe/lim/lim_send_frames_host_roam.c | 2 + .../src/pe/lim/lim_send_management_frames.c | 4 ++ .../mac/src/sys/legacy/src/utils/src/dot11f.c | 43 +++++++++++-------- .../src/sys/legacy/src/utils/src/parser_api.c | 13 +++++- 8 files changed, 50 insertions(+), 23 deletions(-) diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index 1c9bca5b309c..1db71025ebdb 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -3306,8 +3306,9 @@ 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, 0x04, 0x08) +IE vendor_vht_ie (EID_VENDOR_SPECIFIC) OUI (0x00, 0x90, 0x4c, 0x04) { + 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 718fbbe24f7d..f179836f94e7 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' - * Tue Sep 26 14:44:22 2017 from the following file(s): + * Tue Sep 26 17:32:45 2017 from the following file(s): * * dot11f.frms * @@ -9108,9 +9108,10 @@ uint32_t dot11f_get_packed_ie_vendor_he_op( }; /* End extern "C". */ #endif /* C++ */ -/* EID 221 (0xdd) {OUI 0x00, 0x90, 0x4c, 0x04, 0x08} */ +/* EID 221 (0xdd) {OUI 0x00, 0x90, 0x4c, 0x04} */ typedef struct sDot11fIEvendor_vht_ie { uint8_t present; + 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 f2ab85979456..29aa56faa3e0 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -482,6 +482,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ #endif uint8_t sap_dot11mc; bool is_vendor_specific_vhtcaps; + 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 2e2030921a86..aa8ecb06fca5 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3242,6 +3242,8 @@ 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_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 bce9c7f45636..1f82979a2fc9 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,6 +304,8 @@ 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.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 7fb25cb74d9a..c86be8a5294f 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1258,6 +1258,8 @@ 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.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); @@ -1866,6 +1868,8 @@ 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.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 dc84421967c8..1de062912585 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' - * Tue Sep 26 14:44:22 2017 from the following file(s): + * Tue Sep 26 17:32:45 2017 from the following file(s): * * dot11f.frms * @@ -6956,6 +6956,9 @@ uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, if (pDst->present) status = DOT11F_DUPLICATE_IE; pDst->present = 1; + pDst->sub_type = *pBuf; + pBuf += 1; + ielen -= (uint8_t)1; (void)pCtx; status |= unpack_core(pCtx, pBuf, @@ -7208,8 +7211,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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}, @@ -7368,8 +7371,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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, }, @@ -7643,8 +7646,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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, }, @@ -7873,8 +7876,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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, }, @@ -8099,8 +8102,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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, }, @@ -8743,8 +8746,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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, }, @@ -9029,8 +9032,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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}, @@ -9170,8 +9173,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, 4, 8}, - 5, DOT11F_EID_VENDOR_VHT_IE, 0, 0, }, + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 4, 0}, + 4, 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}, @@ -13305,6 +13308,7 @@ uint32_t dot11f_get_packed_ie_vendor_vht_ie(tpAniSirGlobal pCtx, uint32_t status = DOT11F_PARSE_SUCCESS; (void)pCtx; while (pIe->present) { + *pnNeeded += 1; status = get_packed_size_core(pCtx, (uint8_t *)pIe, pnNeeded, IES_vendor_vht_ie); break; @@ -23804,8 +23808,9 @@ uint32_t dot11f_pack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, ++pBuf; --nBuf; ++(*pnConsumed); *pBuf = 0x4; ++pBuf; --nBuf; ++(*pnConsumed); - *pBuf = 0x8; - ++pBuf; --nBuf; ++(*pnConsumed); + *pBuf = pSrc->sub_type; + *pnConsumed += 1; + pBuf += 1; 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 623cf7152805..fe0fb4e83a4c 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,6 +2565,8 @@ 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.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, @@ -2806,6 +2808,7 @@ 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.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, @@ -3096,6 +3099,8 @@ 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.sub_type = ar->vendor_vht_ie.sub_type; if (ar->OBSSScanParameters.present) { qdf_mem_copy(&pAssocRsp->obss_scanparams, &ar->OBSSScanParameters, @@ -3819,6 +3824,9 @@ 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.sub_type = + pBies->vendor_vht_ie.sub_type; if (pBies->vendor_vht_ie.VHTCaps.present) { pBeaconStruct->vendor_vht_ie.VHTCaps.present = 1; @@ -4173,8 +4181,11 @@ 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) + if (pBeacon->vendor_vht_ie.present) { + pBeaconStruct->vendor_vht_ie.sub_type = + pBeacon->vendor_vht_ie.sub_type; pe_debug("Vendor Specific VHT caps present in Beacon Frame!"); + } if (pBeacon->vendor_vht_ie.VHTCaps.present) { qdf_mem_copy(&pBeaconStruct->vendor_vht_ie.VHTCaps,