lpfc_attr.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. #define LPFC_ATTR(name, defval, minval, maxval, desc) \
  22. static uint lpfc_##name = defval;\
  23. module_param(lpfc_##name, uint, S_IRUGO);\
  24. MODULE_PARM_DESC(lpfc_##name, desc);\
  25. lpfc_param_init(name, defval, minval, maxval)
  26. #define LPFC_ATTR_R(name, defval, minval, maxval, desc) \
  27. static uint lpfc_##name = defval;\
  28. module_param(lpfc_##name, uint, S_IRUGO);\
  29. MODULE_PARM_DESC(lpfc_##name, desc);\
  30. lpfc_param_show(name)\
  31. lpfc_param_init(name, defval, minval, maxval)\
  32. static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
  33. #define LPFC_ATTR_RW(name, defval, minval, maxval, desc) \
  34. static uint lpfc_##name = defval;\
  35. module_param(lpfc_##name, uint, S_IRUGO);\
  36. MODULE_PARM_DESC(lpfc_##name, desc);\
  37. lpfc_param_show(name)\
  38. lpfc_param_init(name, defval, minval, maxval)\
  39. lpfc_param_set(name, defval, minval, maxval)\
  40. lpfc_param_store(name)\
  41. static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
  42. lpfc_##name##_show, lpfc_##name##_store)
  43. #define LPFC_ATTR_HEX_R(name, defval, minval, maxval, desc) \
  44. static uint lpfc_##name = defval;\
  45. module_param(lpfc_##name, uint, S_IRUGO);\
  46. MODULE_PARM_DESC(lpfc_##name, desc);\
  47. lpfc_param_hex_show(name)\
  48. lpfc_param_init(name, defval, minval, maxval)\
  49. static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
  50. #define LPFC_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
  51. static uint lpfc_##name = defval;\
  52. module_param(lpfc_##name, uint, S_IRUGO);\
  53. MODULE_PARM_DESC(lpfc_##name, desc);\
  54. lpfc_param_hex_show(name)\
  55. lpfc_param_init(name, defval, minval, maxval)\
  56. lpfc_param_set(name, defval, minval, maxval)\
  57. lpfc_param_store(name)\
  58. static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
  59. lpfc_##name##_show, lpfc_##name##_store)
  60. #define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
  61. static uint lpfc_##name = defval;\
  62. module_param(lpfc_##name, uint, S_IRUGO);\
  63. MODULE_PARM_DESC(lpfc_##name, desc);\
  64. lpfc_vport_param_init(name, defval, minval, maxval)
  65. #define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
  66. static uint lpfc_##name = defval;\
  67. module_param(lpfc_##name, uint, S_IRUGO);\
  68. MODULE_PARM_DESC(lpfc_##name, desc);\
  69. lpfc_vport_param_show(name)\
  70. lpfc_vport_param_init(name, defval, minval, maxval)\
  71. static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
  72. #define LPFC_VPORT_ULL_ATTR_R(name, defval, minval, maxval, desc) \
  73. static uint64_t lpfc_##name = defval;\
  74. module_param(lpfc_##name, ullong, S_IRUGO);\
  75. MODULE_PARM_DESC(lpfc_##name, desc);\
  76. lpfc_vport_param_show(name)\
  77. lpfc_vport_param_init(name, defval, minval, maxval)\
  78. static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
  79. #define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
  80. static uint lpfc_##name = defval;\
  81. module_param(lpfc_##name, uint, S_IRUGO);\
  82. MODULE_PARM_DESC(lpfc_##name, desc);\
  83. lpfc_vport_param_show(name)\
  84. lpfc_vport_param_init(name, defval, minval, maxval)\
  85. lpfc_vport_param_set(name, defval, minval, maxval)\
  86. lpfc_vport_param_store(name)\
  87. static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
  88. lpfc_##name##_show, lpfc_##name##_store)
  89. #define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
  90. static uint lpfc_##name = defval;\
  91. module_param(lpfc_##name, uint, S_IRUGO);\
  92. MODULE_PARM_DESC(lpfc_##name, desc);\
  93. lpfc_vport_param_hex_show(name)\
  94. lpfc_vport_param_init(name, defval, minval, maxval)\
  95. static DEVICE_ATTR(lpfc_##name, S_IRUGO, lpfc_##name##_show, NULL)
  96. #define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
  97. static uint lpfc_##name = defval;\
  98. module_param(lpfc_##name, uint, S_IRUGO);\
  99. MODULE_PARM_DESC(lpfc_##name, desc);\
  100. lpfc_vport_param_hex_show(name)\
  101. lpfc_vport_param_init(name, defval, minval, maxval)\
  102. lpfc_vport_param_set(name, defval, minval, maxval)\
  103. lpfc_vport_param_store(name)\
  104. static DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
  105. lpfc_##name##_show, lpfc_##name##_store)