Browse Source

qcacmn: Enable promiscuous mode for M-copy feature

In existing code M-copy feature was designed to provide
first 100bytes of payload of self BSS packets.

Add change to enable promiscusous mode and provide metadata and
100bytes of payload of all the packets received by the radio.

Change-Id: I5b1f168028a4fba3a24e9d2ccd0d68c246661d76
Soumya Bhat 7 years ago
parent
commit
2f54de20b0
4 changed files with 22 additions and 14 deletions
  1. 2 1
      dp/wifi3.0/dp_main.c
  2. 15 8
      dp/wifi3.0/dp_rx_mon_status.c
  3. 4 4
      dp/wifi3.0/dp_tx.c
  4. 1 1
      dp/wifi3.0/dp_types.h

+ 2 - 1
dp/wifi3.0/dp_main.c

@@ -5564,7 +5564,8 @@ dp_ppdu_ring_cfg(struct dp_pdev *pdev)
 	htt_tlv_filter.ppdu_end_status_done = 1;
 	htt_tlv_filter.enable_fp = 1;
 	htt_tlv_filter.enable_md = 0;
-	htt_tlv_filter.enable_mo = 0;
+	if (pdev->mcopy_mode)
+		htt_tlv_filter.enable_mo = 1;
 	htt_tlv_filter.fp_mgmt_filter = FILTER_MGMT_ALL;
 	htt_tlv_filter.fp_ctrl_filter = FILTER_CTRL_ALL;
 	htt_tlv_filter.fp_data_filter = FILTER_DATA_ALL;

+ 15 - 8
dp/wifi3.0/dp_rx_mon_status.c

@@ -218,12 +218,13 @@ dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
 	if (ppdu_info->first_msdu_payload == NULL)
 		return QDF_STATUS_SUCCESS;
 
-	if (pdev->am_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id)
+	if (pdev->m_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id)
 		return QDF_STATUS_SUCCESS;
 
-	pdev->am_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id;
+	pdev->m_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id;
 
-	size = ppdu_info->first_msdu_payload - qdf_nbuf_data(nbuf);
+	/* Include 2 bytes of reserved space appended to the msdu payload */
+	size = (ppdu_info->first_msdu_payload - qdf_nbuf_data(nbuf)) + 2;
 	ppdu_info->first_msdu_payload = NULL;
 
 	if (qdf_nbuf_pull_head(nbuf, size) == NULL)
@@ -287,8 +288,13 @@ dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
 			dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc,
 					ppdu_nbuf, cdp_rx_ppdu->peer_id,
 					WDI_NO_VAL, pdev->pdev_id);
-		} else
+		} else if (pdev->mcopy_mode) {
+			dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc,
+					ppdu_nbuf, HTT_INVALID_PEER,
+					WDI_NO_VAL, pdev->pdev_id);
+		} else {
 			qdf_nbuf_free(ppdu_nbuf);
+		}
 	}
 }
 #else
@@ -317,7 +323,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 	uint8_t *rx_tlv;
 	uint8_t *rx_tlv_start;
 	uint32_t tlv_status = HAL_TLV_STATUS_BUF_DONE;
-	QDF_STATUS am_copy_status = QDF_STATUS_SUCCESS;
+	QDF_STATUS m_copy_status = QDF_STATUS_SUCCESS;
 
 	ppdu_info = &pdev->ppdu_info;
 
@@ -336,7 +342,8 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 			status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, mac_id);
 #endif
 #endif
-		if ((pdev->monitor_vdev != NULL) || (pdev->enhanced_stats_en)) {
+		if ((pdev->monitor_vdev != NULL) || (pdev->enhanced_stats_en) ||
+				pdev->mcopy_mode) {
 
 			do {
 				tlv_status = hal_rx_status_get_tlv_info(rx_tlv,
@@ -350,9 +357,9 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 		}
 
 		if (pdev->mcopy_mode) {
-			am_copy_status = dp_rx_handle_mcopy_mode(soc,
+			m_copy_status = dp_rx_handle_mcopy_mode(soc,
 						pdev, ppdu_info, status_nbuf);
-			if (am_copy_status == QDF_STATUS_SUCCESS)
+			if (m_copy_status == QDF_STATUS_SUCCESS)
 				qdf_nbuf_free(status_nbuf);
 		} else {
 			qdf_nbuf_free(status_nbuf);

+ 4 - 4
dp/wifi3.0/dp_tx.c

@@ -2241,13 +2241,13 @@ dp_get_completion_indication_for_stack(struct dp_soc *soc,  struct dp_pdev *pdev
 	}
 
 	if (pdev->mcopy_mode) {
-		if ((pdev->am_copy_id.tx_ppdu_id == ppdu_id) &&
-			(pdev->am_copy_id.tx_peer_id == peer_id)) {
+		if ((pdev->m_copy_id.tx_ppdu_id == ppdu_id) &&
+			(pdev->m_copy_id.tx_peer_id == peer_id)) {
 			return QDF_STATUS_E_INVAL;
 		}
 
-		pdev->am_copy_id.tx_ppdu_id = ppdu_id;
-		pdev->am_copy_id.tx_peer_id = peer_id;
+		pdev->m_copy_id.tx_ppdu_id = ppdu_id;
+		pdev->m_copy_id.tx_peer_id = peer_id;
 	}
 
 	if (!qdf_nbuf_push_head(netbuf, sizeof(struct tx_capture_hdr))) {

+ 1 - 1
dp/wifi3.0/dp_types.h

@@ -1123,7 +1123,7 @@ struct dp_pdev {
 		uint16_t tx_ppdu_id;
 		uint16_t tx_peer_id;
 		uint16_t rx_ppdu_id;
-	} am_copy_id;
+	} m_copy_id;
 
 	/* To check if PPDU Tx stats are enabled for Pktlog */
 	bool pktlog_ppdu_stats;