xref: /linux/drivers/scsi/lpfc/lpfc_attr.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
193dd1911SJames Smart /*******************************************************************
293dd1911SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
393dd1911SJames Smart  * Fibre Channel Host Bus Adapters.                                *
4*4ae2ebdeSJames Smart  * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term *
5*4ae2ebdeSJames Smart  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
693dd1911SJames Smart  * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
793dd1911SJames Smart  * EMULEX and SLI are trademarks of Emulex.                        *
8d080abe0SJames Smart  * www.broadcom.com                                                *
993dd1911SJames Smart  * Portions Copyright (C) 2004-2005 Christoph Hellwig              *
1093dd1911SJames Smart  *                                                                 *
1193dd1911SJames Smart  * This program is free software; you can redistribute it and/or   *
1293dd1911SJames Smart  * modify it under the terms of version 2 of the GNU General       *
1393dd1911SJames Smart  * Public License as published by the Free Software Foundation.    *
1493dd1911SJames Smart  * This program is distributed in the hope that it will be useful. *
1593dd1911SJames Smart  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
1693dd1911SJames Smart  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
1793dd1911SJames Smart  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
1893dd1911SJames Smart  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
1993dd1911SJames Smart  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
2093dd1911SJames Smart  * more details, a copy of which can be found in the file COPYING  *
2193dd1911SJames Smart  * included with this package.                                     *
2293dd1911SJames Smart  *******************************************************************/
2393dd1911SJames Smart 
2493dd1911SJames Smart #define LPFC_ATTR(name, defval, minval, maxval, desc) \
2593dd1911SJames Smart static uint lpfc_##name = defval;\
2693dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
2793dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
2893dd1911SJames Smart lpfc_param_init(name, defval, minval, maxval)
2993dd1911SJames Smart 
3093dd1911SJames Smart #define LPFC_ATTR_R(name, defval, minval, maxval, desc) \
3193dd1911SJames Smart static uint lpfc_##name = defval;\
3293dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
3393dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
3493dd1911SJames Smart lpfc_param_show(name)\
3593dd1911SJames Smart lpfc_param_init(name, defval, minval, maxval)\
3693dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
3793dd1911SJames Smart 
3893dd1911SJames Smart #define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \
3993dd1911SJames Smart static uint lpfc_##name = defval;\
4093dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
4193dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
4293dd1911SJames Smart lpfc_param_show(name)\
4393dd1911SJames Smart lpfc_param_init(name, defval, minval, maxval)\
4493dd1911SJames Smart lpfc_param_set(name, defval, minval, maxval)\
4593dd1911SJames Smart lpfc_param_store(name)\
4693dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
4793dd1911SJames Smart 		   lpfc_##name##_show, lpfc_##name##_store)
4893dd1911SJames Smart 
4944fd7fe3SJames Smart #define LPFC_BBCR_ATTR_RW(name, defval, minval, maxval, desc) \
5044fd7fe3SJames Smart static uint lpfc_##name = defval;\
5144fd7fe3SJames Smart module_param(lpfc_##name, uint, 0444);\
5244fd7fe3SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
5344fd7fe3SJames Smart lpfc_param_show(name)\
5444fd7fe3SJames Smart lpfc_param_init(name, defval, minval, maxval)\
5544fd7fe3SJames Smart lpfc_param_store(name)\
5644fd7fe3SJames Smart static DEVICE_ATTR(lpfc_##name, 0444 | 0644,\
5744fd7fe3SJames Smart 		   lpfc_##name##_show, lpfc_##name##_store)
5844fd7fe3SJames Smart 
5993dd1911SJames Smart #define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \
6093dd1911SJames Smart static uint lpfc_##name = defval;\
6193dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
6293dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
6393dd1911SJames Smart lpfc_param_hex_show(name)\
6493dd1911SJames Smart lpfc_param_init(name, defval, minval, maxval)\
6593dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
6693dd1911SJames Smart 
6793dd1911SJames Smart #define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
6893dd1911SJames Smart static uint lpfc_##name = defval;\
6993dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
7093dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
7193dd1911SJames Smart lpfc_param_hex_show(name)\
7293dd1911SJames Smart lpfc_param_init(name, defval, minval, maxval)\
7393dd1911SJames Smart lpfc_param_set(name, defval, minval, maxval)\
7493dd1911SJames Smart lpfc_param_store(name)\
7593dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
7693dd1911SJames Smart 		   lpfc_##name##_show, lpfc_##name##_store)
7793dd1911SJames Smart 
7893dd1911SJames Smart #define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
7993dd1911SJames Smart static uint lpfc_##name = defval;\
8093dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
8193dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
8293dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)
8393dd1911SJames Smart 
8493dd1911SJames Smart #define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
8593dd1911SJames Smart static uint lpfc_##name = defval;\
8693dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
8793dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
8893dd1911SJames Smart lpfc_vport_param_show(name)\
8993dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)\
9093dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
9193dd1911SJames Smart 
9293dd1911SJames Smart #define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
9393dd1911SJames Smart static uint64_t lpfc_##name = defval;\
9493dd1911SJames Smart module_param(lpfc_##name, ullong, S_IRUGO);\
9593dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
9693dd1911SJames Smart lpfc_vport_param_show(name)\
9793dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)\
9893dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
9993dd1911SJames Smart 
10093dd1911SJames Smart #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
10193dd1911SJames Smart static uint lpfc_##name = defval;\
10293dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
10393dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
10493dd1911SJames Smart lpfc_vport_param_show(name)\
10593dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)\
10693dd1911SJames Smart lpfc_vport_param_set(name, defval, minval, maxval)\
10793dd1911SJames Smart lpfc_vport_param_store(name)\
10893dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
10993dd1911SJames Smart 		   lpfc_##name##_show, lpfc_##name##_store)
11093dd1911SJames Smart 
11193dd1911SJames Smart #define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
11293dd1911SJames Smart static uint lpfc_##name = defval;\
11393dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
11493dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
11593dd1911SJames Smart lpfc_vport_param_hex_show(name)\
11693dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)\
11793dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
11893dd1911SJames Smart 
11993dd1911SJames Smart #define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
12093dd1911SJames Smart static uint lpfc_##name = defval;\
12193dd1911SJames Smart module_param(lpfc_##name, uint, S_IRUGO);\
12293dd1911SJames Smart MODULE_PARM_DESC(lpfc_##name, desc);\
12393dd1911SJames Smart lpfc_vport_param_hex_show(name)\
12493dd1911SJames Smart lpfc_vport_param_init(name, defval, minval, maxval)\
12593dd1911SJames Smart lpfc_vport_param_set(name, defval, minval, maxval)\
12693dd1911SJames Smart lpfc_vport_param_store(name)\
12793dd1911SJames Smart static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
12893dd1911SJames Smart 		   lpfc_##name##_show, lpfc_##name##_store)
129