Browse Source

qcacld-3.0: Add last beacon report indication and Frag ID sub elements

Add support for Last Beacon Report indication sub element and
Beacon Report Frame Body Fragment ID sub element to the beacon report IE
of Radio Measurement Frame.

Change-Id: I07facc245ca96b375779b30f61fc7659f1aa679d
CRs-Fixed: 2254248
Vignesh Viswanathan 6 years ago
parent
commit
3b4bf98056

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

@@ -1630,6 +1630,23 @@ IE BeaconReportFrmBody (EID_BCN_REPORT_FRAME_BODY)
      reportedFields[0..224];
 }
 
+const EID_BCN_REPORT_FRAME_BODY_FRAGMENT_ID = 2;
+IE beacon_report_frm_body_fragment_id (EID_BCN_REPORT_FRAME_BODY_FRAGMENT_ID)
+{
+    // Data
+    {
+        beacon_report_id:    8;
+        fragment_id_number:  7;
+        more_fragments:      1;
+    }
+}
+
+const EID_BCN_REPORT_LAST_BEACON_REPORT_INDICATION = 164;
+IE last_beacon_report_indication (EID_BCN_REPORT_LAST_BEACON_REPORT_INDICATION)
+{
+    last_fragment, 1;
+}
+
 IE MeasurementReport (EID_MEAS_REPORT)    // 7.3.2.22
 {
     token, 1;
@@ -1696,6 +1713,8 @@ IE MeasurementReport (EID_MEAS_REPORT)    // 7.3.2.22
            antenna_id,               1;
            parent_TSF,              4;
            OPTIE BeaconReportFrmBody;
+           OPTIE beacon_report_frm_body_fragment_id;
+           OPTIE last_beacon_report_indication;
            //IE vendor_specific
      }
     };
@@ -2787,6 +2806,7 @@ IE MeasurementRequest (EID_MEAS_REQUEST)  // 7.3.2.21
           OPTIE BcnReportingDetail;
           OPTIE RequestedInfo;
           OPTIE APChannelReport[0..2];
+          OPTIE last_beacon_report_indication;
           //OPTIONAL vendor_specific[1..239];
        }
        lci (measurement_type IS 8)

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

@@ -26,7 +26,7 @@
  *
  *
  * This file was automatically generated by 'framesc'
- * Fri Jun  1 09:48:59 2018 from the following file(s):
+ * Tue Jun  5 18:01:08 2018 from the following file(s):
  *
  * dot11f.frms
  *
@@ -3967,6 +3967,86 @@ uint32_t dot11f_get_packed_ie_azimuth_req(
 }; /* End extern "C". */
 #endif /* C++ */
 
+/* EID 2 (0x02) */
+typedef struct sDot11fIEbeacon_report_frm_body_fragment_id {
+	uint8_t             present;
+	uint16_t     beacon_report_id:8;
+	uint16_t   fragment_id_number:7;
+	uint16_t       more_fragments:1;
+} tDot11fIEbeacon_report_frm_body_fragment_id;
+
+#define DOT11F_EID_BEACON_REPORT_FRM_BODY_FRAGMENT_ID (2)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_BEACON_REPORT_FRM_BODY_FRAGMENT_ID_MIN_LEN (2)
+
+#define DOT11F_IE_BEACON_REPORT_FRM_BODY_FRAGMENT_ID_MAX_LEN (2)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+__must_check uint32_t dot11f_unpack_ie_beacon_report_frm_body_fragment_id(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIEbeacon_report_frm_body_fragment_id*,
+	bool);
+
+uint32_t dot11f_pack_ie_beacon_report_frm_body_fragment_id(
+	tpAniSirGlobal,
+	tDot11fIEbeacon_report_frm_body_fragment_id *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_beacon_report_frm_body_fragment_id(
+	tpAniSirGlobal,
+	tDot11fIEbeacon_report_frm_body_fragment_id *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
+/* EID 164 (0xa4) */
+typedef struct sDot11fIElast_beacon_report_indication {
+	uint8_t             present;
+	uint8_t             last_fragment;
+} tDot11fIElast_beacon_report_indication;
+
+#define DOT11F_EID_LAST_BEACON_REPORT_INDICATION (164)
+
+/* N.B. These #defines do *not* include the EID & length */
+#define DOT11F_IE_LAST_BEACON_REPORT_INDICATION_MIN_LEN (1)
+
+#define DOT11F_IE_LAST_BEACON_REPORT_INDICATION_MAX_LEN (1)
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* C++ */
+__must_check uint32_t dot11f_unpack_ie_last_beacon_report_indication(
+	tpAniSirGlobal,
+	uint8_t *,
+	uint8_t,
+	tDot11fIElast_beacon_report_indication*,
+	bool);
+
+uint32_t dot11f_pack_ie_last_beacon_report_indication(
+	tpAniSirGlobal,
+	tDot11fIElast_beacon_report_indication *,
+	uint8_t *,
+	uint32_t,
+	uint32_t*);
+
+uint32_t dot11f_get_packed_ie_last_beacon_report_indication(
+	tpAniSirGlobal,
+	tDot11fIElast_beacon_report_indication *,
+	uint32_t*);
+
+#ifdef __cplusplus
+}; /* End extern "C". */
+#endif /* C++ */
+
 /* EID 4 (0x04) */
 typedef struct sDot11fIEmax_age {
 	uint8_t             present;
@@ -5398,6 +5478,8 @@ typedef struct sDot11fIEMeasurementReport {
 			uint8_t antenna_id;
 			uint32_t parent_TSF;
 	tDot11fIEBeaconReportFrmBody BeaconReportFrmBody;
+	tDot11fIEbeacon_report_frm_body_fragment_id beacon_report_frm_body_fragment_id;
+	tDot11fIElast_beacon_report_indication last_beacon_report_indication;
 		} Beacon; /* type = 5 */
 	} report;
 } tDot11fIEMeasurementReport;
@@ -5475,6 +5557,7 @@ typedef struct sDot11fIEMeasurementRequest {
 	tDot11fIERequestedInfo RequestedInfo;
 	uint16_t num_APChannelReport;
 	tDot11fIEAPChannelReport APChannelReport[2];
+	tDot11fIElast_beacon_report_indication last_beacon_report_indication;
 		} Beacon; /* measurement_type = 5 */
 		struct {
 			uint8_t loc_subject;

+ 12 - 1
core/mac/src/include/parser_api.h

@@ -733,10 +733,21 @@ populate_dot11f_ext_supp_rates(tpAniSirGlobal pMac,
 			uint8_t nChannelNum, tDot11fIEExtSuppRates *pDot11f,
 			tpPESession psessionEntry);
 
+/**
+ * populate_dot11f_beacon_report() - Populate the Beacon Report IE
+ * @pMac: Pointer to the global MAC context
+ * @pDot11f: Pointer to the measurement report structure
+ * @pBeaconReport: Pointer to the Beacon Report structure
+ * @last_beacon_report_params: Last Beacon Report indication params
+ *
+ * Return: Ret Status
+ */
 tSirRetStatus
 populate_dot11f_beacon_report(tpAniSirGlobal pMac,
 			tDot11fIEMeasurementReport *pDot11f,
-			tSirMacBeaconReport *pBeaconReport);
+			tSirMacBeaconReport *pBeaconReport,
+			struct rrm_beacon_report_last_beacon_params
+			*last_beacon_report_params);
 
 /**
  * \brief Populate a tDot11fIEExtSuppRates

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

@@ -153,12 +153,27 @@ typedef struct sRRMReq {
 	union {
 		struct {
 			uint8_t reportingDetail;
+			uint8_t last_beacon_report_indication;
 			tRRMBeaconReportRequestedIes reqIes;
 		} Beacon;
 	} request;
 	uint8_t sendEmptyBcnRpt;
 } tRRMReq, *tpRRMReq;
 
+/**
+ * rrm_beacon_report_last_beacon_params - Last Beacon Report Indication params
+ * @last_beacon_ind: flag for whether last beacon indication is required
+ * @report_id: Report ID of the corresponding Beacon Report Request
+ * @frag_id: Current fragment's Fragment ID
+ * @num_frags: Total number of fragments in the Beacon Report
+ */
+struct rrm_beacon_report_last_beacon_params {
+	uint8_t last_beacon_ind;
+	uint8_t report_id;
+	uint8_t frag_id;
+	uint8_t num_frags;
+};
+
 typedef struct sRRMCaps {
 	uint8_t LinkMeasurement:1;
 	uint8_t NeighborRpt:1;

+ 11 - 29
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -4259,34 +4259,15 @@ returnAfterError:
 	return statusCode;
 } /* End lim_send_link_report_action_frame. */
 
-/**
- * \brief Send a Beacon Report Action frame
- *
- *
- * \param pMac Pointer to the global MAC structure
- *
- * \param dialog_token dialog token to be used in the action frame.
- *
- * \param num_report number of reports in pRRMReport.
- *
- * \param pRRMReport Address of a tSirMacRadioMeasureReport.
- *
- * \param peer mac address of peer station.
- *
- * \param psessionEntry address of session entry.
- *
- * \return eSIR_SUCCESS on success, eSIR_FAILURE else
- *
- *
- */
-
 tSirRetStatus
 lim_send_radio_measure_report_action_frame(tpAniSirGlobal pMac,
-					   uint8_t dialog_token,
-					   uint8_t num_report,
-					   tpSirMacRadioMeasureReport pRRMReport,
-					   tSirMacAddr peer,
-					   tpPESession psessionEntry)
+				uint8_t dialog_token,
+				uint8_t num_report,
+				struct rrm_beacon_report_last_beacon_params
+				*last_beacon_report_params,
+				tpSirMacRadioMeasureReport pRRMReport,
+				tSirMacAddr peer,
+				tpPESession psessionEntry)
 {
 	tSirRetStatus statusCode = eSIR_SUCCESS;
 	uint8_t *pFrame;
@@ -4332,9 +4313,10 @@ lim_send_radio_measure_report_action_frame(tpAniSirGlobal pMac,
 		switch (pRRMReport[i].type) {
 		case SIR_MAC_RRM_BEACON_TYPE:
 			populate_dot11f_beacon_report(pMac,
-						      &frm->MeasurementReport[i],
-						      &pRRMReport[i].report.
-						      beaconReport);
+						     &frm->MeasurementReport[i],
+						     &pRRMReport[i].report.
+						     beaconReport,
+						     last_beacon_report_params);
 			frm->MeasurementReport[i].incapable =
 				pRRMReport[i].incapable;
 			frm->MeasurementReport[i].refused =

+ 21 - 4
core/mac/src/pe/lim/lim_types.h

@@ -638,11 +638,28 @@ tSirRetStatus lim_send_neighbor_report_request_frame(tpAniSirGlobal,
 						     tSirMacAddr, tpPESession);
 tSirRetStatus lim_send_link_report_action_frame(tpAniSirGlobal, tpSirMacLinkReport,
 						tSirMacAddr, tpPESession);
-tSirRetStatus lim_send_radio_measure_report_action_frame(tpAniSirGlobal, uint8_t,
-							 uint8_t,
-							 tpSirMacRadioMeasureReport,
-							 tSirMacAddr, tpPESession);
 
+/**
+ * lim_send_radio_measure_report_action_frame - Send RRM report action frame
+ * @pMac: pointer to global MAC context
+ * @dialog_token: Dialog token to be used in the action frame
+ * @num_report: number of reports in pRRMReport
+ * @last_beacon_report_params: Last Beacon Report indication params
+ * @pRRMReport: Pointer to the RRM report structure
+ * @peer: MAC address of the peer
+ * @psessionEntry: Pointer to the PE session entry
+ *
+ * Return: Ret Status
+ */
+tSirRetStatus
+lim_send_radio_measure_report_action_frame(tpAniSirGlobal pMac,
+				uint8_t dialog_token,
+				uint8_t num_report,
+				struct rrm_beacon_report_last_beacon_params
+				*last_beacon_report_params,
+				tpSirMacRadioMeasureReport pRRMReport,
+				tSirMacAddr peer,
+				tpPESession psessionEntry);
 
 #ifdef FEATURE_WLAN_TDLS
 void lim_init_tdls_data(tpAniSirGlobal, tpPESession);

+ 46 - 8
core/mac/src/pe/rrm/rrm_api.c

@@ -561,6 +561,19 @@ rrm_process_beacon_report_req(tpAniSirGlobal pMac,
 		present ? pBeaconReq->measurement_request.Beacon.BcnReportingDetail.
 		reportingDetail : BEACON_REPORTING_DETAIL_ALL_FF_IE;
 
+	if (pBeaconReq->measurement_request.Beacon.
+	    last_beacon_report_indication.present) {
+		pCurrentReq->request.Beacon.last_beacon_report_indication =
+			pBeaconReq->measurement_request.Beacon.
+			last_beacon_report_indication.last_fragment;
+		pe_debug("Last Beacon Report in request = %d",
+			pCurrentReq->request.Beacon.
+			last_beacon_report_indication);
+	} else {
+		pCurrentReq->request.Beacon.last_beacon_report_indication = 0;
+		pe_debug("Last Beacon report not present in request");
+	}
+
 	if (pBeaconReq->measurement_request.Beacon.RequestedInfo.present) {
 		pCurrentReq->request.Beacon.reqIes.pElementIds =
 			qdf_mem_malloc(sizeof(uint8_t) *
@@ -759,6 +772,7 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx,
 	tpSirBssDescription bss_desc;
 	tpRRMReq curr_req = mac_ctx->rrm.rrmPEContext.pCurrentReq;
 	tpPESession session_entry;
+	struct rrm_beacon_report_last_beacon_params last_beacon_report_params;
 	uint8_t session_id, counter;
 	uint8_t bss_desc_count = 0;
 	uint8_t report_index = 0;
@@ -875,22 +889,43 @@ rrm_process_beacon_report_xmit(tpAniSirGlobal mac_ctx,
 				break;
 			}
 		}
+
+
+		qdf_mem_zero(&last_beacon_report_params,
+			sizeof(last_beacon_report_params));
 		/*
 		 * Each frame can hold RADIO_REPORTS_MAX_IN_A_FRAME reports.
 		 * Multiple frames may be sent if bss_desc_count is larger.
+		 * Count the total number of frames to be sent first
 		 */
+
+
+		last_beacon_report_params.last_beacon_ind =
+			curr_req->request.Beacon.last_beacon_report_indication;
+		last_beacon_report_params.num_frags =
+			(bss_desc_count / RADIO_REPORTS_MAX_IN_A_FRAME);
+		if (bss_desc_count % RADIO_REPORTS_MAX_IN_A_FRAME)
+			last_beacon_report_params.num_frags++;
+
+		pe_debug("last_beacon_report_ind required %d num_frags %d bss_count %d",
+			last_beacon_report_params.last_beacon_ind,
+			last_beacon_report_params.num_frags,
+			bss_desc_count);
+
 		while (report_index < bss_desc_count) {
 			int m_count;
 
 			m_count = QDF_MIN((bss_desc_count - report_index),
 					RADIO_REPORTS_MAX_IN_A_FRAME);
-			pe_info("Sending Action frame with %d bss info",
-				m_count);
+			pe_info("Sending Action frame with %d bss info frag_id %d",
+				m_count, last_beacon_report_params.frag_id);
 			lim_send_radio_measure_report_action_frame(mac_ctx,
 				curr_req->dialog_token, m_count,
+				&last_beacon_report_params,
 				&report[report_index],
 				beacon_xmit_ind->bssId, session_entry);
 			report_index += m_count;
+			last_beacon_report_params.frag_id++;
 		}
 		curr_req->sendEmptyBcnRpt = false;
 	}
@@ -942,8 +977,11 @@ static void rrm_process_beacon_request_failure(tpAniSirGlobal pMac,
 		return;
 	}
 
-	lim_send_radio_measure_report_action_frame(pMac, pCurrentReq->dialog_token, 1,
-						   pReport, peer, pSessionEntry);
+	lim_send_radio_measure_report_action_frame(pMac,
+						   pCurrentReq->dialog_token,
+						   1, NULL,
+						   pReport, peer,
+						   pSessionEntry);
 
 	qdf_mem_free(pReport);
 	return;
@@ -1096,8 +1134,8 @@ rrm_process_radio_measurement_request(tpAniSirGlobal mac_ctx,
 		report->incapable = 1;
 		num_report = 1;
 		lim_send_radio_measure_report_action_frame(mac_ctx,
-			rrm_req->DialogToken.token, num_report, report, peer,
-			session_entry);
+			rrm_req->DialogToken.token, num_report, NULL,
+			report, peer, session_entry);
 		qdf_mem_free(report);
 		return eSIR_FAILURE;
 	}
@@ -1149,8 +1187,8 @@ rrm_process_radio_measurement_request(tpAniSirGlobal mac_ctx,
 end:
 	if (report) {
 		lim_send_radio_measure_report_action_frame(mac_ctx,
-			rrm_req->DialogToken.token, num_report, report,
-			peer, session_entry);
+			rrm_req->DialogToken.token, num_report, NULL,
+			report, peer, session_entry);
 		qdf_mem_free(report);
 	}
 	return status;

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


+ 34 - 2
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -5866,8 +5866,10 @@ tSirRetStatus populate_dot11f_wfatpc(tpAniSirGlobal pMac,
 }
 
 tSirRetStatus populate_dot11f_beacon_report(tpAniSirGlobal pMac,
-					    tDot11fIEMeasurementReport *pDot11f,
-					    tSirMacBeaconReport *pBeaconReport)
+				tDot11fIEMeasurementReport *pDot11f,
+				tSirMacBeaconReport *pBeaconReport,
+				struct rrm_beacon_report_last_beacon_params
+				*last_beacon_report_params)
 {
 
 	pDot11f->report.Beacon.regClass = pBeaconReport->regClass;
@@ -5895,6 +5897,36 @@ tSirRetStatus populate_dot11f_beacon_report(tpAniSirGlobal pMac,
 			pBeaconReport->numIes;
 	}
 
+	if (last_beacon_report_params &&
+	    last_beacon_report_params->last_beacon_ind) {
+		pe_debug("Including Last Beacon Report in RRM Frame, report_id %d, frag_id %d",
+			last_beacon_report_params->report_id,
+			last_beacon_report_params->frag_id);
+		pDot11f->report.Beacon.beacon_report_frm_body_fragment_id.
+			present = 1;
+		pDot11f->report.Beacon.beacon_report_frm_body_fragment_id.
+			beacon_report_id = last_beacon_report_params->report_id;
+		pDot11f->report.Beacon.beacon_report_frm_body_fragment_id.
+			fragment_id_number = last_beacon_report_params->frag_id;
+
+		pDot11f->report.Beacon.last_beacon_report_indication.present = 1;
+
+		if (last_beacon_report_params->frag_id ==
+		    (last_beacon_report_params->num_frags - 1)) {
+			pDot11f->report.Beacon.
+				beacon_report_frm_body_fragment_id.
+				more_fragments = 0;
+			pDot11f->report.Beacon.last_beacon_report_indication.
+				last_fragment = 1;
+			pe_debug("Last Fragment");
+		} else {
+			pDot11f->report.Beacon.
+				beacon_report_frm_body_fragment_id.
+				more_fragments = 1;
+			pDot11f->report.Beacon.last_beacon_report_indication.
+				last_fragment = 0;
+		}
+	}
 	return eSIR_SUCCESS;
 
 }

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