xref: /openbmc/linux/include/uapi/scsi/fc/fc_gs.h (revision e2be04c7f9958dde770eeb8b30e829ca969b37bb)
1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2cf028200SDavid Howells /*
3cf028200SDavid Howells  * Copyright(c) 2007 Intel Corporation. All rights reserved.
4cf028200SDavid Howells  *
5cf028200SDavid Howells  * This program is free software; you can redistribute it and/or modify it
6cf028200SDavid Howells  * under the terms and conditions of the GNU General Public License,
7cf028200SDavid Howells  * version 2, as published by the Free Software Foundation.
8cf028200SDavid Howells  *
9cf028200SDavid Howells  * This program is distributed in the hope it will be useful, but WITHOUT
10cf028200SDavid Howells  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11cf028200SDavid Howells  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12cf028200SDavid Howells  * more details.
13cf028200SDavid Howells  *
14cf028200SDavid Howells  * You should have received a copy of the GNU General Public License along with
15cf028200SDavid Howells  * this program; if not, write to the Free Software Foundation, Inc.,
16cf028200SDavid Howells  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17cf028200SDavid Howells  *
18cf028200SDavid Howells  * Maintained at www.Open-FCoE.org
19cf028200SDavid Howells  */
20cf028200SDavid Howells 
21cf028200SDavid Howells #ifndef _FC_GS_H_
22cf028200SDavid Howells #define	_FC_GS_H_
23cf028200SDavid Howells 
24cf028200SDavid Howells #include <linux/types.h>
25cf028200SDavid Howells 
26cf028200SDavid Howells /*
27cf028200SDavid Howells  * Fibre Channel Services - Common Transport.
28cf028200SDavid Howells  * From T11.org FC-GS-2 Rev 5.3 November 1998.
29cf028200SDavid Howells  */
30cf028200SDavid Howells 
31cf028200SDavid Howells struct fc_ct_hdr {
32cf028200SDavid Howells 	__u8		ct_rev;		/* revision */
33cf028200SDavid Howells 	__u8		ct_in_id[3];	/* N_Port ID of original requestor */
34cf028200SDavid Howells 	__u8		ct_fs_type;	/* type of fibre channel service */
35cf028200SDavid Howells 	__u8		ct_fs_subtype;	/* subtype */
36cf028200SDavid Howells 	__u8		ct_options;
37cf028200SDavid Howells 	__u8		_ct_resvd1;
38cf028200SDavid Howells 	__be16		ct_cmd;		/* command / response code */
39cf028200SDavid Howells 	__be16		ct_mr_size;	/* maximum / residual size */
40cf028200SDavid Howells 	__u8		_ct_resvd2;
41cf028200SDavid Howells 	__u8		ct_reason;	/* reject reason */
42cf028200SDavid Howells 	__u8		ct_explan;	/* reason code explanation */
43cf028200SDavid Howells 	__u8		ct_vendor;	/* vendor unique data */
44cf028200SDavid Howells };
45cf028200SDavid Howells 
46cf028200SDavid Howells #define	FC_CT_HDR_LEN	16	/* expected sizeof (struct fc_ct_hdr) */
47cf028200SDavid Howells 
48cf028200SDavid Howells enum fc_ct_rev {
49cf028200SDavid Howells 	FC_CT_REV = 1		/* common transport revision */
50cf028200SDavid Howells };
51cf028200SDavid Howells 
52cf028200SDavid Howells /*
53cf028200SDavid Howells  * ct_fs_type values.
54cf028200SDavid Howells  */
55cf028200SDavid Howells enum fc_ct_fs_type {
56cf028200SDavid Howells 	FC_FST_ALIAS =	0xf8,	/* alias service */
57cf028200SDavid Howells 	FC_FST_MGMT =	0xfa,	/* management service */
58cf028200SDavid Howells 	FC_FST_TIME =	0xfb,	/* time service */
59cf028200SDavid Howells 	FC_FST_DIR =	0xfc,	/* directory service */
60cf028200SDavid Howells };
61cf028200SDavid Howells 
62cf028200SDavid Howells /*
63cf028200SDavid Howells  * ct_cmd: Command / response codes
64cf028200SDavid Howells  */
65cf028200SDavid Howells enum fc_ct_cmd {
66cf028200SDavid Howells 	FC_FS_RJT =	0x8001,	/* reject */
67cf028200SDavid Howells 	FC_FS_ACC =	0x8002,	/* accept */
68cf028200SDavid Howells };
69cf028200SDavid Howells 
70cf028200SDavid Howells /*
71cf028200SDavid Howells  * FS_RJT reason codes.
72cf028200SDavid Howells  */
73cf028200SDavid Howells enum fc_ct_reason {
74cf028200SDavid Howells 	FC_FS_RJT_CMD =		0x01,	/* invalid command code */
75cf028200SDavid Howells 	FC_FS_RJT_VER =		0x02,	/* invalid version level */
76cf028200SDavid Howells 	FC_FS_RJT_LOG =		0x03,	/* logical error */
77cf028200SDavid Howells 	FC_FS_RJT_IUSIZ =	0x04,	/* invalid IU size */
78cf028200SDavid Howells 	FC_FS_RJT_BSY =		0x05,	/* logical busy */
79cf028200SDavid Howells 	FC_FS_RJT_PROTO =	0x07,	/* protocol error */
80cf028200SDavid Howells 	FC_FS_RJT_UNABL =	0x09,	/* unable to perform command request */
81cf028200SDavid Howells 	FC_FS_RJT_UNSUP =	0x0b,	/* command not supported */
82cf028200SDavid Howells };
83cf028200SDavid Howells 
84cf028200SDavid Howells /*
85cf028200SDavid Howells  * FS_RJT reason code explanations.
86cf028200SDavid Howells  */
87cf028200SDavid Howells enum fc_ct_explan {
88cf028200SDavid Howells 	FC_FS_EXP_NONE =	0x00,	/* no additional explanation */
89cf028200SDavid Howells 	FC_FS_EXP_PID =		0x01,	/* port ID not registered */
90cf028200SDavid Howells 	FC_FS_EXP_PNAM =	0x02,	/* port name not registered */
91cf028200SDavid Howells 	FC_FS_EXP_NNAM =	0x03,	/* node name not registered */
92cf028200SDavid Howells 	FC_FS_EXP_COS =		0x04,	/* class of service not registered */
93cf028200SDavid Howells 	FC_FS_EXP_FTNR =	0x07,	/* FC-4 types not registered */
94cf028200SDavid Howells 	/* definitions not complete */
95cf028200SDavid Howells };
96cf028200SDavid Howells 
97cf028200SDavid Howells #endif /* _FC_GS_H_ */
98