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