Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f041f1c authored by Abhinav Kumar's avatar Abhinav Kumar Committed by Gerrit - the friendly Code Review server
Browse files

wlan: Add OWE IEs

propagation from qcacld-3.0 to prima

Add support for Opportunistic Wireless Encryption IEs.

Change-Id: Ifb5b11c3f775654e31248ea5b91da0df6aebe6a9
CRs-Fixed: 2531182
parent a70b3cfe
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -120,6 +120,22 @@ const EID_EXT_CAP = 127;
const EID_OPERATING_MODE             =  199;
const EID_WIDER_BW_CHANNEL_SWITCH_ANN=  194;
const EID_VENDOR_SPECIFIC            = 221;
/**
 * Extended Element ID
 *
 * As part of IEEE-802.11-2016 spec, extended element ID is introduced(9.4.2.1)
 * Elements are defined to have a common general format consisting of a 1 octet
 * Element ID field, a 1 octet Length field, an optional 1 octet Element ID
 * Extension field, and a variable-length element-specific Information field.
 * Each element is identified by the contents of the Element ID and, when
 * present, Element ID Extension fields as defined in this standard. An Extended
 * Element ID is a combination of an Element ID and an Element ID Extension for
 * those elements that have a defined Element ID Extension. The Length field
 * specifies the number of octets following the Length field. The presence of
 * the Element ID Extension field is determined by the Element ID field having
 * value of 255
 */
const EID_EXTN_ID_ELEMENT            = 255;

const SIR_MAC_PROP_EXT_RATES_TYPE    =   0;
const SIR_MAC_PROP_AP_NAME_TYPE      =   1;
@@ -2890,6 +2906,11 @@ CONTAINERIE RICDataDesc
  OPTIE  WMMSchedule;
}

IE dh_parameter_element (EID_EXTN_ID_ELEMENT) OUI ( 0x20 )
{
  group[2];
  public_key[0..255];
}
/////////////////////////////////////////////////////////////////////////////
//                                MULTIIEs                                 //
/////////////////////////////////////////////////////////////////////////////
@@ -3539,6 +3560,7 @@ FRAME AssocRequest // 7.2.3.4
    OPTIE  QOSCapsStation;
    OPTIE  RRMEnabledCap;
    OPTIE  MobilityDomain;
    OPTIE  dh_parameter_element;
    OPTIE  WPAOpaque;
    OPTIE  HTCaps;
    OPTIE  WMMCaps;
+57 −29
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -32,7 +32,7 @@
  * \brief Structures, function prototypes & definitions
  * for working with 802.11 Frames
  * This file was automatically generated by 'framesc'
  * Tue Aug 28 09:50:49 2018 from the following file(s):
  * Mon Jul 22 17:48:28 2019 from the following file(s):
  *
  * dot11f.frms
  *
@@ -6188,6 +6188,33 @@ tANI_U32 dot11fPackIeWscReassocRes(tpAniSirGlobal, tDot11fIEWscReassocRes*, tANI

tANI_U32 dot11fGetPackedIEWscReassocRes(tpAniSirGlobal, tDot11fIEWscReassocRes*, tANI_U32*);

#ifdef __cplusplus
}; /* End extern "C". */
#endif /* C++ */
// EID 255 (0xff) Extended EID 32 (0x20)
typedef struct sDot11fIEdh_parameter_element {
    tANI_U8      present;
    tANI_U8      group[2];
    tANI_U8      num_public_key;
    tANI_U8      public_key[255];
} tDot11fIEdh_parameter_element;

#define DOT11F_EID_DH_PARAMETER_ELEMENT ( 255 )

// N.B. These #defines do *not* include the EID & length
#define DOT11F_IE_DH_PARAMETER_ELEMENT_MIN_LEN ( 2 )

#define DOT11F_IE_DH_PARAMETER_ELEMENT_MAX_LEN ( 257 )

#ifdef __cplusplus
extern "C" {
#endif /* C++ */
tANI_U32 dot11fUnpackIedh_parameter_element(tpAniSirGlobal, tANI_U8*,tANI_U8, tDot11fIEdh_parameter_element*);

tANI_U32 dot11fPackIedh_parameter_element(tpAniSirGlobal, tDot11fIEdh_parameter_element*, tANI_U8*, tANI_U32, tANI_U32*);

tANI_U32 dot11fGetPackedIEdh_parameter_element(tpAniSirGlobal, tDot11fIEdh_parameter_element*, tANI_U32*);

#ifdef __cplusplus
}; /* End extern "C". */
#endif /* C++ */
@@ -6408,6 +6435,7 @@ typedef struct sDot11fAssocRequest{
    tDot11fIEQOSCapsStation       QOSCapsStation;
    tDot11fIERRMEnabledCap        RRMEnabledCap;
    tDot11fIEMobilityDomain       MobilityDomain;
    tDot11fIEdh_parameter_element dh_parameter_element;
    tDot11fIEWPAOpaque            WPAOpaque;
    tDot11fIEHTCaps               HTCaps;
    tDot11fIEWMMCaps              WMMCaps;
+97 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
 *
 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
 *
@@ -30,7 +30,7 @@
  * \brief Structures, functions & definitions for
  * working with 802.11 Frames
  * This file was automatically generated by 'framesc'
  * Tue Aug 28 09:50:49 2018 from the following file(s):
  * Mon Jul 22 17:48:28 2019 from the following file(s):
  *
  * dot11f.frms
  *
@@ -7770,6 +7770,29 @@ tANI_U32 dot11fUnpackIeWscReassocRes(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8
#define SigIeWscReassocRes ( 0x008e )
tANI_U32 dot11fUnpackIedh_parameter_element(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEdh_parameter_element *pDst)
{
    tANI_U32 status = DOT11F_PARSE_SUCCESS;
    (void) pBuf; (void)ielen; /* Shutup the compiler */
    if (pDst->present) status = DOT11F_DUPLICATE_IE;
    pDst->present = 1;
    if (unlikely(ielen < 2)) {
        pDst->present = 0;
        return DOT11F_INCOMPLETE_IE;
    }
    DOT11F_MEMCPY(pCtx, pDst->group, pBuf, 2);
    pBuf += 2;
    ielen -= (tANI_U8)2;
    pDst->num_public_key = (tANI_U8)( ielen );
    DOT11F_MEMCPY(pCtx, pDst->public_key, pBuf, ( ielen ) );
    (void)pCtx;
    return status;
} /* End dot11fUnpackIedh_parameter_element. */
#define SigIedh_parameter_element ( 0x008f )
tANI_U32 dot11fUnpackIeext_chan_switch_ann(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEext_chan_switch_ann *pDst)
{
    tANI_U32 status = DOT11F_PARSE_SUCCESS;
@@ -7810,7 +7833,7 @@ tANI_U32 dot11fUnpackIeext_chan_switch_ann(tpAniSirGlobal pCtx, tANI_U8 *pBuf, t
    return status;
} /* End dot11fUnpackIeext_chan_switch_ann. */
#define SigIeext_chan_switch_ann ( 0x008f )
#define SigIeext_chan_switch_ann ( 0x0090 )
tANI_U32 dot11fUnpackIehs20vendor_ie(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEhs20vendor_ie *pDst)
@@ -7866,7 +7889,7 @@ tANI_U32 dot11fUnpackIehs20vendor_ie(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8
    return status;
} /* End dot11fUnpackIehs20vendor_ie. */
#define SigIehs20vendor_ie ( 0x0090 )
#define SigIehs20vendor_ie ( 0x0091 )
tANI_U32 dot11fUnpackIesec_chan_offset(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U8 ielen, tDot11fIEsec_chan_offset *pDst)
@@ -7885,7 +7908,7 @@ tANI_U32 dot11fUnpackIesec_chan_offset(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_
    return status;
} /* End dot11fUnpackIesec_chan_offset. */
#define SigIesec_chan_offset ( 0x0091 )
#define SigIesec_chan_offset ( 0x0092 )
    static const tFFDefn FFS_AddBAReq[] = {
@@ -8530,6 +8553,7 @@ tANI_U32 dot11fUnpackAddTSResponse(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32
        {offsetof(tDot11fAssocRequest, QOSCapsStation), offsetof(tDot11fIEQOSCapsStation, present), 0, "QOSCapsStation" , 0, 3, 3, SigIeQOSCapsStation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSCAPSSTATION, 0, 0, },
        {offsetof(tDot11fAssocRequest, RRMEnabledCap), offsetof(tDot11fIERRMEnabledCap, present), 0, "RRMEnabledCap" , 0, 7, 7, SigIeRRMEnabledCap, {0, 0, 0, 0, 0}, 0, DOT11F_EID_RRMENABLEDCAP, 0, 0, },
        {offsetof(tDot11fAssocRequest, MobilityDomain), offsetof(tDot11fIEMobilityDomain, present), 0, "MobilityDomain" , 0, 5, 5, SigIeMobilityDomain, {0, 0, 0, 0, 0}, 0, DOT11F_EID_MOBILITYDOMAIN, 0, 0, },
        {offsetof(tDot11fAssocRequest, dh_parameter_element), offsetof(tDot11fIEdh_parameter_element, present), 0, "dh_parameter_element" , 0, 4, 259, SigIedh_parameter_element, {0, 0, 0, 0, 0}, 0, DOT11F_EID_DH_PARAMETER_ELEMENT, 32, 0, },
        {offsetof(tDot11fAssocRequest, WPAOpaque), offsetof(tDot11fIEWPAOpaque, present), 0, "WPAOpaque" , 0, 8, 255, SigIeWPAOpaque, {0, 80, 242, 1, 0}, 4, DOT11F_EID_WPAOPAQUE, 0, 0, },
        {offsetof(tDot11fAssocRequest, HTCaps), offsetof(tDot11fIEHTCaps, present), 0, "HTCaps" , 0, 28, 60, SigIeHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_HTCAPS, 0, 0, },
        {offsetof(tDot11fAssocRequest, WMMCaps), offsetof(tDot11fIEWMMCaps, present), 0, "WMMCaps" , 0, 9, 9, SigIeWMMCaps, {0, 80, 242, 2, 5}, 5, DOT11F_EID_WMMCAPS, 0, 0, },
@@ -8704,6 +8728,17 @@ tANI_U32 dot11fUnpackAssocRequest(tpAniSirGlobal pCtx, tANI_U8 *pBuf, tANI_U32 n
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("resourceReqCap (1): %d\n"), pFrm->MobilityDomain.resourceReqCap);
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved (6): %d\n"), pFrm->MobilityDomain.reserved);
        }
        FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("dh_parameter_element:\n"));
        if (!pFrm->dh_parameter_element.present)
        {
            FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("Not present.\n"));
        }
        else
        {
            FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* )&pFrm->dh_parameter_element.group, 2);
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("num_public_key: %d.\n"), pFrm->dh_parameter_element.num_public_key);
            FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* ) pFrm->dh_parameter_element.public_key, pFrm->dh_parameter_element.num_public_key);
        }
        FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("WPAOpaque:\n"));
        if (!pFrm->WPAOpaque.present)
        {
@@ -23207,6 +23242,9 @@ static tANI_U32 UnpackCore(tpAniSirGlobal pCtx,
                case SigIeWscReassocRes:
                        status |= dot11fUnpackIeWscReassocRes(pCtx, pBufRemaining, len, ( tDot11fIEWscReassocRes* )(pFrm + pIe->offset + sizeof(tDot11fIEWscReassocRes)*countOffset) );
                            break;
                case SigIedh_parameter_element:
                        status |= dot11fUnpackIedh_parameter_element(pCtx, pBufRemaining, len, ( tDot11fIEdh_parameter_element* )(pFrm + pIe->offset + sizeof(tDot11fIEdh_parameter_element)*countOffset) );
                            break;
                case SigIeext_chan_switch_ann:
                        status |= dot11fUnpackIeext_chan_switch_ann(pCtx, pBufRemaining, len, ( tDot11fIEext_chan_switch_ann* )(pFrm + pIe->offset + sizeof(tDot11fIEext_chan_switch_ann)*countOffset) );
                            break;
@@ -25580,6 +25618,11 @@ static tANI_U32 GetPackedSizeCore(tpAniSirGlobal pCtx,
                            offset = sizeof(tDot11fIEWscReassocRes);
                            status |= dot11fGetPackedIEWscReassocRes(pCtx, ( tDot11fIEWscReassocRes* )(pFrm + pIe->offset + offset * i ), pnNeeded);
                            break;
                case SigIedh_parameter_element:
                            offset = sizeof(tDot11fIEdh_parameter_element);
                            byteCount = ((tDot11fIEdh_parameter_element* )(pFrm + pIe->offset + sizeof(tDot11fIEdh_parameter_element) * i ))->num_public_key + 2;
                            pIePresent = ( (tDot11fIEdh_parameter_element* )(pFrm + pIe->offset + offset * i  ))->present;
                            break;
                case SigIeext_chan_switch_ann:
                            offset = sizeof(tDot11fIEext_chan_switch_ann);
                            byteCount = 4;
@@ -34234,6 +34277,41 @@ tANI_U32 dot11fPackIeWscReassocRes(tpAniSirGlobal pCtx,
    return status;
} /* End dot11fPackIeWscReassocRes. */
tANI_U32 dot11fPackIedh_parameter_element(tpAniSirGlobal pCtx,
                                          tDot11fIEdh_parameter_element *pSrc,
                                          tANI_U8 *pBuf,
                                          tANI_U32 nBuf,
                                          tANI_U32 *pnConsumed)
{
    tANI_U8* pIeLen = 0;
    tANI_U32 nConsumedOnEntry = *pnConsumed;
    tANI_U32 nNeeded = 0U;
    nNeeded  +=  (pSrc->num_public_key + 2);
    while ( pSrc->present )
    {
        if ( nNeeded > nBuf ) return DOT11F_BUFFER_OVERFLOW;
        *pBuf = 255;
        ++pBuf; ++(*pnConsumed);
        pIeLen = pBuf;
        ++pBuf; ++(*pnConsumed);
        *pBuf = 32;
        ++pBuf; ++(*pnConsumed);
        DOT11F_MEMCPY(pCtx, pBuf, pSrc->group, 2);
        *pnConsumed += 2;
        pBuf += 2;
        DOT11F_MEMCPY(pCtx, pBuf, &( pSrc->public_key ), pSrc->num_public_key);
        *pnConsumed += pSrc->num_public_key;
        // fieldsEndFlag = 1
        break;
    }
    (void)pCtx;
    if (pIeLen)
    {
        *pIeLen = *pnConsumed - nConsumedOnEntry - 2;
    }
    return DOT11F_PARSE_SUCCESS;
} /* End dot11fPackIedh_parameter_element. */
tANI_U32 dot11fPackIeext_chan_switch_ann(tpAniSirGlobal pCtx,
                                         tDot11fIEext_chan_switch_ann *pSrc,
                                         tANI_U8 *pBuf,
@@ -35089,6 +35167,17 @@ tANI_U32 dot11fPackAssocRequest(tpAniSirGlobal pCtx, tDot11fAssocRequest *pFrm,
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("resourceReqCap (1): %d\n"), pFrm->MobilityDomain.resourceReqCap);
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("reserved (6): %d\n"), pFrm->MobilityDomain.reserved);
        }
        FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("dh_parameter_element:\n"));
        if (!pFrm->dh_parameter_element.present)
        {
            FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("Not present.\n"));
        }
        else
        {
            FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* )&pFrm->dh_parameter_element.group, 2);
            FRAMES_LOG1(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("num_public_key: %d.\n"), pFrm->dh_parameter_element.num_public_key);
            FRAMES_DUMP(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), ( tANI_U8* ) pFrm->dh_parameter_element.public_key, pFrm->dh_parameter_element.num_public_key);
        }
        FRAMES_LOG0(pCtx, FRAMES_SEV_FOR_FRAME(pCtx, DOT11F_ASSOCREQUEST), FRFL("WPAOpaque:\n"));
        if (!pFrm->WPAOpaque.present)
        {
@@ -48559,6 +48648,9 @@ static tANI_U32 PackCore(tpAniSirGlobal pCtx,
                    case SigIeWscReassocRes:
                        status |= dot11fPackIeWscReassocRes(pCtx, ( tDot11fIEWscReassocRes* )(pSrc + pIe->offset + sizeof(tDot11fIEWscReassocRes) * i ),  pBufRemaining, nBufRemaining, &len);
                        break;
                    case SigIedh_parameter_element:
                        status |= dot11fPackIedh_parameter_element(pCtx, ( tDot11fIEdh_parameter_element* )(pSrc + pIe->offset + sizeof(tDot11fIEdh_parameter_element) * i ),  pBufRemaining, nBufRemaining, &len);
                        break;
                    case SigIeext_chan_switch_ann:
                        status |= dot11fPackIeext_chan_switch_ann(pCtx, ( tDot11fIEext_chan_switch_ann* )(pSrc + pIe->offset + sizeof(tDot11fIEext_chan_switch_ann) * i ),  pBufRemaining, nBufRemaining, &len);
                        break;