2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
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
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.
23 #include "bfa_defs_svc.h"
27 enum 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 BFI_IOCFC_H2I_FAA_QUERY_REQ
= 4,
32 BFI_IOCFC_H2I_ADDR_REQ
= 5,
35 enum bfi_iocfc_i2h_msgs
{
36 BFI_IOCFC_I2H_CFG_REPLY
= BFA_I2HM(1),
37 BFI_IOCFC_I2H_UPDATEQ_RSP
= BFA_I2HM(3),
38 BFI_IOCFC_I2H_FAA_QUERY_RSP
= BFA_I2HM(4),
39 BFI_IOCFC_I2H_ADDR_MSG
= BFA_I2HM(5),
42 struct bfi_iocfc_cfg_s
{
43 u8 num_cqs
; /* Number of CQs to be used */
44 u8 sense_buf_len
; /* SCSI sense length */
46 u32 endian_sig
; /* endian signature of host */
51 __be16 num_fwtio_reqs
;
55 * Request and response circular queue base addresses, size and
56 * shadow index pointers.
58 union bfi_addr_u req_cq_ba
[BFI_IOC_MAX_CQS
];
59 union bfi_addr_u req_shadow_ci
[BFI_IOC_MAX_CQS
];
60 __be16 req_cq_elems
[BFI_IOC_MAX_CQS
];
61 union bfi_addr_u rsp_cq_ba
[BFI_IOC_MAX_CQS
];
62 union bfi_addr_u rsp_shadow_pi
[BFI_IOC_MAX_CQS
];
63 __be16 rsp_cq_elems
[BFI_IOC_MAX_CQS
];
65 union bfi_addr_u stats_addr
; /* DMA-able address for stats */
66 union bfi_addr_u cfgrsp_addr
; /* config response dma address */
67 union bfi_addr_u ioim_snsbase
[BFI_IOIM_SNSBUF_SEGS
];
68 /* IO sense buf base addr segments */
69 struct bfa_iocfc_intr_attr_s intr_attr
; /* IOC interrupt attributes */
73 * Boot target wwn information for this port. This contains either the stored
74 * or discovered boot target port wwns for the port.
76 struct bfi_iocfc_bootwwns
{
77 wwn_t wwn
[BFA_BOOT_BOOTLUN_MAX
];
83 * Queue configuration response from firmware
85 struct bfi_iocfc_qreg_s
{
86 u32 cpe_q_ci_off
[BFI_IOC_MAX_CQS
];
87 u32 cpe_q_pi_off
[BFI_IOC_MAX_CQS
];
88 u32 cpe_qctl_off
[BFI_IOC_MAX_CQS
];
89 u32 rme_q_ci_off
[BFI_IOC_MAX_CQS
];
90 u32 rme_q_pi_off
[BFI_IOC_MAX_CQS
];
91 u32 rme_qctl_off
[BFI_IOC_MAX_CQS
];
92 u8 hw_qid
[BFI_IOC_MAX_CQS
];
95 struct bfi_iocfc_cfgrsp_s
{
96 struct bfa_iocfc_fwcfg_s fwcfg
;
97 struct bfa_iocfc_intr_attr_s intr_attr
;
98 struct bfi_iocfc_bootwwns bootwwns
;
99 struct bfi_pbc_s pbc_cfg
;
100 struct bfi_iocfc_qreg_s qreg
;
104 * BFI_IOCFC_H2I_CFG_REQ message
106 struct bfi_iocfc_cfg_req_s
{
107 struct bfi_mhdr_s mh
;
108 union bfi_addr_u ioc_cfg_dma_addr
;
113 * BFI_IOCFC_I2H_CFG_REPLY message
115 struct bfi_iocfc_cfg_reply_s
{
116 struct bfi_mhdr_s mh
; /* Common msg header */
117 u8 cfg_success
; /* cfg reply status */
118 u8 lpu_bm
; /* LPUs assigned for this IOC */
124 * BFI_IOCFC_H2I_SET_INTR_REQ message
126 struct bfi_iocfc_set_intr_req_s
{
127 struct bfi_mhdr_s mh
; /* common msg header */
128 u8 coalesce
; /* enable intr coalescing */
130 __be16 delay
; /* delay timer 0..1125us */
131 __be16 latency
; /* latency timer 0..225us */
136 * BFI_IOCFC_H2I_UPDATEQ_REQ message
138 struct bfi_iocfc_updateq_req_s
{
139 struct bfi_mhdr_s mh
; /* common msg header */
140 u32 reqq_ba
; /* reqq base addr */
141 u32 rspq_ba
; /* rspq base addr */
142 u32 reqq_sci
; /* reqq shadow ci */
143 u32 rspq_spi
; /* rspq shadow pi */
148 * BFI_IOCFC_I2H_UPDATEQ_RSP message
150 struct bfi_iocfc_updateq_rsp_s
{
151 struct bfi_mhdr_s mh
; /* common msg header */
152 u8 status
; /* updateq status */
160 union bfi_iocfc_h2i_msg_u
{
161 struct bfi_mhdr_s mh
;
162 struct bfi_iocfc_cfg_req_s cfg_req
;
163 struct bfi_iocfc_updateq_req_s updateq_req
;
164 u32 mboxmsg
[BFI_IOC_MSGSZ
];
171 union bfi_iocfc_i2h_msg_u
{
172 struct bfi_mhdr_s mh
;
173 struct bfi_iocfc_cfg_reply_s cfg_reply
;
174 struct bfi_iocfc_updateq_rsp_s updateq_rsp
;
175 u32 mboxmsg
[BFI_IOC_MSGSZ
];
179 * BFI_IOCFC_H2I_FAA_ENABLE_REQ BFI_IOCFC_H2I_FAA_DISABLE_REQ message
181 struct bfi_faa_en_dis_s
{
182 struct bfi_mhdr_s mh
; /* common msg header */
185 struct bfi_faa_addr_msg_s
{
186 struct bfi_mhdr_s mh
; /* common msg header */
188 wwn_t pwwn
; /* Fabric acquired PWWN */
189 wwn_t nwwn
; /* Fabric acquired PWWN */
193 * BFI_IOCFC_H2I_FAA_QUERY_REQ message
195 struct bfi_faa_query_s
{
196 struct bfi_mhdr_s mh
; /* common msg header */
197 u8 faa_status
; /* FAA status */
198 u8 addr_source
; /* PWWN source */
200 wwn_t faa
; /* Fabric acquired PWWN */
204 * BFI_IOCFC_I2H_FAA_ENABLE_RSP, BFI_IOCFC_I2H_FAA_DISABLE_RSP message
206 struct bfi_faa_en_dis_rsp_s
{
207 struct bfi_mhdr_s mh
; /* common msg header */
208 u8 status
; /* updateq status */
213 * BFI_IOCFC_I2H_FAA_QUERY_RSP message
215 #define bfi_faa_query_rsp_t struct bfi_faa_query_s
217 enum bfi_fcport_h2i
{
218 BFI_FCPORT_H2I_ENABLE_REQ
= (1),
219 BFI_FCPORT_H2I_DISABLE_REQ
= (2),
220 BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
= (3),
221 BFI_FCPORT_H2I_STATS_GET_REQ
= (4),
222 BFI_FCPORT_H2I_STATS_CLEAR_REQ
= (5),
226 enum bfi_fcport_i2h
{
227 BFI_FCPORT_I2H_ENABLE_RSP
= BFA_I2HM(1),
228 BFI_FCPORT_I2H_DISABLE_RSP
= BFA_I2HM(2),
229 BFI_FCPORT_I2H_SET_SVC_PARAMS_RSP
= BFA_I2HM(3),
230 BFI_FCPORT_I2H_STATS_GET_RSP
= BFA_I2HM(4),
231 BFI_FCPORT_I2H_STATS_CLEAR_RSP
= BFA_I2HM(5),
232 BFI_FCPORT_I2H_EVENT
= BFA_I2HM(6),
233 BFI_FCPORT_I2H_TRUNK_SCN
= BFA_I2HM(7),
234 BFI_FCPORT_I2H_ENABLE_AEN
= BFA_I2HM(8),
235 BFI_FCPORT_I2H_DISABLE_AEN
= BFA_I2HM(9),
242 struct bfi_fcport_req_s
{
243 struct bfi_mhdr_s mh
; /* msg header */
244 u32 msgtag
; /* msgtag for reply */
250 struct bfi_fcport_rsp_s
{
251 struct bfi_mhdr_s mh
; /* common msg header */
252 u8 status
; /* port enable status */
254 struct bfa_port_cfg_s port_cfg
;/* port configuration */
255 u32 msgtag
; /* msgtag for reply */
259 * BFI_FCPORT_H2I_ENABLE_REQ
261 struct bfi_fcport_enable_req_s
{
262 struct bfi_mhdr_s mh
; /* msg header */
264 wwn_t nwwn
; /* node wwn of physical port */
265 wwn_t pwwn
; /* port wwn of physical port */
266 struct bfa_port_cfg_s port_cfg
; /* port configuration */
267 union bfi_addr_u stats_dma_addr
; /* DMA address for stats */
268 u32 msgtag
; /* msgtag for reply */
269 u8 use_flash_cfg
; /* get prot cfg from flash */
274 * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
276 struct bfi_fcport_set_svc_params_req_s
{
277 struct bfi_mhdr_s mh
; /* msg header */
278 __be16 tx_bbcredit
; /* Tx credits */
279 u8 bb_scn
; /* BB_SC FC credit recovery */
284 * BFI_FCPORT_I2H_EVENT
286 struct bfi_fcport_event_s
{
287 struct bfi_mhdr_s mh
; /* common msg header */
288 struct bfa_port_link_s link_state
;
292 * BFI_FCPORT_I2H_TRUNK_SCN
294 struct bfi_fcport_trunk_link_s
{
296 u8 fctl
; /* bfa_trunk_link_fctl_t */
297 u8 state
; /* bfa_trunk_link_state_t */
298 u8 speed
; /* bfa_port_speed_t */
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 */
309 struct bfi_fcport_trunk_link_s tlink
[BFI_FCPORT_MAX_LINKS
];
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
;
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
;
339 BFI_FCXP_H2I_SEND_REQ
= 1,
343 BFI_FCXP_I2H_SEND_RSP
= BFA_I2HM(1),
346 #define BFA_FCXP_MAX_SGES 2
349 * FCXP send request structure
351 struct bfi_fcxp_send_req_s
{
352 struct bfi_mhdr_s mh
; /* Common msg header */
353 __be16 fcxp_tag
; /* driver request tag */
354 __be16 max_frmsz
; /* max send frame size */
355 __be16 vf_id
; /* vsan tag if applicable */
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 */
360 u8 lp_fwtag
; /* lport tag */
361 struct fchs_s fchs
; /* request FC header structure */
362 __be32 req_len
; /* request payload length */
363 __be32 rsp_maxlen
; /* max response length expected */
364 struct bfi_alen_s req_alen
; /* request buffer */
365 struct bfi_alen_s rsp_alen
; /* response buffer */
369 * FCXP send response structure
371 struct bfi_fcxp_send_rsp_s
{
372 struct bfi_mhdr_s mh
; /* Common msg header */
373 __be16 fcxp_tag
; /* send request tag */
374 u8 req_status
; /* request status */
376 __be32 rsp_len
; /* actual response length */
377 __be32 residue_len
; /* residual response length */
378 struct fchs_s fchs
; /* response FC header structure */
382 BFI_UF_H2I_BUF_POST
= 1,
386 BFI_UF_I2H_FRM_RCVD
= BFA_I2HM(1),
389 #define BFA_UF_MAX_SGES 2
391 struct bfi_uf_buf_post_s
{
392 struct bfi_mhdr_s mh
; /* Common msg header */
393 u16 buf_tag
; /* buffer tag */
394 __be16 buf_len
; /* total buffer length */
395 struct bfi_alen_s alen
; /* buffer address/len pair */
398 struct bfi_uf_frm_rcvd_s
{
399 struct bfi_mhdr_s mh
; /* Common msg header */
400 u16 buf_tag
; /* buffer tag */
402 u16 frm_len
; /* received frame length */
403 u16 xfr_len
; /* tranferred length */
406 enum bfi_lps_h2i_msgs
{
407 BFI_LPS_H2I_LOGIN_REQ
= 1,
408 BFI_LPS_H2I_LOGOUT_REQ
= 2,
409 BFI_LPS_H2I_N2N_PID_REQ
= 3,
412 enum bfi_lps_i2h_msgs
{
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),
418 struct bfi_lps_login_req_s
{
419 struct bfi_mhdr_s mh
; /* common msg header */
431 struct bfi_lps_login_rsp_s
{
432 struct bfi_mhdr_s mh
; /* common msg header */
447 u8 brcd_switch
; /* attached peer is brcd switch */
448 u8 bb_scn
; /* atatched port's bb_scn */
452 struct bfi_lps_logout_req_s
{
453 struct bfi_mhdr_s mh
; /* common msg header */
459 struct bfi_lps_logout_rsp_s
{
460 struct bfi_mhdr_s mh
; /* common msg header */
466 struct bfi_lps_cvl_event_s
{
467 struct bfi_mhdr_s mh
; /* common msg header */
472 struct bfi_lps_n2n_pid_req_s
{
473 struct bfi_mhdr_s mh
; /* common msg header */
478 union bfi_lps_h2i_msg_u
{
479 struct bfi_mhdr_s
*msg
;
480 struct bfi_lps_login_req_s
*login_req
;
481 struct bfi_lps_logout_req_s
*logout_req
;
482 struct bfi_lps_n2n_pid_req_s
*n2n_pid_req
;
485 union bfi_lps_i2h_msg_u
{
486 struct bfi_msg_s
*msg
;
487 struct bfi_lps_login_rsp_s
*login_rsp
;
488 struct bfi_lps_logout_rsp_s
*logout_rsp
;
489 struct bfi_lps_cvl_event_s
*cvl_event
;
492 enum bfi_rport_h2i_msgs
{
493 BFI_RPORT_H2I_CREATE_REQ
= 1,
494 BFI_RPORT_H2I_DELETE_REQ
= 2,
495 BFI_RPORT_H2I_SET_SPEED_REQ
= 3,
498 enum bfi_rport_i2h_msgs
{
499 BFI_RPORT_I2H_CREATE_RSP
= BFA_I2HM(1),
500 BFI_RPORT_I2H_DELETE_RSP
= BFA_I2HM(2),
501 BFI_RPORT_I2H_QOS_SCN
= BFA_I2HM(3),
504 struct bfi_rport_create_req_s
{
505 struct bfi_mhdr_s mh
; /* common msg header */
506 u16 bfa_handle
; /* host rport handle */
507 __be16 max_frmsz
; /* max rcv pdu size */
508 u32 pid
:24, /* remote port ID */
509 lp_fwtag
:8; /* local port tag */
510 u32 local_pid
:24, /* local port ID */
512 u8 fc_class
; /* supported FC classes */
513 u8 vf_en
; /* virtual fabric enable */
514 u16 vf_id
; /* virtual fabric ID */
517 struct bfi_rport_create_rsp_s
{
518 struct bfi_mhdr_s mh
; /* common msg header */
519 u8 status
; /* rport creation status */
521 u16 bfa_handle
; /* host rport handle */
522 u16 fw_handle
; /* firmware rport handle */
523 struct bfa_rport_qos_attr_s qos_attr
; /* QoS Attributes */
526 struct bfa_rport_speed_req_s
{
527 struct bfi_mhdr_s mh
; /* common msg header */
528 u16 fw_handle
; /* firmware rport handle */
529 u8 speed
; /* rport's speed via RPSC */
533 struct bfi_rport_delete_req_s
{
534 struct bfi_mhdr_s mh
; /* common msg header */
535 u16 fw_handle
; /* firmware rport handle */
539 struct bfi_rport_delete_rsp_s
{
540 struct bfi_mhdr_s mh
; /* common msg header */
541 u16 bfa_handle
; /* host rport handle */
542 u8 status
; /* rport deletion status */
546 struct bfi_rport_qos_scn_s
{
547 struct bfi_mhdr_s mh
; /* common msg header */
548 u16 bfa_handle
; /* host rport handle */
550 struct bfa_rport_qos_attr_s old_qos_attr
; /* Old QoS Attributes */
551 struct bfa_rport_qos_attr_s new_qos_attr
; /* New QoS Attributes */
554 union bfi_rport_h2i_msg_u
{
555 struct bfi_msg_s
*msg
;
556 struct bfi_rport_create_req_s
*create_req
;
557 struct bfi_rport_delete_req_s
*delete_req
;
558 struct bfi_rport_speed_req_s
*speed_req
;
561 union bfi_rport_i2h_msg_u
{
562 struct bfi_msg_s
*msg
;
563 struct bfi_rport_create_rsp_s
*create_rsp
;
564 struct bfi_rport_delete_rsp_s
*delete_rsp
;
565 struct bfi_rport_qos_scn_s
*qos_scn_evt
;
569 * Initiator mode I-T nexus interface defines.
573 BFI_ITN_H2I_CREATE_REQ
= 1, /* i-t nexus creation */
574 BFI_ITN_H2I_DELETE_REQ
= 2, /* i-t nexus deletion */
578 BFI_ITN_I2H_CREATE_RSP
= BFA_I2HM(1),
579 BFI_ITN_I2H_DELETE_RSP
= BFA_I2HM(2),
580 BFI_ITN_I2H_SLER_EVENT
= BFA_I2HM(3),
583 struct bfi_itn_create_req_s
{
584 struct bfi_mhdr_s mh
; /* common msg header */
585 u16 fw_handle
; /* f/w handle for itnim */
586 u8
class; /* FC class for IO */
587 u8 seq_rec
; /* sequence recovery support */
588 u8 msg_no
; /* seq id of the msg */
592 struct bfi_itn_create_rsp_s
{
593 struct bfi_mhdr_s mh
; /* common msg header */
594 u16 bfa_handle
; /* bfa handle for itnim */
595 u8 status
; /* fcp request status */
596 u8 seq_id
; /* seq id of the msg */
599 struct bfi_itn_delete_req_s
{
600 struct bfi_mhdr_s mh
; /* common msg header */
601 u16 fw_handle
; /* f/w itnim handle */
602 u8 seq_id
; /* seq id of the msg */
606 struct bfi_itn_delete_rsp_s
{
607 struct bfi_mhdr_s mh
; /* common msg header */
608 u16 bfa_handle
; /* bfa handle for itnim */
609 u8 status
; /* fcp request status */
610 u8 seq_id
; /* seq id of the msg */
613 struct bfi_itn_sler_event_s
{
614 struct bfi_mhdr_s mh
; /* common msg header */
615 u16 bfa_handle
; /* bfa handle for itnim */
619 union bfi_itn_h2i_msg_u
{
620 struct bfi_itn_create_req_s
*create_req
;
621 struct bfi_itn_delete_req_s
*delete_req
;
622 struct bfi_msg_s
*msg
;
625 union bfi_itn_i2h_msg_u
{
626 struct bfi_itn_create_rsp_s
*create_rsp
;
627 struct bfi_itn_delete_rsp_s
*delete_rsp
;
628 struct bfi_itn_sler_event_s
*sler_event
;
629 struct bfi_msg_s
*msg
;
633 * Initiator mode IO interface defines.
637 BFI_IOIM_H2I_IOABORT_REQ
= 1, /* IO abort request */
638 BFI_IOIM_H2I_IOCLEANUP_REQ
= 2, /* IO cleanup request */
642 BFI_IOIM_I2H_IO_RSP
= BFA_I2HM(1), /* non-fp IO response */
643 BFI_IOIM_I2H_IOABORT_RSP
= BFA_I2HM(2), /* ABORT rsp */
647 * IO command DIF info
649 struct bfi_ioim_dif_s
{
654 * FCP IO messages overview
657 * - Max CDB length supported is 64 bytes.
658 * - SCSI Linked commands and SCSI bi-directional Commands not
662 struct bfi_ioim_req_s
{
663 struct bfi_mhdr_s mh
; /* Common msg header */
664 __be16 io_tag
; /* I/O tag */
665 u16 rport_hdl
; /* itnim/rport firmware handle */
666 struct fcp_cmnd_s cmnd
; /* IO request info */
669 * SG elements array within the IO request must be double word
670 * aligned. This aligment is required to optimize SGM setup for the IO.
672 struct bfi_sge_s sges
[BFI_SGE_INLINE_MAX
];
676 struct bfi_ioim_dif_s dif
;
680 * This table shows various IO status codes from firmware and their
681 * meaning. Host driver can use these status codes to further process
684 * BFI_IOIM_STS_OK : IO completed with error free SCSI &
686 * io-tag can be reused.
688 * BFA_IOIM_STS_SCSI_ERR : IO completed with scsi error.
689 * - io-tag can be reused.
691 * BFI_IOIM_STS_HOST_ABORTED : IO was aborted successfully due to
693 * - io-tag cannot be reused yet.
695 * BFI_IOIM_STS_ABORTED : IO was aborted successfully
697 * - io-tag cannot be reused yet.
699 * BFI_IOIM_STS_TIMEDOUT : IO timedout and ABTS/RRQ is happening
700 * in the firmware and
701 * - io-tag cannot be reused yet.
703 * BFI_IOIM_STS_SQER_NEEDED : Firmware could not recover the IO
704 * with sequence level error
705 * logic and hence host needs to retry
706 * this IO with a different IO tag
707 * - io-tag cannot be used yet.
709 * BFI_IOIM_STS_NEXUS_ABORT : Second Level Error Recovery from host
710 * is required because 2 consecutive ABTS
711 * timedout and host needs logout and
712 * re-login with the target
713 * - io-tag cannot be used yet.
715 * BFI_IOIM_STS_UNDERRUN : IO completed with SCSI status good,
716 * but the data tranferred is less than
717 * the fcp data length in the command.
718 * ex. SCSI INQUIRY where transferred
719 * data length and residue count in FCP
720 * response accounts for total fcp-dl
721 * - io-tag can be reused.
723 * BFI_IOIM_STS_OVERRUN : IO completed with SCSI status good,
724 * but the data transerred is more than
725 * fcp data length in the command. ex.
726 * TAPE IOs where blocks can of unequal
728 * - io-tag can be reused.
730 * BFI_IOIM_STS_RES_FREE : Firmware has completed using io-tag
731 * during abort process
732 * - io-tag can be reused.
734 * BFI_IOIM_STS_PROTO_ERR : Firmware detected a protocol error.
735 * ex target sent more data than
736 * requested, or there was data frame
737 * loss and other reasons
738 * - io-tag cannot be used yet.
740 * BFI_IOIM_STS_DIF_ERR : Firwmare detected DIF error. ex: DIF
741 * CRC err or Ref Tag err or App tag err.
742 * - io-tag can be reused.
744 * BFA_IOIM_STS_TSK_MGT_ABORT : IO was aborted because of Task
745 * Management command from the host
746 * - io-tag can be reused.
748 * BFI_IOIM_STS_UTAG : Firmware does not know about this
750 * - io-tag can be reused.
752 enum bfi_ioim_status
{
754 BFI_IOIM_STS_HOST_ABORTED
= 1,
755 BFI_IOIM_STS_ABORTED
= 2,
756 BFI_IOIM_STS_TIMEDOUT
= 3,
757 BFI_IOIM_STS_RES_FREE
= 4,
758 BFI_IOIM_STS_SQER_NEEDED
= 5,
759 BFI_IOIM_STS_PROTO_ERR
= 6,
760 BFI_IOIM_STS_UTAG
= 7,
761 BFI_IOIM_STS_PATHTOV
= 8,
765 * I/O response message
767 struct bfi_ioim_rsp_s
{
768 struct bfi_mhdr_s mh
; /* common msg header */
769 __be16 io_tag
; /* completed IO tag */
770 u16 bfa_rport_hndl
; /* releated rport handle */
771 u8 io_status
; /* IO completion status */
772 u8 reuse_io_tag
; /* IO tag can be reused */
773 u16 abort_tag
; /* host abort request tag */
774 u8 scsi_status
; /* scsi status from target */
775 u8 sns_len
; /* scsi sense length */
776 u8 resid_flags
; /* IO residue flags */
778 __be32 residue
; /* IO residual length in bytes */
782 struct bfi_ioim_abort_req_s
{
783 struct bfi_mhdr_s mh
; /* Common msg header */
784 __be16 io_tag
; /* I/O tag */
785 u16 abort_tag
; /* unique request tag */
789 * Initiator mode task management command interface defines.
793 BFI_TSKIM_H2I_TM_REQ
= 1, /* task-mgmt command */
794 BFI_TSKIM_H2I_ABORT_REQ
= 2, /* task-mgmt command */
798 BFI_TSKIM_I2H_TM_RSP
= BFA_I2HM(1),
801 struct bfi_tskim_req_s
{
802 struct bfi_mhdr_s mh
; /* Common msg header */
803 __be16 tsk_tag
; /* task management tag */
804 u16 itn_fhdl
; /* itn firmware handle */
805 struct scsi_lun lun
; /* LU number */
806 u8 tm_flags
; /* see enum fcp_tm_cmnd */
807 u8 t_secs
; /* Timeout value in seconds */
811 struct bfi_tskim_abortreq_s
{
812 struct bfi_mhdr_s mh
; /* Common msg header */
813 __be16 tsk_tag
; /* task management tag */
817 enum bfi_tskim_status
{
819 * Following are FCP-4 spec defined status codes,
820 * **DO NOT CHANGE THEM **
822 BFI_TSKIM_STS_OK
= 0,
823 BFI_TSKIM_STS_NOT_SUPP
= 4,
824 BFI_TSKIM_STS_FAILED
= 5,
829 BFI_TSKIM_STS_TIMEOUT
= 10, /* TM request timedout */
830 BFI_TSKIM_STS_ABORTED
= 11, /* Aborted on host request */
833 struct bfi_tskim_rsp_s
{
834 struct bfi_mhdr_s mh
; /* Common msg header */
835 __be16 tsk_tag
; /* task mgmt cmnd tag */
836 u8 tsk_status
; /* @ref bfi_tskim_status */
843 * Crossbow PCI MSI-X vector defines
846 BFI_MSIX_CPE_QMIN_CB
= 0,
847 BFI_MSIX_CPE_QMAX_CB
= 7,
848 BFI_MSIX_RME_QMIN_CB
= 8,
849 BFI_MSIX_RME_QMAX_CB
= 15,
850 BFI_MSIX_CB_MAX
= 22,
854 * Catapult FC PCI MSI-X vector defines
857 BFI_MSIX_LPU_ERR_CT
= 0,
858 BFI_MSIX_CPE_QMIN_CT
= 1,
859 BFI_MSIX_CPE_QMAX_CT
= 4,
860 BFI_MSIX_RME_QMIN_CT
= 5,
861 BFI_MSIX_RME_QMAX_CT
= 8,
865 #endif /* __BFI_MS_H__ */