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

Commit c4a2cd52 authored by Alok Kumar's avatar Alok Kumar Committed by nshrivas
Browse files

qcacld-3.0: Add ol_txrx support to (de)register mon ctx and cb

For packet capture mode, add support to register and deregister
the mon adapter context and callback in pdev.

Change-Id: Idde181184c787ac881b61e17fcb73e69a5f35da2
CRs-Fixed: 2451437
parent 65310d47
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
@@ -2445,6 +2445,48 @@ ol_txrx_vdev_attach(ol_txrx_pdev_handle pdev,
	return vdev;
}

/**
 * ol_txrx_mon_cb_deregister() - Deregister pkt capture mode callback
 * @void:
 *
 * Return: None
 */
void ol_txrx_mon_cb_deregister(void)
{
	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);

	if (qdf_unlikely(!pdev)) {
		qdf_print("%s: pdev is NULL!\n", __func__);
		qdf_assert(0);
		return;
	}

	pdev->mon_osif_dev = NULL;
	pdev->mon_cb = NULL;
}

/**
 * ol_txrx_mon_cb_register() - Register pkt capture mode callback
 * @osif_vdev: the virtual device's OS shim object
 * @mon_cb: callback to register
 *
 * Return: None
 */
void ol_txrx_mon_cb_register(void *osif_vdev,
			     ol_txrx_mon_callback_fp mon_cb)
{
	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);

	if (qdf_unlikely(!pdev)) {
		qdf_print("%s: pdev is NULL!\n", __func__);
		qdf_assert(0);
		return;
	}

	pdev->mon_osif_dev = osif_vdev;
	pdev->mon_cb = mon_cb;
}

/**
 *ol_txrx_vdev_register - Link a vdev's data object with the
 * matching OS shim vdev object.
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -618,6 +618,9 @@ struct ol_txrx_pdev_t {
	/* osdev - handle for mem alloc / free, map / unmap */
	qdf_device_t osdev;

	void *mon_osif_dev;
	ol_txrx_mon_callback_fp mon_cb;

	htt_pdev_handle htt_pdev;

#ifdef WLAN_FEATURE_FASTPATH