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

Commit 65d0df53 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 rx packets in pkt capture

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

Change-Id: I9aeb8071cfc6207359f8d7ec74af2a21e2742d1e
CRs-Fixed: 3044857
parent 64a2d1ee
Loading
Loading
Loading
Loading
+31 −2
Original line number Diff line number Diff line
@@ -426,17 +426,43 @@ pkt_capture_mgmt_rx_data_cb(struct wlan_objmgr_psoc *psoc,
			    enum mgmt_frame_type frm_type)
{
	struct mon_rx_status txrx_status = {0};
	struct pkt_psoc_priv *psoc_priv;
	struct ieee80211_frame *wh;
	tpSirMacFrameCtl pfc;
	qdf_nbuf_t nbuf;
	int buf_len;
	struct wlan_objmgr_vdev *vdev;

	if (!(pkt_capture_get_pktcap_mode(psoc) & PKT_CAPTURE_MODE_MGMT_ONLY)) {
		qdf_nbuf_free(wbuf);
	psoc_priv = pkt_capture_psoc_get_priv(psoc);
	if (!psoc_priv) {
		pkt_capture_err("psoc priv is NULL");
		return QDF_STATUS_E_FAILURE;
	}

	pfc = (tpSirMacFrameCtl)(qdf_nbuf_data(wbuf));

	if (pfc->type == SIR_MAC_CTRL_FRAME  &&
	    !psoc_priv->frame_filter.ctrl_rx_frame_filter)
		goto exit;

	if (pfc->type == SIR_MAC_MGMT_FRAME  &&
	    !psoc_priv->frame_filter.mgmt_rx_frame_filter)
		goto exit;

	if (pfc->type == SIR_MAC_MGMT_FRAME) {
		if (pfc->subType == SIR_MAC_MGMT_BEACON) {
			if (psoc_priv->frame_filter.mgmt_rx_frame_filter &
			    PKT_CAPTURE_MGMT_CONNECT_NO_BEACON)
				goto exit;
		} else {
			if (!((psoc_priv->frame_filter.mgmt_rx_frame_filter &
			    PKT_CAPTURE_MGMT_FRAME_TYPE_ALL) ||
			    (psoc_priv->frame_filter.mgmt_rx_frame_filter &
			    PKT_CAPTURE_MGMT_CONNECT_NO_BEACON)))
				goto exit;
		}
	}

	buf_len = qdf_nbuf_len(wbuf);
	nbuf = qdf_nbuf_alloc(NULL, roundup(
				  buf_len + RESERVE_BYTES, 4),
@@ -501,6 +527,9 @@ pkt_capture_mgmt_rx_data_cb(struct wlan_objmgr_psoc *psoc,
		qdf_nbuf_free(nbuf);

	return QDF_STATUS_SUCCESS;
exit:
	qdf_nbuf_free(wbuf);
	return QDF_STATUS_SUCCESS;
}

QDF_STATUS pkt_capture_mgmt_rx_ops(struct wlan_objmgr_psoc *psoc,