fc_gs.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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_GS_H_
  20. #define _FC_GS_H_
  21. #include <linux/types.h>
  22. /*
  23. * Fibre Channel Services - Common Transport.
  24. * From T11.org FC-GS-2 Rev 5.3 November 1998.
  25. */
  26. struct fc_ct_hdr {
  27. __u8 ct_rev; /* revision */
  28. __u8 ct_in_id[3]; /* N_Port ID of original requestor */
  29. __u8 ct_fs_type; /* type of fibre channel service */
  30. __u8 ct_fs_subtype; /* subtype */
  31. __u8 ct_options;
  32. __u8 _ct_resvd1;
  33. __be16 ct_cmd; /* command / response code */
  34. __be16 ct_mr_size; /* maximum / residual size */
  35. __u8 _ct_resvd2;
  36. __u8 ct_reason; /* reject reason */
  37. __u8 ct_explan; /* reason code explanation */
  38. __u8 ct_vendor; /* vendor unique data */
  39. };
  40. #define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */
  41. enum fc_ct_rev {
  42. FC_CT_REV = 1 /* common transport revision */
  43. };
  44. /*
  45. * ct_fs_type values.
  46. */
  47. enum fc_ct_fs_type {
  48. FC_FST_ALIAS = 0xf8, /* alias service */
  49. FC_FST_MGMT = 0xfa, /* management service */
  50. FC_FST_TIME = 0xfb, /* time service */
  51. FC_FST_DIR = 0xfc, /* directory service */
  52. };
  53. /*
  54. * ct_cmd: Command / response codes
  55. */
  56. enum fc_ct_cmd {
  57. FC_FS_RJT = 0x8001, /* reject */
  58. FC_FS_ACC = 0x8002, /* accept */
  59. };
  60. /*
  61. * FS_RJT reason codes.
  62. */
  63. enum fc_ct_reason {
  64. FC_FS_RJT_CMD = 0x01, /* invalid command code */
  65. FC_FS_RJT_VER = 0x02, /* invalid version level */
  66. FC_FS_RJT_LOG = 0x03, /* logical error */
  67. FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */
  68. FC_FS_RJT_BSY = 0x05, /* logical busy */
  69. FC_FS_RJT_PROTO = 0x07, /* protocol error */
  70. FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */
  71. FC_FS_RJT_UNSUP = 0x0b, /* command not supported */
  72. };
  73. /*
  74. * FS_RJT reason code explanations.
  75. */
  76. enum fc_ct_explan {
  77. FC_FS_EXP_NONE = 0x00, /* no additional explanation */
  78. FC_FS_EXP_PID = 0x01, /* port ID not registered */
  79. FC_FS_EXP_PNAM = 0x02, /* port name not registered */
  80. FC_FS_EXP_NNAM = 0x03, /* node name not registered */
  81. FC_FS_EXP_COS = 0x04, /* class of service not registered */
  82. FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
  83. /* definitions not complete */
  84. };
  85. #endif /* _FC_GS_H_ */