1
0

fc_gs.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  17. /*
  18. * Copyright(c) 2007 Intel Corporation. All rights reserved.
  19. *
  20. * Maintained at www.Open-FCoE.org
  21. */
  22. #ifndef _FC_GS_H_
  23. #define _FC_GS_H_
  24. #include <linux/types.h>
  25. /*
  26. * Fibre Channel Services - Common Transport.
  27. * From T11.org FC-GS-2 Rev 5.3 November 1998.
  28. */
  29. struct fc_ct_hdr {
  30. __u8 ct_rev; /* revision */
  31. __u8 ct_in_id[3]; /* N_Port ID of original requestor */
  32. __u8 ct_fs_type; /* type of fibre channel service */
  33. __u8 ct_fs_subtype; /* subtype */
  34. __u8 ct_options;
  35. __u8 _ct_resvd1;
  36. __be16 ct_cmd; /* command / response code */
  37. __be16 ct_mr_size; /* maximum / residual size */
  38. __u8 _ct_resvd2;
  39. __u8 ct_reason; /* reject reason */
  40. __u8 ct_explan; /* reason code explanation */
  41. __u8 ct_vendor; /* vendor unique data */
  42. };
  43. #define FC_CT_HDR_LEN 16 /* expected sizeof (struct fc_ct_hdr) */
  44. enum fc_ct_rev {
  45. FC_CT_REV = 1 /* common transport revision */
  46. };
  47. /*
  48. * ct_fs_type values.
  49. */
  50. enum fc_ct_fs_type {
  51. FC_FST_ALIAS = 0xf8, /* alias service */
  52. FC_FST_MGMT = 0xfa, /* management service */
  53. FC_FST_TIME = 0xfb, /* time service */
  54. FC_FST_DIR = 0xfc, /* directory service */
  55. };
  56. /*
  57. * ct_cmd: Command / response codes
  58. */
  59. enum fc_ct_cmd {
  60. FC_FS_RJT = 0x8001, /* reject */
  61. FC_FS_ACC = 0x8002, /* accept */
  62. };
  63. /*
  64. * FS_RJT reason codes.
  65. */
  66. enum fc_ct_reason {
  67. FC_FS_RJT_CMD = 0x01, /* invalid command code */
  68. FC_FS_RJT_VER = 0x02, /* invalid version level */
  69. FC_FS_RJT_LOG = 0x03, /* logical error */
  70. FC_FS_RJT_IUSIZ = 0x04, /* invalid IU size */
  71. FC_FS_RJT_BSY = 0x05, /* logical busy */
  72. FC_FS_RJT_PROTO = 0x07, /* protocol error */
  73. FC_FS_RJT_UNABL = 0x09, /* unable to perform command request */
  74. FC_FS_RJT_UNSUP = 0x0b, /* command not supported */
  75. };
  76. /*
  77. * FS_RJT reason code explanations.
  78. */
  79. enum fc_ct_explan {
  80. FC_FS_EXP_NONE = 0x00, /* no additional explanation */
  81. FC_FS_EXP_PID = 0x01, /* port ID not registered */
  82. FC_FS_EXP_PNAM = 0x02, /* port name not registered */
  83. FC_FS_EXP_NNAM = 0x03, /* node name not registered */
  84. FC_FS_EXP_COS = 0x04, /* class of service not registered */
  85. FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */
  86. /* definitions not complete */
  87. };
  88. #endif /* _FC_GS_H_ */