Bladeren bron

qcacld-3.0: Add support for extension eid in beacon request

Currently extension eid parsing in beacon request is
not supported and so ML IE is not included in the beacon
report.

Change is to
1. Parse extension eid in beacon request and store.
2. Include the basic ML IE is in the beacon report
even if scan database has ML probe response stored.

Change-Id: I5ee37bf8a15e829df167c0fe1283d048dbffe2f9
CRs-Fixed: 3541308
Amruta Kulkarni 1 jaar geleden
bovenliggende
commit
f2af7014e7

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

@@ -1333,6 +1333,13 @@ IE RequestedInfo (EID_REQUEST)            // 7.3.2.12
     requested_eids[0..255];
 }
 
+const EID_BCN_REQ_EXTENDED_INFO = 11;
+IE ExtRequestedInfo (EID_BCN_REQ_EXTENDED_INFO)
+{
+    req_element_id,     1;
+    req_element_id_ext[0..255];
+}
+
 IE Country (EID_COUNTRY)                  // 7.3.2.9
 {
     country[3];
@@ -3135,6 +3142,7 @@ IE MeasurementRequest (EID_MEAS_REQUEST)  // 7.3.2.21
           OPTIE rrm_reporting;
           OPTIE BcnReportingDetail;
           OPTIE RequestedInfo;
+          OPTIE ExtRequestedInfo;
           OPTIE APChannelReport[0..2];
           OPTIE last_beacon_report_indication;
           //OPTIONAL vendor_specific[1..239];

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

@@ -27,7 +27,7 @@
  *
  *
  * This file was automatically generated by 'framesc'
- * Thu Aug 31 01:23:37 2023 from the following file(s):
+ * Thu Sep  7 12:02:23 2023 from the following file(s):
  *
  * dot11f.frms
  *
@@ -3315,6 +3315,47 @@ uint32_t dot11f_get_packed_ie_CondensedCountryStr(
 }; /* End extern "C". */
 #endif /* C++ */
 
+/* EID 11 (0x0b) */
+typedef struct sDot11fIEExtRequestedInfo {
+	uint8_t             present;
+	uint8_t             req_element_id;
+	uint8_t             num_req_element_id_ext;
+	uint8_t             req_element_id_ext[255];
+} tDot11fIEExtRequestedInfo;
+
+#define DOT11F_EID_EXTREQUESTEDINFO (11)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_EXTREQUESTEDINFO_MIN_LEN (1)
+
+#define DOT11F_IE_EXTREQUESTEDINFO_MAX_LEN (256)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+__must_check uint32_t dot11f_unpack_ie_ExtRequestedInfo(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIEExtRequestedInfo*,
+	bool);
+
+uint32_t dot11f_pack_ie_ExtRequestedInfo(
+	tpAniSirGlobal,
+	tDot11fIEExtRequestedInfo *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_ExtRequestedInfo(
+	tpAniSirGlobal,
+	tDot11fIEExtRequestedInfo *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
 /* EID 66 (0x42) */
 typedef struct sDot11fIEMeasurementPilot {
 	uint8_t             present;
@@ -6213,6 +6254,7 @@ typedef struct sDot11fIEMeasurementRequest {
 	tDot11fIErrm_reporting rrm_reporting;
 	tDot11fIEBcnReportingDetail BcnReportingDetail;
 	tDot11fIERequestedInfo RequestedInfo;
+	tDot11fIEExtRequestedInfo ExtRequestedInfo;
 	uint16_t num_APChannelReport;
 	tDot11fIEAPChannelReport APChannelReport[2];
 	tDot11fIElast_beacon_report_indication last_beacon_report_indication;

+ 7 - 0
core/mac/src/pe/include/rrm_global.h

@@ -199,9 +199,16 @@ typedef struct sSirNeighborReportInd {
 	tSirNeighborBssDescription sNeighborBssDescription[1];
 } tSirNeighborReportInd, *tpSirNeighborReportInd;
 
+typedef struct eid_ext_info {
+	uint8_t eid;
+	uint8_t num_eid_ext;
+	uint8_t eid_ext[255];
+} eid_ext_info;
+
 typedef struct sRRMBeaconReportRequestedIes {
 	uint8_t num;
 	uint8_t *pElementIds;
+	eid_ext_info ext_info;
 } tRRMBeaconReportRequestedIes, *tpRRMBeaconReportRequestedIes;
 
 /* Reporting detail defines. */

+ 132 - 12
core/mac/src/pe/rrm/rrm_api.c

@@ -49,12 +49,12 @@
 #include "../../core/src/wlan_cp_stats_obj_mgr_handler.h"
 #include "../../core/src/wlan_cp_stats_defs.h"
 #include "cdp_txrx_host_stats.h"
+#include "utils_mlo.h"
 
 #define MAX_CTRL_STAT_VDEV_ENTRIES 1
 #define MAX_CTRL_STAT_MAC_ADDR_ENTRIES 1
 #define MAX_RMM_STA_STATS_REQUESTED 2
 #define MAX_MEAS_DURATION_FOR_STA_STATS 10
-
 /* Max passive scan dwell for wide band rrm scan, in milliseconds */
 #define RRM_SCAN_MAX_DWELL_TIME 110
 
@@ -1195,6 +1195,7 @@ rrm_process_beacon_report_req(struct mac_context *mac,
 	char *tmp_buf = NULL;
 	uint8_t country[WNI_CFG_COUNTRY_CODE_LEN];
 	uint8_t req_mode;
+	uint8_t i;
 
 	if (!pe_session) {
 		pe_err("pe_session is NULL");
@@ -1297,6 +1298,36 @@ rrm_process_beacon_report_req(struct mac_context *mac,
 			     pBeaconReq->measurement_request.Beacon.
 			     RequestedInfo.requested_eids,
 			     pCurrentReq->request.Beacon.reqIes.num);
+		for (i = 0; i < pCurrentReq->request.Beacon.reqIes.num; i++)
+			pe_debug("RX: [802.11 BCN_RPT]:Requested EID is %d",
+				pBeaconReq->measurement_request.Beacon.RequestedInfo.requested_eids[i]);
+	}
+
+	if (pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.present) {
+		if (!pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.num_req_element_id_ext) {
+			pe_err("RX: [802.11 BCN_RPT]: Requested num of Extn EID is 0");
+			return eRRM_FAILURE;
+		}
+		if (pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.req_element_id !=
+			WLAN_ELEMID_EXTN_ELEM) {
+			pe_err("RX: [802.11 BCN_RPT]: Extn Element ID is not 0xFF");
+			return eRRM_FAILURE;
+		}
+
+		pCurrentReq->request.Beacon.reqIes.ext_info.eid =
+			pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.req_element_id;
+		pCurrentReq->request.Beacon.reqIes.ext_info.num_eid_ext =
+			pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.num_req_element_id_ext;
+		qdf_mem_copy(pCurrentReq->request.Beacon.reqIes.ext_info.eid_ext,
+			     pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.req_element_id_ext,
+			     pCurrentReq->request.Beacon.reqIes.ext_info.num_eid_ext);
+		pe_debug("RX: [802.11 BCN_RPT]: EID is %d",
+			 pCurrentReq->request.Beacon.reqIes.ext_info.eid);
+		pe_debug("RX: [802.11 BCN_RPT]:Num of Extn EID is %d",
+			 pCurrentReq->request.Beacon.reqIes.ext_info.num_eid_ext);
+	for (i = 0; i < pCurrentReq->request.Beacon.reqIes.ext_info.num_eid_ext; i++)
+		pe_debug("RX: [802.11 BCN_RPT]:Requested Extn EID is %d",
+			 pBeaconReq->measurement_request.Beacon.ExtRequestedInfo.req_element_id_ext[i]);
 	}
 
 	/* Prepare the request to send to SME. */
@@ -1421,6 +1452,70 @@ rrm_process_beacon_report_req(struct mac_context *mac,
 	return eRRM_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static uint8_t *
+rrm_check_ml_ie(uint8_t *ies, uint16_t len, uint8_t *mlie_copy_len)
+{
+	uint8_t *ml_ie = NULL;
+	qdf_size_t ml_ie_total_len = 0;
+	uint8_t *mlie_copy = NULL;
+	uint8_t ml_common_info_length = 0;
+	uint8_t ml_bv_ie_len = 0;
+
+	util_find_mlie(ies, len, &ml_ie, &ml_ie_total_len);
+	if (!ml_ie) {
+		mlo_debug("[802.11 BCN_RPT]: Not ML AP total_len:%d", len);
+		return NULL;
+	}
+
+	mlo_debug("[802.11 BCN_RPT]: ML IE is present ml_ie_total_len:%d", ml_ie_total_len);
+
+	util_get_mlie_common_info_len(ml_ie, ml_ie_total_len,
+				      &ml_common_info_length);
+
+	ml_bv_ie_len = sizeof(struct wlan_ie_multilink) + ml_common_info_length;
+	if (ml_bv_ie_len) {
+		mlie_copy = qdf_mem_malloc(ml_bv_ie_len);
+		if (!mlie_copy) {
+			mlo_err("malloc failed");
+			goto end;
+		}
+		qdf_mem_copy(mlie_copy, ml_ie, ml_bv_ie_len);
+		mlie_copy[TAG_LEN_POS] = ml_bv_ie_len - sizeof(struct ie_header);
+		*mlie_copy_len = ml_bv_ie_len;
+	}
+
+end:
+	return mlie_copy;
+}
+
+static bool
+rrm_copy_ml_ie(uint8_t eid, uint8_t extn_eid,
+	       uint8_t *ml_ie, uint16_t ml_len, uint8_t *pIes)
+{
+	if ((eid == WLAN_ELEMID_EXTN_ELEM || !eid) &&
+		extn_eid == WLAN_EXTN_ELEMID_MULTI_LINK) {
+		if (ml_ie && ml_len && pIes) {
+			qdf_mem_copy(pIes, ml_ie, ml_len);
+			return true;
+		}
+	}
+
+	return false;
+}
+
+#else
+static inline uint8_t *
+rrm_check_ml_ie(uint8_t *ies, uint16_t len, uint8_t *mlie_copy_len) {
+	return NULL;
+}
+
+static inline bool
+rrm_copy_ml_ie(uint8_t eid, uint8_t extn_eid, uint8_t *ml_ie,
+	       uint16_t ml_len, uint8_t *pIes) {
+	return false;
+}
+#endif
 /**
  * rrm_fill_beacon_ies() - Fills fixed fields and Ies in bss description to an
  * array of uint8_t.
@@ -1438,19 +1533,25 @@ rrm_process_beacon_report_req(struct mac_context *mac,
 static uint16_t
 rrm_fill_beacon_ies(struct mac_context *mac, uint8_t *pIes,
 		    uint8_t *pNumIes, uint8_t pIesMaxSize, uint8_t *eids,
-		    uint8_t numEids, uint16_t start_offset,
+		    uint8_t numEids, uint8_t eid, uint8_t *extn_eids,
+		    uint8_t extn_eids_count, uint16_t start_offset,
 		    struct bss_description *bss_desc)
 {
-	uint8_t *pBcnIes, count = 0, i;
+	uint8_t *pBcnIes, i;
 	uint16_t BcnNumIes, total_ies_len, len;
 	uint16_t rem_len = 0;
+	uint8_t num_eids = 0;
+	uint8_t ml_len = 0;
+	uint8_t *ml_copy = NULL;
 
 	if ((!pIes) || (!pNumIes) || (!bss_desc)) {
 		pe_err("Invalid parameters");
 		return 0;
 	}
 	/* Make sure that if eid is null, numEids is set to zero. */
-	numEids = (!eids) ? 0 : numEids;
+	num_eids = (!eids) ? 0 : numEids;
+	num_eids += (!extn_eids) ? 0 : extn_eids_count;
+	pe_err("extn_eids_count %d", extn_eids_count);
 
 	total_ies_len = GET_IE_LEN_IN_BSS(bss_desc->length);
 	BcnNumIes = total_ies_len;
@@ -1461,6 +1562,7 @@ rrm_fill_beacon_ies(struct mac_context *mac, uint8_t *pIes,
 	}
 
 	pBcnIes = (uint8_t *)&bss_desc->ieFields[0];
+	ml_copy = rrm_check_ml_ie(pBcnIes, total_ies_len, &ml_len);
 	pBcnIes += start_offset;
 	BcnNumIes = BcnNumIes - start_offset;
 
@@ -1491,6 +1593,8 @@ rrm_fill_beacon_ies(struct mac_context *mac, uint8_t *pIes,
 		len += 2;       /* element id + length. */
 		pe_debug("EID = %d, len = %d total = %d",
 			*pBcnIes, *(pBcnIes + 1), len);
+		if (*pBcnIes == WLAN_ELEMID_EXTN_ELEM && *(pBcnIes + 2) > 0)
+			pe_debug("Extended EID = %d", *(pBcnIes + 2));
 
 		if (BcnNumIes < len || len <= 2) {
 			pe_err("RRM: Invalid IE len:%d exp_len:%d",
@@ -1500,31 +1604,37 @@ rrm_fill_beacon_ies(struct mac_context *mac, uint8_t *pIes,
 
 		i = 0;
 		do {
-			if ((!eids) || (*pBcnIes == eids[i])) {
+			if (((!eids) || (*pBcnIes == eids[i])) ||
+				((*pBcnIes == eid) && *(pBcnIes + 2) == extn_eids[i])) {
 				if (((*pNumIes) + len) < pIesMaxSize) {
-					qdf_mem_copy(pIes, pBcnIes, len);
-					pIes += len;
-					*pNumIes += len;
-					count++;
+						qdf_mem_copy(pIes, pBcnIes, len);
+						pIes += len;
+						*pNumIes += len;
 				} else {
+					if (rrm_copy_ml_ie(*pBcnIes, *(pBcnIes + 2), ml_copy, ml_len, pIes)) {
+						pIes += ml_len;
+						*pNumIes += ml_len;
+						start_offset = start_offset + len - ml_len;
+					} else {
 					/*
 					 * If max size of fragment is reached,
 					 * calculate the remaining length and
 					 * break. For first fragment, account
 					 * for the fixed fields also.
 					 */
-					rem_len = total_ies_len - *pNumIes -
-						  start_offset;
+						rem_len = total_ies_len - *pNumIes -
+							  start_offset;
 					if (start_offset == 0)
 						rem_len = rem_len +
 						BEACON_FRAME_IES_OFFSET;
 					pe_debug("rem_len %d ies added %d",
 						 rem_len, *pNumIes);
+					}
 				}
 				break;
 			}
 			i++;
-		} while (i < numEids);
+		} while (i < num_eids);
 
 		if (rem_len)
 			break;
@@ -1532,6 +1642,10 @@ rrm_fill_beacon_ies(struct mac_context *mac, uint8_t *pIes,
 		pBcnIes += len;
 		BcnNumIes -= len;
 	}
+
+	if (ml_copy)
+		qdf_mem_free(ml_copy);
+
 	pe_debug("Total length of Ies added = %d rem_len %d",
 		 *pNumIes, rem_len);
 
@@ -1688,6 +1802,9 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
 					    curr_req->request.Beacon.reqIes.
 					    pElementIds,
 					    curr_req->request.Beacon.reqIes.num,
+					    curr_req->request.Beacon.reqIes.ext_info.eid,
+					    &curr_req->request.Beacon.reqIes.ext_info.eid_ext[0],
+					    curr_req->request.Beacon.reqIes.ext_info.num_eid_ext,
 					    offset, bss_desc);
 				break;
 			case BEACON_REPORTING_DETAIL_ALL_FF_IE:
@@ -1702,6 +1819,9 @@ rrm_process_beacon_report_xmit(struct mac_context *mac_ctx,
 					    BEACON_REPORT_MAX_IES,
 					    NULL,
 					    0,
+					    0,
+					    NULL,
+					    0,
 					    offset, bss_desc);
 				break;
 			}

File diff suppressed because it is too large
+ 141 - 108
core/mac/src/sys/legacy/src/utils/src/dot11f.c


Some files were not shown because too many files changed in this diff