lpfc_nl.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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) 2010 Emulex. All rights reserved. *
  7. * EMULEX and SLI are trademarks of Emulex. *
  8. * www.broadcom.com *
  9. * *
  10. * This program is free software; you can redistribute it and/or *
  11. * modify it under the terms of version 2 of the GNU General *
  12. * Public License as published by the Free Software Foundation. *
  13. * This program is distributed in the hope that it will be useful. *
  14. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
  15. * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
  16. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
  17. * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
  18. * TO BE LEGALLY INVALID. See the GNU General Public License for *
  19. * more details, a copy of which can be found in the file COPYING *
  20. * included with this package. *
  21. *******************************************************************/
  22. /* Event definitions for RegisterForEvent */
  23. #define FC_REG_LINK_EVENT 0x0001 /* link up / down events */
  24. #define FC_REG_RSCN_EVENT 0x0002 /* RSCN events */
  25. #define FC_REG_CT_EVENT 0x0004 /* CT request events */
  26. #define FC_REG_DUMP_EVENT 0x0010 /* Dump events */
  27. #define FC_REG_TEMPERATURE_EVENT 0x0020 /* temperature events */
  28. #define FC_REG_VPORTRSCN_EVENT 0x0040 /* Vport RSCN events */
  29. #define FC_REG_ELS_EVENT 0x0080 /* lpfc els events */
  30. #define FC_REG_FABRIC_EVENT 0x0100 /* lpfc fabric events */
  31. #define FC_REG_SCSI_EVENT 0x0200 /* lpfc scsi events */
  32. #define FC_REG_BOARD_EVENT 0x0400 /* lpfc board events */
  33. #define FC_REG_ADAPTER_EVENT 0x0800 /* lpfc adapter events */
  34. #define FC_REG_EVENT_MASK (FC_REG_LINK_EVENT | \
  35. FC_REG_RSCN_EVENT | \
  36. FC_REG_CT_EVENT | \
  37. FC_REG_DUMP_EVENT | \
  38. FC_REG_TEMPERATURE_EVENT | \
  39. FC_REG_VPORTRSCN_EVENT | \
  40. FC_REG_ELS_EVENT | \
  41. FC_REG_FABRIC_EVENT | \
  42. FC_REG_SCSI_EVENT | \
  43. FC_REG_BOARD_EVENT | \
  44. FC_REG_ADAPTER_EVENT)
  45. /* Temperature events */
  46. #define LPFC_CRIT_TEMP 0x1
  47. #define LPFC_THRESHOLD_TEMP 0x2
  48. #define LPFC_NORMAL_TEMP 0x3
  49. /*
  50. * All net link event payloads will begin with and event type
  51. * and subcategory. The event type must come first.
  52. * The subcategory further defines the data that follows in the rest
  53. * of the payload. Each category will have its own unique header plus
  54. * any additional data unique to the subcategory.
  55. * The payload sent via the fc transport is one-way driver->application.
  56. */
  57. /* RSCN event header */
  58. struct lpfc_rscn_event_header {
  59. uint32_t event_type;
  60. uint32_t payload_length; /* RSCN data length in bytes */
  61. uint32_t rscn_payload[];
  62. };
  63. /* els event header */
  64. struct lpfc_els_event_header {
  65. uint32_t event_type;
  66. uint32_t subcategory;
  67. uint8_t wwpn[8];
  68. uint8_t wwnn[8];
  69. };
  70. /* subcategory codes for FC_REG_ELS_EVENT */
  71. #define LPFC_EVENT_PLOGI_RCV 0x01
  72. #define LPFC_EVENT_PRLO_RCV 0x02
  73. #define LPFC_EVENT_ADISC_RCV 0x04
  74. #define LPFC_EVENT_LSRJT_RCV 0x08
  75. #define LPFC_EVENT_LOGO_RCV 0x10
  76. /* special els lsrjt event */
  77. struct lpfc_lsrjt_event {
  78. struct lpfc_els_event_header header;
  79. uint32_t command;
  80. uint32_t reason_code;
  81. uint32_t explanation;
  82. };
  83. /* special els logo event */
  84. struct lpfc_logo_event {
  85. struct lpfc_els_event_header header;
  86. uint8_t logo_wwpn[8];
  87. };
  88. /* fabric event header */
  89. struct lpfc_fabric_event_header {
  90. uint32_t event_type;
  91. uint32_t subcategory;
  92. uint8_t wwpn[8];
  93. uint8_t wwnn[8];
  94. };
  95. /* subcategory codes for FC_REG_FABRIC_EVENT */
  96. #define LPFC_EVENT_FABRIC_BUSY 0x01
  97. #define LPFC_EVENT_PORT_BUSY 0x02
  98. #define LPFC_EVENT_FCPRDCHKERR 0x04
  99. /* special case fabric fcprdchkerr event */
  100. struct lpfc_fcprdchkerr_event {
  101. struct lpfc_fabric_event_header header;
  102. uint32_t lun;
  103. uint32_t opcode;
  104. uint32_t fcpiparam;
  105. };
  106. /* scsi event header */
  107. struct lpfc_scsi_event_header {
  108. uint32_t event_type;
  109. uint32_t subcategory;
  110. uint32_t lun;
  111. uint8_t wwpn[8];
  112. uint8_t wwnn[8];
  113. };
  114. /* subcategory codes for FC_REG_SCSI_EVENT */
  115. #define LPFC_EVENT_QFULL 0x0001
  116. #define LPFC_EVENT_DEVBSY 0x0002
  117. #define LPFC_EVENT_CHECK_COND 0x0004
  118. #define LPFC_EVENT_LUNRESET 0x0008
  119. #define LPFC_EVENT_TGTRESET 0x0010
  120. #define LPFC_EVENT_BUSRESET 0x0020
  121. #define LPFC_EVENT_VARQUEDEPTH 0x0040
  122. /* special case scsi varqueuedepth event */
  123. struct lpfc_scsi_varqueuedepth_event {
  124. struct lpfc_scsi_event_header scsi_event;
  125. uint32_t oldval;
  126. uint32_t newval;
  127. };
  128. /* special case scsi check condition event */
  129. struct lpfc_scsi_check_condition_event {
  130. struct lpfc_scsi_event_header scsi_event;
  131. uint8_t opcode;
  132. uint8_t sense_key;
  133. uint8_t asc;
  134. uint8_t ascq;
  135. };
  136. /* event codes for FC_REG_BOARD_EVENT */
  137. #define LPFC_EVENT_PORTINTERR 0x01
  138. /* board event header */
  139. struct lpfc_board_event_header {
  140. uint32_t event_type;
  141. uint32_t subcategory;
  142. };
  143. /* event codes for FC_REG_ADAPTER_EVENT */
  144. #define LPFC_EVENT_ARRIVAL 0x01
  145. /* adapter event header */
  146. struct lpfc_adapter_event_header {
  147. uint32_t event_type;
  148. uint32_t subcategory;
  149. };
  150. /* event codes for temp_event */
  151. #define LPFC_CRIT_TEMP 0x1
  152. #define LPFC_THRESHOLD_TEMP 0x2
  153. #define LPFC_NORMAL_TEMP 0x3
  154. struct temp_event {
  155. uint32_t event_type;
  156. uint32_t event_code;
  157. uint32_t data;
  158. };