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