xref: /openbmc/linux/include/uapi/scsi/fc/fc_ns.h (revision 0898782247ae533d1f4e47a06bc5d4870931b284)
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_NS_H_
9cf028200SDavid Howells #define	_FC_NS_H_
10cf028200SDavid Howells 
11cf028200SDavid Howells #include <linux/types.h>
12cf028200SDavid Howells 
13cf028200SDavid Howells /*
14cf028200SDavid Howells  * Fibre Channel Services - Name Service (dNS)
15cf028200SDavid Howells  * From T11.org FC-GS-2 Rev 5.3 November 1998.
16cf028200SDavid Howells  */
17cf028200SDavid Howells 
18cf028200SDavid Howells /*
19cf028200SDavid Howells  * Common-transport sub-type for Name Server.
20cf028200SDavid Howells  */
21cf028200SDavid Howells #define	FC_NS_SUBTYPE	    2	/* fs_ct_hdr.ct_fs_subtype */
22cf028200SDavid Howells 
23cf028200SDavid Howells /*
24cf028200SDavid Howells  * Name server Requests.
25cf028200SDavid Howells  * Note:  this is an incomplete list, some unused requests are omitted.
26cf028200SDavid Howells  */
27cf028200SDavid Howells enum fc_ns_req {
28cf028200SDavid Howells 	FC_NS_GA_NXT =	0x0100,		/* get all next */
29cf028200SDavid Howells 	FC_NS_GI_A =	0x0101,		/* get identifiers - scope */
30cf028200SDavid Howells 	FC_NS_GPN_ID =	0x0112,		/* get port name by ID */
31cf028200SDavid Howells 	FC_NS_GNN_ID =	0x0113,		/* get node name by ID */
32cf028200SDavid Howells 	FC_NS_GSPN_ID = 0x0118,		/* get symbolic port name */
33cf028200SDavid Howells 	FC_NS_GID_PN =	0x0121,		/* get ID for port name */
34cf028200SDavid Howells 	FC_NS_GID_NN =	0x0131,		/* get IDs for node name */
35cf028200SDavid Howells 	FC_NS_GID_FT =	0x0171,		/* get IDs by FC4 type */
36cf028200SDavid Howells 	FC_NS_GPN_FT =	0x0172,		/* get port names by FC4 type */
37cf028200SDavid Howells 	FC_NS_GID_PT =	0x01a1,		/* get IDs by port type */
38cf028200SDavid Howells 	FC_NS_RPN_ID =	0x0212,		/* reg port name for ID */
39cf028200SDavid Howells 	FC_NS_RNN_ID =	0x0213,		/* reg node name for ID */
40cf028200SDavid Howells 	FC_NS_RFT_ID =	0x0217,		/* reg FC4 type for ID */
41cf028200SDavid Howells 	FC_NS_RSPN_ID =	0x0218,		/* reg symbolic port name */
42cf028200SDavid Howells 	FC_NS_RFF_ID =	0x021f,		/* reg FC4 Features for ID */
43cf028200SDavid Howells 	FC_NS_RSNN_NN =	0x0239,		/* reg symbolic node name */
44cf028200SDavid Howells };
45cf028200SDavid Howells 
46cf028200SDavid Howells /*
47cf028200SDavid Howells  * Port type values.
48cf028200SDavid Howells  */
49cf028200SDavid Howells enum fc_ns_pt {
50cf028200SDavid Howells 	FC_NS_UNID_PORT = 0x00,	/* unidentified */
51cf028200SDavid Howells 	FC_NS_N_PORT =	0x01,	/* N port */
52cf028200SDavid Howells 	FC_NS_NL_PORT =	0x02,	/* NL port */
53cf028200SDavid Howells 	FC_NS_FNL_PORT = 0x03,	/* F/NL port */
54cf028200SDavid Howells 	FC_NS_NX_PORT =	0x7f,	/* Nx port */
55cf028200SDavid Howells 	FC_NS_F_PORT =	0x81,	/* F port */
56cf028200SDavid Howells 	FC_NS_FL_PORT =	0x82,	/* FL port */
57cf028200SDavid Howells 	FC_NS_E_PORT =	0x84,	/* E port */
58cf028200SDavid Howells 	FC_NS_B_PORT =	0x85,	/* B port */
59cf028200SDavid Howells };
60cf028200SDavid Howells 
61cf028200SDavid Howells /*
62cf028200SDavid Howells  * Port type object.
63cf028200SDavid Howells  */
64cf028200SDavid Howells struct fc_ns_pt_obj {
65cf028200SDavid Howells 	__u8		pt_type;
66cf028200SDavid Howells };
67cf028200SDavid Howells 
68cf028200SDavid Howells /*
69cf028200SDavid Howells  * Port ID object
70cf028200SDavid Howells  */
71cf028200SDavid Howells struct fc_ns_fid {
72cf028200SDavid Howells 	__u8		fp_flags;	/* flags for responses only */
73cf028200SDavid Howells 	__u8		fp_fid[3];
74cf028200SDavid Howells };
75cf028200SDavid Howells 
76cf028200SDavid Howells /*
77cf028200SDavid Howells  * fp_flags in port ID object, for responses only.
78cf028200SDavid Howells  */
79cf028200SDavid Howells #define	FC_NS_FID_LAST	0x80		/* last object */
80cf028200SDavid Howells 
81cf028200SDavid Howells /*
82cf028200SDavid Howells  * FC4-types object.
83cf028200SDavid Howells  */
84cf028200SDavid Howells #define	FC_NS_TYPES	256	/* number of possible FC-4 types */
85cf028200SDavid Howells #define	FC_NS_BPW	32	/* bits per word in bitmap */
86cf028200SDavid Howells 
87cf028200SDavid Howells struct fc_ns_fts {
88cf028200SDavid Howells 	__be32	ff_type_map[FC_NS_TYPES / FC_NS_BPW]; /* bitmap of FC-4 types */
89cf028200SDavid Howells };
90cf028200SDavid Howells 
91cf028200SDavid Howells /*
92cf028200SDavid Howells  * FC4-features object.
93cf028200SDavid Howells  */
94cf028200SDavid Howells struct fc_ns_ff	{
95cf028200SDavid Howells 	__be32	fd_feat[FC_NS_TYPES * 4 / FC_NS_BPW]; /* 4-bits per FC-type */
96cf028200SDavid Howells };
97cf028200SDavid Howells 
98cf028200SDavid Howells /*
99cf028200SDavid Howells  * GID_PT request.
100cf028200SDavid Howells  */
101cf028200SDavid Howells struct fc_ns_gid_pt {
102cf028200SDavid Howells 	__u8		fn_pt_type;
103cf028200SDavid Howells 	__u8		fn_domain_id_scope;
104cf028200SDavid Howells 	__u8		fn_area_id_scope;
105cf028200SDavid Howells 	__u8		fn_resvd;
106cf028200SDavid Howells };
107cf028200SDavid Howells 
108cf028200SDavid Howells /*
109cf028200SDavid Howells  * GID_FT or GPN_FT request.
110cf028200SDavid Howells  */
111cf028200SDavid Howells struct fc_ns_gid_ft {
112cf028200SDavid Howells 	__u8		fn_resvd;
113cf028200SDavid Howells 	__u8		fn_domain_id_scope;
114cf028200SDavid Howells 	__u8		fn_area_id_scope;
115cf028200SDavid Howells 	__u8		fn_fc4_type;
116cf028200SDavid Howells };
117cf028200SDavid Howells 
118cf028200SDavid Howells /*
119cf028200SDavid Howells  * GPN_FT response.
120cf028200SDavid Howells  */
121cf028200SDavid Howells struct fc_gpn_ft_resp {
122cf028200SDavid Howells 	__u8		fp_flags;	/* see fp_flags definitions above */
123cf028200SDavid Howells 	__u8		fp_fid[3];	/* port ID */
124cf028200SDavid Howells 	__be32		fp_resvd;
125cf028200SDavid Howells 	__be64		fp_wwpn;	/* port name */
126cf028200SDavid Howells };
127cf028200SDavid Howells 
128cf028200SDavid Howells /*
129cf028200SDavid Howells  * GID_PN request
130cf028200SDavid Howells  */
131cf028200SDavid Howells struct fc_ns_gid_pn {
132cf028200SDavid Howells 	__be64     fn_wwpn;    /* port name */
133cf028200SDavid Howells };
134cf028200SDavid Howells 
135cf028200SDavid Howells /*
136cf028200SDavid Howells  * GID_PN response or GSPN_ID request
137cf028200SDavid Howells  */
138cf028200SDavid Howells struct fc_gid_pn_resp {
139cf028200SDavid Howells 	__u8      fp_resvd;
140cf028200SDavid Howells 	__u8      fp_fid[3];     /* port ID */
141cf028200SDavid Howells };
142cf028200SDavid Howells 
143cf028200SDavid Howells /*
144cf028200SDavid Howells  * GSPN_ID response
145cf028200SDavid Howells  */
146cf028200SDavid Howells struct fc_gspn_resp {
147cf028200SDavid Howells 	__u8	fp_name_len;
148cf028200SDavid Howells 	char	fp_name[];
149cf028200SDavid Howells };
150cf028200SDavid Howells 
151cf028200SDavid Howells /*
152cf028200SDavid Howells  * RFT_ID request - register FC-4 types for ID.
153cf028200SDavid Howells  */
154cf028200SDavid Howells struct fc_ns_rft_id {
155cf028200SDavid Howells 	struct fc_ns_fid fr_fid;	/* port ID object */
156cf028200SDavid Howells 	struct fc_ns_fts fr_fts;	/* FC-4 types object */
157cf028200SDavid Howells };
158cf028200SDavid Howells 
159cf028200SDavid Howells /*
160cf028200SDavid Howells  * RPN_ID request - register port name for ID.
161cf028200SDavid Howells  * RNN_ID request - register node name for ID.
162cf028200SDavid Howells  */
163cf028200SDavid Howells struct fc_ns_rn_id {
164cf028200SDavid Howells 	struct fc_ns_fid fr_fid;	/* port ID object */
165cf028200SDavid Howells 	__be64		fr_wwn;		/* node name or port name */
166cf028200SDavid Howells } __attribute__((__packed__));
167cf028200SDavid Howells 
168cf028200SDavid Howells /*
169cf028200SDavid Howells  * RSNN_NN request - register symbolic node name
170cf028200SDavid Howells  */
171cf028200SDavid Howells struct fc_ns_rsnn {
172cf028200SDavid Howells 	__be64		fr_wwn;		/* node name */
173cf028200SDavid Howells 	__u8		fr_name_len;
174cf028200SDavid Howells 	char		fr_name[];
175cf028200SDavid Howells } __attribute__((__packed__));
176cf028200SDavid Howells 
177cf028200SDavid Howells /*
178cf028200SDavid Howells  * RSPN_ID request - register symbolic port name
179cf028200SDavid Howells  */
180cf028200SDavid Howells struct fc_ns_rspn {
181cf028200SDavid Howells 	struct fc_ns_fid fr_fid;	/* port ID object */
182cf028200SDavid Howells 	__u8		fr_name_len;
183cf028200SDavid Howells 	char		fr_name[];
184cf028200SDavid Howells } __attribute__((__packed__));
185cf028200SDavid Howells 
186cf028200SDavid Howells /*
187cf028200SDavid Howells  * RFF_ID request - register FC-4 Features for ID.
188cf028200SDavid Howells  */
189cf028200SDavid Howells struct fc_ns_rff_id {
190cf028200SDavid Howells 	struct fc_ns_fid fr_fid;	/* port ID object */
191cf028200SDavid Howells 	__u8		fr_resvd[2];
192cf028200SDavid Howells 	__u8		fr_feat;	/* FC-4 Feature bits */
193cf028200SDavid Howells 	__u8		fr_type;	/* FC-4 type */
194cf028200SDavid Howells } __attribute__((__packed__));
195cf028200SDavid Howells 
196cf028200SDavid Howells #endif /* _FC_NS_H_ */
197