From 67e02bdb0b7d67e9e087b30d8fbf7cd78a699e51 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 11 Dec 2017 10:47:12 +0530 Subject: [PATCH] qcacld-3.0: Avoid adding duplicate qcn ie in directed probe req If mac_ctx->roam.configParam.qcn_ie_support is enabled driver adds qcn ie in directed probe req, even if its already present in the additional scan IEs. Thus in probe request two qcn ie are present. To fix this add qcn ie only if roam.configParam.qcn_ie_support is set and qcn ie is not present in the additional scan IE. Change-Id: I4c7ea32dc06e5c62b4043dbd3794348f8185fd9b CRs-Fixed: 2152795 --- core/mac/inc/sir_mac_prot_def.h | 3 +++ core/mac/src/pe/lim/lim_send_management_frames.c | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 6082bc69614d..467ee039827b 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -470,6 +470,9 @@ #define SIR_MAC_CISCO_OUI "\x00\x40\x96" #define SIR_MAC_CISCO_OUI_SIZE 3 +#define SIR_MAC_QCN_OUI_TYPE "\x8c\xfd\xf0\x01" +#define SIR_MAC_QCN_OUI_TYPE_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/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index dd74c5b1fb40..4305dc05dec5 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -230,6 +230,7 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, bool extracted_ext_cap_flag = false; tDot11fIEExtCap extracted_ext_cap; tSirRetStatus sir_status; + const uint8_t *qcn_ie = NULL; /* The probe req should not send 11ac capabilieties if band is 2.4GHz, * unless enableVhtFor24GHz is enabled in INI. So if enableVhtFor24GHz @@ -350,9 +351,6 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, populate_dot11f_ext_cap(mac_ctx, is_vht_enabled, &pr.ExtCap, pesession); - if (mac_ctx->roam.configParam.qcn_ie_support) - populate_dot11f_qcn_ie(&pr.QCN_IE); - if (IS_DOT11_MODE_HE(dot11mode) && NULL != pesession) lim_update_session_he_capable(mac_ctx, pesession); @@ -380,7 +378,13 @@ lim_send_probe_req_mgmt_frame(tpAniSirGlobal mac_ctx, extracted_ext_cap_flag = (extracted_ext_cap.num_bytes > 0); } + qcn_ie = wlan_get_vendor_ie_ptr_from_oui(SIR_MAC_QCN_OUI_TYPE, + SIR_MAC_QCN_OUI_TYPE_SIZE, + additional_ie, addn_ielen); } + /* Add qcn_ie only if qcn ie is not present in additional_ie */ + if (mac_ctx->roam.configParam.qcn_ie_support && !qcn_ie) + populate_dot11f_qcn_ie(&pr.QCN_IE); /* * Extcap IE now support variable length, merge Extcap IE from addn_ie