blob: b2bd28e965faf2802661980675cb6652ceff69af [file] [log] [blame]
James Smart93dd1912016-07-06 12:36:10 -07001/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
8 * *
9 * This program is free software; you can redistribute it and/or *
10 * modify it under the terms of version 2 of the GNU General *
11 * Public License as published by the Free Software Foundation. *
12 * This program is distributed in the hope that it will be useful. *
13 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
14 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
15 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
16 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
17 * TO BE LEGALLY INVALID. See the GNU General Public License for *
18 * more details, a copy of which can be found in the file COPYING *
19 * included with this package. *
20 *******************************************************************/
21
22#define LPFC_ATTR(name, defval, minval, maxval, desc) \
23static uint lpfc_##name = defval;\
24module_param(lpfc_##name, uint, S_IRUGO);\
25MODULE_PARM_DESC(lpfc_##name, desc);\
26lpfc_param_init(name, defval, minval, maxval)
27
28#define LPFC_ATTR_R(name, defval, minval, maxval, desc) \
29static uint lpfc_##name = defval;\
30module_param(lpfc_##name, uint, S_IRUGO);\
31MODULE_PARM_DESC(lpfc_##name, desc);\
32lpfc_param_show(name)\
33lpfc_param_init(name, defval, minval, maxval)\
34static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
35
36#define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \
37static uint lpfc_##name = defval;\
38module_param(lpfc_##name, uint, S_IRUGO);\
39MODULE_PARM_DESC(lpfc_##name, desc);\
40lpfc_param_show(name)\
41lpfc_param_init(name, defval, minval, maxval)\
42lpfc_param_set(name, defval, minval, maxval)\
43lpfc_param_store(name)\
44static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
45 lpfc_##name##_show, lpfc_##name##_store)
46
47#define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \
48static uint lpfc_##name = defval;\
49module_param(lpfc_##name, uint, S_IRUGO);\
50MODULE_PARM_DESC(lpfc_##name, desc);\
51lpfc_param_hex_show(name)\
52lpfc_param_init(name, defval, minval, maxval)\
53static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
54
55#define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
56static uint lpfc_##name = defval;\
57module_param(lpfc_##name, uint, S_IRUGO);\
58MODULE_PARM_DESC(lpfc_##name, desc);\
59lpfc_param_hex_show(name)\
60lpfc_param_init(name, defval, minval, maxval)\
61lpfc_param_set(name, defval, minval, maxval)\
62lpfc_param_store(name)\
63static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
64 lpfc_##name##_show, lpfc_##name##_store)
65
66#define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
67static uint lpfc_##name = defval;\
68module_param(lpfc_##name, uint, S_IRUGO);\
69MODULE_PARM_DESC(lpfc_##name, desc);\
70lpfc_vport_param_init(name, defval, minval, maxval)
71
72#define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
73static uint lpfc_##name = defval;\
74module_param(lpfc_##name, uint, S_IRUGO);\
75MODULE_PARM_DESC(lpfc_##name, desc);\
76lpfc_vport_param_show(name)\
77lpfc_vport_param_init(name, defval, minval, maxval)\
78static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
79
80#define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
81static uint64_t lpfc_##name = defval;\
82module_param(lpfc_##name, ullong, S_IRUGO);\
83MODULE_PARM_DESC(lpfc_##name, desc);\
84lpfc_vport_param_show(name)\
85lpfc_vport_param_init(name, defval, minval, maxval)\
86static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
87
88#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
89static uint lpfc_##name = defval;\
90module_param(lpfc_##name, uint, S_IRUGO);\
91MODULE_PARM_DESC(lpfc_##name, desc);\
92lpfc_vport_param_show(name)\
93lpfc_vport_param_init(name, defval, minval, maxval)\
94lpfc_vport_param_set(name, defval, minval, maxval)\
95lpfc_vport_param_store(name)\
96static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
97 lpfc_##name##_show, lpfc_##name##_store)
98
99#define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
100static uint lpfc_##name = defval;\
101module_param(lpfc_##name, uint, S_IRUGO);\
102MODULE_PARM_DESC(lpfc_##name, desc);\
103lpfc_vport_param_hex_show(name)\
104lpfc_vport_param_init(name, defval, minval, maxval)\
105static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
106
107#define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
108static uint lpfc_##name = defval;\
109module_param(lpfc_##name, uint, S_IRUGO);\
110MODULE_PARM_DESC(lpfc_##name, desc);\
111lpfc_vport_param_hex_show(name)\
112lpfc_vport_param_init(name, defval, minval, maxval)\
113lpfc_vport_param_set(name, defval, minval, maxval)\
114lpfc_vport_param_store(name)\
115static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
116 lpfc_##name##_show, lpfc_##name##_store)