Forráskód Böngészése

qcacld-3.0: Deliver tx offload mgmt pkts based on filter

Deliver tx offload management to mon interface in packet capture
mode based on config filters added by vendor command.

Change-Id: Id60529b963e3021d7744858980b316b546606550
CRs-Fixed: 3045460
Surabhi Vishnoi 3 éve
szülő
commit
6cdd0dd785

+ 8 - 0
components/pkt_capture/core/inc/wlan_pkt_capture_main.h

@@ -230,6 +230,14 @@ void pkt_capture_mon(struct pkt_capture_cb_context *cb_ctx, qdf_nbuf_t msdu,
 QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
 				  struct wlan_objmgr_vdev *vdev);
 
+/**
+ * pkt_capture_is_tx_mgmt_enable - Check if tx mgmt frames enabled
+ * @pdev: pointer to pdev
+ *
+ * Return: bool
+ */
+bool pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev);
+
 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
 /**
  * pkt_capture_get_pktcap_mode_v2 - Get packet capture mode

+ 24 - 0
components/pkt_capture/core/src/wlan_pkt_capture_main.c

@@ -650,6 +650,30 @@ enum pkt_capture_mode pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc)
 	return psoc_priv->cfg_param.pkt_capture_mode;
 }
 
+bool pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev)
+{
+	struct pkt_capture_vdev_priv *vdev_priv;
+	struct wlan_objmgr_vdev *vdev;
+
+	vdev = pkt_capture_get_vdev();
+	if (!vdev) {
+		pkt_capture_err("vdev is NULL");
+		return false;
+	}
+
+	vdev_priv = pkt_capture_vdev_get_priv(vdev);
+	if (!vdev_priv) {
+		pkt_capture_err("vdev_priv is NULL");
+		return false;
+	}
+
+	if (!(vdev_priv->frame_filter.mgmt_tx_frame_filter &
+	    PKT_CAPTURE_MGMT_FRAME_TYPE_ALL))
+		return false;
+
+	return true;
+}
+
 QDF_STATUS
 pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
 			       QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),

+ 7 - 1
components/pkt_capture/dispatcher/src/wlan_pkt_capture_ucfg_api.c

@@ -229,9 +229,15 @@ ucfg_pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
 				      qdf_nbuf_t nbuf,
 				      uint8_t status)
 {
-	return pkt_capture_process_mgmt_tx_data(
+	if (pkt_capture_is_tx_mgmt_enable(pdev))
+		return pkt_capture_process_mgmt_tx_data(
 					pdev, params, nbuf,
 					pkt_capture_mgmt_status_map(status));
+
+	else {
+		qdf_nbuf_free(nbuf);
+		return QDF_STATUS_SUCCESS;
+	}
 }
 
 void