]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/scsi/lpfc/lpfc_attr.h
Merge tag 'efi-urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into...
[mirror_ubuntu-artful-kernel.git] / drivers / scsi / lpfc / lpfc_attr.h
CommitLineData
93dd1911
JS
1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. *
d080abe0
JS
4 * Copyright (C) 2017 Broadcom. All Rights Reserved. The term *
5 * “Broadcom” refers to Broadcom Limited and/or its subsidiaries. *
93dd1911
JS
6 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
7 * EMULEX and SLI are trademarks of Emulex. *
d080abe0 8 * www.broadcom.com *
93dd1911
JS
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_ATTR_HEX_R(name, defval, minval, maxval, desc) \
50static uint lpfc_##name = defval;\
51module_param(lpfc_##name, uint, S_IRUGO);\
52MODULE_PARM_DESC(lpfc_##name, desc);\
53lpfc_param_hex_show(name)\
54lpfc_param_init(name, defval, minval, maxval)\
55static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
56
57#define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
58static uint lpfc_##name = defval;\
59module_param(lpfc_##name, uint, S_IRUGO);\
60MODULE_PARM_DESC(lpfc_##name, desc);\
61lpfc_param_hex_show(name)\
62lpfc_param_init(name, defval, minval, maxval)\
63lpfc_param_set(name, defval, minval, maxval)\
64lpfc_param_store(name)\
65static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
66 lpfc_##name##_show, lpfc_##name##_store)
67
68#define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
69static uint lpfc_##name = defval;\
70module_param(lpfc_##name, uint, S_IRUGO);\
71MODULE_PARM_DESC(lpfc_##name, desc);\
72lpfc_vport_param_init(name, defval, minval, maxval)
73
74#define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
75static uint lpfc_##name = defval;\
76module_param(lpfc_##name, uint, S_IRUGO);\
77MODULE_PARM_DESC(lpfc_##name, desc);\
78lpfc_vport_param_show(name)\
79lpfc_vport_param_init(name, defval, minval, maxval)\
80static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
81
82#define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
83static uint64_t lpfc_##name = defval;\
84module_param(lpfc_##name, ullong, S_IRUGO);\
85MODULE_PARM_DESC(lpfc_##name, desc);\
86lpfc_vport_param_show(name)\
87lpfc_vport_param_init(name, defval, minval, maxval)\
88static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
89
90#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
91static uint lpfc_##name = defval;\
92module_param(lpfc_##name, uint, S_IRUGO);\
93MODULE_PARM_DESC(lpfc_##name, desc);\
94lpfc_vport_param_show(name)\
95lpfc_vport_param_init(name, defval, minval, maxval)\
96lpfc_vport_param_set(name, defval, minval, maxval)\
97lpfc_vport_param_store(name)\
98static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
99 lpfc_##name##_show, lpfc_##name##_store)
100
101#define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
102static uint lpfc_##name = defval;\
103module_param(lpfc_##name, uint, S_IRUGO);\
104MODULE_PARM_DESC(lpfc_##name, desc);\
105lpfc_vport_param_hex_show(name)\
106lpfc_vport_param_init(name, defval, minval, maxval)\
107static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
108
109#define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
110static uint lpfc_##name = defval;\
111module_param(lpfc_##name, uint, S_IRUGO);\
112MODULE_PARM_DESC(lpfc_##name, desc);\
113lpfc_vport_param_hex_show(name)\
114lpfc_vport_param_init(name, defval, minval, maxval)\
115lpfc_vport_param_set(name, defval, minval, maxval)\
116lpfc_vport_param_store(name)\
117static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
118 lpfc_##name##_show, lpfc_##name##_store)