Commit | Line | Data |
---|---|---|
a36c61f9 | 1 | /* |
889d0d42 AG |
2 | * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. |
3 | * Copyright (c) 2014- QLogic Corporation. | |
a36c61f9 | 4 | * All rights reserved |
889d0d42 | 5 | * www.qlogic.com |
a36c61f9 | 6 | * |
31e1d569 | 7 | * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. |
a36c61f9 KG |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify it | |
10 | * under the terms of the GNU General Public License (GPL) Version 2 as | |
11 | * published by the Free Software Foundation | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | */ | |
18 | ||
19 | #ifndef __BFI_MS_H__ | |
20 | #define __BFI_MS_H__ | |
21 | ||
22 | #include "bfi.h" | |
23 | #include "bfa_fc.h" | |
24 | #include "bfa_defs_svc.h" | |
25 | ||
26 | #pragma pack(1) | |
27 | ||
28 | enum bfi_iocfc_h2i_msgs { | |
29 | BFI_IOCFC_H2I_CFG_REQ = 1, | |
30 | BFI_IOCFC_H2I_SET_INTR_REQ = 2, | |
31 | BFI_IOCFC_H2I_UPDATEQ_REQ = 3, | |
db9d8a75 KG |
32 | BFI_IOCFC_H2I_FAA_QUERY_REQ = 4, |
33 | BFI_IOCFC_H2I_ADDR_REQ = 5, | |
a36c61f9 KG |
34 | }; |
35 | ||
36 | enum bfi_iocfc_i2h_msgs { | |
37 | BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1), | |
38 | BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3), | |
db9d8a75 KG |
39 | BFI_IOCFC_I2H_FAA_QUERY_RSP = BFA_I2HM(4), |
40 | BFI_IOCFC_I2H_ADDR_MSG = BFA_I2HM(5), | |
a36c61f9 KG |
41 | }; |
42 | ||
43 | struct bfi_iocfc_cfg_s { | |
44 | u8 num_cqs; /* Number of CQs to be used */ | |
45 | u8 sense_buf_len; /* SCSI sense length */ | |
46 | u16 rsvd_1; | |
47 | u32 endian_sig; /* endian signature of host */ | |
4507025d KG |
48 | u8 rsvd_2; |
49 | u8 single_msix_vec; | |
50 | u8 rsvd[2]; | |
e2187d7f KG |
51 | __be16 num_ioim_reqs; |
52 | __be16 num_fwtio_reqs; | |
4507025d | 53 | |
a36c61f9 | 54 | |
acdc79a6 | 55 | /* |
a36c61f9 KG |
56 | * Request and response circular queue base addresses, size and |
57 | * shadow index pointers. | |
58 | */ | |
59 | union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS]; | |
60 | union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS]; | |
50444a34 | 61 | __be16 req_cq_elems[BFI_IOC_MAX_CQS]; |
a36c61f9 KG |
62 | union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS]; |
63 | union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS]; | |
50444a34 | 64 | __be16 rsp_cq_elems[BFI_IOC_MAX_CQS]; |
a36c61f9 KG |
65 | |
66 | union bfi_addr_u stats_addr; /* DMA-able address for stats */ | |
67 | union bfi_addr_u cfgrsp_addr; /* config response dma address */ | |
4507025d KG |
68 | union bfi_addr_u ioim_snsbase[BFI_IOIM_SNSBUF_SEGS]; |
69 | /* IO sense buf base addr segments */ | |
a36c61f9 KG |
70 | struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */ |
71 | }; | |
72 | ||
acdc79a6 | 73 | /* |
a36c61f9 KG |
74 | * Boot target wwn information for this port. This contains either the stored |
75 | * or discovered boot target port wwns for the port. | |
76 | */ | |
77 | struct bfi_iocfc_bootwwns { | |
78 | wwn_t wwn[BFA_BOOT_BOOTLUN_MAX]; | |
79 | u8 nwwns; | |
80 | u8 rsvd[7]; | |
81 | }; | |
82 | ||
11189208 KG |
83 | /** |
84 | * Queue configuration response from firmware | |
85 | */ | |
86 | struct bfi_iocfc_qreg_s { | |
87 | u32 cpe_q_ci_off[BFI_IOC_MAX_CQS]; | |
88 | u32 cpe_q_pi_off[BFI_IOC_MAX_CQS]; | |
89 | u32 cpe_qctl_off[BFI_IOC_MAX_CQS]; | |
90 | u32 rme_q_ci_off[BFI_IOC_MAX_CQS]; | |
91 | u32 rme_q_pi_off[BFI_IOC_MAX_CQS]; | |
92 | u32 rme_qctl_off[BFI_IOC_MAX_CQS]; | |
3fd45980 | 93 | u8 hw_qid[BFI_IOC_MAX_CQS]; |
11189208 KG |
94 | }; |
95 | ||
a36c61f9 KG |
96 | struct bfi_iocfc_cfgrsp_s { |
97 | struct bfa_iocfc_fwcfg_s fwcfg; | |
98 | struct bfa_iocfc_intr_attr_s intr_attr; | |
99 | struct bfi_iocfc_bootwwns bootwwns; | |
100 | struct bfi_pbc_s pbc_cfg; | |
11189208 | 101 | struct bfi_iocfc_qreg_s qreg; |
a36c61f9 KG |
102 | }; |
103 | ||
acdc79a6 | 104 | /* |
a36c61f9 KG |
105 | * BFI_IOCFC_H2I_CFG_REQ message |
106 | */ | |
107 | struct bfi_iocfc_cfg_req_s { | |
108 | struct bfi_mhdr_s mh; | |
109 | union bfi_addr_u ioc_cfg_dma_addr; | |
110 | }; | |
111 | ||
112 | ||
acdc79a6 | 113 | /* |
a36c61f9 KG |
114 | * BFI_IOCFC_I2H_CFG_REPLY message |
115 | */ | |
116 | struct bfi_iocfc_cfg_reply_s { | |
117 | struct bfi_mhdr_s mh; /* Common msg header */ | |
118 | u8 cfg_success; /* cfg reply status */ | |
119 | u8 lpu_bm; /* LPUs assigned for this IOC */ | |
120 | u8 rsvd[2]; | |
121 | }; | |
122 | ||
123 | ||
acdc79a6 | 124 | /* |
a36c61f9 KG |
125 | * BFI_IOCFC_H2I_SET_INTR_REQ message |
126 | */ | |
127 | struct bfi_iocfc_set_intr_req_s { | |
128 | struct bfi_mhdr_s mh; /* common msg header */ | |
129 | u8 coalesce; /* enable intr coalescing */ | |
130 | u8 rsvd[3]; | |
50444a34 M |
131 | __be16 delay; /* delay timer 0..1125us */ |
132 | __be16 latency; /* latency timer 0..225us */ | |
a36c61f9 KG |
133 | }; |
134 | ||
135 | ||
acdc79a6 | 136 | /* |
a36c61f9 KG |
137 | * BFI_IOCFC_H2I_UPDATEQ_REQ message |
138 | */ | |
139 | struct bfi_iocfc_updateq_req_s { | |
140 | struct bfi_mhdr_s mh; /* common msg header */ | |
141 | u32 reqq_ba; /* reqq base addr */ | |
142 | u32 rspq_ba; /* rspq base addr */ | |
143 | u32 reqq_sci; /* reqq shadow ci */ | |
144 | u32 rspq_spi; /* rspq shadow pi */ | |
145 | }; | |
146 | ||
147 | ||
acdc79a6 | 148 | /* |
a36c61f9 KG |
149 | * BFI_IOCFC_I2H_UPDATEQ_RSP message |
150 | */ | |
151 | struct bfi_iocfc_updateq_rsp_s { | |
152 | struct bfi_mhdr_s mh; /* common msg header */ | |
153 | u8 status; /* updateq status */ | |
154 | u8 rsvd[3]; | |
155 | }; | |
156 | ||
157 | ||
acdc79a6 | 158 | /* |
a36c61f9 KG |
159 | * H2I Messages |
160 | */ | |
161 | union bfi_iocfc_h2i_msg_u { | |
162 | struct bfi_mhdr_s mh; | |
163 | struct bfi_iocfc_cfg_req_s cfg_req; | |
164 | struct bfi_iocfc_updateq_req_s updateq_req; | |
165 | u32 mboxmsg[BFI_IOC_MSGSZ]; | |
166 | }; | |
167 | ||
168 | ||
acdc79a6 | 169 | /* |
a36c61f9 KG |
170 | * I2H Messages |
171 | */ | |
172 | union bfi_iocfc_i2h_msg_u { | |
173 | struct bfi_mhdr_s mh; | |
174 | struct bfi_iocfc_cfg_reply_s cfg_reply; | |
175 | struct bfi_iocfc_updateq_rsp_s updateq_rsp; | |
176 | u32 mboxmsg[BFI_IOC_MSGSZ]; | |
177 | }; | |
178 | ||
a714134a KG |
179 | /* |
180 | * BFI_IOCFC_H2I_FAA_ENABLE_REQ BFI_IOCFC_H2I_FAA_DISABLE_REQ message | |
181 | */ | |
182 | struct bfi_faa_en_dis_s { | |
183 | struct bfi_mhdr_s mh; /* common msg header */ | |
184 | }; | |
185 | ||
db9d8a75 KG |
186 | struct bfi_faa_addr_msg_s { |
187 | struct bfi_mhdr_s mh; /* common msg header */ | |
188 | u8 rsvd[4]; | |
189 | wwn_t pwwn; /* Fabric acquired PWWN */ | |
190 | wwn_t nwwn; /* Fabric acquired PWWN */ | |
191 | }; | |
192 | ||
a714134a KG |
193 | /* |
194 | * BFI_IOCFC_H2I_FAA_QUERY_REQ message | |
195 | */ | |
196 | struct bfi_faa_query_s { | |
197 | struct bfi_mhdr_s mh; /* common msg header */ | |
198 | u8 faa_status; /* FAA status */ | |
199 | u8 addr_source; /* PWWN source */ | |
200 | u8 rsvd[2]; | |
201 | wwn_t faa; /* Fabric acquired PWWN */ | |
202 | }; | |
203 | ||
204 | /* | |
205 | * BFI_IOCFC_I2H_FAA_ENABLE_RSP, BFI_IOCFC_I2H_FAA_DISABLE_RSP message | |
206 | */ | |
207 | struct bfi_faa_en_dis_rsp_s { | |
208 | struct bfi_mhdr_s mh; /* common msg header */ | |
209 | u8 status; /* updateq status */ | |
210 | u8 rsvd[3]; | |
211 | }; | |
212 | ||
213 | /* | |
214 | * BFI_IOCFC_I2H_FAA_QUERY_RSP message | |
215 | */ | |
216 | #define bfi_faa_query_rsp_t struct bfi_faa_query_s | |
a36c61f9 KG |
217 | |
218 | enum bfi_fcport_h2i { | |
219 | BFI_FCPORT_H2I_ENABLE_REQ = (1), | |
220 | BFI_FCPORT_H2I_DISABLE_REQ = (2), | |
221 | BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3), | |
222 | BFI_FCPORT_H2I_STATS_GET_REQ = (4), | |
223 | BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5), | |
224 | }; | |
225 | ||
226 | ||
227 | enum bfi_fcport_i2h { | |
228 | BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1), | |
229 | BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2), | |
230 | BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3), | |
231 | BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4), | |
232 | BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5), | |
233 | BFI_FCPORT_I2H_EVENT = BFA_I2HM(6), | |
234 | BFI_FCPORT_I2H_TRUNK_SCN = BFA_I2HM(7), | |
235 | BFI_FCPORT_I2H_ENABLE_AEN = BFA_I2HM(8), | |
236 | BFI_FCPORT_I2H_DISABLE_AEN = BFA_I2HM(9), | |
237 | }; | |
238 | ||
239 | ||
acdc79a6 | 240 | /* |
a36c61f9 KG |
241 | * Generic REQ type |
242 | */ | |
243 | struct bfi_fcport_req_s { | |
244 | struct bfi_mhdr_s mh; /* msg header */ | |
245 | u32 msgtag; /* msgtag for reply */ | |
246 | }; | |
247 | ||
acdc79a6 | 248 | /* |
a36c61f9 KG |
249 | * Generic RSP type |
250 | */ | |
251 | struct bfi_fcport_rsp_s { | |
252 | struct bfi_mhdr_s mh; /* common msg header */ | |
253 | u8 status; /* port enable status */ | |
254 | u8 rsvd[3]; | |
f3a060ca KG |
255 | struct bfa_port_cfg_s port_cfg;/* port configuration */ |
256 | u32 msgtag; /* msgtag for reply */ | |
a36c61f9 KG |
257 | }; |
258 | ||
acdc79a6 | 259 | /* |
a36c61f9 KG |
260 | * BFI_FCPORT_H2I_ENABLE_REQ |
261 | */ | |
262 | struct bfi_fcport_enable_req_s { | |
263 | struct bfi_mhdr_s mh; /* msg header */ | |
264 | u32 rsvd1; | |
265 | wwn_t nwwn; /* node wwn of physical port */ | |
266 | wwn_t pwwn; /* port wwn of physical port */ | |
267 | struct bfa_port_cfg_s port_cfg; /* port configuration */ | |
268 | union bfi_addr_u stats_dma_addr; /* DMA address for stats */ | |
269 | u32 msgtag; /* msgtag for reply */ | |
f3a060ca KG |
270 | u8 use_flash_cfg; /* get prot cfg from flash */ |
271 | u8 rsvd2[3]; | |
a36c61f9 KG |
272 | }; |
273 | ||
acdc79a6 | 274 | /* |
a36c61f9 KG |
275 | * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ |
276 | */ | |
277 | struct bfi_fcport_set_svc_params_req_s { | |
278 | struct bfi_mhdr_s mh; /* msg header */ | |
50444a34 | 279 | __be16 tx_bbcredit; /* Tx credits */ |
bbe37a67 | 280 | u8 rsvd[2]; |
a36c61f9 KG |
281 | }; |
282 | ||
acdc79a6 | 283 | /* |
a36c61f9 KG |
284 | * BFI_FCPORT_I2H_EVENT |
285 | */ | |
286 | struct bfi_fcport_event_s { | |
287 | struct bfi_mhdr_s mh; /* common msg header */ | |
288 | struct bfa_port_link_s link_state; | |
289 | }; | |
290 | ||
acdc79a6 | 291 | /* |
a36c61f9 KG |
292 | * BFI_FCPORT_I2H_TRUNK_SCN |
293 | */ | |
294 | struct bfi_fcport_trunk_link_s { | |
295 | wwn_t trunk_wwn; | |
296 | u8 fctl; /* bfa_trunk_link_fctl_t */ | |
297 | u8 state; /* bfa_trunk_link_state_t */ | |
298 | u8 speed; /* bfa_port_speed_t */ | |
299 | u8 rsvd; | |
50444a34 | 300 | __be32 deskew; |
a36c61f9 KG |
301 | }; |
302 | ||
303 | #define BFI_FCPORT_MAX_LINKS 2 | |
304 | struct bfi_fcport_trunk_scn_s { | |
305 | struct bfi_mhdr_s mh; | |
306 | u8 trunk_state; /* bfa_trunk_state_t */ | |
307 | u8 trunk_speed; /* bfa_port_speed_t */ | |
308 | u8 rsvd_a[2]; | |
309 | struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS]; | |
310 | }; | |
311 | ||
acdc79a6 | 312 | /* |
a36c61f9 KG |
313 | * fcport H2I message |
314 | */ | |
315 | union bfi_fcport_h2i_msg_u { | |
316 | struct bfi_mhdr_s *mhdr; | |
317 | struct bfi_fcport_enable_req_s *penable; | |
318 | struct bfi_fcport_req_s *pdisable; | |
319 | struct bfi_fcport_set_svc_params_req_s *psetsvcparams; | |
320 | struct bfi_fcport_req_s *pstatsget; | |
321 | struct bfi_fcport_req_s *pstatsclear; | |
322 | }; | |
323 | ||
acdc79a6 | 324 | /* |
a36c61f9 KG |
325 | * fcport I2H message |
326 | */ | |
327 | union bfi_fcport_i2h_msg_u { | |
328 | struct bfi_msg_s *msg; | |
329 | struct bfi_fcport_rsp_s *penable_rsp; | |
330 | struct bfi_fcport_rsp_s *pdisable_rsp; | |
331 | struct bfi_fcport_rsp_s *psetsvcparams_rsp; | |
332 | struct bfi_fcport_rsp_s *pstatsget_rsp; | |
333 | struct bfi_fcport_rsp_s *pstatsclear_rsp; | |
334 | struct bfi_fcport_event_s *event; | |
335 | struct bfi_fcport_trunk_scn_s *trunk_scn; | |
336 | }; | |
337 | ||
338 | enum bfi_fcxp_h2i { | |
339 | BFI_FCXP_H2I_SEND_REQ = 1, | |
340 | }; | |
341 | ||
342 | enum bfi_fcxp_i2h { | |
343 | BFI_FCXP_I2H_SEND_RSP = BFA_I2HM(1), | |
344 | }; | |
345 | ||
346 | #define BFA_FCXP_MAX_SGES 2 | |
347 | ||
acdc79a6 | 348 | /* |
a36c61f9 KG |
349 | * FCXP send request structure |
350 | */ | |
351 | struct bfi_fcxp_send_req_s { | |
352 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 M |
353 | __be16 fcxp_tag; /* driver request tag */ |
354 | __be16 max_frmsz; /* max send frame size */ | |
355 | __be16 vf_id; /* vsan tag if applicable */ | |
a36c61f9 KG |
356 | u16 rport_fw_hndl; /* FW Handle for the remote port */ |
357 | u8 class; /* FC class used for req/rsp */ | |
358 | u8 rsp_timeout; /* timeout in secs, 0-no response */ | |
359 | u8 cts; /* continue sequence */ | |
3fd45980 | 360 | u8 lp_fwtag; /* lport tag */ |
a36c61f9 | 361 | struct fchs_s fchs; /* request FC header structure */ |
50444a34 M |
362 | __be32 req_len; /* request payload length */ |
363 | __be32 rsp_maxlen; /* max response length expected */ | |
85ce928d KG |
364 | struct bfi_alen_s req_alen; /* request buffer */ |
365 | struct bfi_alen_s rsp_alen; /* response buffer */ | |
a36c61f9 KG |
366 | }; |
367 | ||
acdc79a6 | 368 | /* |
a36c61f9 KG |
369 | * FCXP send response structure |
370 | */ | |
371 | struct bfi_fcxp_send_rsp_s { | |
372 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 373 | __be16 fcxp_tag; /* send request tag */ |
a36c61f9 KG |
374 | u8 req_status; /* request status */ |
375 | u8 rsvd; | |
50444a34 M |
376 | __be32 rsp_len; /* actual response length */ |
377 | __be32 residue_len; /* residual response length */ | |
a36c61f9 KG |
378 | struct fchs_s fchs; /* response FC header structure */ |
379 | }; | |
380 | ||
381 | enum bfi_uf_h2i { | |
382 | BFI_UF_H2I_BUF_POST = 1, | |
383 | }; | |
384 | ||
385 | enum bfi_uf_i2h { | |
386 | BFI_UF_I2H_FRM_RCVD = BFA_I2HM(1), | |
387 | }; | |
388 | ||
389 | #define BFA_UF_MAX_SGES 2 | |
390 | ||
391 | struct bfi_uf_buf_post_s { | |
392 | struct bfi_mhdr_s mh; /* Common msg header */ | |
393 | u16 buf_tag; /* buffer tag */ | |
50444a34 | 394 | __be16 buf_len; /* total buffer length */ |
85ce928d | 395 | struct bfi_alen_s alen; /* buffer address/len pair */ |
a36c61f9 KG |
396 | }; |
397 | ||
398 | struct bfi_uf_frm_rcvd_s { | |
399 | struct bfi_mhdr_s mh; /* Common msg header */ | |
400 | u16 buf_tag; /* buffer tag */ | |
401 | u16 rsvd; | |
402 | u16 frm_len; /* received frame length */ | |
403 | u16 xfr_len; /* tranferred length */ | |
404 | }; | |
405 | ||
406 | enum bfi_lps_h2i_msgs { | |
407 | BFI_LPS_H2I_LOGIN_REQ = 1, | |
408 | BFI_LPS_H2I_LOGOUT_REQ = 2, | |
b704495c | 409 | BFI_LPS_H2I_N2N_PID_REQ = 3, |
a36c61f9 KG |
410 | }; |
411 | ||
412 | enum bfi_lps_i2h_msgs { | |
43ffdf4d KG |
413 | BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1), |
414 | BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2), | |
415 | BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3), | |
a36c61f9 KG |
416 | }; |
417 | ||
418 | struct bfi_lps_login_req_s { | |
419 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 420 | u8 bfa_tag; |
a36c61f9 | 421 | u8 alpa; |
50444a34 | 422 | __be16 pdu_size; |
a36c61f9 KG |
423 | wwn_t pwwn; |
424 | wwn_t nwwn; | |
425 | u8 fdisc; | |
426 | u8 auth_en; | |
dd5aaf45 | 427 | u8 lps_role; |
be540a99 | 428 | u8 bb_scn; |
e6826c96 | 429 | u32 vvl_flag; |
a36c61f9 KG |
430 | }; |
431 | ||
432 | struct bfi_lps_login_rsp_s { | |
433 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 434 | u8 fw_tag; |
a36c61f9 KG |
435 | u8 status; |
436 | u8 lsrjt_rsn; | |
437 | u8 lsrjt_expl; | |
438 | wwn_t port_name; | |
439 | wwn_t node_name; | |
50444a34 | 440 | __be16 bb_credit; |
a36c61f9 KG |
441 | u8 f_port; |
442 | u8 npiv_en; | |
443 | u32 lp_pid:24; | |
444 | u32 auth_req:8; | |
445 | mac_t lp_mac; | |
446 | mac_t fcf_mac; | |
447 | u8 ext_status; | |
448 | u8 brcd_switch; /* attached peer is brcd switch */ | |
3fd45980 | 449 | u8 bfa_tag; |
bbe37a67 | 450 | u8 rsvd; |
a36c61f9 KG |
451 | }; |
452 | ||
453 | struct bfi_lps_logout_req_s { | |
454 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 455 | u8 fw_tag; |
a36c61f9 KG |
456 | u8 rsvd[3]; |
457 | wwn_t port_name; | |
458 | }; | |
459 | ||
460 | struct bfi_lps_logout_rsp_s { | |
461 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 462 | u8 bfa_tag; |
a36c61f9 KG |
463 | u8 status; |
464 | u8 rsvd[2]; | |
465 | }; | |
466 | ||
467 | struct bfi_lps_cvl_event_s { | |
468 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 469 | u8 bfa_tag; |
a36c61f9 KG |
470 | u8 rsvd[3]; |
471 | }; | |
472 | ||
b704495c KG |
473 | struct bfi_lps_n2n_pid_req_s { |
474 | struct bfi_mhdr_s mh; /* common msg header */ | |
3fd45980 | 475 | u8 fw_tag; |
b704495c KG |
476 | u32 lp_pid:24; |
477 | }; | |
478 | ||
a36c61f9 KG |
479 | union bfi_lps_h2i_msg_u { |
480 | struct bfi_mhdr_s *msg; | |
481 | struct bfi_lps_login_req_s *login_req; | |
482 | struct bfi_lps_logout_req_s *logout_req; | |
b704495c | 483 | struct bfi_lps_n2n_pid_req_s *n2n_pid_req; |
a36c61f9 KG |
484 | }; |
485 | ||
486 | union bfi_lps_i2h_msg_u { | |
487 | struct bfi_msg_s *msg; | |
488 | struct bfi_lps_login_rsp_s *login_rsp; | |
489 | struct bfi_lps_logout_rsp_s *logout_rsp; | |
490 | struct bfi_lps_cvl_event_s *cvl_event; | |
491 | }; | |
492 | ||
493 | enum bfi_rport_h2i_msgs { | |
494 | BFI_RPORT_H2I_CREATE_REQ = 1, | |
495 | BFI_RPORT_H2I_DELETE_REQ = 2, | |
496 | BFI_RPORT_H2I_SET_SPEED_REQ = 3, | |
497 | }; | |
498 | ||
499 | enum bfi_rport_i2h_msgs { | |
500 | BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1), | |
501 | BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2), | |
502 | BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3), | |
bc0e2c2a KG |
503 | BFI_RPORT_I2H_LIP_SCN_ONLINE = BFA_I2HM(4), |
504 | BFI_RPORT_I2H_LIP_SCN_OFFLINE = BFA_I2HM(5), | |
505 | BFI_RPORT_I2H_NO_DEV = BFA_I2HM(6), | |
a36c61f9 KG |
506 | }; |
507 | ||
508 | struct bfi_rport_create_req_s { | |
509 | struct bfi_mhdr_s mh; /* common msg header */ | |
510 | u16 bfa_handle; /* host rport handle */ | |
50444a34 | 511 | __be16 max_frmsz; /* max rcv pdu size */ |
a36c61f9 | 512 | u32 pid:24, /* remote port ID */ |
3fd45980 | 513 | lp_fwtag:8; /* local port tag */ |
a36c61f9 KG |
514 | u32 local_pid:24, /* local port ID */ |
515 | cisc:8; | |
516 | u8 fc_class; /* supported FC classes */ | |
517 | u8 vf_en; /* virtual fabric enable */ | |
518 | u16 vf_id; /* virtual fabric ID */ | |
519 | }; | |
520 | ||
521 | struct bfi_rport_create_rsp_s { | |
522 | struct bfi_mhdr_s mh; /* common msg header */ | |
523 | u8 status; /* rport creation status */ | |
524 | u8 rsvd[3]; | |
525 | u16 bfa_handle; /* host rport handle */ | |
526 | u16 fw_handle; /* firmware rport handle */ | |
527 | struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */ | |
528 | }; | |
529 | ||
530 | struct bfa_rport_speed_req_s { | |
531 | struct bfi_mhdr_s mh; /* common msg header */ | |
532 | u16 fw_handle; /* firmware rport handle */ | |
533 | u8 speed; /* rport's speed via RPSC */ | |
534 | u8 rsvd; | |
535 | }; | |
536 | ||
537 | struct bfi_rport_delete_req_s { | |
538 | struct bfi_mhdr_s mh; /* common msg header */ | |
539 | u16 fw_handle; /* firmware rport handle */ | |
540 | u16 rsvd; | |
541 | }; | |
542 | ||
543 | struct bfi_rport_delete_rsp_s { | |
544 | struct bfi_mhdr_s mh; /* common msg header */ | |
545 | u16 bfa_handle; /* host rport handle */ | |
546 | u8 status; /* rport deletion status */ | |
547 | u8 rsvd; | |
548 | }; | |
549 | ||
550 | struct bfi_rport_qos_scn_s { | |
551 | struct bfi_mhdr_s mh; /* common msg header */ | |
552 | u16 bfa_handle; /* host rport handle */ | |
553 | u16 rsvd; | |
554 | struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */ | |
555 | struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */ | |
556 | }; | |
557 | ||
bc0e2c2a KG |
558 | struct bfi_rport_lip_scn_s { |
559 | struct bfi_mhdr_s mh; /*!< common msg header */ | |
560 | u16 bfa_handle; /*!< host rport handle */ | |
561 | u8 status; /*!< scn online status */ | |
562 | u8 rsvd; | |
563 | struct bfa_fcport_loop_info_s loop_info; | |
564 | }; | |
565 | ||
a36c61f9 KG |
566 | union bfi_rport_h2i_msg_u { |
567 | struct bfi_msg_s *msg; | |
568 | struct bfi_rport_create_req_s *create_req; | |
569 | struct bfi_rport_delete_req_s *delete_req; | |
570 | struct bfi_rport_speed_req_s *speed_req; | |
571 | }; | |
572 | ||
573 | union bfi_rport_i2h_msg_u { | |
574 | struct bfi_msg_s *msg; | |
575 | struct bfi_rport_create_rsp_s *create_rsp; | |
576 | struct bfi_rport_delete_rsp_s *delete_rsp; | |
577 | struct bfi_rport_qos_scn_s *qos_scn_evt; | |
bc0e2c2a | 578 | struct bfi_rport_lip_scn_s *lip_scn; |
a36c61f9 KG |
579 | }; |
580 | ||
581 | /* | |
582 | * Initiator mode I-T nexus interface defines. | |
583 | */ | |
584 | ||
dd5aaf45 KG |
585 | enum bfi_itn_h2i { |
586 | BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */ | |
587 | BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */ | |
a36c61f9 KG |
588 | }; |
589 | ||
dd5aaf45 KG |
590 | enum bfi_itn_i2h { |
591 | BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1), | |
592 | BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2), | |
593 | BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3), | |
a36c61f9 KG |
594 | }; |
595 | ||
dd5aaf45 | 596 | struct bfi_itn_create_req_s { |
a36c61f9 KG |
597 | struct bfi_mhdr_s mh; /* common msg header */ |
598 | u16 fw_handle; /* f/w handle for itnim */ | |
599 | u8 class; /* FC class for IO */ | |
600 | u8 seq_rec; /* sequence recovery support */ | |
601 | u8 msg_no; /* seq id of the msg */ | |
dd5aaf45 | 602 | u8 role; |
a36c61f9 KG |
603 | }; |
604 | ||
dd5aaf45 | 605 | struct bfi_itn_create_rsp_s { |
a36c61f9 KG |
606 | struct bfi_mhdr_s mh; /* common msg header */ |
607 | u16 bfa_handle; /* bfa handle for itnim */ | |
608 | u8 status; /* fcp request status */ | |
609 | u8 seq_id; /* seq id of the msg */ | |
610 | }; | |
611 | ||
dd5aaf45 | 612 | struct bfi_itn_delete_req_s { |
a36c61f9 KG |
613 | struct bfi_mhdr_s mh; /* common msg header */ |
614 | u16 fw_handle; /* f/w itnim handle */ | |
615 | u8 seq_id; /* seq id of the msg */ | |
616 | u8 rsvd; | |
617 | }; | |
618 | ||
dd5aaf45 | 619 | struct bfi_itn_delete_rsp_s { |
a36c61f9 KG |
620 | struct bfi_mhdr_s mh; /* common msg header */ |
621 | u16 bfa_handle; /* bfa handle for itnim */ | |
622 | u8 status; /* fcp request status */ | |
623 | u8 seq_id; /* seq id of the msg */ | |
624 | }; | |
625 | ||
dd5aaf45 | 626 | struct bfi_itn_sler_event_s { |
a36c61f9 KG |
627 | struct bfi_mhdr_s mh; /* common msg header */ |
628 | u16 bfa_handle; /* bfa handle for itnim */ | |
629 | u16 rsvd; | |
630 | }; | |
631 | ||
dd5aaf45 KG |
632 | union bfi_itn_h2i_msg_u { |
633 | struct bfi_itn_create_req_s *create_req; | |
634 | struct bfi_itn_delete_req_s *delete_req; | |
a36c61f9 KG |
635 | struct bfi_msg_s *msg; |
636 | }; | |
637 | ||
dd5aaf45 KG |
638 | union bfi_itn_i2h_msg_u { |
639 | struct bfi_itn_create_rsp_s *create_rsp; | |
640 | struct bfi_itn_delete_rsp_s *delete_rsp; | |
641 | struct bfi_itn_sler_event_s *sler_event; | |
a36c61f9 KG |
642 | struct bfi_msg_s *msg; |
643 | }; | |
644 | ||
645 | /* | |
646 | * Initiator mode IO interface defines. | |
647 | */ | |
648 | ||
649 | enum bfi_ioim_h2i { | |
650 | BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */ | |
651 | BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */ | |
652 | }; | |
653 | ||
654 | enum bfi_ioim_i2h { | |
655 | BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */ | |
656 | BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */ | |
657 | }; | |
658 | ||
acdc79a6 | 659 | /* |
a36c61f9 KG |
660 | * IO command DIF info |
661 | */ | |
662 | struct bfi_ioim_dif_s { | |
663 | u32 dif_info[4]; | |
664 | }; | |
665 | ||
acdc79a6 | 666 | /* |
a36c61f9 KG |
667 | * FCP IO messages overview |
668 | * | |
669 | * @note | |
670 | * - Max CDB length supported is 64 bytes. | |
671 | * - SCSI Linked commands and SCSI bi-directional Commands not | |
672 | * supported. | |
673 | * | |
674 | */ | |
675 | struct bfi_ioim_req_s { | |
676 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 677 | __be16 io_tag; /* I/O tag */ |
a36c61f9 KG |
678 | u16 rport_hdl; /* itnim/rport firmware handle */ |
679 | struct fcp_cmnd_s cmnd; /* IO request info */ | |
680 | ||
acdc79a6 | 681 | /* |
a36c61f9 KG |
682 | * SG elements array within the IO request must be double word |
683 | * aligned. This aligment is required to optimize SGM setup for the IO. | |
684 | */ | |
685 | struct bfi_sge_s sges[BFI_SGE_INLINE_MAX]; | |
686 | u8 io_timeout; | |
687 | u8 dif_en; | |
688 | u8 rsvd_a[2]; | |
689 | struct bfi_ioim_dif_s dif; | |
690 | }; | |
691 | ||
acdc79a6 | 692 | /* |
a36c61f9 KG |
693 | * This table shows various IO status codes from firmware and their |
694 | * meaning. Host driver can use these status codes to further process | |
695 | * IO completions. | |
696 | * | |
697 | * BFI_IOIM_STS_OK : IO completed with error free SCSI & | |
698 | * transport status. | |
699 | * io-tag can be reused. | |
700 | * | |
701 | * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error. | |
702 | * - io-tag can be reused. | |
703 | * | |
704 | * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to | |
705 | * host request. | |
706 | * - io-tag cannot be reused yet. | |
707 | * | |
708 | * BFI_IOIM_STS_ABORTED : IO was aborted successfully | |
709 | * internally by f/w. | |
710 | * - io-tag cannot be reused yet. | |
711 | * | |
712 | * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening | |
713 | * in the firmware and | |
714 | * - io-tag cannot be reused yet. | |
715 | * | |
716 | * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO | |
717 | * with sequence level error | |
718 | * logic and hence host needs to retry | |
719 | * this IO with a different IO tag | |
720 | * - io-tag cannot be used yet. | |
721 | * | |
722 | * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host | |
723 | * is required because 2 consecutive ABTS | |
724 | * timedout and host needs logout and | |
725 | * re-login with the target | |
726 | * - io-tag cannot be used yet. | |
727 | * | |
728 | * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good, | |
729 | * but the data tranferred is less than | |
730 | * the fcp data length in the command. | |
731 | * ex. SCSI INQUIRY where transferred | |
732 | * data length and residue count in FCP | |
733 | * response accounts for total fcp-dl | |
734 | * - io-tag can be reused. | |
735 | * | |
736 | * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good, | |
737 | * but the data transerred is more than | |
738 | * fcp data length in the command. ex. | |
739 | * TAPE IOs where blocks can of unequal | |
740 | * lengths. | |
741 | * - io-tag can be reused. | |
742 | * | |
743 | * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag | |
744 | * during abort process | |
745 | * - io-tag can be reused. | |
746 | * | |
747 | * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error. | |
748 | * ex target sent more data than | |
749 | * requested, or there was data frame | |
750 | * loss and other reasons | |
751 | * - io-tag cannot be used yet. | |
752 | * | |
753 | * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF | |
754 | * CRC err or Ref Tag err or App tag err. | |
755 | * - io-tag can be reused. | |
756 | * | |
757 | * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task | |
758 | * Management command from the host | |
759 | * - io-tag can be reused. | |
760 | * | |
761 | * BFI_IOIM_STS_UTAG : Firmware does not know about this | |
762 | * io_tag. | |
763 | * - io-tag can be reused. | |
764 | */ | |
765 | enum bfi_ioim_status { | |
766 | BFI_IOIM_STS_OK = 0, | |
767 | BFI_IOIM_STS_HOST_ABORTED = 1, | |
768 | BFI_IOIM_STS_ABORTED = 2, | |
769 | BFI_IOIM_STS_TIMEDOUT = 3, | |
770 | BFI_IOIM_STS_RES_FREE = 4, | |
771 | BFI_IOIM_STS_SQER_NEEDED = 5, | |
772 | BFI_IOIM_STS_PROTO_ERR = 6, | |
773 | BFI_IOIM_STS_UTAG = 7, | |
774 | BFI_IOIM_STS_PATHTOV = 8, | |
775 | }; | |
776 | ||
acdc79a6 | 777 | /* |
a36c61f9 KG |
778 | * I/O response message |
779 | */ | |
780 | struct bfi_ioim_rsp_s { | |
781 | struct bfi_mhdr_s mh; /* common msg header */ | |
50444a34 | 782 | __be16 io_tag; /* completed IO tag */ |
a36c61f9 KG |
783 | u16 bfa_rport_hndl; /* releated rport handle */ |
784 | u8 io_status; /* IO completion status */ | |
785 | u8 reuse_io_tag; /* IO tag can be reused */ | |
786 | u16 abort_tag; /* host abort request tag */ | |
787 | u8 scsi_status; /* scsi status from target */ | |
788 | u8 sns_len; /* scsi sense length */ | |
789 | u8 resid_flags; /* IO residue flags */ | |
790 | u8 rsvd_a; | |
50444a34 | 791 | __be32 residue; /* IO residual length in bytes */ |
a36c61f9 KG |
792 | u32 rsvd_b[3]; |
793 | }; | |
794 | ||
795 | struct bfi_ioim_abort_req_s { | |
796 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 797 | __be16 io_tag; /* I/O tag */ |
a36c61f9 KG |
798 | u16 abort_tag; /* unique request tag */ |
799 | }; | |
800 | ||
801 | /* | |
802 | * Initiator mode task management command interface defines. | |
803 | */ | |
804 | ||
805 | enum bfi_tskim_h2i { | |
806 | BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */ | |
807 | BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */ | |
808 | }; | |
809 | ||
810 | enum bfi_tskim_i2h { | |
811 | BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1), | |
812 | }; | |
813 | ||
814 | struct bfi_tskim_req_s { | |
815 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 816 | __be16 tsk_tag; /* task management tag */ |
a36c61f9 | 817 | u16 itn_fhdl; /* itn firmware handle */ |
f314878a | 818 | struct scsi_lun lun; /* LU number */ |
a36c61f9 KG |
819 | u8 tm_flags; /* see enum fcp_tm_cmnd */ |
820 | u8 t_secs; /* Timeout value in seconds */ | |
821 | u8 rsvd[2]; | |
822 | }; | |
823 | ||
824 | struct bfi_tskim_abortreq_s { | |
825 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 826 | __be16 tsk_tag; /* task management tag */ |
a36c61f9 KG |
827 | u16 rsvd; |
828 | }; | |
829 | ||
830 | enum bfi_tskim_status { | |
831 | /* | |
832 | * Following are FCP-4 spec defined status codes, | |
833 | * **DO NOT CHANGE THEM ** | |
834 | */ | |
835 | BFI_TSKIM_STS_OK = 0, | |
836 | BFI_TSKIM_STS_NOT_SUPP = 4, | |
837 | BFI_TSKIM_STS_FAILED = 5, | |
838 | ||
acdc79a6 | 839 | /* |
a36c61f9 KG |
840 | * Defined by BFA |
841 | */ | |
842 | BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */ | |
843 | BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */ | |
1306e31d | 844 | BFI_TSKIM_STS_UTAG = 12, /* unknown tag for request */ |
a36c61f9 KG |
845 | }; |
846 | ||
847 | struct bfi_tskim_rsp_s { | |
848 | struct bfi_mhdr_s mh; /* Common msg header */ | |
50444a34 | 849 | __be16 tsk_tag; /* task mgmt cmnd tag */ |
a36c61f9 KG |
850 | u8 tsk_status; /* @ref bfi_tskim_status */ |
851 | u8 rsvd; | |
852 | }; | |
853 | ||
854 | #pragma pack() | |
855 | ||
11189208 KG |
856 | /* |
857 | * Crossbow PCI MSI-X vector defines | |
858 | */ | |
859 | enum { | |
860 | BFI_MSIX_CPE_QMIN_CB = 0, | |
861 | BFI_MSIX_CPE_QMAX_CB = 7, | |
862 | BFI_MSIX_RME_QMIN_CB = 8, | |
863 | BFI_MSIX_RME_QMAX_CB = 15, | |
864 | BFI_MSIX_CB_MAX = 22, | |
865 | }; | |
866 | ||
867 | /* | |
868 | * Catapult FC PCI MSI-X vector defines | |
869 | */ | |
870 | enum { | |
871 | BFI_MSIX_LPU_ERR_CT = 0, | |
872 | BFI_MSIX_CPE_QMIN_CT = 1, | |
873 | BFI_MSIX_CPE_QMAX_CT = 4, | |
874 | BFI_MSIX_RME_QMIN_CT = 5, | |
875 | BFI_MSIX_RME_QMAX_CT = 8, | |
876 | BFI_MSIX_CT_MAX = 9, | |
877 | }; | |
878 | ||
a36c61f9 | 879 | #endif /* __BFI_MS_H__ */ |