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