xref: /illumos-gate/usr/src/uts/common/io/bnxe/577xx/drivers/common/lm/fw/57xx_fcoe_rfc_constants.h (revision d14abf155341d55053c76eeec58b787a456b753b)
1 #ifndef __57XX_FCOE_RFC_CONSTANTS_H_
2 #define __57XX_FCOE_RFC_CONSTANTS_H_
3 
4 /**
5 * This file defines FCoE RFC constants
6 */
7 
8 
9 /* Frame Header type constants */
10 
11 #define FC_TYPE_BLS	0x00	/* basic link service */
12 #define FC_TYPE_ELS	0x01	/* extended link service */
13 #define FC_TYPE_IP 	0x05	/* IP over FC, RFC 4338 */
14 #define FC_TYPE_FCP	0x08	/* SCSI FCP */
15 #define FC_TYPE_CT 	0x20	/* Fibre Channel Services (FC-CT) */
16 #define FC_TYPE_ILS	0x22	/* internal link service */
17 
18 
19 /* Frame Header R_CTL constants */
20 
21 /* routing */
22 #define FC_RCTL_DDF				0x0	/* device data frames */
23 #define FC_RCTL_ELS				0x2	/* extended link services */
24 #define FC_RCTL_FC4_DATA		0x3	/* FC-4 Link Data */
25 #define FC_RCTL_BLS				0x8	/* basic link services */
26 #define FC_RCTL_LCF				0xc	/* link control frame */
27 
28 /* info */
29 /* device data frames */
30 #define FC_RCTL_DDF_UNCAT		0x0	/* uncategorized information */
31 #define FC_RCTL_DDF_SOL_DATA	0x1	/* solicited data */
32 #define FC_RCTL_DDF_UNSOL_CTL	0x2	/* unsolicited control */
33 #define FC_RCTL_DDF_SOL_CTL		0x3	/* solicited control or reply */
34 #define FC_RCTL_DDF_UNSOL_DATA	0x4	/* unsolicited data */
35 #define FC_RCTL_DDF_DATA_DESC	0x5	/* data descriptor */
36 #define FC_RCTL_DDF_UNSOL_CMD	0x6	/* unsolicited command */
37 #define FC_RCTL_DDF_CMD_STATUS	0x7	/* command status */
38 /* Extended Link services */
39 #define FC_RCTL_ELS_REQ			0x2	/* extended link services request */
40 #define FC_RCTL_ELS_REP			0x3	/* extended link services reply */
41 /* Basic Link Services */
42 #define FC_RCTL_BLS_NOP			0x0	/* basic link service NOP */
43 #define FC_RCTL_BLS_ABTS		0x1	/* basic link service abort */
44 #define FC_RCTL_BLS_RMC			0x2	/* remove connection */
45 #define FC_RCTL_BLS_ACC			0x4	/* basic accept */
46 #define FC_RCTL_BLS_RJT			0x5	/* basic reject */
47 #define FC_RCTL_BLS_PRMT		0x6	/* dedicated connection preempted */
48 /* Link Control Information */
49 #define FC_RCTL_LCF_ACK_1 		0x0	/* acknowledge_1 */
50 #define FC_RCTL_LCF_ACK_0 		0x1	/* acknowledge_0 */
51 #define FC_RCTL_LCF_P_RJT 		0x2	/* port reject */
52 #define FC_RCTL_LCF_F_RJT 		0x3	/* fabric reject */
53 #define FC_RCTL_LCF_P_BSY 		0x4	/* port busy */
54 #define FC_RCTL_LCF_F_BSY 		0x5	/* fabric busy to data frame */
55 #define FC_RCTL_LCF_F_BSYL		0x6	/* fabric busy to link control frame */
56 #define FC_RCTL_LCF_LCR			0x7	/* link credit reset */
57 #define FC_RCTL_LCF_END			0x9	/* end */
58 
59 
60 /* Frame Header F_CTL constants */
61 
62 /* exchange context */
63 #define	FC_FCTL_EX_CTX_SHIFT		23
64 #define	FC_FCTL_EX_CTX_MASK			(0x1 << FC_FCTL_EX_CTX_SHIFT)
65 #define	FC_FCTL_EX_CTX_ORIGINATOR	(0x0 << FC_FCTL_EX_CTX_SHIFT)
66 #define	FC_FCTL_EX_CTX_RESPONDER	(0x1 << FC_FCTL_EX_CTX_SHIFT)
67 /* sequence context */
68 #define	FC_FCTL_SEQ_CTX_SHIFT		22
69 #define	FC_FCTL_SEQ_CTX_MASK		(0x1 << FC_FCTL_SEQ_CTX_SHIFT)
70 #define	FC_FCTL_SEQ_CTX_INITIATOR	(0x0 << FC_FCTL_SEQ_CTX_SHIFT)
71 #define	FC_FCTL_SEQ_CTX_RECIPIENT	(0x1 << FC_FCTL_SEQ_CTX_SHIFT)
72 /* first sequence of exchange */
73 #define	FC_FCTL_FIRST_SEQ_SHIFT		21
74 #define	FC_FCTL_FIRST_SEQ_MASK		(0x1 << FC_FCTL_FIRST_SEQ_SHIFT)
75 #define	FC_FCTL_FIRST_SEQ_FALSE		(0x0 << FC_FCTL_FIRST_SEQ_SHIFT)
76 #define	FC_FCTL_FIRST_SEQ_TRUE		(0x1 << FC_FCTL_FIRST_SEQ_SHIFT)
77 /* last sequence of exchange */
78 #define	FC_FCTL_LAST_SEQ_SHIFT		20
79 #define	FC_FCTL_LAST_SEQ_MASK		(0x1 << FC_FCTL_LAST_SEQ_SHIFT)
80 #define	FC_FCTL_LAST_SEQ_FALSE		(0x0 << FC_FCTL_LAST_SEQ_SHIFT)
81 #define	FC_FCTL_LAST_SEQ_TRUE		(0x1 << FC_FCTL_LAST_SEQ_SHIFT)
82 /* last frame of sequence */
83 #define	FC_FCTL_END_SEQ_SHIFT		19
84 #define	FC_FCTL_END_SEQ_MASK		(0x1 << FC_FCTL_END_SEQ_SHIFT)
85 #define	FC_FCTL_END_SEQ_FALSE		(0x0 << FC_FCTL_END_SEQ_SHIFT)
86 #define	FC_FCTL_END_SEQ_TRUE		(0x1 << FC_FCTL_END_SEQ_SHIFT)
87 /* CS_CTL/priority enable */
88 #define	FC_FCTL_PRI_ENABLE_SHIFT	17
89 #define	FC_FCTL_PRI_ENABLE_MASK		(0x1 << FC_FCTL_PRI_ENABLE_SHIFT)
90 #define	FC_FCTL_PRI_ENABLE_FALSE	(0x0 << FC_FCTL_PRI_ENABLE_SHIFT)
91 #define	FC_FCTL_PRI_ENABLE_TRUE		(0x1 << FC_FCTL_PRI_ENABLE_SHIFT)
92 /* sequence initiative */
93 #define	FC_FCTL_SEQ_INIT_SHIFT		16
94 #define	FC_FCTL_SEQ_INIT_MASK		(0x1 << FC_FCTL_SEQ_INIT_SHIFT)
95 #define	FC_FCTL_SEQ_INIT_HOLD		(0x0 << FC_FCTL_SEQ_INIT_SHIFT)
96 #define	FC_FCTL_SEQ_INIT_TRANSFER	(0x1 << FC_FCTL_SEQ_INIT_SHIFT)
97 /* ack form */
98 #define	FC_FCTL_ACK_SHIFT			12
99 #define	FC_FCTL_ACK_MASK			(0x3 << FC_FCTL_ACK_SHIFT)
100 #define FC_FCTL_ACK_NONE			(0x0 << FC_FCTL_ACK_SHIFT)
101 #define FC_FCTL_ACK_1				(0x1 << FC_FCTL_ACK_SHIFT)
102 #define FC_FCTL_ACK_0				(0x3 << FC_FCTL_ACK_SHIFT)
103 /* retransmitted sequence */
104 #define	FC_FCTL_RETX_SEQ_SHIFT		9
105 #define	FC_FCTL_RETX_SEQ_MASK		(0x1 << FC_FCTL_RETX_SEQ_SHIFT)
106 #define FC_FCTL_RETX_SEQ_FALSE		(0x0 << FC_FCTL_RETX_SEQ_SHIFT)
107 #define FC_FCTL_RETX_SEQ_TRUE		(0x1 << FC_FCTL_RETX_SEQ_SHIFT)
108 /* abort sequence condition */
109 #define	FC_FCTL_ABT_SEQ_SHIFT				4
110 #define	FC_FCTL_ABT_SEQ_MASK				(0x2 << FC_FCTL_ABT_SEQ_SHIFT)
111 #define	FC_FCTL_ABT_SEQ_DISCARD_MULT		(0x0 << FC_FCTL_ABT_SEQ_SHIFT)
112 #define	FC_FCTL_ABT_SEQ_DISCARD_SINGLE		(0x1 << FC_FCTL_ABT_SEQ_SHIFT)
113 #define	FC_FCTL_ABT_SEQ_PROCESS_POLICY		(0x2 << FC_FCTL_ABT_SEQ_SHIFT)
114 #define	FC_FCTL_ABT_SEQ_DISCARD_MULT_RETX	(0x3 << FC_FCTL_ABT_SEQ_SHIFT)
115 /* relative offset */
116 #define	FC_FCTL_REL_OFF_SHIFT		3
117 #define	FC_FCTL_REL_OFF_MASK		(0x1 << FC_FCTL_REL_OFF_SHIFT)
118 #define FC_FCTL_REL_OFF_FALSE		(0x0 << FC_FCTL_REL_OFF_SHIFT)
119 #define FC_FCTL_REL_OFF_TRUE		(0x1 << FC_FCTL_REL_OFF_SHIFT)
120 /* bytes of trailing fill */
121 #define	FC_FCTL_FILL_SHIFT			0
122 #define	FC_FCTL_FILL_MASK			(0x3 << FC_FCTL_FILL_SHIFT)
123 #define	FC_FCTL_FILL_0_BYTES		(0x0 << FC_FCTL_FILL_SHIFT)
124 #define	FC_FCTL_FILL_1_BYTES		(0x1 << FC_FCTL_FILL_SHIFT)
125 #define	FC_FCTL_FILL_2_BYTES		(0x2 << FC_FCTL_FILL_SHIFT)
126 #define	FC_FCTL_FILL_3_BYTES		(0x3 << FC_FCTL_FILL_SHIFT)
127 
128 
129 /* SOF / EOF bytes */
130 #define FC_SOF_F	0x28   /* fabric */
131 #define FC_SOF_I4	0x29   /* initiate class 4 */
132 #define FC_SOF_I2	0x2d   /* initiate class 2 */
133 #define FC_SOF_I3	0x2e   /* initiate class 3 */
134 #define FC_SOF_N4	0x31   /* normal class 4 */
135 #define FC_SOF_N2	0x35   /* normal class 2 */
136 #define FC_SOF_N3	0x36   /* normal class 3 */
137 #define FC_SOF_C4	0x39   /* activate class 4 */
138 #define FC_EOF_N	0x41   /* normal (not last frame of seq) */
139 #define FC_EOF_T	0x42   /* terminate (last frame of sequence) */
140 #define FC_EOF_RT	0x44
141 #define FC_EOF_DT	0x46   /* disconnect-terminate class-1 */
142 #define FC_EOF_NI	0x49   /* normal-invalid */
143 #define FC_EOF_DTI	0x4e   /* disconnect-terminate-invalid */
144 #define FC_EOF_RTI	0x4f
145 #define FC_EOF_A	0x50   /* abort */
146 
147 
148 /* ELS Command codes - byte 0 of the frame payload */
149 #define	FC_ELS_CMD_LS_RJT		0x01	/* ESL reject */
150 #define	FC_ELS_CMD_LS_ACC		0x02	/* ESL Accept */
151 #define	FC_ELS_CMD_PLOGI		0x03	/* N_Port login */
152 #define	FC_ELS_CMD_FLOGI		0x04	/* F_Port login */
153 #define	FC_ELS_CMD_LOGO			0x05	/* Logout */
154 #define	FC_ELS_CMD_ABTX			0x06	/* Abort exchange - obsolete */
155 #define	FC_ELS_CMD_RCS			0x07	/* read connection status */
156 #define	FC_ELS_CMD_RES			0x08	/* read exchange status block */
157 #define	FC_ELS_CMD_RSS			0x09	/* read sequence status block */
158 #define	FC_ELS_CMD_RSI			0x0a	/* read sequence initiative */
159 #define	FC_ELS_CMD_ESTS			0x0b	/* establish streaming */
160 #define	FC_ELS_CMD_ESTC			0x0c	/* estimate credit */
161 #define	FC_ELS_CMD_ADVC			0x0d	/* advise credit */
162 #define	FC_ELS_CMD_RTV			0x0e	/* read timeout value */
163 #define	FC_ELS_CMD_RLS			0x0f	/* read link error status block */
164 #define	FC_ELS_CMD_ECHO			0x10	/* echo */
165 #define	FC_ELS_CMD_TEST			0x11	/* test */
166 #define	FC_ELS_CMD_RRQ			0x12	/* reinstate recovery qualifier */
167 #define	FC_ELS_CMD_REC			0x13	/* read exchange concise */
168 #define	FC_ELS_CMD_PRLI			0x20	/* process login */
169 #define	FC_ELS_CMD_PRLO			0x21	/* process logout */
170 #define	FC_ELS_CMD_SCN			0x22	/* state change notification */
171 #define	FC_ELS_CMD_TPLS			0x23	/* test process login state */
172 #define	FC_ELS_CMD_TPRLO		0x24	/* third party process logout */
173 #define	FC_ELS_CMD_LCLM			0x25	/* login control list mgmt (obs) */
174 #define	FC_ELS_CMD_GAID			0x30	/* get alias_ID */
175 #define	FC_ELS_CMD_FACT			0x31	/* fabric activate alias_id */
176 #define	FC_ELS_CMD_FDACDT		0x32	/* fabric deactivate alias_id */
177 #define	FC_ELS_CMD_NACT			0x33	/* N-port activate alias_id */
178 #define	FC_ELS_CMD_NDACT		0x34	/* N-port deactivate alias_id */
179 #define	FC_ELS_CMD_QOSR			0x40	/* quality of service request */
180 #define	FC_ELS_CMD_RVCS			0x41	/* read virtual circuit status */
181 #define	FC_ELS_CMD_PDISC		0x50	/* discover N_port service params */
182 #define	FC_ELS_CMD_FDISC		0x51	/* discover F_port service params */
183 #define	FC_ELS_CMD_ADISC		0x52	/* discover address */
184 #define	FC_ELS_CMD_RNC			0x53	/* report node cap (obs) */
185 #define	FC_ELS_CMD_FARP_REQ		0x54	/* FC ARP request */
186 #define	FC_ELS_CMD_FARP_REPL	0x55	/* FC ARP reply */
187 #define	FC_ELS_CMD_RPS			0x56	/* read port status block */
188 #define	FC_ELS_CMD_RPL			0x57	/* read port list */
189 #define	FC_ELS_CMD_RPBC			0x58	/* read port buffer condition */
190 #define	FC_ELS_CMD_FAN			0x60	/* fabric address notification */
191 #define	FC_ELS_CMD_RSCN			0x61	/* registered state change notification */
192 #define	FC_ELS_CMD_SCR			0x62	/* state change registration */
193 #define	FC_ELS_CMD_RNFT			0x63	/* report node FC-4 types */
194 #define	FC_ELS_CMD_CSR			0x68	/* clock synch. request */
195 #define	FC_ELS_CMD_CSU			0x69	/* clock synch. update */
196 #define	FC_ELS_CMD_LINIT		0x70	/* loop initialize */
197 #define	FC_ELS_CMD_LSTS			0x72	/* loop status */
198 #define	FC_ELS_CMD_RNID			0x78	/* request node ID data */
199 #define	FC_ELS_CMD_RLIR			0x79	/* registered link incident report */
200 #define	FC_ELS_CMD_LIRR			0x7a	/* link incident record registration */
201 #define	FC_ELS_CMD_SRL			0x7b	/* scan remote loop */
202 #define	FC_ELS_CMD_SBRP			0x7c	/* set bit-error reporting params */
203 #define	FC_ELS_CMD_RPSC			0x7d	/* report speed capabilities */
204 #define	FC_ELS_CMD_QSA			0x7e	/* query security attributes */
205 #define	FC_ELS_CMD_EVFP			0x7f	/* exchange virt. fabrics params */
206 #define	FC_ELS_CMD_LKA			0x80	/* link keep-alive */
207 #define	FC_ELS_CMD_AUTH_ELS		0x90	/* authentication ELS */
208 
209 #endif /*__57XX_FCOE_RFC_CONSTANTS_H_ */
210