fc_ms.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright(c) 2011 Intel Corporation. All rights reserved.
  4. *
  5. * Maintained at www.Open-FCoE.org
  6. */
  7. #ifndef _FC_MS_H_
  8. #define _FC_MS_H_
  9. #include <linux/types.h>
  10. /*
  11. * Fibre Channel Services - Management Service (MS)
  12. * From T11.org FC-GS-4 Rev 7.91 February 4, 2004
  13. */
  14. /*
  15. * Fabric Device Management Interface
  16. */
  17. /*
  18. * Common-transport sub-type for FDMI
  19. */
  20. #define FC_FDMI_SUBTYPE 0x10 /* fs_ct_hdr.ct_fs_subtype */
  21. /*
  22. * Management server FDMI specifications.
  23. */
  24. #define FDMI_V1 1 /* FDMI version 1 specifications */
  25. #define FDMI_V2 2 /* FDMI version 2 specifications */
  26. /*
  27. * Management server FDMI Requests.
  28. */
  29. enum fc_fdmi_req {
  30. FC_FDMI_GRHL = 0x0100, /* Get Registered HBA List */
  31. FC_FDMI_GHAT = 0x0101, /* Get HBA Attributes */
  32. FC_FDMI_GRPL = 0x0102, /* Get Registered Port List */
  33. FC_FDMI_GPAT = 0x0110, /* Get Port Attributes */
  34. FC_FDMI_RHBA = 0x0200, /* Register HBA */
  35. FC_FDMI_RHAT = 0x0201, /* Register HBA Attributes */
  36. FC_FDMI_RPRT = 0x0210, /* Register Port */
  37. FC_FDMI_RPA = 0x0211, /* Register Port Attributes */
  38. FC_FDMI_DHBA = 0x0300, /* Deregister HBA */
  39. FC_FDMI_DHAT = 0x0301, /* Deregister HBA Attributes */
  40. FC_FDMI_DPRT = 0x0310, /* Deregister Port */
  41. FC_FDMI_DPA = 0x0311, /* Deregister Port Attributes */
  42. };
  43. /*
  44. * HBA Attribute Entry Type
  45. */
  46. enum fc_fdmi_hba_attr_type {
  47. FC_FDMI_HBA_ATTR_NODENAME = 0x0001,
  48. FC_FDMI_HBA_ATTR_MANUFACTURER = 0x0002,
  49. FC_FDMI_HBA_ATTR_SERIALNUMBER = 0x0003,
  50. FC_FDMI_HBA_ATTR_MODEL = 0x0004,
  51. FC_FDMI_HBA_ATTR_MODELDESCRIPTION = 0x0005,
  52. FC_FDMI_HBA_ATTR_HARDWAREVERSION = 0x0006,
  53. FC_FDMI_HBA_ATTR_DRIVERVERSION = 0x0007,
  54. FC_FDMI_HBA_ATTR_OPTIONROMVERSION = 0x0008,
  55. FC_FDMI_HBA_ATTR_FIRMWAREVERSION = 0x0009,
  56. FC_FDMI_HBA_ATTR_OSNAMEVERSION = 0x000A,
  57. FC_FDMI_HBA_ATTR_MAXCTPAYLOAD = 0x000B,
  58. FC_FDMI_HBA_ATTR_NODESYMBLNAME = 0x000C,
  59. FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO = 0x000D,
  60. FC_FDMI_HBA_ATTR_NUMBEROFPORTS = 0x000E,
  61. FC_FDMI_HBA_ATTR_FABRICNAME = 0x000F,
  62. FC_FDMI_HBA_ATTR_BIOSVERSION = 0x0010,
  63. FC_FDMI_HBA_ATTR_BIOSSTATE = 0x0011,
  64. FC_FDMI_HBA_ATTR_VENDORIDENTIFIER = 0x00E0,
  65. };
  66. /*
  67. * HBA Attribute Length
  68. */
  69. #define FC_FDMI_HBA_ATTR_NODENAME_LEN 8
  70. #define FC_FDMI_HBA_ATTR_MANUFACTURER_LEN 64
  71. #define FC_FDMI_HBA_ATTR_SERIALNUMBER_LEN 64
  72. #define FC_FDMI_HBA_ATTR_MODEL_LEN 64
  73. #define FC_FDMI_HBA_ATTR_MODELDESCR_LEN 64
  74. #define FC_FDMI_HBA_ATTR_HARDWAREVERSION_LEN 64
  75. #define FC_FDMI_HBA_ATTR_DRIVERVERSION_LEN 64
  76. #define FC_FDMI_HBA_ATTR_OPTIONROMVERSION_LEN 64
  77. #define FC_FDMI_HBA_ATTR_FIRMWAREVERSION_LEN 64
  78. #define FC_FDMI_HBA_ATTR_OSNAMEVERSION_LEN 128
  79. #define FC_FDMI_HBA_ATTR_MAXCTPAYLOAD_LEN 4
  80. #define FC_FDMI_HBA_ATTR_NODESYMBLNAME_LEN 64
  81. #define FC_FDMI_HBA_ATTR_VENDORSPECIFICINFO_LEN 4
  82. #define FC_FDMI_HBA_ATTR_NUMBEROFPORTS_LEN 4
  83. #define FC_FDMI_HBA_ATTR_FABRICNAME_LEN 8
  84. #define FC_FDMI_HBA_ATTR_BIOSVERSION_LEN 64
  85. #define FC_FDMI_HBA_ATTR_BIOSSTATE_LEN 4
  86. #define FC_FDMI_HBA_ATTR_VENDORIDENTIFIER_LEN 8
  87. /*
  88. * Port Attribute Type
  89. */
  90. enum fc_fdmi_port_attr_type {
  91. FC_FDMI_PORT_ATTR_FC4TYPES = 0x0001,
  92. FC_FDMI_PORT_ATTR_SUPPORTEDSPEED = 0x0002,
  93. FC_FDMI_PORT_ATTR_CURRENTPORTSPEED = 0x0003,
  94. FC_FDMI_PORT_ATTR_MAXFRAMESIZE = 0x0004,
  95. FC_FDMI_PORT_ATTR_OSDEVICENAME = 0x0005,
  96. FC_FDMI_PORT_ATTR_HOSTNAME = 0x0006,
  97. FC_FDMI_PORT_ATTR_NODENAME = 0x0007,
  98. FC_FDMI_PORT_ATTR_PORTNAME = 0x0008,
  99. FC_FDMI_PORT_ATTR_SYMBOLICNAME = 0x0009,
  100. FC_FDMI_PORT_ATTR_PORTTYPE = 0x000A,
  101. FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC = 0x000B,
  102. FC_FDMI_PORT_ATTR_FABRICNAME = 0x000C,
  103. FC_FDMI_PORT_ATTR_CURRENTFC4TYPE = 0x000D,
  104. FC_FDMI_PORT_ATTR_PORTSTATE = 0x101,
  105. FC_FDMI_PORT_ATTR_DISCOVEREDPORTS = 0x102,
  106. FC_FDMI_PORT_ATTR_PORTID = 0x103,
  107. };
  108. /*
  109. * Port Attribute Length
  110. */
  111. #define FC_FDMI_PORT_ATTR_FC4TYPES_LEN 32
  112. #define FC_FDMI_PORT_ATTR_SUPPORTEDSPEED_LEN 4
  113. #define FC_FDMI_PORT_ATTR_CURRENTPORTSPEED_LEN 4
  114. #define FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN 4
  115. #define FC_FDMI_PORT_ATTR_OSDEVICENAME_LEN 256
  116. #define FC_FDMI_PORT_ATTR_HOSTNAME_LEN 256
  117. #define FC_FDMI_PORT_ATTR_NODENAME_LEN 8
  118. #define FC_FDMI_PORT_ATTR_PORTNAME_LEN 8
  119. #define FC_FDMI_PORT_ATTR_SYMBOLICNAME_LEN 256
  120. #define FC_FDMI_PORT_ATTR_PORTTYPE_LEN 4
  121. #define FC_FDMI_PORT_ATTR_SUPPORTEDCLASSSRVC_LEN 4
  122. #define FC_FDMI_PORT_ATTR_FABRICNAME_LEN 8
  123. #define FC_FDMI_PORT_ATTR_CURRENTFC4TYPE_LEN 32
  124. #define FC_FDMI_PORT_ATTR_PORTSTATE_LEN 4
  125. #define FC_FDMI_PORT_ATTR_DISCOVEREDPORTS_LEN 4
  126. #define FC_FDMI_PORT_ATTR_PORTID_LEN 4
  127. /*
  128. * HBA Attribute ID
  129. */
  130. struct fc_fdmi_hba_identifier {
  131. __be64 id;
  132. };
  133. /*
  134. * Port Name
  135. */
  136. struct fc_fdmi_port_name {
  137. __be64 portname;
  138. };
  139. /*
  140. * Attribute Entry Block for HBA/Port Attributes
  141. */
  142. #define FC_FDMI_ATTR_ENTRY_HEADER_LEN 4
  143. struct fc_fdmi_attr_entry {
  144. __be16 type;
  145. __be16 len;
  146. __u8 value[];
  147. } __attribute__((__packed__));
  148. /*
  149. * Common for HBA/Port Attributes
  150. */
  151. struct fs_fdmi_attrs {
  152. __be32 numattrs;
  153. struct fc_fdmi_attr_entry attr[];
  154. } __attribute__((__packed__));
  155. /*
  156. * Registered Port List
  157. */
  158. struct fc_fdmi_rpl {
  159. __be32 numport;
  160. struct fc_fdmi_port_name port[1];
  161. } __attribute__((__packed__));
  162. /*
  163. * Register HBA (RHBA)
  164. */
  165. struct fc_fdmi_rhba {
  166. struct fc_fdmi_hba_identifier hbaid;
  167. struct fc_fdmi_rpl port;
  168. struct fs_fdmi_attrs hba_attrs;
  169. } __attribute__((__packed__));
  170. /*
  171. * Register HBA Attributes (RHAT)
  172. */
  173. struct fc_fdmi_rhat {
  174. struct fc_fdmi_hba_identifier hbaid;
  175. struct fs_fdmi_attrs hba_attrs;
  176. } __attribute__((__packed__));
  177. /*
  178. * Register Port (RPRT)
  179. */
  180. struct fc_fdmi_rprt {
  181. struct fc_fdmi_hba_identifier hbaid;
  182. struct fc_fdmi_port_name port;
  183. struct fs_fdmi_attrs hba_attrs;
  184. } __attribute__((__packed__));
  185. /*
  186. * Register Port Attributes (RPA)
  187. */
  188. struct fc_fdmi_rpa {
  189. struct fc_fdmi_port_name port;
  190. struct fs_fdmi_attrs hba_attrs;
  191. } __attribute__((__packed__));
  192. /*
  193. * Deregister Port (DPRT)
  194. */
  195. struct fc_fdmi_dprt {
  196. struct fc_fdmi_port_name port;
  197. } __attribute__((__packed__));
  198. /*
  199. * Deregister Port Attributes (DPA)
  200. */
  201. struct fc_fdmi_dpa {
  202. struct fc_fdmi_port_name port;
  203. struct fs_fdmi_attrs hba_attrs;
  204. } __attribute__((__packed__));
  205. /*
  206. * Deregister HBA Attributes (DHAT)
  207. */
  208. struct fc_fdmi_dhat {
  209. struct fc_fdmi_hba_identifier hbaid;
  210. } __attribute__((__packed__));
  211. /*
  212. * Deregister HBA (DHBA)
  213. */
  214. struct fc_fdmi_dhba {
  215. struct fc_fdmi_hba_identifier hbaid;
  216. } __attribute__((__packed__));
  217. #endif /* _FC_MS_H_ */