fc_ms.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* * Copyright(c) 2011 Intel Corporation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify it
  4. * under the terms and conditions of the GNU General Public License,
  5. * version 2, as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  10. * more details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program; if not, write to the Free Software Foundation, Inc.,
  14. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  15. *
  16. * Maintained at www.Open-FCoE.org
  17. */
  18. #ifndef _FC_MS_H_
  19. #define _FC_MS_H_
  20. #include <linux/types.h>
  21. /*
  22. * Fibre Channel Services - Management Service (MS)
  23. * From T11.org FC-GS-4 Rev 7.91 February 4, 2004
  24. */
  25. /*
  26. * Fabric Device Management Interface
  27. */
  28. /*
  29. * Common-transport sub-type for FDMI
  30. */
  31. #define FC_FDMI_SUBTYPE 0x10 /* fs_ct_hdr.ct_fs_subtype */
  32. /*
  33. * Management server FDMI Requests.
  34. */
  35. enum fc_fdmi_req {
  36. FC_FDMI_GRHL = 0x0100, /* Get Registered HBA List */
  37. FC_FDMI_GHAT = 0x0101, /* Get HBA Attributes */
  38. FC_FDMI_GRPL = 0x0102, /* Get Registered Port List */
  39. FC_FDMI_GPAT = 0x0110, /* Get Port Attributes */
  40. FC_FDMI_RHBA = 0x0200, /* Register HBA */
  41. FC_FDMI_RHAT = 0x0201, /* Register HBA Attributes */
  42. FC_FDMI_RPRT = 0x0210, /* Register Port */
  43. FC_FDMI_RPA = 0x0211, /* Register Port Attributes */
  44. FC_FDMI_DHBA = 0x0300, /* Deregister HBA */
  45. FC_FDMI_DHAT = 0x0301, /* Deregister HBA Attributes */
  46. FC_FDMI_DPRT = 0x0310, /* Deregister Port */
  47. FC_FDMI_DPA = 0x0311, /* Deregister Port Attributes */
  48. };
  49. /*
  50. * HBA Attribute Entry Type
  51. */
  52. enum fc_fdmi_hba_attr_type {
  53. FC_FDMI_HBA_ATTR_NODENAME = 0x0001,
  54. FC_FDMI_HBA_ATTR_MANUFACTURER = 0x0002,
  55. FC_FDMI_HBA_ATTR_SERIALNUMBER = 0x0003,
  56. FC_FDMI_HBA_ATTR_MODEL = 0x0004,
  57. FC_FDMI_HBA_ATTR_MODELDESCRIPTION = 0x0005,
  58. FC_FDMI_HBA_ATTR_HARDWAREVERSION = 0x0006,
  59. FC_FDMI_HBA_ATTR_DRIVERVERSION = 0x0007,
  60. FC_FDMI_HBA_ATTR_OPTIONROMVERSION = 0x0008,
  61. FC_FDMI_HBA_ATTR_FIRMWAREVERSION = 0x0009,
  62. FC_FDMI_HBA_ATTR_OSNAMEVERSION = 0x000A,
  63. FC_FDMI_HBA_ATTR_MAXCTPAYLOAD = 0x000B,
  64. };
  65. /*
  66. * HBA Attribute Length
  67. */
  68. #define FC_FDMI_HBA_ATTR_NODENAME_LEN 8
  69. #define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 64
  70. #define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 64
  71. #define FC_FDMI_HBA_ATTR_MODEL_LEN 256
  72. #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN 256
  73. #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN 256
  74. #define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN 256
  75. #define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN 256
  76. #define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN 256
  77. #define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN 256
  78. #define FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN 4
  79. /*
  80. * Port Attribute Type
  81. */
  82. enum fc_fdmi_port_attr_type {
  83. FC_FDMI_PORT_ATTR_FC4TYPES = 0x0001,
  84. FC_FDMI_PORT_ATTR_SUPPORTEDSPEED = 0x0002,
  85. FC_FDMI_PORT_ATTR_CURRENTPORTSPEED = 0x0003,
  86. FC_FDMI_PORT_ATTR_MAXFRAMESIZE = 0x0004,
  87. FC_FDMI_PORT_ATTR_OSDEVICENAME = 0x0005,
  88. FC_FDMI_PORT_ATTR_HOSTNAME = 0x0006,
  89. };
  90. /*
  91. * Port Attribute Length
  92. */
  93. #define FC_FDMI_PORT_ATTR_FC4TYPES_LEN 32
  94. #define FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN 4
  95. #define FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN 4
  96. #define FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN 4
  97. #define FC_FDMI_PORT_ATTR_OSDEVICENAME_LEN 256
  98. #define FC_FDMI_PORT_ATTR_HOSTNAME_LEN 256
  99. /*
  100. * HBA Attribute ID
  101. */
  102. struct fc_fdmi_hba_identifier {
  103. __be64 id;
  104. };
  105. /*
  106. * Port Name
  107. */
  108. struct fc_fdmi_port_name {
  109. __be64 portname;
  110. };
  111. /*
  112. * Attribute Entry Block for HBA/Port Attributes
  113. */
  114. #define FC_FDMI_ATTR_ENTRY_HEADER_LEN 4
  115. struct fc_fdmi_attr_entry {
  116. __be16 type;
  117. __be16 len;
  118. __u8 value[1];
  119. } __attribute__((__packed__));
  120. /*
  121. * Common for HBA/Port Attributes
  122. */
  123. struct fs_fdmi_attrs {
  124. __be32 numattrs;
  125. struct fc_fdmi_attr_entry attr[1];
  126. } __attribute__((__packed__));
  127. /*
  128. * Registered Port List
  129. */
  130. struct fc_fdmi_rpl {
  131. __be32 numport;
  132. struct fc_fdmi_port_name port[1];
  133. } __attribute__((__packed__));
  134. /*
  135. * Register HBA (RHBA)
  136. */
  137. struct fc_fdmi_rhba {
  138. struct fc_fdmi_hba_identifier hbaid;
  139. struct fc_fdmi_rpl port;
  140. struct fs_fdmi_attrs hba_attrs;
  141. } __attribute__((__packed__));
  142. /*
  143. * Register HBA Attributes (RHAT)
  144. */
  145. struct fc_fdmi_rhat {
  146. struct fc_fdmi_hba_identifier hbaid;
  147. struct fs_fdmi_attrs hba_attrs;
  148. } __attribute__((__packed__));
  149. /*
  150. * Register Port (RPRT)
  151. */
  152. struct fc_fdmi_rprt {
  153. struct fc_fdmi_hba_identifier hbaid;
  154. struct fc_fdmi_port_name port;
  155. struct fs_fdmi_attrs hba_attrs;
  156. } __attribute__((__packed__));
  157. /*
  158. * Register Port Attributes (RPA)
  159. */
  160. struct fc_fdmi_rpa {
  161. struct fc_fdmi_port_name port;
  162. struct fs_fdmi_attrs hba_attrs;
  163. } __attribute__((__packed__));
  164. /*
  165. * Deregister Port (DPRT)
  166. */
  167. struct fc_fdmi_dprt {
  168. struct fc_fdmi_port_name port;
  169. } __attribute__((__packed__));
  170. /*
  171. * Deregister Port Attributes (DPA)
  172. */
  173. struct fc_fdmi_dpa {
  174. struct fc_fdmi_port_name port;
  175. struct fs_fdmi_attrs hba_attrs;
  176. } __attribute__((__packed__));
  177. /*
  178. * Deregister HBA Attributes (DHAT)
  179. */
  180. struct fc_fdmi_dhat {
  181. struct fc_fdmi_hba_identifier hbaid;
  182. } __attribute__((__packed__));
  183. /*
  184. * Deregister HBA (DHBA)
  185. */
  186. struct fc_fdmi_dhba {
  187. struct fc_fdmi_hba_identifier hbaid;
  188. } __attribute__((__packed__));
  189. #endif /* _FC_MS_H_ */