qcacld-3.0: Update mscs action frame as per spec

Currently, Host sends classifier type and classifier
mask part of TCLAS Mask OPIE only with tag length of
2 bytes.

As per spec tag length for TCLAS Mask OPIE should be 18.
Ext Tag: TCLAS Mask
   Ext Tag Number: TCLAS Mask (89)
   Ext Tag length: 18
   Classifier Type: 4
   Classifier Mask: 0x5f
   Reserved:00000000000000000000000000000000

Fix is to add a reserved parameter in TCLAS Mask OPIE
of length 16 bytes and set it to NULL.

Change-Id: I54cd896a4ffad16581c14fc254575bcec8e6f6d7
CRs-Fixed: 2822616
This commit is contained in:
Abhinav Kumar 2020-11-09 22:14:54 +05:30 • committed by Gerrit - the friendly Code Review server
commit 837733a63b
4 changed files with 18 additions and 267 deletions

View file

@ -162,28 +162,8 @@ struct tclas_mask {
uint8_t classifier_mask;
union {
struct {
uint8_t version;
union {
struct {
uint8_t source[4];
uint8_t dest[4];
uint16_t src_port;
uint16_t dest_port;
uint8_t dscp;
uint8_t proto;
uint8_t reserved;
} ip_v4_params;
struct {
uint8_t source[16];
uint8_t dest[16];
uint16_t src_port;
uint16_t dest_port;
uint8_t DSCP;
uint8_t next_header;
uint8_t flow_label[3];
} ip_v6_params;
} params;
} ip_params; /* classifier_type = 4 */
uint8_t reserved[16];
} ip_param; /* classifier_type = 4 */
} info;
};

View file

@ -2930,32 +2930,9 @@ IE tclas_mask (EID_EXTN_ID_ELEMENT) OUI (0x59)
classifier_mask, 1;
UNION info (DISCRIMINATOR classifier_type)
{
IpParams (classifier_type IS 4)
ip_param (classifier_type IS 4)
{
version, 1;
UNION params (DISCRIMINATOR version)
{
IpV4Params (version IS 4)
{
source[4];
dest[4];
src_port, 2;
dest_port, 2;
DSCP, 1;
proto, 1;
reserved, 1;
}
IpV6Params (version IS 6)
{
source[16];
dest[16];
src_port, 2;
dest_port, 2;
DSCP, 1;
next_header, 1;
flow_label[3];
}
};
reserved[16];
}
};
}

View file

@ -4603,28 +4603,8 @@ typedef struct sDot11fIEtclas_mask {
uint8_t classifier_mask;
union {
struct {
uint8_t version;
union {
struct {
uint8_t source[4];
uint8_t dest[4];
uint16_t src_port;
uint16_t dest_port;
uint8_t DSCP;
uint8_t proto;
uint8_t reserved;
} IpV4Params; /* version = 4 */
struct {
uint8_t source[16];
uint8_t dest[16];
uint16_t src_port;
uint16_t dest_port;
uint8_t DSCP;
uint8_t next_header;
uint8_t flow_label[3];
} IpV6Params; /* version = 6 */
} params;
} IpParams; /* classifier_type = 4 */
uint8_t reserved[16];
} ip_param; /* classifier_type = 4 */
} info;
} tDot11fIEtclas_mask;
@ -4633,7 +4613,7 @@ typedef struct sDot11fIEtclas_mask {
/* N.B. These #defines do *not* include the EID & length */
#define DOT11F_IE_TCLAS_MASK_MIN_LEN (18)
#define DOT11F_IE_TCLAS_MASK_MAX_LEN (44)
#define DOT11F_IE_TCLAS_MASK_MAX_LEN (18)
#ifdef __cplusplus
extern "C" {
@ -8684,7 +8664,7 @@ typedef struct sDot11fIEdecriptor_element {
/* N.B. These #defines do *not* include the EID & length */
#define DOT11F_IE_DECRIPTOR_ELEMENT_MIN_LEN (7)
#define DOT11F_IE_DECRIPTOR_ELEMENT_MAX_LEN (56)
#define DOT11F_IE_DECRIPTOR_ELEMENT_MAX_LEN (30)
#ifdef __cplusplus
extern "C" {

View file

@ -3841,132 +3841,14 @@ uint32_t dot11f_unpack_ie_tclas_mask(tpAniSirGlobal pCtx,
ielen -= (uint8_t)1;
switch (pDst->classifier_type) {
case 4:
if (unlikely(ielen < 1)) {
if (unlikely(ielen < 16)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.version = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
switch (pDst->info.IpParams.version) {
case 4:
if (unlikely(ielen < 4)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.source, pBuf, 4);
pBuf += 4;
ielen -= (uint8_t)4;
if (unlikely(ielen < 4)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV4Params.dest, pBuf, 4);
pBuf += 4;
ielen -= (uint8_t)4;
if (unlikely(ielen < 2)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.src_port, pBuf, 0);
pBuf += 2;
ielen -= (uint8_t)2;
if (unlikely(ielen < 2)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
framesntohs(pCtx, &pDst->info.IpParams.params.IpV4Params.dest_port, pBuf, 0);
pBuf += 2;
ielen -= (uint8_t)2;
if (unlikely(ielen < 1)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.params.IpV4Params.DSCP = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
if (unlikely(ielen < 1)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.params.IpV4Params.proto = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
if (unlikely(ielen < 1)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.params.IpV4Params.reserved = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
break;
case 6:
if (unlikely(ielen < 16)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.source, pBuf, 16);
pBuf += 16;
ielen -= (uint8_t)16;
if (unlikely(ielen < 16)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.dest, pBuf, 16);
pBuf += 16;
ielen -= (uint8_t)16;
if (unlikely(ielen < 2)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.src_port, pBuf, 0);
pBuf += 2;
ielen -= (uint8_t)2;
if (unlikely(ielen < 2)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
framesntohs(pCtx, &pDst->info.IpParams.params.IpV6Params.dest_port, pBuf, 0);
pBuf += 2;
ielen -= (uint8_t)2;
if (unlikely(ielen < 1)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.params.IpV6Params.DSCP = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
if (unlikely(ielen < 1)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
pDst->info.IpParams.params.IpV6Params.next_header = *pBuf;
pBuf += 1;
ielen -= (uint8_t)1;
if (unlikely(ielen < 3)) {
pDst->present = 0;
return DOT11F_INCOMPLETE_IE;
}
DOT11F_MEMCPY(pCtx, pDst->info.IpParams.params.IpV6Params.flow_label, pBuf, 3);
pBuf += 3;
ielen -= (uint8_t)3;
break;
}
DOT11F_MEMCPY(pCtx, pDst->info.ip_param.reserved, pBuf, 16);
pBuf += 16;
ielen -= (uint8_t)16;
break;
}
(void)pCtx;
@ -8605,7 +8487,7 @@ static const tFFDefn FFS_decriptor_element[] = {
static const tIEDefn IES_decriptor_element[] = {
{ offsetof(tDot11fIEdecriptor_element, tclas_mask),
offsetof(tDot11fIEtclas_mask, present), 0, "tclas_mask",
0, 20, 46, SigIetclas_mask, {0, 0, 0, 0, 0},
0, 20, 20, SigIetclas_mask, {0, 0, 0, 0, 0},
0, DOT11F_EID_TCLAS_MASK, 89, 0, },
{ offsetof(tDot11fIEdecriptor_element, mscs_status),
offsetof(tDot11fIEmscs_status, present), 0, "mscs_status",
@ -13221,7 +13103,7 @@ static const tFFDefn FFS_mscs_request_action_frame[] = {
static const tIEDefn IES_mscs_request_action_frame[] = {
{ offsetof(tDot11fmscs_request_action_frame, decriptor_element),
offsetof(tDot11fIEdecriptor_element, present), 0, "decriptor_element",
0, 9, 58, SigIedecriptor_element, {0, 0, 0, 0, 0},
0, 9, 32, SigIedecriptor_element, {0, 0, 0, 0, 0},
0, DOT11F_EID_DECRIPTOR_ELEMENT, 88, 1, },
{0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },};
@ -16024,27 +15906,7 @@ uint32_t dot11f_get_packed_ie_tclas_mask(tpAniSirGlobal pCtx,
*pnNeeded += 1;
switch (pIe->classifier_type) {
case 4:
*pnNeeded += 1;
switch (pIe->info.IpParams.version) {
case 4:
*pnNeeded += 4;
*pnNeeded += 4;
*pnNeeded += 2;
*pnNeeded += 2;
*pnNeeded += 1;
*pnNeeded += 1;
*pnNeeded += 1;
break;
case 6:
*pnNeeded += 16;
*pnNeeded += 16;
*pnNeeded += 2;
*pnNeeded += 2;
*pnNeeded += 1;
*pnNeeded += 1;
*pnNeeded += 3;
break;
}
*pnNeeded += 16;
break;
}
break;
@ -22724,57 +22586,9 @@ uint32_t dot11f_pack_ie_tclas_mask(tpAniSirGlobal pCtx,
pBuf += 1;
switch (pSrc->classifier_type) {
case 4:
*pBuf = pSrc->info.IpParams.version;
*pnConsumed += 1;
pBuf += 1;
switch (pSrc->info.IpParams.version) {
case 4:
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.IpParams.params.IpV4Params.source, 4);
*pnConsumed += 4;
pBuf += 4;
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.IpParams.params.IpV4Params.dest, 4);
*pnConsumed += 4;
pBuf += 4;
frameshtons(pCtx, pBuf, pSrc->info.IpParams.params.IpV4Params.src_port, 0);
*pnConsumed += 2;
pBuf += 2;
frameshtons(pCtx, pBuf, pSrc->info.IpParams.params.IpV4Params.dest_port, 0);
*pnConsumed += 2;
pBuf += 2;
*pBuf = pSrc->info.IpParams.params.IpV4Params.DSCP;
*pnConsumed += 1;
pBuf += 1;
*pBuf = pSrc->info.IpParams.params.IpV4Params.proto;
*pnConsumed += 1;
pBuf += 1;
*pBuf = pSrc->info.IpParams.params.IpV4Params.reserved;
*pnConsumed += 1;
/* fieldsEndFlag = 1 */
break;
case 6:
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.IpParams.params.IpV6Params.source, 16);
*pnConsumed += 16;
pBuf += 16;
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.IpParams.params.IpV6Params.dest, 16);
*pnConsumed += 16;
pBuf += 16;
frameshtons(pCtx, pBuf, pSrc->info.IpParams.params.IpV6Params.src_port, 0);
*pnConsumed += 2;
pBuf += 2;
frameshtons(pCtx, pBuf, pSrc->info.IpParams.params.IpV6Params.dest_port, 0);
*pnConsumed += 2;
pBuf += 2;
*pBuf = pSrc->info.IpParams.params.IpV6Params.DSCP;
*pnConsumed += 1;
pBuf += 1;
*pBuf = pSrc->info.IpParams.params.IpV6Params.next_header;
*pnConsumed += 1;
pBuf += 1;
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.IpParams.params.IpV6Params.flow_label, 3);
*pnConsumed += 3;
/* fieldsEndFlag = 1 */
break;
}
DOT11F_MEMCPY(pCtx, pBuf, pSrc->info.ip_param.reserved, 16);
*pnConsumed += 16;
/* fieldsEndFlag = 1 */
break;
}
break;