Parcourir la source

qcacld-3.0: Add FILS HLP Support for Assoc Request

This change adds support to append/store the HLP IE(if present)
in req_ie as part of connect request from Supplicant and adds the
same in Association request for FILS connection.

Change-Id: I8cd3e28b462a8ac2bd9eee2a383f9d0886adfa83
CRs-Fixed: 2034452
Sridhar Selvaraj il y a 7 ans
Parent
commit
6d3e0d78a3

+ 24 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -16291,6 +16291,30 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
 					return status;
 				break;
 			}
+		case SIR_MAC_REQUEST_EID_MAX:
+			{
+				if (genie[0] == SIR_FILS_HLP_EXT_EID) {
+					hdd_debug("Set HLP EXT IE(len %d)",
+							eLen + 2);
+					status = wlan_hdd_add_assoc_ie(
+							pWextState, genie - 2,
+							eLen + 2);
+					if (status)
+						return status;
+				} else {
+					hdd_err("UNKNOWN EID: %X", genie[0]);
+				}
+				break;
+			}
+		case DOT11F_EID_FRAGMENT_IE:
+			{
+				hdd_debug("Set Fragment IE(len %d)", eLen + 2);
+				status = wlan_hdd_add_assoc_ie(pWextState,
+							genie - 2, eLen + 2);
+				if (status)
+					return status;
+				break;
+			}
 		default:
 			hdd_err("Set UNKNOWN IE: %X", elementId);
 			/* when Unknown IE is received we break

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

@@ -124,6 +124,7 @@ const VHT_TRANSMIT_POWER_ENVELOPE    = 195;
 const EID_CHANNEL_SWITCH_WRAPPER     = 196;
 const EID_VENDOR_SPECIFIC            = 221;
 const EID_FILS_INDICATION            = 240;
+const EID_FRAGMENT_IE                = 242;
 /**
  * Extended Element ID
  *
@@ -2647,6 +2648,11 @@ IE fils_nonce (EID_EXTN_ID_ELEMENT) OUI ( 0x0D )
     nonce[16];
 }
 
+IE fragment_ie (EID_FRAGMENT_IE)
+{
+    data[0..255];
+}
+
 const EID_RRM_BEACON_REPORTING     = 1;
 const EID_RRM_BCN_REPORTING_DETAIL = 2;
 
@@ -3582,6 +3588,7 @@ FRAME AssocRequest                        // 7.2.3.4
     OPTIE  fils_public_key;
     OPTIE  fils_key_confirmation;
     OPTIE  fils_hlp_container;
+    OPTIE  fragment_ie;
     OPTIE  WPAOpaque;
     OPTIE  WMMCaps;
     OPTIE  WMMInfoStation;

+ 41 - 0
core/mac/src/include/dot11f.h

@@ -8674,6 +8674,46 @@ uint32_t dot11f_get_packed_ie_fils_wrapped_data(
 }; /* End extern "C". */
 #endif /* C++ */
 
+/* EID 242 (0xf2) */
+typedef struct sDot11fIEfragment_ie {
+	uint8_t             present;
+	uint8_t             num_data;
+	uint8_t             data[255];
+} tDot11fIEfragment_ie;
+
+#define DOT11F_EID_FRAGMENT_IE (242)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_FRAGMENT_IE_MIN_LEN (0)
+
+#define DOT11F_IE_FRAGMENT_IE_MAX_LEN (255)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+uint32_t dot11f_unpack_ie_fragment_ie(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIEfragment_ie*,
+	bool);
+
+uint32_t dot11f_pack_ie_fragment_ie(
+	tpAniSirGlobal,
+	tDot11fIEfragment_ie *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_fragment_ie(
+	tpAniSirGlobal,
+	tDot11fIEfragment_ie *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
 /* EID 221 (0xdd) {OUI 0x50, 0x6f, 0x9a, 0x10} */
 typedef struct sDot11fIEhs20vendor_ie {
 	uint8_t             present;
@@ -9251,6 +9291,7 @@ typedef struct sDot11fAssocRequest{
 	tDot11fIEfils_public_key              fils_public_key;
 	tDot11fIEfils_key_confirmation        fils_key_confirmation;
 	tDot11fIEfils_hlp_container           fils_hlp_container;
+	tDot11fIEfragment_ie                  fragment_ie;
 	tDot11fIEWPAOpaque                    WPAOpaque;
 	tDot11fIEWMMCaps                      WMMCaps;
 	tDot11fIEWMMInfoStation               WMMInfoStation;

+ 3 - 0
core/mac/src/pe/include/lim_fils_defs.h

@@ -65,6 +65,9 @@
 #define SIR_FILS_SESSION_LENGTH    8
 #define SIR_FILS_SESSION_EXT_EID   4
 
+/* 9.4.2.184 FILS HLP Container Element */
+#define SIR_FILS_HLP_EXT_EID 5
+
 /* 9.4.2.190 FILS Nonce element */
 #define SIR_FILS_NONCE_LENGTH      16
 #define SIR_FILS_NONCE_EXT_EID   13

+ 89 - 9
core/mac/src/sys/legacy/src/utils/src/dot11f.c

@@ -6524,6 +6524,26 @@ uint32_t dot11f_unpack_ie_fils_wrapped_data(tpAniSirGlobal pCtx,
 #define SigIefils_wrapped_data (0x0089)
 
 
+uint32_t dot11f_unpack_ie_fragment_ie(tpAniSirGlobal pCtx,
+				      uint8_t *pBuf,
+				      uint8_t ielen,
+				      tDot11fIEfragment_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_fragment_ie. */
+
+#define SigIefragment_ie (0x008a)
+
+
 uint32_t dot11f_unpack_ie_hs20vendor_ie(tpAniSirGlobal pCtx,
 					 uint8_t *pBuf,
 					 uint8_t ielen,
@@ -6563,7 +6583,7 @@ uint32_t dot11f_unpack_ie_hs20vendor_ie(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_hs20vendor_ie. */
 
-#define SigIehs20vendor_ie (0x008a)
+#define SigIehs20vendor_ie (0x008b)
 
 
 uint32_t dot11f_unpack_ie_ht2040_bss_coexistence(tpAniSirGlobal pCtx,
@@ -6589,7 +6609,7 @@ uint32_t dot11f_unpack_ie_ht2040_bss_coexistence(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_ht2040_bss_coexistence. */
 
-#define SigIeht2040_bss_coexistence (0x008b)
+#define SigIeht2040_bss_coexistence (0x008c)
 
 
 uint32_t dot11f_unpack_ie_ht2040_bss_intolerant_report(tpAniSirGlobal pCtx,
@@ -6617,7 +6637,7 @@ uint32_t dot11f_unpack_ie_ht2040_bss_intolerant_report(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_ht2040_bss_intolerant_report. */
 
-#define SigIeht2040_bss_intolerant_report (0x008c)
+#define SigIeht2040_bss_intolerant_report (0x008d)
 
 
 uint32_t dot11f_unpack_ie_mu_edca_param_set(tpAniSirGlobal pCtx,
@@ -6704,7 +6724,7 @@ uint32_t dot11f_unpack_ie_mu_edca_param_set(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_mu_edca_param_set. */
 
-#define SigIemu_edca_param_set (0x008d)
+#define SigIemu_edca_param_set (0x008e)
 
 
 uint32_t dot11f_unpack_ie_osen_ie(tpAniSirGlobal pCtx,
@@ -6724,7 +6744,7 @@ uint32_t dot11f_unpack_ie_osen_ie(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_osen_ie. */
 
-#define SigIeosen_ie (0x008e)
+#define SigIeosen_ie (0x008f)
 
 
 uint32_t dot11f_unpack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx,
@@ -6743,7 +6763,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 (0x008f)
+#define SigIesec_chan_offset_ele (0x0090)
 
 
 static const tFFDefn FFS_vendor_he_cap[] = {
@@ -6874,7 +6894,7 @@ uint32_t dot11f_unpack_ie_vendor_he_cap(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_he_cap. */
 
-#define SigIevendor_he_cap (0x0090)
+#define SigIevendor_he_cap (0x0091)
 
 
 static const tFFDefn FFS_vendor_he_op[] = {
@@ -6927,7 +6947,7 @@ uint32_t dot11f_unpack_ie_vendor_he_op(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_he_op. */
 
-#define SigIevendor_he_op (0x0091)
+#define SigIevendor_he_op (0x0092)
 
 
 static const tFFDefn FFS_vendor_vht_ie[] = {
@@ -6971,7 +6991,7 @@ uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx,
 	return status;
 } /* End dot11f_unpack_ie_vendor_vht_ie. */
 
-#define SigIevendor_vht_ie (0x0092)
+#define SigIevendor_vht_ie (0x0093)
 
 
 static const tFFDefn FFS_AddTSRequest[] = {
@@ -7179,6 +7199,10 @@ static const tIEDefn IES_AssocRequest[] = {
 	offsetof(tDot11fIEfils_hlp_container, present), 0, "fils_hlp_container",
 	0, 14, 269, SigIefils_hlp_container, {0, 0, 0, 0, 0},
 	0, DOT11F_EID_FILS_HLP_CONTAINER, 5, 0, },
+	{ offsetof(tDot11fAssocRequest, fragment_ie),
+	offsetof(tDot11fIEfragment_ie, present), 0, "fragment_ie",
+	0, 2, 257, SigIefragment_ie, {0, 0, 0, 0, 0},
+	0, DOT11F_EID_FRAGMENT_IE, 0, 0, },
 	{ offsetof(tDot11fAssocRequest, WPAOpaque), offsetof(tDot11fIEWPAOpaque,
 	present), 0, "WPAOpaque", 0, 8, 255, SigIeWPAOpaque, {0, 80, 242, 1, 0},
 	4, DOT11F_EID_WPAOPAQUE, 0, 0, },
@@ -11903,6 +11927,16 @@ static uint32_t unpack_core(tpAniSirGlobal pCtx,
 						    countOffset),
 						    append_ie);
 					break;
+				case SigIefragment_ie:
+					status |=
+						dot11f_unpack_ie_fragment_ie(
+						    pCtx, pBufRemaining, len,
+						    (tDot11fIEfragment_ie *)
+						    (pFrm + pIe->offset +
+						    sizeof(tDot11fIEfragment_ie) *
+						    countOffset),
+						    append_ie);
+					break;
 				case SigIehs20vendor_ie:
 					status |=
 						dot11f_unpack_ie_hs20vendor_ie(
@@ -14921,6 +14955,15 @@ static uint32_t get_packed_size_core(tpAniSirGlobal pCtx,
 					  (pFrm + pIe->offset + offset * i))->
 					  present;
 					break;
+				case SigIefragment_ie:
+					offset = sizeof(tDot11fIEfragment_ie);
+					byteCount = ((tDot11fIEfragment_ie *)
+					  (pFrm + pIe->offset + offset * i))->
+					  num_data;
+					pIePresent = ((tDot11fIEfragment_ie *)
+					  (pFrm + pIe->offset + offset * i))->
+					  present;
+					break;
 				case SigIehs20vendor_ie:
 					offset = sizeof(tDot11fIEhs20vendor_ie);
 					status |=
@@ -23249,6 +23292,35 @@ uint32_t dot11f_pack_ie_fils_wrapped_data(tpAniSirGlobal pCtx,
 	return DOT11F_PARSE_SUCCESS;
 } /* End dot11f_pack_ie_fils_wrapped_data. */
 
+uint32_t dot11f_pack_ie_fragment_ie(tpAniSirGlobal pCtx,
+				    tDot11fIEfragment_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 = 242;
+		++pBuf; ++(*pnConsumed);
+		pIeLen = pBuf;
+		++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_fragment_ie. */
+
 uint32_t dot11f_pack_ie_hs20vendor_ie(tpAniSirGlobal pCtx,
 				      tDot11fIEhs20vendor_ie *pSrc,
 				      uint8_t *pBuf,
@@ -25938,6 +26010,14 @@ static uint32_t pack_core(tpAniSirGlobal pCtx,
 				sizeof(tDot11fIEfils_wrapped_data) * i),
 				pBufRemaining, nBufRemaining, &len);
 			break;
+			case SigIefragment_ie:
+			status |=
+				dot11f_pack_ie_fragment_ie(
+				pCtx, (tDot11fIEfragment_ie *)
+				(pSrc + pIe->offset +
+				sizeof(tDot11fIEfragment_ie) * i),
+				pBufRemaining, nBufRemaining, &len);
+			break;
 			case SigIehs20vendor_ie:
 			status |=
 				dot11f_pack_ie_hs20vendor_ie(