1 /*
2 * Copyright (c) 2020 The Linux Foundation. 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_rts_cts.h
19 *
20 * implementation for creating sysfs file rts_cts
21 */
22
23 #ifndef _WLAN_HDD_SYSFS_RTS_CTS_H
24 #define _WLAN_HDD_SYSFS_RTS_CTS_H
25
26 #if defined(WLAN_SYSFS) && defined(WLAN_SYSFS_RTS_CTS)
27
28 #define HDD_SYSFS_RTS_CTS_DISABLE 0
29 #define HDD_SYSFS_RTS_CTS_ENABLE 1
30 #define HDD_SYSFS_CTS_ENABLE 2
31
32 /**
33 * hdd_sysfs_rts_cts_create() - API to create rts_cts
34 * @adapter: hdd adapter
35 *
36 * this file is created per adapter.
37 * file path: /sys/class/net/wlanxx/rts_cts
38 * (wlanxx is adapter name)
39 * usage:
40 * echo [value] > rts_cts
41 *
42 * Return: 0 on success and errno on failure
43 */
44 int hdd_sysfs_rts_cts_create(struct hdd_adapter *adapter);
45
46 /**
47 * hdd_sysfs_rts_cts_destroy() - API to destroy rts_cts
48 * @adapter: pointer to adapter
49 *
50 * Return: none
51 */
52 void hdd_sysfs_rts_cts_destroy(struct hdd_adapter *adapter);
53 #else
54 static inline int
hdd_sysfs_rts_cts_create(struct hdd_adapter * adapter)55 hdd_sysfs_rts_cts_create(struct hdd_adapter *adapter)
56 {
57 return 0;
58 }
59
60 static inline void
hdd_sysfs_rts_cts_destroy(struct hdd_adapter * adapter)61 hdd_sysfs_rts_cts_destroy(struct hdd_adapter *adapter)
62 {
63 }
64 #endif
65 #endif /* #ifndef _WLAN_HDD_SYSFS_RTS_CTS_H */
66