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

Commit 2bd2232a authored by Vulupala Shashank Reddy's avatar Vulupala Shashank Reddy Committed by Vulupala Shashank Reddy
Browse files

qcacld-3.0: Add support to send config to FW based on filter

In packet capture component add support to send ctrl and beacon
frames config to FW based on frame filter received from user through
vendor command.

Change-Id: Ie233eafd4331a10840d2b7ba51db64363b41d346
parent 952fbb47
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -172,6 +172,25 @@ void pkt_capture_set_pktcap_mode(struct wlan_objmgr_psoc *psoc,
enum pkt_capture_mode
pkt_capture_get_pktcap_mode(struct wlan_objmgr_psoc *psoc);

/**
 * pkt_capture_set_pktcap_config - Set packet capture config
 * @vdev: pointer to vdev object
 * @config: config to be set
 *
 * Return: None
 */
void pkt_capture_set_pktcap_config(struct wlan_objmgr_vdev *vdev,
				   enum pkt_capture_config config);

/**
 * pkt_capture_get_pktcap_config - Get packet capture config
 * @vdev: pointer to vdev object
 *
 * Return: config value
 */
enum pkt_capture_config
pkt_capture_get_pktcap_config(struct wlan_objmgr_vdev *vdev);

/**
 * pkt_capture_drop_nbuf_list() - drop an nbuf list
 * @buf_list: buffer list to be dropepd
+5 −3
Original line number Diff line number Diff line
@@ -32,23 +32,23 @@
#include "wlan_pkt_capture_mon_thread.h"

/**
 * struct pkt_capture_cfg - packet capture cfg to store ini values
 * struct pkt_capture_cfg - struct to store config values
 * @pkt_capture_mode: packet capture mode
 * @pkt_capture_config: config for trigger, qos and beacon frames
 */
struct pkt_capture_cfg {
	enum pkt_capture_mode pkt_capture_mode;
	enum pkt_capture_config pkt_capture_config;
};

/**
 * struct pkt_capture_cb_context - packet capture callback context
 * @mon_cb: monitor callback function pointer
 * @mon_ctx: monitor callback context
 * @pkt_capture_mode: packet capture mode
 */
struct pkt_capture_cb_context {
	QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t);
	void *mon_ctx;
	enum pkt_capture_mode pkt_capture_mode;
};

/**
@@ -59,6 +59,7 @@ struct pkt_capture_cb_context {
 * @rx_ops: rx ops
 * @tx_ops: tx ops
 * @frame_filter: config filter set by vendor command
 * @cfg_params: packet capture config params
 * @rx_avg_rssi: avg rssi of rx data packets
 * @ppdu_stats_q: list used for storing smu related ppdu stats
 * @lock_q: spinlock for ppdu_stats q
@@ -71,6 +72,7 @@ struct pkt_capture_vdev_priv {
	struct wlan_pkt_capture_rx_ops rx_ops;
	struct wlan_pkt_capture_tx_ops tx_ops;
	struct pkt_capture_frame_filter frame_filter;
	struct pkt_capture_cfg cfg_params;
	int32_t rx_avg_rssi;
	qdf_list_t ppdu_stats_q;
	qdf_spinlock_t lock_q;
+83 −5
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ pkt_capture_get_pktcap_mode_v2()
	if (!vdev_priv)
		pkt_capture_err("vdev_priv is NULL");
	else
		mode = vdev_priv->cb_ctx->pkt_capture_mode;
		mode = vdev_priv->cfg_params.pkt_capture_mode;

	return mode;
}
@@ -648,7 +648,7 @@ void pkt_capture_set_pktcap_mode(struct wlan_objmgr_psoc *psoc,

	vdev_priv = pkt_capture_vdev_get_priv(vdev);
	if (vdev_priv)
		vdev_priv->cb_ctx->pkt_capture_mode = mode;
		vdev_priv->cfg_params.pkt_capture_mode = mode;
	else
		pkt_capture_err("vdev_priv is NULL");

@@ -680,12 +680,47 @@ pkt_capture_get_pktcap_mode(struct wlan_objmgr_psoc *psoc)
	if (!vdev_priv)
		pkt_capture_err("vdev_priv is NULL");
	else
		mode = vdev_priv->cb_ctx->pkt_capture_mode;
		mode = vdev_priv->cfg_params.pkt_capture_mode;

	wlan_objmgr_vdev_release_ref(vdev, WLAN_PKT_CAPTURE_ID);
	return mode;
}

void pkt_capture_set_pktcap_config(struct wlan_objmgr_vdev *vdev,
				   enum pkt_capture_config config)
{
	struct pkt_capture_vdev_priv *vdev_priv;

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

	vdev_priv = pkt_capture_vdev_get_priv(vdev);
	if (vdev_priv)
		vdev_priv->cfg_params.pkt_capture_config = config;
	else
		pkt_capture_err("vdev_priv is NULL");
}

enum pkt_capture_config
pkt_capture_get_pktcap_config(struct wlan_objmgr_vdev *vdev)
{
	enum pkt_capture_config config = 0;
	struct pkt_capture_vdev_priv *vdev_priv;

	if (!vdev)
		return 0;

	vdev_priv = pkt_capture_vdev_get_priv(vdev);
	if (!vdev_priv)
		pkt_capture_err("vdev_priv is NULL");
	else
		config = vdev_priv->cfg_params.pkt_capture_config;

	return config;
}

/**
 * pkt_capture_callback_ctx_create() - Create packet capture callback context
 * @vdev_priv: pointer to packet capture vdev priv obj
@@ -986,6 +1021,8 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
	enum pkt_capture_mode mode = PACKET_CAPTURE_MODE_DISABLE;
	ol_txrx_soc_handle soc;
	QDF_STATUS status;
	enum pkt_capture_config config = 0;
	bool check_enable_beacon = 0;

	if (!vdev) {
		pkt_capture_err("vdev is NULL");
@@ -1045,10 +1082,35 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
		vdev_priv->frame_filter.connected_beacon_interval =
			frame_filter.connected_beacon_interval;

	if (vdev_priv->frame_filter.mgmt_tx_frame_filter ||
	    vdev_priv->frame_filter.mgmt_rx_frame_filter)
	if (vdev_priv->frame_filter.mgmt_tx_frame_filter)
		mode |= PACKET_CAPTURE_MODE_MGMT_ONLY;

	if (vdev_priv->frame_filter.mgmt_rx_frame_filter &
	    PKT_CAPTURE_MGMT_FRAME_TYPE_ALL) {
		mode |= PACKET_CAPTURE_MODE_MGMT_ONLY;
		config |= PACKET_CAPTURE_CONFIG_BEACON_ENABLE;
		config |= PACKET_CAPTURE_CONFIG_OFF_CHANNEL_BEACON_ENABLE;
	} else {
		if (vdev_priv->frame_filter.mgmt_rx_frame_filter &
		    PKT_CAPTURE_MGMT_CONNECT_NO_BEACON) {
			mode |= PACKET_CAPTURE_MODE_MGMT_ONLY;
			config |= PACKET_CAPTURE_CONFIG_NO_BEACON_ENABLE;
		} else {
			check_enable_beacon = 1;
		}
	}

	if (check_enable_beacon) {
		if (vdev_priv->frame_filter.mgmt_rx_frame_filter &
		    PKT_CAPTURE_MGMT_CONNECT_BEACON)
			config |= PACKET_CAPTURE_CONFIG_BEACON_ENABLE;

		if (vdev_priv->frame_filter.mgmt_rx_frame_filter &
		    PKT_CAPTURE_MGMT_CONNECT_SCAN_BEACON)
			config |=
				PACKET_CAPTURE_CONFIG_OFF_CHANNEL_BEACON_ENABLE;
	}

	if (vdev_priv->frame_filter.data_tx_frame_filter ||
	    vdev_priv->frame_filter.data_rx_frame_filter)
		mode |= PACKET_CAPTURE_MODE_DATA_ONLY;
@@ -1064,5 +1126,21 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
			cdp_set_pkt_capture_mode(soc, true);
	}

	if (vdev_priv->frame_filter.ctrl_tx_frame_filter ||
	    vdev_priv->frame_filter.ctrl_rx_frame_filter)
		config |= PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE;

	if (vdev_priv->frame_filter.data_rx_frame_filter &
	    PKT_CAPTURE_DATA_FRAME_QOS_NULL)
		config |= PACKET_CAPTURE_CONFIG_QOS_ENABLE;

	if (config != pkt_capture_get_pktcap_config(vdev)) {
		status = tgt_pkt_capture_send_config(vdev, config);
		if (QDF_IS_STATUS_ERROR(status)) {
			pkt_capture_err("packet capture send config failed");
			return status;
		}
	}

	return QDF_STATUS_SUCCESS;
}
+14 −11
Original line number Diff line number Diff line
@@ -38,19 +38,22 @@ enum pkt_capture_mode {
};

/**
 * enum pkt_capture_trigger_qos_config - packet capture config
 * @PACKET_CAPTURE_CONFIG_TRIGGER_QOS_DISABLE: disable capture for trigger and
 *                                             qos frames
 * enum pkt_capture_config - packet capture config
 * @PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE: enable capture for trigger frames only
 * @PACKET_CAPTURE_CONFIG_QOS_ENABLE: enable capture for qos frames only
 * @PACKET_CAPTURE_CONFIG_TRIGGER_QOS_ENABLE: enable capture for both trigger
 *                                            and qos frames
 * @PACKET_CAPTURE_CONFIG_CONNECT_NO_BEACON_ENABLE: drop all beacons, when
 *                                                  device in connected state
 * @PACKET_CAPTURE_CONFIG_CONNECT_BEACON_ENABLE: enable only connected BSSID
 *                                      beacons, when device in connected state
 * @PACKET_CAPTURE_CONFIG_CONNECT_OFF_CHANNEL_BEACON_ENABLE: enable off channel
 *                                      beacons, when device in connected state
 */
enum pkt_capture_trigger_qos_config {
	PACKET_CAPTURE_CONFIG_TRIGGER_QOS_DISABLE = 0,
	PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE,
	PACKET_CAPTURE_CONFIG_QOS_ENABLE,
	PACKET_CAPTURE_CONFIG_TRIGGER_QOS_ENABLE,
enum pkt_capture_config {
	PACKET_CAPTURE_CONFIG_TRIGGER_ENABLE = BIT(0),
	PACKET_CAPTURE_CONFIG_QOS_ENABLE = BIT(1),
	PACKET_CAPTURE_CONFIG_NO_BEACON_ENABLE = BIT(2),
	PACKET_CAPTURE_CONFIG_BEACON_ENABLE = BIT(3),
	PACKET_CAPTURE_CONFIG_OFF_CHANNEL_BEACON_ENABLE = BIT(4),
};

/**
@@ -106,7 +109,7 @@ struct wlan_pkt_capture_tx_ops {
	QDF_STATUS (*pkt_capture_send_config)
				(struct wlan_objmgr_psoc *psoc,
				 uint8_t vdev_id,
				 enum pkt_capture_trigger_qos_config config);
				 enum pkt_capture_config config);
};

/**
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ QDF_STATUS
tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
			  enum pkt_capture_mode mode);

#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
/**
 * tgt_pkt_capture_send_config() - send packet capture config to firmware
 * @vdev: pointer to vdev object
@@ -63,8 +62,9 @@ tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
 */
QDF_STATUS
tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
			    enum pkt_capture_trigger_qos_config config);
			    enum pkt_capture_config config);

#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
/**
 * tgt_pkt_capture_smu_event() - Receive smart monitor event from firmware
 * @psoc: pointer to psoc
Loading