Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c28d3506 authored by Surabhi Vishnoi's avatar Surabhi Vishnoi Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Add check for mgmt/ctrl tx packets in pkt capture

Deliver management and control tx packets to monitor interface
only if corresponding filter is set by vendor command.

Change-Id: Ifc7f0ecfce7d7a105902e8a9ce522ba0325ee9cd
CRs-Fixed: 3044855
parent 65d0df53
Loading
Loading
Loading
Loading
+49 −1
Original line number Diff line number Diff line
@@ -329,15 +329,39 @@ void pkt_capture_mgmt_tx(struct wlan_objmgr_pdev *pdev,
			 uint16_t chan_freq,
			 uint8_t preamble_type)
{
	struct mgmt_offload_event_params params = {0};
	tpSirMacFrameCtl pfc = (tpSirMacFrameCtl)(qdf_nbuf_data(nbuf));
	struct pkt_psoc_priv *psoc_priv;
	struct wlan_objmgr_psoc *psoc;
	qdf_nbuf_t wbuf;
	int nbuf_len;
	struct mgmt_offload_event_params params = {0};

	if (!pdev) {
		pkt_capture_err("pdev is NULL");
		return;
	}

	psoc = wlan_pdev_get_psoc(pdev);
	if (!psoc) {
		pkt_capture_err("psoc is NULL");
		return;
	}

	psoc_priv = pkt_capture_psoc_get_priv(psoc);
	if (!psoc_priv) {
		pkt_capture_err("psoc priv is NULL");
		return;
	}

	if (pfc->type == IEEE80211_FC0_TYPE_MGT &&
	    !(psoc_priv->frame_filter.mgmt_tx_frame_filter &
	    PKT_CAPTURE_MGMT_FRAME_TYPE_ALL))
		return;

	if (pfc->type == IEEE80211_FC0_TYPE_CTL &&
	    !psoc_priv->frame_filter.ctrl_tx_frame_filter)
		return;

	nbuf_len = qdf_nbuf_len(nbuf);
	wbuf = qdf_nbuf_alloc(NULL, roundup(nbuf_len + RESERVE_BYTES, 4),
			      RESERVE_BYTES, 4, false);
@@ -380,6 +404,9 @@ pkt_capture_mgmt_tx_completion(struct wlan_objmgr_pdev *pdev,
			       uint32_t status,
			       struct mgmt_offload_event_params *params)
{
	struct pkt_psoc_priv *psoc_priv;
	struct wlan_objmgr_psoc *psoc;
	tpSirMacFrameCtl pfc;
	qdf_nbuf_t wbuf, nbuf;
	int nbuf_len;

@@ -388,9 +415,30 @@ pkt_capture_mgmt_tx_completion(struct wlan_objmgr_pdev *pdev,
		return;
	}

	psoc = wlan_pdev_get_psoc(pdev);
	if (!psoc) {
		pkt_capture_err("psoc is NULL");
		return;
	}

	psoc_priv = pkt_capture_psoc_get_priv(psoc);
	if (!psoc_priv) {
		pkt_capture_err("psoc priv is NULL");
		return;
	}

	nbuf = mgmt_txrx_get_nbuf(pdev, desc_id);
	if (!nbuf)
		return;
	pfc = (tpSirMacFrameCtl)(qdf_nbuf_data(nbuf));
	if (pfc->type == IEEE80211_FC0_TYPE_MGT &&
	    !(psoc_priv->frame_filter.mgmt_tx_frame_filter &
	    PKT_CAPTURE_MGMT_FRAME_TYPE_ALL))
		return;

	if (pfc->type == IEEE80211_FC0_TYPE_CTL &&
	    !psoc_priv->frame_filter.ctrl_tx_frame_filter)
		return;

	nbuf_len = qdf_nbuf_len(nbuf);
	wbuf = qdf_nbuf_alloc(NULL, roundup(nbuf_len + RESERVE_BYTES, 4),