Эх сурвалжийг харах

qcacmn: Add changes to distinguish between LPC and STA+MON

Currently there is no way to distinguish between
Local Packet Capture and STA+Mon mode as both mode
uses same monitor interface. So to distinguish between
two mode in local_packet_capture enable case use
mon_flags which can be passed during monitor interface
add time. If "flags otherbss" is passed during
monitor interface add driver will consider current mode
as STA+MON mode, LPC otherwise.

Change-Id: I56a724697bb187d0b809b6c43c7b5bf4b7d15ca7
CRs-Fixed: 3739438
Amit Mehta 1 жил өмнө
parent
commit
03f346bc1e

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

@@ -4804,7 +4804,7 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
 	} else if (dp_soc_get_con_mode(soc) == QDF_GLOBAL_MISSION_MODE &&
 		   soc->intr_mode == DP_INTR_MSI &&
 		   wlan_op_mode_monitor == vdev->opmode &&
-		   !wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) {
+		   !dp_mon_mode_local_pkt_capture(soc)) {
 		/* Timer to reap status ring in mission mode */
 		dp_monitor_vdev_timer_start(soc);
 	}

+ 2 - 2
dp/wifi3.0/dp_rings.h

@@ -264,7 +264,7 @@ static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
 		if (ring_type != RXDMA_MONITOR_STATUS)
 			return true;
 	} else if (ring_type == RXDMA_MONITOR_STATUS &&
-		   !wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) {
+		   !dp_mon_mode_local_pkt_capture(soc)) {
 		return true;
 	}
 
@@ -278,7 +278,7 @@ static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
 		if (ring_type == REO_DST || ring_type == RXDMA_DST)
 			return true;
 	} else if (ring_type == RXDMA_MONITOR_STATUS &&
-		  !wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) {
+		  !dp_mon_mode_local_pkt_capture(soc)) {
 		return true;
 	}
 

+ 1 - 1
dp/wifi3.0/dp_rings_main.c

@@ -826,7 +826,7 @@ static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc)
 {
 	return !!(soc->cdp_soc.ol_ops->get_con_mode() !=
 		 QDF_GLOBAL_MONITOR_MODE &&
-		 !wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx));
+		 !dp_mon_mode_local_pkt_capture(soc));
 }
 #else
 static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc)

+ 32 - 0
dp/wifi3.0/monitor/dp_mon.h

@@ -4911,12 +4911,44 @@ void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops);
  * Return: QDF_STATUS
  */
 QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev);
+
+/*
+ * dp_mon_mode_local_pkt_capture() - Check if in LPC mode
+ * @soc: DP SOC handle
+ *
+ * Return: True in case of LPC mode else false
+ *
+ */
+static inline bool
+dp_mon_mode_local_pkt_capture(struct dp_soc *soc)
+{
+	/* Currently there is no way to distinguish between
+	 * Local Packet Capture and STA+Mon mode as both mode
+	 * uses same monitor interface. So to distinguish between
+	 * two mode in local_packet_capture enable case use
+	 * mon_flags which can be passed during monitor interface
+	 * add time. If "flags otherbss" is passed during
+	 * monitor interface add driver will consider current mode
+	 * as STA+MON mode, LPC otherwise.
+	 */
+	if (wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx) &&
+	    !(soc->mon_flags & QDF_MONITOR_FLAG_OTHER_BSS))
+		return true;
+
+	return false;
+}
 #else
 static inline
 QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline bool
+dp_mon_mode_local_pkt_capture(struct dp_soc *soc)
+{
+	return false;
+}
 #endif
 
 #ifdef WIFI_MONITOR_SUPPORT

+ 4 - 4
dp/wifi3.0/monitor/dp_mon_filter.c

@@ -284,18 +284,18 @@ void dp_mon_filter_h2t_setup(struct dp_soc *soc, struct dp_pdev *pdev,
 }
 
 /**
- * dp_mon_is_lpc_mode() - Check if it's local packets capturing mode
+ * dp_mon_skip_filter_config() - Check if filter config need to be skipped
  * @soc: DP soc context
  *
  * Return: true if yes, false if not
  */
 static inline
-bool dp_mon_is_lpc_mode(struct dp_soc *soc)
+bool dp_mon_skip_filter_config(struct dp_soc *soc)
 {
 	if (soc->cdp_soc.ol_ops->get_con_mode &&
 	    soc->cdp_soc.ol_ops->get_con_mode() ==
 	    QDF_GLOBAL_MISSION_MODE &&
-	    wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx))
+	    !(QDF_MONITOR_FLAG_OTHER_BSS & soc->mon_flags))
 		return true;
 	else
 		return false;
@@ -313,7 +313,7 @@ dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc,
 	uint32_t target_type = hal_get_target_type(soc->hal_soc);
 
 	if (srng_type == DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF &&
-	    dp_mon_is_lpc_mode(soc)) {
+	    dp_mon_skip_filter_config(soc)) {
 		dp_mon_filter_info("skip rxdma_buf filter cfg for lpc mode");
 		return QDF_STATUS_SUCCESS;
 	}