diff options
| author | Hu Wang <huw@codeaurora.org> | 2016-09-06 10:36:13 +0800 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-09-13 13:40:12 +0530 |
| commit | bdf49ddda45600202dac2457038b43d2aac09e21 (patch) | |
| tree | b49e378ed574d6d18474a5456a37bea3aab09fe5 | |
| parent | 5983a374ac062f3d7e5d7fb88070b0bf35b5f739 (diff) | |
qcacld-2.0: Clear the bits in Ext Cap IE if AP not support
prima to qcacld-2.0 propagation
Some specific AP will send assoc reject if DUT set the bits in
Ext Cap IE which AP not advertise in beacon or probe response.
To avoid the IoT issue, clear the bits in Ext Cap IE if AP not
support.
Change-Id: I632f5474331abf51257cacdcce412d7a110d2433
CRs-Fixed: 1052140
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSendManagementFrames.c | 34 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limUtils.c | 31 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limUtils.h | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/sch/schApi.c | 2 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/sch/schBeaconGen.c | 2 |
5 files changed, 58 insertions, 14 deletions
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c index d5c3213cf785..46aa62a771b6 100644 --- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c +++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c @@ -450,7 +450,7 @@ limSendProbeReqMgmtFrame(tpAniSirGlobal pMac, /* merge the ExtCap struct*/ if (extracted_ext_cap_flag) - lim_merge_extcap_struct(&pr.ExtCap, &extracted_ext_cap); + lim_merge_extcap_struct(&pr.ExtCap, &extracted_ext_cap, true); // That done, pack the Probe Request: nStatus = dot11fPackProbeRequest( pMac, &pr, pFrame + @@ -873,7 +873,7 @@ limSendProbeRspMgmtFrame(tpAniSirGlobal pMac, /*merge ExtCap IE*/ if (extractedExtCapFlag) { - lim_merge_extcap_struct(&pFrm->ExtCap, &extractedExtCap); + lim_merge_extcap_struct(&pFrm->ExtCap, &extractedExtCap, true); } // That done, pack the Probe Response: nStatus = dot11fPackProbeResponse( pMac, pFrm, pFrame + sizeof(tSirMacMgmtHdr), @@ -1512,7 +1512,7 @@ limSendAssocRspMgmtFrame(tpAniSirGlobal pMac, /* merge the ExtCap struct*/ if (extractedExtCapFlag) { - lim_merge_extcap_struct(&(frm.ExtCap), &extractedExtCap); + lim_merge_extcap_struct(&(frm.ExtCap), &extractedExtCap, true); } nStatus = dot11fPackAssocResponse( pMac, &frm, pFrame + sizeof( tSirMacMgmtHdr ), @@ -2057,6 +2057,11 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, tDot11fIEExtCap extractedExtCap; tANI_BOOLEAN extractedExtCapFlag = eANI_BOOLEAN_TRUE; tpSirMacMgmtHdr pMacHdr; + tDot11fIEExtCap ap_extcap; + tANI_U8 *ap_extcap_ptr = NULL; + tANI_U8 *pIe = NULL; + tANI_U32 ieLen = 0; + tANI_U32 fixed_param_len = 0; if(NULL == psessionEntry) { @@ -2375,7 +2380,28 @@ limSendAssocReqMgmtFrame(tpAniSirGlobal pMac, /* merge the ExtCap struct*/ if (extractedExtCapFlag) { - lim_merge_extcap_struct(&pFrm->ExtCap, &extractedExtCap); + lim_merge_extcap_struct(&pFrm->ExtCap, &extractedExtCap, true); + } + + /* Clear the bits in EXTCAP IE if AP not advertise it in beacon */ + if (pFrm->ExtCap.present && psessionEntry->is_ext_caps_present) + { + fixed_param_len = DOT11F_FF_TIMESTAMP_LEN + + DOT11F_FF_BEACONINTERVAL_LEN + + DOT11F_FF_CAPABILITIES_LEN; + vos_mem_zero((tANI_U8*)&ap_extcap, sizeof(tDot11fIEExtCap)); + if (psessionEntry->beacon && psessionEntry->bcnLen > fixed_param_len) + { + pIe = psessionEntry->beacon + fixed_param_len; + ieLen = psessionEntry->bcnLen - fixed_param_len; + + /* Extract EXTCAP IE from beacon frame */ + ap_extcap_ptr = lim_get_ie_ptr(pIe, ieLen, DOT11F_EID_EXTCAP); + lim_update_extcap_struct(pMac, ap_extcap_ptr, &ap_extcap); + + /* Clear the bits if AP not advertise it in beacon */ + lim_merge_extcap_struct(&pFrm->ExtCap, &ap_extcap, false); + } } // That done, pack the Assoc Request: diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index c3bfc514b3eb..4929e821f95c 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -8455,7 +8455,7 @@ eHalStatus lim_send_ext_cap_ie(tpAniSirGlobal mac_ctx, if (merge && NULL != extra_extcap && extra_extcap->num_bytes > 0) { if (extra_extcap->num_bytes > ext_cap_data.num_bytes) num_bytes = extra_extcap->num_bytes; - lim_merge_extcap_struct(&ext_cap_data, extra_extcap); + lim_merge_extcap_struct(&ext_cap_data, extra_extcap, true); } /* Allocate memory for the WMI request, and copy the parameter */ @@ -8637,26 +8637,43 @@ tSirRetStatus lim_strip_extcap_update_struct(tpAniSirGlobal mac_ctx, * lim_merge_extcap_struct() - merge extended capabilities info * @dst: destination extended capabilities * @src: source extended capabilities + * @add: true if add the capabilites, false if strip the capabilites. * - * This function is used to take @src info and merge it with @dst - * extended capabilities info. + * This function is used to take @src info and add/strip it to/from + * @dst extended capabilities info. * * Return: None */ void lim_merge_extcap_struct(tDot11fIEExtCap *dst, - tDot11fIEExtCap *src) + tDot11fIEExtCap *src, + bool add) { uint8_t *tempdst = (uint8_t *)dst->bytes; uint8_t *tempsrc = (uint8_t *)src->bytes; uint8_t structlen = member_size(tDot11fIEExtCap, bytes); - while(tempdst && tempsrc && structlen--) { - *tempdst |= *tempsrc; + /* Return if @src not present */ + if (!src->present) + return; + + /* Return if strip the capabilites from @dst which not present */ + if (!dst->present && !add) + return; + + /* Merge the capabilites info in other cases */ + while (tempdst && tempsrc && structlen--) { + if (add) + *tempdst |= *tempsrc; + else + *tempdst &= *tempsrc; tempdst++; tempsrc++; } - dst->present |= src->present; dst->num_bytes = lim_compute_ext_cap_ie_length(dst); + if (dst->num_bytes == 0) + dst->present = 0; + else + dst->present = 1; } /** diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h index 633bbf5ce40e..e1b64fdcf6c8 100644 --- a/CORE/MAC/src/pe/lim/limUtils.h +++ b/CORE/MAC/src/pe/lim/limUtils.h @@ -666,7 +666,8 @@ void lim_update_extcap_struct(tpAniSirGlobal mac_ctx, uint8_t *buf, tDot11fIEExtCap *ext_cap); tSirRetStatus lim_strip_extcap_update_struct(tpAniSirGlobal mac_ctx, uint8_t* addn_ie, uint16_t *addn_ielen, tDot11fIEExtCap *dst); -void lim_merge_extcap_struct(tDot11fIEExtCap *dst, tDot11fIEExtCap *src); +void lim_merge_extcap_struct(tDot11fIEExtCap *dst, tDot11fIEExtCap *src, + bool add); uint8_t lim_get_80Mhz_center_channel(uint8_t primary_channel); tANI_U8 lim_compute_ext_cap_ie_length (tDot11fIEExtCap *ext_cap); diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c index 4820f645685f..3d5d508ceefb 100644 --- a/CORE/MAC/src/pe/sch/schApi.c +++ b/CORE/MAC/src/pe/sch/schApi.c @@ -537,7 +537,7 @@ tANI_U32 limSendProbeRspTemplateToHal(tpAniSirGlobal pMac,tpPESession psessionEn /* merge extcap IE */ prb_rsp_frm = &psessionEntry->probeRespFrame; if (extcap_present) - lim_merge_extcap_struct(&prb_rsp_frm->ExtCap, &extracted_extcap); + lim_merge_extcap_struct(&prb_rsp_frm->ExtCap, &extracted_extcap, true); // That done, pack the Probe Response: nStatus = dot11fPackProbeResponse( pMac, &psessionEntry->probeRespFrame, pFrame2Hal + sizeof(tSirMacMgmtHdr), diff --git a/CORE/MAC/src/pe/sch/schBeaconGen.c b/CORE/MAC/src/pe/sch/schBeaconGen.c index 7a8a96cba6cd..438d462072ab 100644 --- a/CORE/MAC/src/pe/sch/schBeaconGen.c +++ b/CORE/MAC/src/pe/sch/schBeaconGen.c @@ -492,7 +492,7 @@ tSirRetStatus schSetFixedBeaconFields(tpAniSirGlobal pMac,tpPESession psessionEn /* merge extcap IE */ if (extcap_present && psessionEntry->limSystemRole != eLIM_STA_IN_IBSS_ROLE) - lim_merge_extcap_struct(&pBcn2->ExtCap, &extracted_extcap); + lim_merge_extcap_struct(&pBcn2->ExtCap, &extracted_extcap, true); } |
