xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_sysfs_bitrates.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: wlan_hdd_sysfs_bitrates.h
19  *
20  * implementation for creating sysfs file bitrates
21  * file path: /sys/class/net/wlanxx/sta_bitrates
22  * file path: /sys/class/net/wlanxx/sap_bitrates
23  *
24  * usage:
25  *      echo [arg_0] [arg_1] > sta_bitrates
26  *      echo [arg_0] [arg_1] > sap_bitrates
27  */
28 
29 #ifndef _WLAN_HDD_SYSFS_BITRATES_H
30 #define _WLAN_HDD_SYSFS_BITRATES_H
31 
32 #define SET_11N_RATES 0
33 #define SET_11AC_RATES 1
34 #define SET_11AX_RATES 2
35 
36 #if defined(WLAN_SYSFS) && defined(CONFIG_WLAN_SYSFS_BITRATES)
37 /**
38  * hdd_sysfs_sta_bitrates_create() - API to create sta_bitrates
39  * @adapter: hdd adapter
40  *
41  * Return: 0 on success and errno on failure
42  */
43 int hdd_sysfs_sta_bitrates_create(struct hdd_adapter *adapter);
44 /**
45  * hdd_sysfs_sap_bitrates_create() - API to create sap_bitrates
46  * @adapter: hdd adapter
47  *
48  * Return: 0 on success and errno on failure
49  */
50 int hdd_sysfs_sap_bitrates_create(struct hdd_adapter *adapter);
51 /**
52  * hdd_sysfs_sta_bitrates_destroy() - API to destroy sta_bitrates
53  * @adapter: hdd adapter
54  *
55  * Return: none
56  */
57 void
58 hdd_sysfs_sta_bitrates_destroy(struct hdd_adapter *adapter);
59 /**
60  * hdd_sysfs_sap_bitrates_destroy() - API to destroy sap_bitrates
61  * @adapter: hdd adapter
62  *
63  * Return: none
64  */
65 void
66 hdd_sysfs_sap_bitrates_destroy(struct hdd_adapter *adapter);
67 #else
68 static inline int
hdd_sysfs_sta_bitrates_create(struct hdd_adapter * adapter)69 hdd_sysfs_sta_bitrates_create(struct hdd_adapter *adapter)
70 {
71 	return 0;
72 }
73 
74 static inline int
hdd_sysfs_sap_bitrates_create(struct hdd_adapter * adapter)75 hdd_sysfs_sap_bitrates_create(struct hdd_adapter *adapter)
76 {
77 	return 0;
78 }
79 
80 static inline void
hdd_sysfs_sta_bitrates_destroy(struct hdd_adapter * adapter)81 hdd_sysfs_sta_bitrates_destroy(struct hdd_adapter *adapter)
82 {
83 }
84 
85 static inline void
hdd_sysfs_sap_bitrates_destroy(struct hdd_adapter * adapter)86 hdd_sysfs_sap_bitrates_destroy(struct hdd_adapter *adapter)
87 {
88 }
89 #endif
90 #endif /* #ifndef _WLAN_HDD_SYSFS_BITRATES_H */
91