1 /*
2  * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: i_qdf_module.h
21  * Linux-specific definitions for QDF module API's
22  */
23 
24 #ifndef _I_QDF_MODULE_H
25 #define _I_QDF_MODULE_H
26 
27 #include <linux/version.h>
28 #include <linux/module.h>
29 #include <linux/moduleparam.h>
30 #include <qdf_types.h>
31 
32 
33 #define __qdf_virt_module_init(_x)  \
34 	static int _x##_mod(void) \
35 	{                   \
36 		uint32_t st;  \
37 		st = (_x)();         \
38 		if (st != QDF_STATUS_SUCCESS)  \
39 			return QDF_STATUS_E_INVAL;            \
40 		else                    \
41 			return 0;             \
42 	}                           \
43 	module_init(_x##_mod);
44 
45 #define __qdf_virt_module_exit(_x)  module_exit(_x)
46 
47 #define __qdf_virt_module_name(_name) MODULE_LICENSE("Dual BSD/GPL")
48 
49 #ifdef WLAN_DISABLE_EXPORT_SYMBOL
50 #define __qdf_export_symbol(_sym)
51 #else
52 #define __qdf_export_symbol(_sym) EXPORT_SYMBOL(_sym)
53 #endif
54 
55 #define __qdf_declare_param(_name, _type) \
56 	module_param(_name, _type, 0600)
57 
58 #define __qdf_declare_param_array(_name, _type, _num) \
59 	module_param_array(_name, _type, _num, 0600)
60 
61 #endif /* _I_QDF_MODULE_H */
62