xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_sysfs_unit_test.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 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_unit_test.h
19  *
20  * implementation for creating sysfs file unit_test_target
21  */
22 
23 #ifndef _WLAN_HDD_SYSFS_UNIT_TEST_H
24 #define _WLAN_HDD_SYSFS_UNIT_TEST_H
25 
26 #if defined(WLAN_SYSFS)
27 /**
28  * hdd_sysfs_unit_test_target_create() - API to create unit_test_target file
29  * @adapter: hdd adapter
30  *
31  * this file is created per adapter.
32  * file path: /sys/class/net/wlan_xx/unit_test_target
33  *                (wlan_xx is adapter name)
34  * usage:
35  *      echo [module_id] [arg_num] [arg_0] [arg_xx] ... >unit_test_target
36  *      echo 5 2 2 1 >unit_test_target
37  *
38  * Return: 0 on success and errno on failure
39  */
40 int hdd_sysfs_unit_test_target_create(struct hdd_adapter *adapter);
41 
42 /**
43  * hdd_sysfs_unit_test_target_destroy() -
44  *   API to destroy unit_test_target sys file
45  * @adapter: pointer to adapter
46  *
47  * Return: none
48  */
49 void hdd_sysfs_unit_test_target_destroy(struct hdd_adapter *adapter);
50 #else
51 static inline int
hdd_sysfs_unit_test_target_create(struct hdd_adapter * adapter)52 hdd_sysfs_unit_test_target_create(struct hdd_adapter *adapter)
53 {
54 	return 0;
55 }
56 
57 static inline void
hdd_sysfs_unit_test_target_destroy(struct hdd_adapter * adapter)58 hdd_sysfs_unit_test_target_destroy(struct hdd_adapter *adapter)
59 {
60 }
61 #endif
62 #endif /* #ifndef _WLAN_HDD_SYSFS_UNIT_TEST_H */
63