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