qla_bsg.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * QLogic Fibre Channel HBA Driver
  3. * Copyright (c) 2003-2010 QLogic Corporation
  4. *
  5. * See LICENSE.qla2xxx for copyright and licensing details.
  6. */
  7. #ifndef __QLA_BSG_H
  8. #define __QLA_BSG_H
  9. /* BSG Vendor specific commands */
  10. #define QL_VND_LOOPBACK 0x01
  11. #define QL_VND_A84_RESET 0x02
  12. #define QL_VND_A84_UPDATE_FW 0x03
  13. #define QL_VND_A84_MGMT_CMD 0x04
  14. #define QL_VND_IIDMA 0x05
  15. #define QL_VND_FCP_PRIO_CFG_CMD 0x06
  16. #define QL_VND_READ_FLASH 0x07
  17. #define QL_VND_UPDATE_FLASH 0x08
  18. /* BSG definations for interpreting CommandSent field */
  19. #define INT_DEF_LB_LOOPBACK_CMD 0
  20. #define INT_DEF_LB_ECHO_CMD 1
  21. /* Loopback related definations */
  22. #define EXTERNAL_LOOPBACK 0xF2
  23. #define ENABLE_INTERNAL_LOOPBACK 0x02
  24. #define INTERNAL_LOOPBACK_MASK 0x000E
  25. #define MAX_ELS_FRAME_PAYLOAD 252
  26. #define ELS_OPCODE_BYTE 0x10
  27. /* BSG Vendor specific definations */
  28. #define A84_ISSUE_WRITE_TYPE_CMD 0
  29. #define A84_ISSUE_READ_TYPE_CMD 1
  30. #define A84_CLEANUP_CMD 2
  31. #define A84_ISSUE_RESET_OP_FW 3
  32. #define A84_ISSUE_RESET_DIAG_FW 4
  33. #define A84_ISSUE_UPDATE_OPFW_CMD 5
  34. #define A84_ISSUE_UPDATE_DIAGFW_CMD 6
  35. struct qla84_mgmt_param {
  36. union {
  37. struct {
  38. uint32_t start_addr;
  39. } mem; /* for QLA84_MGMT_READ/WRITE_MEM */
  40. struct {
  41. uint32_t id;
  42. #define QLA84_MGMT_CONFIG_ID_UIF 1
  43. #define QLA84_MGMT_CONFIG_ID_FCOE_COS 2
  44. #define QLA84_MGMT_CONFIG_ID_PAUSE 3
  45. #define QLA84_MGMT_CONFIG_ID_TIMEOUTS 4
  46. uint32_t param0;
  47. uint32_t param1;
  48. } config; /* for QLA84_MGMT_CHNG_CONFIG */
  49. struct {
  50. uint32_t type;
  51. #define QLA84_MGMT_INFO_CONFIG_LOG_DATA 1 /* Get Config Log Data */
  52. #define QLA84_MGMT_INFO_LOG_DATA 2 /* Get Log Data */
  53. #define QLA84_MGMT_INFO_PORT_STAT 3 /* Get Port Statistics */
  54. #define QLA84_MGMT_INFO_LIF_STAT 4 /* Get LIF Statistics */
  55. #define QLA84_MGMT_INFO_ASIC_STAT 5 /* Get ASIC Statistics */
  56. #define QLA84_MGMT_INFO_CONFIG_PARAMS 6 /* Get Config Parameters */
  57. #define QLA84_MGMT_INFO_PANIC_LOG 7 /* Get Panic Log */
  58. uint32_t context;
  59. /*
  60. * context definitions for QLA84_MGMT_INFO_CONFIG_LOG_DATA
  61. */
  62. #define IC_LOG_DATA_LOG_ID_DEBUG_LOG 0
  63. #define IC_LOG_DATA_LOG_ID_LEARN_LOG 1
  64. #define IC_LOG_DATA_LOG_ID_FC_ACL_INGRESS_LOG 2
  65. #define IC_LOG_DATA_LOG_ID_FC_ACL_EGRESS_LOG 3
  66. #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_INGRESS_LOG 4
  67. #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_EGRESS_LOG 5
  68. #define IC_LOG_DATA_LOG_ID_MESSAGE_TRANSMIT_LOG 6
  69. #define IC_LOG_DATA_LOG_ID_MESSAGE_RECEIVE_LOG 7
  70. #define IC_LOG_DATA_LOG_ID_LINK_EVENT_LOG 8
  71. #define IC_LOG_DATA_LOG_ID_DCX_LOG 9
  72. /*
  73. * context definitions for QLA84_MGMT_INFO_PORT_STAT
  74. */
  75. #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT0 0
  76. #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT1 1
  77. #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT0 2
  78. #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT1 3
  79. #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT0 4
  80. #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT1 5
  81. /*
  82. * context definitions for QLA84_MGMT_INFO_LIF_STAT
  83. */
  84. #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT0 0
  85. #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT1 1
  86. #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT0 2
  87. #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT1 3
  88. #define IC_LIF_STATISTICS_LIF_NUMBER_CPU 6
  89. } info; /* for QLA84_MGMT_GET_INFO */
  90. } u;
  91. };
  92. struct qla84_msg_mgmt {
  93. uint16_t cmd;
  94. #define QLA84_MGMT_READ_MEM 0x00
  95. #define QLA84_MGMT_WRITE_MEM 0x01
  96. #define QLA84_MGMT_CHNG_CONFIG 0x02
  97. #define QLA84_MGMT_GET_INFO 0x03
  98. uint16_t rsrvd;
  99. struct qla84_mgmt_param mgmtp;/* parameters for cmd */
  100. uint32_t len; /* bytes in payload following this struct */
  101. uint8_t payload[0]; /* payload for cmd */
  102. };
  103. struct qla_bsg_a84_mgmt {
  104. struct qla84_msg_mgmt mgmt;
  105. } __attribute__ ((packed));
  106. struct qla_scsi_addr {
  107. uint16_t bus;
  108. uint16_t target;
  109. } __attribute__ ((packed));
  110. struct qla_ext_dest_addr {
  111. union {
  112. uint8_t wwnn[8];
  113. uint8_t wwpn[8];
  114. uint8_t id[4];
  115. struct qla_scsi_addr scsi_addr;
  116. } dest_addr;
  117. uint16_t dest_type;
  118. #define EXT_DEF_TYPE_WWPN 2
  119. uint16_t lun;
  120. uint16_t padding[2];
  121. } __attribute__ ((packed));
  122. struct qla_port_param {
  123. struct qla_ext_dest_addr fc_scsi_addr;
  124. uint16_t mode;
  125. uint16_t speed;
  126. } __attribute__ ((packed));
  127. #endif