fc_ns.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * Copyright(c) 2007 Intel Corporation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * Maintained at www.Open-FCoE.org
  18. */
  19. #ifndef _FC_NS_H_
  20. #define _FC_NS_H_
  21. #include <linux/types.h>
  22. /*
  23. * Fibre Channel Services - Name Service (dNS)
  24. * From T11.org FC-GS-2 Rev 5.3 November 1998.
  25. */
  26. /*
  27. * Common-transport sub-type for Name Server.
  28. */
  29. #define FC_NS_SUBTYPE 2 /* fs_ct_hdr.ct_fs_subtype */
  30. /*
  31. * Name server Requests.
  32. * Note: this is an incomplete list, some unused requests are omitted.
  33. */
  34. enum fc_ns_req {
  35. FC_NS_GA_NXT = 0x0100, /* get all next */
  36. FC_NS_GI_A = 0x0101, /* get identifiers - scope */
  37. FC_NS_GPN_ID = 0x0112, /* get port name by ID */
  38. FC_NS_GNN_ID = 0x0113, /* get node name by ID */
  39. FC_NS_GID_PN = 0x0121, /* get ID for port name */
  40. FC_NS_GID_NN = 0x0131, /* get IDs for node name */
  41. FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */
  42. FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */
  43. FC_NS_GID_PT = 0x01a1, /* get IDs by port type */
  44. FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */
  45. FC_NS_RPN_ID = 0x0212, /* reg port name for ID */
  46. FC_NS_RNN_ID = 0x0213, /* reg node name for ID */
  47. FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */
  48. FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */
  49. };
  50. /*
  51. * Port type values.
  52. */
  53. enum fc_ns_pt {
  54. FC_NS_UNID_PORT = 0x00, /* unidentified */
  55. FC_NS_N_PORT = 0x01, /* N port */
  56. FC_NS_NL_PORT = 0x02, /* NL port */
  57. FC_NS_FNL_PORT = 0x03, /* F/NL port */
  58. FC_NS_NX_PORT = 0x7f, /* Nx port */
  59. FC_NS_F_PORT = 0x81, /* F port */
  60. FC_NS_FL_PORT = 0x82, /* FL port */
  61. FC_NS_E_PORT = 0x84, /* E port */
  62. FC_NS_B_PORT = 0x85, /* B port */
  63. };
  64. /*
  65. * Port type object.
  66. */
  67. struct fc_ns_pt_obj {
  68. __u8 pt_type;
  69. };
  70. /*
  71. * Port ID object
  72. */
  73. struct fc_ns_fid {
  74. __u8 fp_flags; /* flags for responses only */
  75. __u8 fp_fid[3];
  76. };
  77. /*
  78. * fp_flags in port ID object, for responses only.
  79. */
  80. #define FC_NS_FID_LAST 0x80 /* last object */
  81. /*
  82. * FC4-types object.
  83. */
  84. #define FC_NS_TYPES 256 /* number of possible FC-4 types */
  85. #define FC_NS_BPW 32 /* bits per word in bitmap */
  86. struct fc_ns_fts {
  87. __be32 ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */
  88. };
  89. /*
  90. * GID_PT request.
  91. */
  92. struct fc_ns_gid_pt {
  93. __u8 fn_pt_type;
  94. __u8 fn_domain_id_scope;
  95. __u8 fn_area_id_scope;
  96. __u8 fn_resvd;
  97. };
  98. /*
  99. * GID_FT or GPN_FT request.
  100. */
  101. struct fc_ns_gid_ft {
  102. __u8 fn_resvd;
  103. __u8 fn_domain_id_scope;
  104. __u8 fn_area_id_scope;
  105. __u8 fn_fc4_type;
  106. };
  107. /*
  108. * GPN_FT response.
  109. */
  110. struct fc_gpn_ft_resp {
  111. __u8 fp_flags; /* see fp_flags definitions above */
  112. __u8 fp_fid[3]; /* port ID */
  113. __be32 fp_resvd;
  114. __be64 fp_wwpn; /* port name */
  115. };
  116. /*
  117. * GID_PN request
  118. */
  119. struct fc_ns_gid_pn {
  120. __be64 fn_wwpn; /* port name */
  121. };
  122. /*
  123. * GID_PN response
  124. */
  125. struct fc_gid_pn_resp {
  126. __u8 fp_resvd;
  127. __u8 fp_fid[3]; /* port ID */
  128. };
  129. /*
  130. * RFT_ID request - register FC-4 types for ID.
  131. */
  132. struct fc_ns_rft_id {
  133. struct fc_ns_fid fr_fid; /* port ID object */
  134. struct fc_ns_fts fr_fts; /* FC-4 types object */
  135. };
  136. /*
  137. * RPN_ID request - register port name for ID.
  138. * RNN_ID request - register node name for ID.
  139. */
  140. struct fc_ns_rn_id {
  141. struct fc_ns_fid fr_fid; /* port ID object */
  142. __be64 fr_wwn; /* node name or port name */
  143. } __attribute__((__packed__));
  144. /*
  145. * RSNN_NN request - register symbolic node name
  146. */
  147. struct fc_ns_rsnn {
  148. __be64 fr_wwn; /* node name */
  149. __u8 fr_name_len;
  150. char fr_name[];
  151. } __attribute__((__packed__));
  152. /*
  153. * RSPN_ID request - register symbolic port name
  154. */
  155. struct fc_ns_rspn {
  156. struct fc_ns_fid fr_fid; /* port ID object */
  157. __u8 fr_name_len;
  158. char fr_name[];
  159. } __attribute__((__packed__));
  160. #endif /* _FC_NS_H_ */