qla_bsg.h 4.1 KB

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