Jelajahi Sumber

qcacld-3.0: Add OSEN IE to Assoc request frame parser

With I57f6319cecdf10e08047b510321b885c3cd711b5, adding IE's to
assoc request is modified to honour the spec.i.e. additional IE's
from HDD is not directly appended at the end of the association
request frame. parser code checks if the additional IE is defined
for assoc request frame parser and fills it accordingly as per the
IE order spec mandates. OSEN IE is not defined in assoc request
frame parser which leads to not adding the same to assoc request.

Add OSEN IE to assoc request frame parser.

Change-Id: I3b6e10128bfa2c63cc8d98e9727b99c496cb5b2c
CRs-Fixed: 2056201
Selvaraj, Sridhar 7 tahun lalu
induk
melakukan
99edbc3012

+ 6 - 0
core/mac/src/cfg/cfgUtil/dot11f.frms

@@ -1942,6 +1942,11 @@ IE hs20vendor_ie (EID_VENDOR_SPECIFIC) OUI (0x50, 0x6F, 0x9A, 0x10)
     };
 }
 
+IE osen_ie (EID_VENDOR_SPECIFIC) OUI (0x50, 0x6F, 0x9A, 0x12)
+{
+    data[0..255];
+}
+
 IE QComVendorIE (EID_VENDOR_SPECIFIC) OUI (0x00, 0xA0, 0xC6)
 {
     type,      1;
@@ -3482,6 +3487,7 @@ FRAME AssocRequest                        // 7.2.3.4
     OPTIE  QCN_IE;
     OPTIE  vendor_he_cap;
     OPTIE  MBO_IE;
+    OPTIE  osen_ie;
 } // End frame AssocRequest.
 
 FRAME AssocResponse                       // 7.2.3.5

+ 42 - 1
core/mac/src/include/dot11f.h

@@ -35,7 +35,7 @@
  *
  *
  * This file was automatically generated by 'framesc'
- * Fri Jun  9 14:23:47 2017 from the following file(s):
+ * Thu Jun 22 10:47:16 2017 from the following file(s):
  *
  * dot11f.frms
  *
@@ -8403,6 +8403,46 @@ uint32_t dot11f_get_packed_ie_mu_edca_param_set(
 }; /* End extern "C". */
 #endif /* C++ */
 
+/* EID 221 (0xdd) {OUI 0x50, 0x6f, 0x9a, 0x12} */
+typedef struct sDot11fIEosen_ie {
+	uint8_t             present;
+	uint8_t             num_data;
+	uint8_t             data[255];
+} tDot11fIEosen_ie;
+
+#define DOT11F_EID_OSEN_IE (221)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_OSEN_IE_MIN_LEN (4)
+
+#define DOT11F_IE_OSEN_IE_MAX_LEN (259)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+uint32_t dot11f_unpack_ie_osen_ie(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIEosen_ie*,
+	bool);
+
+uint32_t dot11f_pack_ie_osen_ie(
+	tpAniSirGlobal,
+	tDot11fIEosen_ie *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_osen_ie(
+	tpAniSirGlobal,
+	tDot11fIEosen_ie *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
 /* EID 62 (0x3e) */
 typedef struct sDot11fIEsec_chan_offset_ele {
 	uint8_t             present;
@@ -8752,6 +8792,7 @@ typedef struct sDot11fAssocRequest{
 	tDot11fIEQCN_IE                       QCN_IE;
 	tDot11fIEvendor_he_cap                vendor_he_cap;
 	tDot11fIEMBO_IE                       MBO_IE;
+	tDot11fIEosen_ie                      osen_ie;
 } tDot11fAssocRequest;
 
 #define DOT11F_ASSOCREQUEST (3)

+ 92 - 5
core/mac/src/sys/legacy/src/utils/src/dot11f.c

@@ -33,7 +33,7 @@
  *
  *
  * This file was automatically generated by 'framesc'
- * Fri Jun  9 14:23:47 2017 from the following file(s):
+ * Thu Jun 22 10:47:16 2017 from the following file(s):
  *
  * dot11f.frms
  *
@@ -6538,6 +6538,26 @@ uint32_t dot11f_unpack_ie_mu_edca_param_set(tpAniSirGlobal pCtx,
 #define SigIemu_edca_param_set (0x008c)
 
 
+uint32_t dot11f_unpack_ie_osen_ie(tpAniSirGlobal pCtx,
+				  uint8_t *pBuf,
+				  uint8_t ielen,
+				  tDot11fIEosen_ie *pDst,
+				  bool append_ie)
+{
+	uint32_t status = DOT11F_PARSE_SUCCESS;
+	(void) pBuf; (void)ielen; /* Shutup the compiler */
+	if (pDst->present)
+		status = DOT11F_DUPLICATE_IE;
+	pDst->present = 1;
+	pDst->num_data = (uint8_t)(ielen);
+	DOT11F_MEMCPY(pCtx, pDst->data, pBuf, (ielen));
+	(void)pCtx;
+	return status;
+} /* End dot11f_unpack_ie_osen_ie. */
+
+#define SigIeosen_ie (0x008d)
+
+
 uint32_t dot11f_unpack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx,
 					      uint8_t *pBuf,
 					      uint8_t ielen,
@@ -6554,7 +6574,7 @@ uint32_t dot11f_unpack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_sec_chan_offset_ele. */
 
-#define SigIesec_chan_offset_ele (0x008d)
+#define SigIesec_chan_offset_ele (0x008e)
 
 
 static const tFFDefn FFS_vendor_he_cap[] = {
@@ -6685,7 +6705,7 @@ uint32_t dot11f_unpack_ie_vendor_he_cap(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_he_cap. */
 
-#define SigIevendor_he_cap (0x008e)
+#define SigIevendor_he_cap (0x008f)
 
 
 static const tFFDefn FFS_vendor_he_op[] = {
@@ -6738,7 +6758,7 @@ uint32_t dot11f_unpack_ie_vendor_he_op(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_he_op. */
 
-#define SigIevendor_he_op (0x008f)
+#define SigIevendor_he_op (0x0090)
 
 
 static const tFFDefn FFS_vendor_vht_ie[] = {
@@ -6785,7 +6805,7 @@ uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_vht_ie. */
 
-#define SigIevendor_vht_ie (0x0090)
+#define SigIevendor_vht_ie (0x0091)
 
 
 static const tFFDefn FFS_AddTSRequest[] = {
@@ -7041,6 +7061,9 @@ static const tIEDefn IES_AssocRequest[] = {
 	{ offsetof(tDot11fAssocRequest, MBO_IE), offsetof(tDot11fIEMBO_IE,
 	present), 0, "MBO_IE", 0, 9, 12, 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, },
 	{0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },};
 
 uint32_t dot11f_unpack_assoc_request(tpAniSirGlobal pCtx,
@@ -11722,6 +11745,16 @@ static uint32_t unpack_core(tpAniSirGlobal pCtx,
 						    countOffset),
 						    append_ie);
 					break;
+				case SigIeosen_ie:
+					status |=
+						dot11f_unpack_ie_osen_ie(
+						    pCtx, pBufRemaining, len,
+						    (tDot11fIEosen_ie *)
+						    (pFrm + pIe->offset +
+						    sizeof(tDot11fIEosen_ie) *
+						    countOffset),
+						    append_ie);
+					break;
 				case SigIesec_chan_offset_ele:
 					status |=
 						dot11f_unpack_ie_sec_chan_offset_ele(
@@ -14610,6 +14643,15 @@ static uint32_t get_packed_size_core(tpAniSirGlobal pCtx,
 					  (pFrm + pIe->offset + offset * i))->
 					  present;
 					break;
+				case SigIeosen_ie:
+					offset = sizeof(tDot11fIEosen_ie);
+					byteCount = ((tDot11fIEosen_ie *)
+					  (pFrm + pIe->offset + offset * i))->
+					  num_data;
+					pIePresent = ((tDot11fIEosen_ie *)
+					  (pFrm + pIe->offset + offset * i))->
+					  present;
+					break;
 				case SigIesec_chan_offset_ele:
 					offset = sizeof(tDot11fIEsec_chan_offset_ele);
 					byteCount = 1;
@@ -22720,6 +22762,43 @@ uint32_t dot11f_pack_ie_mu_edca_param_set(tpAniSirGlobal pCtx,
 	return DOT11F_PARSE_SUCCESS;
 } /* End dot11f_pack_ie_mu_edca_param_set. */
 
+uint32_t dot11f_pack_ie_osen_ie(tpAniSirGlobal pCtx,
+				tDot11fIEosen_ie *pSrc,
+				uint8_t *pBuf,
+				uint32_t nBuf,
+				uint32_t *pnConsumed)
+{
+	uint8_t *pIeLen = 0;
+	uint32_t nConsumedOnEntry = *pnConsumed;
+	uint32_t nNeeded = 0U;
+	nNeeded  +=  pSrc->num_data;
+	while (pSrc->present) {
+		if (nNeeded > nBuf)
+			return DOT11F_BUFFER_OVERFLOW;
+		*pBuf = 221;
+		++pBuf; ++(*pnConsumed);
+		pIeLen = pBuf;
+		++pBuf; ++(*pnConsumed);
+		*pBuf = 0x50;
+		++pBuf; ++(*pnConsumed);
+		*pBuf = 0x6f;
+		++pBuf; ++(*pnConsumed);
+		*pBuf = 0x9a;
+		++pBuf; ++(*pnConsumed);
+		*pBuf = 0x12;
+		++pBuf; ++(*pnConsumed);
+		DOT11F_MEMCPY(pCtx, pBuf, &(pSrc->data), pSrc->num_data);
+		*pnConsumed += pSrc->num_data;
+		/* fieldsEndFlag = 1 */
+		break;
+	}
+	(void)pCtx;
+	if (pIeLen) {
+		*pIeLen = *pnConsumed - nConsumedOnEntry - 2;
+	}
+	return DOT11F_PARSE_SUCCESS;
+} /* End dot11f_pack_ie_osen_ie. */
+
 uint32_t dot11f_pack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx,
 					    tDot11fIEsec_chan_offset_ele *pSrc,
 					    uint8_t *pBuf,
@@ -25143,6 +25222,14 @@ static uint32_t pack_core(tpAniSirGlobal pCtx,
 				sizeof(tDot11fIEmu_edca_param_set) * i),
 				pBufRemaining, nBufRemaining, &len);
 			break;
+			case SigIeosen_ie:
+			status |=
+				dot11f_pack_ie_osen_ie(
+				pCtx, (tDot11fIEosen_ie *)
+				(pSrc + pIe->offset +
+				sizeof(tDot11fIEosen_ie) * i),
+				pBufRemaining, nBufRemaining, &len);
+			break;
 			case SigIesec_chan_offset_ele:
 			status |=
 				dot11f_pack_ie_sec_chan_offset_ele(