fdmi.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __FDMI_H__
  18. #define __FDMI_H__
  19. #include <protocol/types.h>
  20. #include <protocol/fc.h>
  21. #include <protocol/ct.h>
  22. #pragma pack(1)
  23. /*
  24. * FDMI Command Codes
  25. */
  26. #define FDMI_GRHL 0x0100
  27. #define FDMI_GHAT 0x0101
  28. #define FDMI_GRPL 0x0102
  29. #define FDMI_GPAT 0x0110
  30. #define FDMI_RHBA 0x0200
  31. #define FDMI_RHAT 0x0201
  32. #define FDMI_RPRT 0x0210
  33. #define FDMI_RPA 0x0211
  34. #define FDMI_DHBA 0x0300
  35. #define FDMI_DPRT 0x0310
  36. /*
  37. * FDMI reason codes
  38. */
  39. #define FDMI_NO_ADDITIONAL_EXP 0x00
  40. #define FDMI_HBA_ALREADY_REG 0x10
  41. #define FDMI_HBA_ATTRIB_NOT_REG 0x11
  42. #define FDMI_HBA_ATTRIB_MULTIPLE 0x12
  43. #define FDMI_HBA_ATTRIB_LENGTH_INVALID 0x13
  44. #define FDMI_HBA_ATTRIB_NOT_PRESENT 0x14
  45. #define FDMI_PORT_ORIG_NOT_IN_LIST 0x15
  46. #define FDMI_PORT_HBA_NOT_IN_LIST 0x16
  47. #define FDMI_PORT_ATTRIB_NOT_REG 0x20
  48. #define FDMI_PORT_NOT_REG 0x21
  49. #define FDMI_PORT_ATTRIB_MULTIPLE 0x22
  50. #define FDMI_PORT_ATTRIB_LENGTH_INVALID 0x23
  51. #define FDMI_PORT_ALREADY_REGISTEREED 0x24
  52. /*
  53. * FDMI Transmission Speed Mask values
  54. */
  55. #define FDMI_TRANS_SPEED_1G 0x00000001
  56. #define FDMI_TRANS_SPEED_2G 0x00000002
  57. #define FDMI_TRANS_SPEED_10G 0x00000004
  58. #define FDMI_TRANS_SPEED_4G 0x00000008
  59. #define FDMI_TRANS_SPEED_8G 0x00000010
  60. #define FDMI_TRANS_SPEED_16G 0x00000020
  61. #define FDMI_TRANS_SPEED_UNKNOWN 0x00008000
  62. /*
  63. * FDMI HBA attribute types
  64. */
  65. enum fdmi_hba_attribute_type {
  66. FDMI_HBA_ATTRIB_NODENAME = 1, /* 0x0001 */
  67. FDMI_HBA_ATTRIB_MANUFACTURER, /* 0x0002 */
  68. FDMI_HBA_ATTRIB_SERIALNUM, /* 0x0003 */
  69. FDMI_HBA_ATTRIB_MODEL, /* 0x0004 */
  70. FDMI_HBA_ATTRIB_MODEL_DESC, /* 0x0005 */
  71. FDMI_HBA_ATTRIB_HW_VERSION, /* 0x0006 */
  72. FDMI_HBA_ATTRIB_DRIVER_VERSION, /* 0x0007 */
  73. FDMI_HBA_ATTRIB_ROM_VERSION, /* 0x0008 */
  74. FDMI_HBA_ATTRIB_FW_VERSION, /* 0x0009 */
  75. FDMI_HBA_ATTRIB_OS_NAME, /* 0x000A */
  76. FDMI_HBA_ATTRIB_MAX_CT, /* 0x000B */
  77. FDMI_HBA_ATTRIB_MAX_TYPE
  78. };
  79. /*
  80. * FDMI Port attribute types
  81. */
  82. enum fdmi_port_attribute_type {
  83. FDMI_PORT_ATTRIB_FC4_TYPES = 1, /* 0x0001 */
  84. FDMI_PORT_ATTRIB_SUPP_SPEED, /* 0x0002 */
  85. FDMI_PORT_ATTRIB_PORT_SPEED, /* 0x0003 */
  86. FDMI_PORT_ATTRIB_FRAME_SIZE, /* 0x0004 */
  87. FDMI_PORT_ATTRIB_DEV_NAME, /* 0x0005 */
  88. FDMI_PORT_ATTRIB_HOST_NAME, /* 0x0006 */
  89. FDMI_PORT_ATTR_MAX_TYPE
  90. };
  91. /*
  92. * FDMI attribute
  93. */
  94. struct fdmi_attr_s {
  95. u16 type;
  96. u16 len;
  97. u8 value[1];
  98. };
  99. /*
  100. * HBA Attribute Block
  101. */
  102. struct fdmi_hba_attr_s {
  103. u32 attr_count; /* # of attributes */
  104. struct fdmi_attr_s hba_attr; /* n attributes */
  105. };
  106. /*
  107. * Registered Port List
  108. */
  109. struct fdmi_port_list_s {
  110. u32 num_ports; /* number Of Port Entries */
  111. wwn_t port_entry; /* one or more */
  112. };
  113. /*
  114. * Port Attribute Block
  115. */
  116. struct fdmi_port_attr_s {
  117. u32 attr_count; /* # of attributes */
  118. struct fdmi_attr_s port_attr; /* n attributes */
  119. };
  120. /*
  121. * FDMI Register HBA Attributes
  122. */
  123. struct fdmi_rhba_s {
  124. wwn_t hba_id; /* HBA Identifier */
  125. struct fdmi_port_list_s port_list; /* Registered Port List */
  126. struct fdmi_hba_attr_s hba_attr_blk; /* HBA attribute block */
  127. };
  128. /*
  129. * FDMI Register Port
  130. */
  131. struct fdmi_rprt_s {
  132. wwn_t hba_id; /* HBA Identifier */
  133. wwn_t port_name; /* Port wwn */
  134. struct fdmi_port_attr_s port_attr_blk; /* Port Attr Block */
  135. };
  136. /*
  137. * FDMI Register Port Attributes
  138. */
  139. struct fdmi_rpa_s {
  140. wwn_t port_name; /* port wwn */
  141. struct fdmi_port_attr_s port_attr_blk; /* Port Attr Block */
  142. };
  143. #pragma pack()
  144. #endif