diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 32e113f9926d..1c2d5f5501b4 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -473,6 +473,10 @@ #define SIR_MAC_QCN_OUI_TYPE "\x8c\xfd\xf0\x01" #define SIR_MAC_QCN_OUI_TYPE_SIZE 4 +/* MBO OUI definitions */ +#define SIR_MAC_MBO_OUI "\x50\x6f\x9a\x16" +#define SIR_MAC_MBO_OUI_SIZE 4 + /* min size of wme oui header: oui(3) + type + subtype + version */ #define SIR_MAC_OUI_WME_HDR_MIN 6 diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index affa1296bed4..a0bebf0e16a9 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -3668,7 +3668,6 @@ FRAME AssocRequest // 7.2.3.4 OPTIE hs20vendor_ie; OPTIE QCN_IE; OPTIE he_cap; - OPTIE MBO_IE; OPTIE osen_ie; } // End frame AssocRequest. diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 2b2317d896f6..596466069d48 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -26,7 +26,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Aug 27 19:08:28 2018 from the following file(s): + * Tue Sep 18 11:47:29 2018 from the following file(s): * * dot11f.frms * @@ -9438,7 +9438,6 @@ typedef struct sDot11fAssocRequest{ tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEQCN_IE QCN_IE; tDot11fIEhe_cap he_cap; - tDot11fIEMBO_IE MBO_IE; tDot11fIEosen_ie osen_ie; } tDot11fAssocRequest; 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 cbcecb228e6a..eaf4366495be 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1663,6 +1663,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, uint32_t bcn_ie_len = 0; uint32_t aes_block_size_len = 0; enum rateid min_rid = RATEID_DEFAULT; + uint8_t *mbo_ie = NULL; + uint8_t mbo_ie_len = 0; if (NULL == pe_session) { pe_err("pe_session is NULL"); @@ -1970,6 +1972,37 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, aes_block_size_len = AES_BLOCK_SIZE; } + /* + * MBO IE needs to be appendded at the end of the assoc request + * frame and is not parsed and unpacked by the frame parser + * as the supplicant can send multiple TLVs with same Attribute + * in the MBO IE and the frame parser does not support multiple + * TLVs with same attribute in a single IE. + * Strip off the MBO IE from add_ie and append it at the end. + */ + if (wlan_get_vendor_ie_ptr_from_oui(SIR_MAC_MBO_OUI, + SIR_MAC_MBO_OUI_SIZE, add_ie, add_ie_len)) { + mbo_ie = qdf_mem_malloc(DOT11F_IE_MBO_IE_MAX_LEN + 2); + if (!mbo_ie) { + pe_err("Failed to allocate mbo_ie"); + goto end; + } + + qdf_status = lim_strip_ie(mac_ctx, add_ie, &add_ie_len, + SIR_MAC_EID_VENDOR, ONE_BYTE, + SIR_MAC_MBO_OUI, + SIR_MAC_MBO_OUI_SIZE, + mbo_ie, DOT11F_IE_MBO_IE_MAX_LEN); + if (QDF_IS_STATUS_ERROR(qdf_status)) { + pe_err("Failed to strip MBO IE"); + goto free_mbo_ie; + } + + /* Include the EID and length fields */ + mbo_ie_len = mbo_ie[1] + 2; + pe_debug("Stripped MBO IE of length %d", mbo_ie_len); + } + /* * Do unpack to populate the add_ie buffer to frm structure * before packing the frm structure. In this way, the IE ordering @@ -1996,7 +2029,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, } bytes = payload + sizeof(tSirMacMgmtHdr) + - aes_block_size_len; + aes_block_size_len + mbo_ie_len; qdf_status = cds_packet_alloc((uint16_t) bytes, (void **)&frame, (void **)&packet); @@ -2036,6 +2069,11 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_warn("Assoc request pack warning (0x%08x)", status); } + /* Copy the MBO IE to the end of the frame */ + qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload, + mbo_ie, mbo_ie_len); + payload = payload + mbo_ie_len; + if (pe_session->assocReq != NULL) { qdf_mem_free(pe_session->assocReq); pe_session->assocReq = NULL; @@ -2102,6 +2140,10 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session, SENT_FAIL, QDF_STATUS_E_FAILURE); /* Pkt will be freed up by the callback */ } +free_mbo_ie: + if (mbo_ie) + qdf_mem_free(mbo_ie); + end: /* Free up buffer allocated for mlm_assoc_req */ qdf_mem_free(mlm_assoc_req); 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 0336105b067f..528872e036f8 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -24,7 +24,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Aug 27 19:08:28 2018 from the following file(s): + * Tue Sep 18 11:47:29 2018 from the following file(s): * * dot11f.frms * @@ -9632,9 +9632,6 @@ static const tIEDefn IES_AssocRequest[] = { { offsetof(tDot11fAssocRequest, he_cap), offsetof(tDot11fIEhe_cap, present), 0, "he_cap", 0, 23, 56, SigIehe_cap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_HE_CAP, 35, 0, }, - { offsetof(tDot11fAssocRequest, MBO_IE), offsetof(tDot11fIEMBO_IE, - present), 0, "MBO_IE", 0, 6, 295, SigIeMBO_IE, {80, 111, 154, 22, 0}, - 4, DOT11F_EID_MBO_IE, 0, 0, }, { offsetof(tDot11fAssocRequest, osen_ie), offsetof(tDot11fIEosen_ie, present), 0, "osen_ie", 0, 6, 261, SigIeosen_ie, {80, 111, 154, 18, 0}, 4, DOT11F_EID_OSEN_IE, 0, 0, },