xref: /wlan-driver/qcacld-3.0/components/pkt_capture/dispatcher/inc/cfg_pkt_capture.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020 The Linux Foundation. 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 #ifndef _CFG_PKT_CAPTURE_H_
20 #define _CFG_PKT_CAPTURE_H_
21 
22 #ifdef WLAN_FEATURE_PKT_CAPTURE
23 
24 #define CFG_PKT_CAPTURE_MODE_DEFAULT	(0)
25 #define CFG_PKT_CAPTURE_MODE_MGMT_PKT	BIT(0)
26 #define CFG_PKT_CAPTURE_MODE_DATA_PKT	BIT(1)
27 #define CFG_PKT_CAPTURE_MODE_MAX	(CFG_PKT_CAPTURE_MODE_MGMT_PKT | \
28 					 CFG_PKT_CAPTURE_MODE_DATA_PKT)
29 
30 /*
31  * <ini>
32  * packet_capture_mode - Packet capture mode
33  * @Min: 0
34  * @Max: 3
35  * Default: 0 - Capture no packets
36  *
37  * This ini is used to decide packet capture mode
38  *
39  * packet_capture_mode = 0 - Capture no packets
40  * packet_capture_mode = 1 - Capture management packets only
41  * packet_capture_mode = 2 - Capture data packets only
42  * packet_capture_mode = 3 - Capture both data and management packets
43  *
44  * Supported Feature: packet capture
45  *
46  * Usage: External
47  *
48  * </ini>
49  */
50 #define CFG_PKT_CAPTURE_MODE \
51 			CFG_INI_UINT("packet_capture_mode", \
52 			0, \
53 			CFG_PKT_CAPTURE_MODE_MAX, \
54 			CFG_PKT_CAPTURE_MODE_DEFAULT, \
55 			CFG_VALUE_OR_DEFAULT, \
56 			"Value for packet capture mode")
57 
58 #define CFG_PKT_CAPTURE_MODE_ALL \
59 	CFG(CFG_PKT_CAPTURE_MODE)
60 #else
61 #define CFG_PKT_CAPTURE_MODE_ALL
62 #endif /* WLAN_FEATURE_PKT_CAPTURE */
63 #endif /* _CFG_PKT_CAPTURE_H_ */
64