xref: /wlan-driver/qcacld-3.0/components/pkt_capture/dispatcher/inc/wlan_pkt_capture_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: Contains pkt_capture public API declarations
21  */
22 
23 #ifndef _WLAN_PKT_CAPTURE_API_H_
24 #define _WLAN_PKT_CAPTURE_API_H_
25 
26 #include "wlan_pkt_capture_objmgr.h"
27 
28 /**
29  * wlan_pkt_capture_is_tx_mgmt_enable() - Check if tx mgmt frames filter
30  * is enabled
31  * @pdev: pointer to pdev
32  *
33  * Return: bool
34  */
35 bool wlan_pkt_capture_is_tx_mgmt_enable(struct wlan_objmgr_pdev *pdev);
36 
37 #ifdef WLAN_FEATURE_PKT_CAPTURE
38 /**
39  * wlan_pkt_capture_register_callbacks - Register packet capture callbacks
40  * @vdev: pointer to wlan vdev object manager
41  * @mon_cb: callback to call
42  * @context: callback context
43  *
44  * Return: 0 in case of success, invalid in case of failure.
45  */
46 QDF_STATUS
47 wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
48 				    QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),
49 				    void *context);
50 
51 #else
52 static inline QDF_STATUS
wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev * vdev,QDF_STATUS (* mon_cb)(void *,qdf_nbuf_t),void * context)53 wlan_pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
54 				    QDF_STATUS (*mon_cb)(void *, qdf_nbuf_t),
55 				    void *context)
56 {
57 	return QDF_STATUS_SUCCESS;
58 }
59 #endif /* WLAN_FEATURE_PKT_CAPTURE */
60 #endif /* _WLAN_PKT_CAPTURE_API_H_ */
61