1 /*
2  * Copyright (c) 2019-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
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: wlan_hdd_debugfs_mibstat.h
22  *
23  * WLAN Host Device Driver implementation to update
24  * debugfs with MIB statistics
25  */
26 
27 #ifndef _WLAN_HDD_DEBUGFS_MIBSTAT_H
28 #define _WLAN_HDD_DEBUGFS_MIBSTAT_H
29 
30 #define DEBUGFS_MIBSTATS_BUF_SIZE 4096
31 
32 #include <wlan_hdd_main.h>
33 
34 #if defined(WLAN_FEATURE_MIB_STATS) && defined(WLAN_DEBUGFS)
35 /**
36  * hdd_debugfs_process_mib_stats() - Process mib stats from fw
37  * @adapter: interface adapter pointer
38  * @stats: mib stats
39  *
40  * This function is used to store mib stats to global variable mib_stats.
41  *
42  * Return: None
43  */
44 void hdd_debugfs_process_mib_stats(struct hdd_adapter *adapter,
45 				   struct stats_event *stats);
46 
47 /**
48  * wlan_hdd_create_mib_stats_file() - API to create MIB stats file
49  * @adapter: interface adapter pointer
50  *
51  * Return: 0 on success and errno on failure
52  */
53 int wlan_hdd_create_mib_stats_file(struct hdd_adapter *adapter);
54 
55 /**
56  * wlan_hdd_create_mib_stats_lock() - API to create MIB stats lock
57  *
58  * Return: No return
59  */
60 void wlan_hdd_create_mib_stats_lock(void);
61 
62 /**
63  * wlan_hdd_destroy_mib_stats_lock() - API to destroy MIB stats lock
64  *
65  * Return: No return
66  */
67 void wlan_hdd_destroy_mib_stats_lock(void);
68 #else
wlan_hdd_create_mib_stats_file(struct hdd_adapter * adapter)69 static inline int wlan_hdd_create_mib_stats_file(struct hdd_adapter *adapter)
70 {
71 	return 0;
72 }
73 
wlan_hdd_create_mib_stats_lock(void)74 static inline void wlan_hdd_create_mib_stats_lock(void)
75 {
76 }
77 
wlan_hdd_destroy_mib_stats_lock(void)78 static inline void wlan_hdd_destroy_mib_stats_lock(void)
79 {
80 }
81 #endif
82 #endif /* #ifndef _WLAN_HDD_DEBUGFS_MIBSTAT_H */
83