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

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

qcacld-3.0: Add tgt support to send beacon report period to FW

Add tgt support in packet capture component to send user
configured beacon report interval to FW.

Change-Id: I8b0b3062dca0667db6ca305ed54ac603086dae82
parent 2bd2232a
Loading
Loading
Loading
Loading
+40 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include "cdp_txrx_ctrl.h"
#include "wlan_pkt_capture_tgt_api.h"
#include <cds_ieee80211_common.h>
#include "wlan_vdev_mgr_utils_api.h"

static struct wlan_objmgr_vdev *gp_pkt_capture_vdev;

@@ -1022,7 +1023,9 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
	ol_txrx_soc_handle soc;
	QDF_STATUS status;
	enum pkt_capture_config config = 0;
	bool check_enable_beacon = 0;
	bool check_enable_beacon = 0, send_bcn = 0;
	struct vdev_mlme_obj *vdev_mlme;
	uint32_t bcn_interval, nth_beacon_value;

	if (!vdev) {
		pkt_capture_err("vdev is NULL");
@@ -1078,9 +1081,14 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
			frame_filter.ctrl_rx_frame_filter;

	if (frame_filter.vendor_attr_to_set &
	    BIT(PKT_CAPTURE_ATTR_SET_MONITOR_MODE_CONNECTED_BEACON_INTERVAL))
	    BIT(PKT_CAPTURE_ATTR_SET_MONITOR_MODE_CONNECTED_BEACON_INTERVAL)) {
		if (frame_filter.connected_beacon_interval !=
		    vdev_priv->frame_filter.connected_beacon_interval) {
			vdev_priv->frame_filter.connected_beacon_interval =
				frame_filter.connected_beacon_interval;
			send_bcn = 1;
		}
	}

	if (vdev_priv->frame_filter.mgmt_tx_frame_filter)
		mode |= PACKET_CAPTURE_MODE_MGMT_ONLY;
@@ -1142,5 +1150,33 @@ QDF_STATUS pkt_capture_set_filter(struct pkt_capture_frame_filter frame_filter,
		}
	}

	if (send_bcn) {
		vdev_mlme = wlan_objmgr_vdev_get_comp_private_obj(
							vdev,
							WLAN_UMAC_COMP_MLME);

		if (!vdev_mlme)
			return QDF_STATUS_E_FAILURE;

		wlan_util_vdev_mlme_get_param(vdev_mlme,
					      WLAN_MLME_CFG_BEACON_INTERVAL,
					      &bcn_interval);

		if (bcn_interval) {
			nth_beacon_value =
				vdev_priv->
				frame_filter.connected_beacon_interval /
				bcn_interval;

			status = tgt_pkt_capture_send_beacon_interval(
							vdev,
							nth_beacon_value);

			if (QDF_IS_STATUS_ERROR(status)) {
				pkt_capture_err("send beacon interval fail");
				return status;
			}
		}
	}
	return QDF_STATUS_SUCCESS;
}
+4 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ struct wlan_pkt_capture_tx_ops {
				(struct wlan_objmgr_psoc *psoc,
				 uint8_t vdev_id,
				 enum pkt_capture_config config);
	QDF_STATUS (*pkt_capture_send_beacon_interval)
				(struct wlan_objmgr_psoc *psoc,
				 uint8_t vdev_id,
				 uint32_t nth_value);
};

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

/**
 * tgt_pkt_capture_send_beacon_interval() - send beacon interval to firmware
 * @vdev: pointer to vdev object
 * @nth_value: Beacon report period
 *
 * Return: QDF_STATUS
 */
QDF_STATUS
tgt_pkt_capture_send_beacon_interval(struct wlan_objmgr_vdev *vdev,
				     uint32_t nth_value);

/**
 * tgt_pkt_capture_send_config() - send packet capture config to firmware
 * @vdev: pointer to vdev object
+36 −0
Original line number Diff line number Diff line
@@ -126,6 +126,42 @@ tgt_pkt_capture_send_mode(struct wlan_objmgr_vdev *vdev,
	return status;
}

QDF_STATUS
tgt_pkt_capture_send_beacon_interval(struct wlan_objmgr_vdev *vdev,
				     uint32_t nth_value)
{
	QDF_STATUS status = QDF_STATUS_E_FAILURE;
	struct pkt_capture_vdev_priv *vdev_priv;
	struct wlan_pkt_capture_tx_ops *tx_ops;
	struct wlan_objmgr_psoc *psoc;

	psoc = wlan_vdev_get_psoc(vdev);
	if (!psoc) {
		pkt_capture_err("psoc is NULL");
		return status;
	}

	vdev_priv = pkt_capture_vdev_get_priv(vdev);
	if (!vdev_priv) {
		pkt_capture_err("vdev priv is NULL");
		return status;
	}

	tx_ops = &vdev_priv->tx_ops;

	if (!tx_ops->pkt_capture_send_beacon_interval)
		return status;

	status = tx_ops->pkt_capture_send_beacon_interval
						(psoc,
						 wlan_vdev_get_id(vdev),
						 nth_value);
	if (QDF_IS_STATUS_ERROR(status))
		pkt_capture_err("Unable to send beacon interval to fw");

	return status;
}

QDF_STATUS
tgt_pkt_capture_send_config(struct wlan_objmgr_vdev *vdev,
			    enum pkt_capture_config config)
+40 −0
Original line number Diff line number Diff line
@@ -125,6 +125,44 @@ target_if_set_packet_capture_config
}
#endif

/**
 * target_if_set_packet_capture_beacon_interval() - set packet capture beacon
 * interval
 * @psoc: pointer to psoc object
 * @vdev_id: vdev id
 * @nth_value: Beacon report period
 *
 * Return: QDF_STATUS
 */
static QDF_STATUS
target_if_set_packet_capture_beacon_interval
			(struct wlan_objmgr_psoc *psoc,
			 uint8_t vdev_id,
			 uint32_t nth_value)
{
	wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
	QDF_STATUS status = QDF_STATUS_E_FAILURE;
	struct vdev_set_params param;

	if (!wmi_handle) {
		target_if_err("Invalid wmi handle");
		return QDF_STATUS_E_INVAL;
	}

	target_if_debug("psoc:%pK, vdev_id:%d nth_value:%d",
			psoc, vdev_id, nth_value);

	param.vdev_id = vdev_id;
	param.param_id = WMI_VDEV_PARAM_NTH_BEACON_TO_HOST;
	param.param_value = nth_value;

	status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
	if (QDF_IS_STATUS_ERROR(status))
		pkt_capture_err("failed to set beacon interval");

	return status;
}

/**
 * target_if_mgmt_offload_data_event_handler() - offload event handler
 * @handle: scn handle
@@ -435,4 +473,6 @@ target_if_pkt_capture_register_tx_ops(struct wlan_pkt_capture_tx_ops *tx_ops)

	tx_ops->pkt_capture_send_mode = target_if_set_packet_capture_mode;
	tx_ops->pkt_capture_send_config = target_if_set_packet_capture_config;
	tx_ops->pkt_capture_send_beacon_interval =
				target_if_set_packet_capture_beacon_interval;
}