xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_sysfs_dp_trace.h (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1 /*
2  * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: wlan_hdd_sysfs_dp_trace.h
20  *
21  * Implementation for creating sysfs files:
22  *
23  * dp_trace
24  * dump_dp_trace
25  * clear_dp_trace
26  */
27 
28 #ifndef _WLAN_HDD_SYSFS_DP_TRACE_H
29 #define _WLAN_HDD_SYSFS_DP_TRACE_H
30 
31 #if defined(WLAN_SYSFS) && defined(WLAN_SYSFS_DP_TRACE)
32 
33 #define HDD_SYSFS_DISABLE_DP_TRACE_LIVE_MODE 0
34 #define HDD_SYSFS_ENABLE_DP_TRACE_LIVE_MODE 1
35 #define HDD_SYSFS_DUMP_DP_TRACE 2
36 
37 /**
38  * hdd_sysfs_dp_trace_create() - API to create dp trace related files
39  * @driver_kobject: sysfs driver kobject
40  *
41  * file path: /sys/kernel/wifi/dp_trace
42  *            /sys/kernel/wifi/dump_dp_trace
43  *            /sys/kernel/wifi/clear_dp_trace
44  *
45  * usage:
46  *      echo [arg_0] [arg_1] [arg_2]> dp_trace
47  *      echo [0/1] > dump_dp_trace
48  *      echo 2 [count] > dump_dp_trace
49  *      cat dump_dp_trace
50  *      echo 1 > clear_dp_trace
51  *
52  * Return: 0 on success and errno on failure
53  */
54 int hdd_sysfs_dp_trace_create(struct kobject *driver_kobject);
55 
56 /**
57  * hdd_sysfs_dp_trace_destroy() - API to destroy dp trace related files
58  * @driver_kobject: sysfs driver kobject
59  *
60  * Return: none
61  */
62 void
63 hdd_sysfs_dp_trace_destroy(struct kobject *driver_kobject);
64 #else
65 static inline int
hdd_sysfs_dp_trace_create(struct kobject * driver_kobject)66 hdd_sysfs_dp_trace_create(struct kobject *driver_kobject)
67 {
68 	return 0;
69 }
70 
71 static inline void
hdd_sysfs_dp_trace_destroy(struct kobject * driver_kobject)72 hdd_sysfs_dp_trace_destroy(struct kobject *driver_kobject)
73 {
74 }
75 #endif
76 #endif /* #ifndef _WLAN_HDD_SYSFS_DP_TRACE_H */
77