blob: 263631dcfa7cce2309e9e06f8224e8390c5acba9 [file] [log] [blame]
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001/*
2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
5 *
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 */
17
18#ifndef __BFI_MS_H__
19#define __BFI_MS_H__
20
21#include "bfi.h"
22#include "bfa_fc.h"
23#include "bfa_defs_svc.h"
24
25#pragma pack(1)
26
27enum bfi_iocfc_h2i_msgs {
28 BFI_IOCFC_H2I_CFG_REQ = 1,
29 BFI_IOCFC_H2I_SET_INTR_REQ = 2,
30 BFI_IOCFC_H2I_UPDATEQ_REQ = 3,
31};
32
33enum bfi_iocfc_i2h_msgs {
34 BFI_IOCFC_I2H_CFG_REPLY = BFA_I2HM(1),
35 BFI_IOCFC_I2H_UPDATEQ_RSP = BFA_I2HM(3),
36};
37
38struct bfi_iocfc_cfg_s {
39 u8 num_cqs; /* Number of CQs to be used */
40 u8 sense_buf_len; /* SCSI sense length */
41 u16 rsvd_1;
42 u32 endian_sig; /* endian signature of host */
Krishna Gudipatie2187d72011-06-13 15:53:58 -070043 __be16 num_ioim_reqs;
44 __be16 num_fwtio_reqs;
45 u8 rsvd[4];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070046
Jing Huangacdc79a2010-10-18 17:15:55 -070047 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070048 * Request and response circular queue base addresses, size and
49 * shadow index pointers.
50 */
51 union bfi_addr_u req_cq_ba[BFI_IOC_MAX_CQS];
52 union bfi_addr_u req_shadow_ci[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080053 __be16 req_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070054 union bfi_addr_u rsp_cq_ba[BFI_IOC_MAX_CQS];
55 union bfi_addr_u rsp_shadow_pi[BFI_IOC_MAX_CQS];
Maggie50444a32010-11-29 18:26:32 -080056 __be16 rsp_cq_elems[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070057
58 union bfi_addr_u stats_addr; /* DMA-able address for stats */
59 union bfi_addr_u cfgrsp_addr; /* config response dma address */
60 union bfi_addr_u ioim_snsbase; /* IO sense buffer base address */
61 struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
62};
63
Jing Huangacdc79a2010-10-18 17:15:55 -070064/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070065 * Boot target wwn information for this port. This contains either the stored
66 * or discovered boot target port wwns for the port.
67 */
68struct bfi_iocfc_bootwwns {
69 wwn_t wwn[BFA_BOOT_BOOTLUN_MAX];
70 u8 nwwns;
71 u8 rsvd[7];
72};
73
Krishna Gudipati11189202011-06-13 15:50:35 -070074/**
75 * Queue configuration response from firmware
76 */
77struct bfi_iocfc_qreg_s {
78 u32 cpe_q_ci_off[BFI_IOC_MAX_CQS];
79 u32 cpe_q_pi_off[BFI_IOC_MAX_CQS];
80 u32 cpe_qctl_off[BFI_IOC_MAX_CQS];
81 u32 rme_q_ci_off[BFI_IOC_MAX_CQS];
82 u32 rme_q_pi_off[BFI_IOC_MAX_CQS];
83 u32 rme_qctl_off[BFI_IOC_MAX_CQS];
84};
85
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070086struct bfi_iocfc_cfgrsp_s {
87 struct bfa_iocfc_fwcfg_s fwcfg;
88 struct bfa_iocfc_intr_attr_s intr_attr;
89 struct bfi_iocfc_bootwwns bootwwns;
90 struct bfi_pbc_s pbc_cfg;
Krishna Gudipati11189202011-06-13 15:50:35 -070091 struct bfi_iocfc_qreg_s qreg;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070092};
93
Jing Huangacdc79a2010-10-18 17:15:55 -070094/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070095 * BFI_IOCFC_H2I_CFG_REQ message
96 */
97struct bfi_iocfc_cfg_req_s {
98 struct bfi_mhdr_s mh;
99 union bfi_addr_u ioc_cfg_dma_addr;
100};
101
102
Jing Huangacdc79a2010-10-18 17:15:55 -0700103/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700104 * BFI_IOCFC_I2H_CFG_REPLY message
105 */
106struct bfi_iocfc_cfg_reply_s {
107 struct bfi_mhdr_s mh; /* Common msg header */
108 u8 cfg_success; /* cfg reply status */
109 u8 lpu_bm; /* LPUs assigned for this IOC */
110 u8 rsvd[2];
111};
112
113
Jing Huangacdc79a2010-10-18 17:15:55 -0700114/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700115 * BFI_IOCFC_H2I_SET_INTR_REQ message
116 */
117struct bfi_iocfc_set_intr_req_s {
118 struct bfi_mhdr_s mh; /* common msg header */
119 u8 coalesce; /* enable intr coalescing */
120 u8 rsvd[3];
Maggie50444a32010-11-29 18:26:32 -0800121 __be16 delay; /* delay timer 0..1125us */
122 __be16 latency; /* latency timer 0..225us */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700123};
124
125
Jing Huangacdc79a2010-10-18 17:15:55 -0700126/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700127 * BFI_IOCFC_H2I_UPDATEQ_REQ message
128 */
129struct bfi_iocfc_updateq_req_s {
130 struct bfi_mhdr_s mh; /* common msg header */
131 u32 reqq_ba; /* reqq base addr */
132 u32 rspq_ba; /* rspq base addr */
133 u32 reqq_sci; /* reqq shadow ci */
134 u32 rspq_spi; /* rspq shadow pi */
135};
136
137
Jing Huangacdc79a2010-10-18 17:15:55 -0700138/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700139 * BFI_IOCFC_I2H_UPDATEQ_RSP message
140 */
141struct bfi_iocfc_updateq_rsp_s {
142 struct bfi_mhdr_s mh; /* common msg header */
143 u8 status; /* updateq status */
144 u8 rsvd[3];
145};
146
147
Jing Huangacdc79a2010-10-18 17:15:55 -0700148/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700149 * H2I Messages
150 */
151union bfi_iocfc_h2i_msg_u {
152 struct bfi_mhdr_s mh;
153 struct bfi_iocfc_cfg_req_s cfg_req;
154 struct bfi_iocfc_updateq_req_s updateq_req;
155 u32 mboxmsg[BFI_IOC_MSGSZ];
156};
157
158
Jing Huangacdc79a2010-10-18 17:15:55 -0700159/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700160 * I2H Messages
161 */
162union bfi_iocfc_i2h_msg_u {
163 struct bfi_mhdr_s mh;
164 struct bfi_iocfc_cfg_reply_s cfg_reply;
165 struct bfi_iocfc_updateq_rsp_s updateq_rsp;
166 u32 mboxmsg[BFI_IOC_MSGSZ];
167};
168
169
170enum bfi_fcport_h2i {
171 BFI_FCPORT_H2I_ENABLE_REQ = (1),
172 BFI_FCPORT_H2I_DISABLE_REQ = (2),
173 BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ = (3),
174 BFI_FCPORT_H2I_STATS_GET_REQ = (4),
175 BFI_FCPORT_H2I_STATS_CLEAR_REQ = (5),
176};
177
178
179enum bfi_fcport_i2h {
180 BFI_FCPORT_I2H_ENABLE_RSP = BFA_I2HM(1),
181 BFI_FCPORT_I2H_DISABLE_RSP = BFA_I2HM(2),
182 BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP = BFA_I2HM(3),
183 BFI_FCPORT_I2H_STATS_GET_RSP = BFA_I2HM(4),
184 BFI_FCPORT_I2H_STATS_CLEAR_RSP = BFA_I2HM(5),
185 BFI_FCPORT_I2H_EVENT = BFA_I2HM(6),
186 BFI_FCPORT_I2H_TRUNK_SCN = BFA_I2HM(7),
187 BFI_FCPORT_I2H_ENABLE_AEN = BFA_I2HM(8),
188 BFI_FCPORT_I2H_DISABLE_AEN = BFA_I2HM(9),
189};
190
191
Jing Huangacdc79a2010-10-18 17:15:55 -0700192/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700193 * Generic REQ type
194 */
195struct bfi_fcport_req_s {
196 struct bfi_mhdr_s mh; /* msg header */
197 u32 msgtag; /* msgtag for reply */
198};
199
Jing Huangacdc79a2010-10-18 17:15:55 -0700200/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700201 * Generic RSP type
202 */
203struct bfi_fcport_rsp_s {
204 struct bfi_mhdr_s mh; /* common msg header */
205 u8 status; /* port enable status */
206 u8 rsvd[3];
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800207 struct bfa_port_cfg_s port_cfg;/* port configuration */
208 u32 msgtag; /* msgtag for reply */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700209};
210
Jing Huangacdc79a2010-10-18 17:15:55 -0700211/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700212 * BFI_FCPORT_H2I_ENABLE_REQ
213 */
214struct bfi_fcport_enable_req_s {
215 struct bfi_mhdr_s mh; /* msg header */
216 u32 rsvd1;
217 wwn_t nwwn; /* node wwn of physical port */
218 wwn_t pwwn; /* port wwn of physical port */
219 struct bfa_port_cfg_s port_cfg; /* port configuration */
220 union bfi_addr_u stats_dma_addr; /* DMA address for stats */
221 u32 msgtag; /* msgtag for reply */
Krishna Gudipatif3a060c2010-12-13 16:16:50 -0800222 u8 use_flash_cfg; /* get prot cfg from flash */
223 u8 rsvd2[3];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700224};
225
Jing Huangacdc79a2010-10-18 17:15:55 -0700226/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700227 * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
228 */
229struct bfi_fcport_set_svc_params_req_s {
230 struct bfi_mhdr_s mh; /* msg header */
Maggie50444a32010-11-29 18:26:32 -0800231 __be16 tx_bbcredit; /* Tx credits */
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700232 u8 bb_scn; /* BB_SC FC credit recovery */
233 u8 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700234};
235
Jing Huangacdc79a2010-10-18 17:15:55 -0700236/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700237 * BFI_FCPORT_I2H_EVENT
238 */
239struct bfi_fcport_event_s {
240 struct bfi_mhdr_s mh; /* common msg header */
241 struct bfa_port_link_s link_state;
242};
243
Jing Huangacdc79a2010-10-18 17:15:55 -0700244/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700245 * BFI_FCPORT_I2H_TRUNK_SCN
246 */
247struct bfi_fcport_trunk_link_s {
248 wwn_t trunk_wwn;
249 u8 fctl; /* bfa_trunk_link_fctl_t */
250 u8 state; /* bfa_trunk_link_state_t */
251 u8 speed; /* bfa_port_speed_t */
252 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800253 __be32 deskew;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700254};
255
256#define BFI_FCPORT_MAX_LINKS 2
257struct bfi_fcport_trunk_scn_s {
258 struct bfi_mhdr_s mh;
259 u8 trunk_state; /* bfa_trunk_state_t */
260 u8 trunk_speed; /* bfa_port_speed_t */
261 u8 rsvd_a[2];
262 struct bfi_fcport_trunk_link_s tlink[BFI_FCPORT_MAX_LINKS];
263};
264
Jing Huangacdc79a2010-10-18 17:15:55 -0700265/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700266 * fcport H2I message
267 */
268union bfi_fcport_h2i_msg_u {
269 struct bfi_mhdr_s *mhdr;
270 struct bfi_fcport_enable_req_s *penable;
271 struct bfi_fcport_req_s *pdisable;
272 struct bfi_fcport_set_svc_params_req_s *psetsvcparams;
273 struct bfi_fcport_req_s *pstatsget;
274 struct bfi_fcport_req_s *pstatsclear;
275};
276
Jing Huangacdc79a2010-10-18 17:15:55 -0700277/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700278 * fcport I2H message
279 */
280union bfi_fcport_i2h_msg_u {
281 struct bfi_msg_s *msg;
282 struct bfi_fcport_rsp_s *penable_rsp;
283 struct bfi_fcport_rsp_s *pdisable_rsp;
284 struct bfi_fcport_rsp_s *psetsvcparams_rsp;
285 struct bfi_fcport_rsp_s *pstatsget_rsp;
286 struct bfi_fcport_rsp_s *pstatsclear_rsp;
287 struct bfi_fcport_event_s *event;
288 struct bfi_fcport_trunk_scn_s *trunk_scn;
289};
290
291enum bfi_fcxp_h2i {
292 BFI_FCXP_H2I_SEND_REQ = 1,
293};
294
295enum bfi_fcxp_i2h {
296 BFI_FCXP_I2H_SEND_RSP = BFA_I2HM(1),
297};
298
299#define BFA_FCXP_MAX_SGES 2
300
Jing Huangacdc79a2010-10-18 17:15:55 -0700301/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700302 * FCXP send request structure
303 */
304struct bfi_fcxp_send_req_s {
305 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800306 __be16 fcxp_tag; /* driver request tag */
307 __be16 max_frmsz; /* max send frame size */
308 __be16 vf_id; /* vsan tag if applicable */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700309 u16 rport_fw_hndl; /* FW Handle for the remote port */
310 u8 class; /* FC class used for req/rsp */
311 u8 rsp_timeout; /* timeout in secs, 0-no response */
312 u8 cts; /* continue sequence */
313 u8 lp_tag; /* lport tag */
314 struct fchs_s fchs; /* request FC header structure */
Maggie50444a32010-11-29 18:26:32 -0800315 __be32 req_len; /* request payload length */
316 __be32 rsp_maxlen; /* max response length expected */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700317 struct bfi_alen_s req_alen; /* request buffer */
318 struct bfi_alen_s rsp_alen; /* response buffer */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700319};
320
Jing Huangacdc79a2010-10-18 17:15:55 -0700321/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700322 * FCXP send response structure
323 */
324struct bfi_fcxp_send_rsp_s {
325 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800326 __be16 fcxp_tag; /* send request tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700327 u8 req_status; /* request status */
328 u8 rsvd;
Maggie50444a32010-11-29 18:26:32 -0800329 __be32 rsp_len; /* actual response length */
330 __be32 residue_len; /* residual response length */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700331 struct fchs_s fchs; /* response FC header structure */
332};
333
334enum bfi_uf_h2i {
335 BFI_UF_H2I_BUF_POST = 1,
336};
337
338enum bfi_uf_i2h {
339 BFI_UF_I2H_FRM_RCVD = BFA_I2HM(1),
340};
341
342#define BFA_UF_MAX_SGES 2
343
344struct bfi_uf_buf_post_s {
345 struct bfi_mhdr_s mh; /* Common msg header */
346 u16 buf_tag; /* buffer tag */
Maggie50444a32010-11-29 18:26:32 -0800347 __be16 buf_len; /* total buffer length */
Krishna Gudipati85ce9282011-06-13 15:39:36 -0700348 struct bfi_alen_s alen; /* buffer address/len pair */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700349};
350
351struct bfi_uf_frm_rcvd_s {
352 struct bfi_mhdr_s mh; /* Common msg header */
353 u16 buf_tag; /* buffer tag */
354 u16 rsvd;
355 u16 frm_len; /* received frame length */
356 u16 xfr_len; /* tranferred length */
357};
358
359enum bfi_lps_h2i_msgs {
360 BFI_LPS_H2I_LOGIN_REQ = 1,
361 BFI_LPS_H2I_LOGOUT_REQ = 2,
Krishna Gudipatib7044952010-12-13 16:17:42 -0800362 BFI_LPS_H2I_N2N_PID_REQ = 3,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700363};
364
365enum bfi_lps_i2h_msgs {
Krishna Gudipati43ffdf42011-06-13 15:46:21 -0700366 BFI_LPS_I2H_LOGIN_RSP = BFA_I2HM(1),
367 BFI_LPS_I2H_LOGOUT_RSP = BFA_I2HM(2),
368 BFI_LPS_I2H_CVL_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700369};
370
371struct bfi_lps_login_req_s {
372 struct bfi_mhdr_s mh; /* common msg header */
373 u8 lp_tag;
374 u8 alpa;
Maggie50444a32010-11-29 18:26:32 -0800375 __be16 pdu_size;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700376 wwn_t pwwn;
377 wwn_t nwwn;
378 u8 fdisc;
379 u8 auth_en;
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700380 u8 lps_role;
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700381 u8 bb_scn;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700382};
383
384struct bfi_lps_login_rsp_s {
385 struct bfi_mhdr_s mh; /* common msg header */
386 u8 lp_tag;
387 u8 status;
388 u8 lsrjt_rsn;
389 u8 lsrjt_expl;
390 wwn_t port_name;
391 wwn_t node_name;
Maggie50444a32010-11-29 18:26:32 -0800392 __be16 bb_credit;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700393 u8 f_port;
394 u8 npiv_en;
395 u32 lp_pid:24;
396 u32 auth_req:8;
397 mac_t lp_mac;
398 mac_t fcf_mac;
399 u8 ext_status;
400 u8 brcd_switch; /* attached peer is brcd switch */
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700401 u8 bb_scn; /* atatched port's bb_scn */
402 u8 resvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700403};
404
405struct bfi_lps_logout_req_s {
406 struct bfi_mhdr_s mh; /* common msg header */
407 u8 lp_tag;
408 u8 rsvd[3];
409 wwn_t port_name;
410};
411
412struct bfi_lps_logout_rsp_s {
413 struct bfi_mhdr_s mh; /* common msg header */
414 u8 lp_tag;
415 u8 status;
416 u8 rsvd[2];
417};
418
419struct bfi_lps_cvl_event_s {
420 struct bfi_mhdr_s mh; /* common msg header */
421 u8 lp_tag;
422 u8 rsvd[3];
423};
424
Krishna Gudipatib7044952010-12-13 16:17:42 -0800425struct bfi_lps_n2n_pid_req_s {
426 struct bfi_mhdr_s mh; /* common msg header */
427 u8 lp_tag;
428 u32 lp_pid:24;
429};
430
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700431union bfi_lps_h2i_msg_u {
432 struct bfi_mhdr_s *msg;
433 struct bfi_lps_login_req_s *login_req;
434 struct bfi_lps_logout_req_s *logout_req;
Krishna Gudipatib7044952010-12-13 16:17:42 -0800435 struct bfi_lps_n2n_pid_req_s *n2n_pid_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700436};
437
438union bfi_lps_i2h_msg_u {
439 struct bfi_msg_s *msg;
440 struct bfi_lps_login_rsp_s *login_rsp;
441 struct bfi_lps_logout_rsp_s *logout_rsp;
442 struct bfi_lps_cvl_event_s *cvl_event;
443};
444
445enum bfi_rport_h2i_msgs {
446 BFI_RPORT_H2I_CREATE_REQ = 1,
447 BFI_RPORT_H2I_DELETE_REQ = 2,
448 BFI_RPORT_H2I_SET_SPEED_REQ = 3,
449};
450
451enum bfi_rport_i2h_msgs {
452 BFI_RPORT_I2H_CREATE_RSP = BFA_I2HM(1),
453 BFI_RPORT_I2H_DELETE_RSP = BFA_I2HM(2),
454 BFI_RPORT_I2H_QOS_SCN = BFA_I2HM(3),
455};
456
457struct bfi_rport_create_req_s {
458 struct bfi_mhdr_s mh; /* common msg header */
459 u16 bfa_handle; /* host rport handle */
Maggie50444a32010-11-29 18:26:32 -0800460 __be16 max_frmsz; /* max rcv pdu size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700461 u32 pid:24, /* remote port ID */
462 lp_tag:8; /* local port tag */
463 u32 local_pid:24, /* local port ID */
464 cisc:8;
465 u8 fc_class; /* supported FC classes */
466 u8 vf_en; /* virtual fabric enable */
467 u16 vf_id; /* virtual fabric ID */
468};
469
470struct bfi_rport_create_rsp_s {
471 struct bfi_mhdr_s mh; /* common msg header */
472 u8 status; /* rport creation status */
473 u8 rsvd[3];
474 u16 bfa_handle; /* host rport handle */
475 u16 fw_handle; /* firmware rport handle */
476 struct bfa_rport_qos_attr_s qos_attr; /* QoS Attributes */
477};
478
479struct bfa_rport_speed_req_s {
480 struct bfi_mhdr_s mh; /* common msg header */
481 u16 fw_handle; /* firmware rport handle */
482 u8 speed; /* rport's speed via RPSC */
483 u8 rsvd;
484};
485
486struct bfi_rport_delete_req_s {
487 struct bfi_mhdr_s mh; /* common msg header */
488 u16 fw_handle; /* firmware rport handle */
489 u16 rsvd;
490};
491
492struct bfi_rport_delete_rsp_s {
493 struct bfi_mhdr_s mh; /* common msg header */
494 u16 bfa_handle; /* host rport handle */
495 u8 status; /* rport deletion status */
496 u8 rsvd;
497};
498
499struct bfi_rport_qos_scn_s {
500 struct bfi_mhdr_s mh; /* common msg header */
501 u16 bfa_handle; /* host rport handle */
502 u16 rsvd;
503 struct bfa_rport_qos_attr_s old_qos_attr; /* Old QoS Attributes */
504 struct bfa_rport_qos_attr_s new_qos_attr; /* New QoS Attributes */
505};
506
507union bfi_rport_h2i_msg_u {
508 struct bfi_msg_s *msg;
509 struct bfi_rport_create_req_s *create_req;
510 struct bfi_rport_delete_req_s *delete_req;
511 struct bfi_rport_speed_req_s *speed_req;
512};
513
514union bfi_rport_i2h_msg_u {
515 struct bfi_msg_s *msg;
516 struct bfi_rport_create_rsp_s *create_rsp;
517 struct bfi_rport_delete_rsp_s *delete_rsp;
518 struct bfi_rport_qos_scn_s *qos_scn_evt;
519};
520
521/*
522 * Initiator mode I-T nexus interface defines.
523 */
524
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700525enum bfi_itn_h2i {
526 BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */
527 BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700528};
529
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700530enum bfi_itn_i2h {
531 BFI_ITN_I2H_CREATE_RSP = BFA_I2HM(1),
532 BFI_ITN_I2H_DELETE_RSP = BFA_I2HM(2),
533 BFI_ITN_I2H_SLER_EVENT = BFA_I2HM(3),
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700534};
535
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700536struct bfi_itn_create_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700537 struct bfi_mhdr_s mh; /* common msg header */
538 u16 fw_handle; /* f/w handle for itnim */
539 u8 class; /* FC class for IO */
540 u8 seq_rec; /* sequence recovery support */
541 u8 msg_no; /* seq id of the msg */
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700542 u8 role;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700543};
544
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700545struct bfi_itn_create_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700546 struct bfi_mhdr_s mh; /* common msg header */
547 u16 bfa_handle; /* bfa handle for itnim */
548 u8 status; /* fcp request status */
549 u8 seq_id; /* seq id of the msg */
550};
551
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700552struct bfi_itn_delete_req_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700553 struct bfi_mhdr_s mh; /* common msg header */
554 u16 fw_handle; /* f/w itnim handle */
555 u8 seq_id; /* seq id of the msg */
556 u8 rsvd;
557};
558
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700559struct bfi_itn_delete_rsp_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700560 struct bfi_mhdr_s mh; /* common msg header */
561 u16 bfa_handle; /* bfa handle for itnim */
562 u8 status; /* fcp request status */
563 u8 seq_id; /* seq id of the msg */
564};
565
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700566struct bfi_itn_sler_event_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700567 struct bfi_mhdr_s mh; /* common msg header */
568 u16 bfa_handle; /* bfa handle for itnim */
569 u16 rsvd;
570};
571
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700572union bfi_itn_h2i_msg_u {
573 struct bfi_itn_create_req_s *create_req;
574 struct bfi_itn_delete_req_s *delete_req;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700575 struct bfi_msg_s *msg;
576};
577
Krishna Gudipatidd5aaf42011-06-13 15:51:24 -0700578union bfi_itn_i2h_msg_u {
579 struct bfi_itn_create_rsp_s *create_rsp;
580 struct bfi_itn_delete_rsp_s *delete_rsp;
581 struct bfi_itn_sler_event_s *sler_event;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700582 struct bfi_msg_s *msg;
583};
584
585/*
586 * Initiator mode IO interface defines.
587 */
588
589enum bfi_ioim_h2i {
590 BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
591 BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
592};
593
594enum bfi_ioim_i2h {
595 BFI_IOIM_I2H_IO_RSP = BFA_I2HM(1), /* non-fp IO response */
596 BFI_IOIM_I2H_IOABORT_RSP = BFA_I2HM(2), /* ABORT rsp */
597};
598
Jing Huangacdc79a2010-10-18 17:15:55 -0700599/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700600 * IO command DIF info
601 */
602struct bfi_ioim_dif_s {
603 u32 dif_info[4];
604};
605
Jing Huangacdc79a2010-10-18 17:15:55 -0700606/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700607 * FCP IO messages overview
608 *
609 * @note
610 * - Max CDB length supported is 64 bytes.
611 * - SCSI Linked commands and SCSI bi-directional Commands not
612 * supported.
613 *
614 */
615struct bfi_ioim_req_s {
616 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800617 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700618 u16 rport_hdl; /* itnim/rport firmware handle */
619 struct fcp_cmnd_s cmnd; /* IO request info */
620
Jing Huangacdc79a2010-10-18 17:15:55 -0700621 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700622 * SG elements array within the IO request must be double word
623 * aligned. This aligment is required to optimize SGM setup for the IO.
624 */
625 struct bfi_sge_s sges[BFI_SGE_INLINE_MAX];
626 u8 io_timeout;
627 u8 dif_en;
628 u8 rsvd_a[2];
629 struct bfi_ioim_dif_s dif;
630};
631
Jing Huangacdc79a2010-10-18 17:15:55 -0700632/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700633 * This table shows various IO status codes from firmware and their
634 * meaning. Host driver can use these status codes to further process
635 * IO completions.
636 *
637 * BFI_IOIM_STS_OK : IO completed with error free SCSI &
638 * transport status.
639 * io-tag can be reused.
640 *
641 * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error.
642 * - io-tag can be reused.
643 *
644 * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to
645 * host request.
646 * - io-tag cannot be reused yet.
647 *
648 * BFI_IOIM_STS_ABORTED : IO was aborted successfully
649 * internally by f/w.
650 * - io-tag cannot be reused yet.
651 *
652 * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening
653 * in the firmware and
654 * - io-tag cannot be reused yet.
655 *
656 * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO
657 * with sequence level error
658 * logic and hence host needs to retry
659 * this IO with a different IO tag
660 * - io-tag cannot be used yet.
661 *
662 * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host
663 * is required because 2 consecutive ABTS
664 * timedout and host needs logout and
665 * re-login with the target
666 * - io-tag cannot be used yet.
667 *
668 * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good,
669 * but the data tranferred is less than
670 * the fcp data length in the command.
671 * ex. SCSI INQUIRY where transferred
672 * data length and residue count in FCP
673 * response accounts for total fcp-dl
674 * - io-tag can be reused.
675 *
676 * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good,
677 * but the data transerred is more than
678 * fcp data length in the command. ex.
679 * TAPE IOs where blocks can of unequal
680 * lengths.
681 * - io-tag can be reused.
682 *
683 * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag
684 * during abort process
685 * - io-tag can be reused.
686 *
687 * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error.
688 * ex target sent more data than
689 * requested, or there was data frame
690 * loss and other reasons
691 * - io-tag cannot be used yet.
692 *
693 * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF
694 * CRC err or Ref Tag err or App tag err.
695 * - io-tag can be reused.
696 *
697 * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task
698 * Management command from the host
699 * - io-tag can be reused.
700 *
701 * BFI_IOIM_STS_UTAG : Firmware does not know about this
702 * io_tag.
703 * - io-tag can be reused.
704 */
705enum bfi_ioim_status {
706 BFI_IOIM_STS_OK = 0,
707 BFI_IOIM_STS_HOST_ABORTED = 1,
708 BFI_IOIM_STS_ABORTED = 2,
709 BFI_IOIM_STS_TIMEDOUT = 3,
710 BFI_IOIM_STS_RES_FREE = 4,
711 BFI_IOIM_STS_SQER_NEEDED = 5,
712 BFI_IOIM_STS_PROTO_ERR = 6,
713 BFI_IOIM_STS_UTAG = 7,
714 BFI_IOIM_STS_PATHTOV = 8,
715};
716
717#define BFI_IOIM_SNSLEN (256)
Jing Huangacdc79a2010-10-18 17:15:55 -0700718/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700719 * I/O response message
720 */
721struct bfi_ioim_rsp_s {
722 struct bfi_mhdr_s mh; /* common msg header */
Maggie50444a32010-11-29 18:26:32 -0800723 __be16 io_tag; /* completed IO tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700724 u16 bfa_rport_hndl; /* releated rport handle */
725 u8 io_status; /* IO completion status */
726 u8 reuse_io_tag; /* IO tag can be reused */
727 u16 abort_tag; /* host abort request tag */
728 u8 scsi_status; /* scsi status from target */
729 u8 sns_len; /* scsi sense length */
730 u8 resid_flags; /* IO residue flags */
731 u8 rsvd_a;
Maggie50444a32010-11-29 18:26:32 -0800732 __be32 residue; /* IO residual length in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700733 u32 rsvd_b[3];
734};
735
736struct bfi_ioim_abort_req_s {
737 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800738 __be16 io_tag; /* I/O tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700739 u16 abort_tag; /* unique request tag */
740};
741
742/*
743 * Initiator mode task management command interface defines.
744 */
745
746enum bfi_tskim_h2i {
747 BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
748 BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
749};
750
751enum bfi_tskim_i2h {
752 BFI_TSKIM_I2H_TM_RSP = BFA_I2HM(1),
753};
754
755struct bfi_tskim_req_s {
756 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800757 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700758 u16 itn_fhdl; /* itn firmware handle */
Maggie Zhangf3148782010-12-09 19:11:39 -0800759 struct scsi_lun lun; /* LU number */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700760 u8 tm_flags; /* see enum fcp_tm_cmnd */
761 u8 t_secs; /* Timeout value in seconds */
762 u8 rsvd[2];
763};
764
765struct bfi_tskim_abortreq_s {
766 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800767 __be16 tsk_tag; /* task management tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700768 u16 rsvd;
769};
770
771enum bfi_tskim_status {
772 /*
773 * Following are FCP-4 spec defined status codes,
774 * **DO NOT CHANGE THEM **
775 */
776 BFI_TSKIM_STS_OK = 0,
777 BFI_TSKIM_STS_NOT_SUPP = 4,
778 BFI_TSKIM_STS_FAILED = 5,
779
Jing Huangacdc79a2010-10-18 17:15:55 -0700780 /*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700781 * Defined by BFA
782 */
783 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
784 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
785};
786
787struct bfi_tskim_rsp_s {
788 struct bfi_mhdr_s mh; /* Common msg header */
Maggie50444a32010-11-29 18:26:32 -0800789 __be16 tsk_tag; /* task mgmt cmnd tag */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700790 u8 tsk_status; /* @ref bfi_tskim_status */
791 u8 rsvd;
792};
793
794#pragma pack()
795
Krishna Gudipati11189202011-06-13 15:50:35 -0700796/*
797 * Crossbow PCI MSI-X vector defines
798 */
799enum {
800 BFI_MSIX_CPE_QMIN_CB = 0,
801 BFI_MSIX_CPE_QMAX_CB = 7,
802 BFI_MSIX_RME_QMIN_CB = 8,
803 BFI_MSIX_RME_QMAX_CB = 15,
804 BFI_MSIX_CB_MAX = 22,
805};
806
807/*
808 * Catapult FC PCI MSI-X vector defines
809 */
810enum {
811 BFI_MSIX_LPU_ERR_CT = 0,
812 BFI_MSIX_CPE_QMIN_CT = 1,
813 BFI_MSIX_CPE_QMAX_CT = 4,
814 BFI_MSIX_RME_QMIN_CT = 5,
815 BFI_MSIX_RME_QMAX_CT = 8,
816 BFI_MSIX_CT_MAX = 9,
817};
818
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700819#endif /* __BFI_MS_H__ */