fc_gs.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * Copyright(c) 2007 Intel Corporation. All rights reserved.
  4. *
  5. * Maintained at www.Open-FCoE.org
  6. */
  7. #ifndef _FC_GS_H_
  8. #define _FC_GS_H_
  9. #include <linux/types.h>
  10. /*
  11. * Fibre Channel Services - Common Transport.
  12. * From T11.org FC-GS-2 Rev 5.3 November 1998.
  13. */
  14. struct fc_ct_hdr {
  15. __u8 ct_rev; /* revision */
  16. __u8 ct_in_id[3]; /* N_Port ID of original requestor */
  17. __u8 ct_fs_type; /* type of fibre channel service */
  18. __u8 ct_fs_subtype; /* subtype */
  19. __u8 ct_options;
  20. __u8 _ct_resvd1;
  21. __be16 ct_cmd; /* command / response code */
  22. __be16 ct_mr_size; /* maximum / residual size */
  23. __u8 _ct_resvd2;
  24. __u8 ct_reason; /* reject reason */
  25. __u8 ct_explan; /* reason code explanation */
  26. __u8 ct_vendor; /* vendor unique data */
  27. };
  28. #define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */
  29. enum fc_ct_rev {
  30. FC_CT_REV = 1 /* common transport revision */
  31. };
  32. /*
  33. * ct_fs_type values.
  34. */
  35. enum fc_ct_fs_type {
  36. FC_FST_ALIAS = 0xf8, /* alias service */
  37. FC_FST_MGMT = 0xfa, /* management service */
  38. FC_FST_TIME = 0xfb, /* time service */
  39. FC_FST_DIR = 0xfc, /* directory service */
  40. };
  41. /*
  42. * ct_cmd: Command / response codes
  43. */
  44. enum fc_ct_cmd {
  45. FC_FS_RJT = 0x8001, /* reject */
  46. FC_FS_ACC = 0x8002, /* accept */
  47. };
  48. /*
  49. * FS_RJT reason codes.
  50. */
  51. enum fc_ct_reason {
  52. FC_FS_RJT_CMD = 0x01, /* invalid command code */
  53. FC_FS_RJT_VER = 0x02, /* invalid version level */
  54. FC_FS_RJT_LOG = 0x03, /* logical error */
  55. FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */
  56. FC_FS_RJT_BSY = 0x05, /* logical busy */
  57. FC_FS_RJT_PROTO = 0x07, /* protocol error */
  58. FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */
  59. FC_FS_RJT_UNSUP = 0x0b, /* command not supported */
  60. };
  61. /*
  62. * FS_RJT reason code explanations.
  63. */
  64. enum fc_ct_explan {
  65. FC_FS_EXP_NONE = 0x00, /* no additional explanation */
  66. FC_FS_EXP_PID = 0x01, /* port ID not registered */
  67. FC_FS_EXP_PNAM = 0x02, /* port name not registered */
  68. FC_FS_EXP_NNAM = 0x03, /* node name not registered */
  69. FC_FS_EXP_COS = 0x04, /* class of service not registered */
  70. FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
  71. /* definitions not complete */
  72. };
  73. #endif /* _FC_GS_H_ */