lpfc_nl.h 5.0 KB

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