Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bfi_ms.h
Go to the documentation of this file.
1 /*
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 
33 };
34 
40 };
41 
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 */
49  u8 rsvd[2];
52 
53 
54  /*
55  * Request and response circular queue base addresses, size and
56  * shadow index pointers.
57  */
64 
65  union bfi_addr_u stats_addr; /* DMA-able address for stats */
66  union bfi_addr_u cfgrsp_addr; /* config response dma address */
68  /* IO sense buf base addr segments */
69  struct bfa_iocfc_intr_attr_s intr_attr; /* IOC interrupt attributes */
70 };
71 
72 /*
73  * Boot target wwn information for this port. This contains either the stored
74  * or discovered boot target port wwns for the port.
75  */
79  u8 rsvd[7];
80 };
81 
93 };
94 
101 };
102 
103 /*
104  * BFI_IOCFC_H2I_CFG_REQ message
105  */
107  struct bfi_mhdr_s mh;
109 };
110 
111 
112 /*
113  * BFI_IOCFC_I2H_CFG_REPLY message
114  */
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 */
119  u8 rsvd[2];
120 };
121 
122 
123 /*
124  * BFI_IOCFC_H2I_SET_INTR_REQ message
125  */
127  struct bfi_mhdr_s mh; /* common msg header */
128  u8 coalesce; /* enable intr coalescing */
129  u8 rsvd[3];
130  __be16 delay; /* delay timer 0..1125us */
131  __be16 latency; /* latency timer 0..225us */
132 };
133 
134 
135 /*
136  * BFI_IOCFC_H2I_UPDATEQ_REQ message
137  */
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 */
144 };
145 
146 
147 /*
148  * BFI_IOCFC_I2H_UPDATEQ_RSP message
149  */
151  struct bfi_mhdr_s mh; /* common msg header */
152  u8 status; /* updateq status */
153  u8 rsvd[3];
154 };
155 
156 
157 /*
158  * H2I Messages
159  */
161  struct bfi_mhdr_s mh;
165 };
166 
167 
168 /*
169  * I2H Messages
170  */
172  struct bfi_mhdr_s mh;
176 };
177 
178 /*
179  * BFI_IOCFC_H2I_FAA_ENABLE_REQ BFI_IOCFC_H2I_FAA_DISABLE_REQ message
180  */
182  struct bfi_mhdr_s mh; /* common msg header */
183 };
184 
186  struct bfi_mhdr_s mh; /* common msg header */
187  u8 rsvd[4];
188  wwn_t pwwn; /* Fabric acquired PWWN */
189  wwn_t nwwn; /* Fabric acquired PWWN */
190 };
191 
192 /*
193  * BFI_IOCFC_H2I_FAA_QUERY_REQ message
194  */
196  struct bfi_mhdr_s mh; /* common msg header */
197  u8 faa_status; /* FAA status */
198  u8 addr_source; /* PWWN source */
199  u8 rsvd[2];
200  wwn_t faa; /* Fabric acquired PWWN */
201 };
202 
203 /*
204  * BFI_IOCFC_I2H_FAA_ENABLE_RSP, BFI_IOCFC_I2H_FAA_DISABLE_RSP message
205  */
207  struct bfi_mhdr_s mh; /* common msg header */
208  u8 status; /* updateq status */
209  u8 rsvd[3];
210 };
211 
212 /*
213  * BFI_IOCFC_I2H_FAA_QUERY_RSP message
214  */
215 #define bfi_faa_query_rsp_t struct bfi_faa_query_s
216 
223 };
224 
225 
236 };
237 
238 
239 /*
240  * Generic REQ type
241  */
243  struct bfi_mhdr_s mh; /* msg header */
244  u32 msgtag; /* msgtag for reply */
245 };
246 
247 /*
248  * Generic RSP type
249  */
251  struct bfi_mhdr_s mh; /* common msg header */
252  u8 status; /* port enable status */
253  u8 rsvd[3];
254  struct bfa_port_cfg_s port_cfg;/* port configuration */
255  u32 msgtag; /* msgtag for reply */
256 };
257 
258 /*
259  * BFI_FCPORT_H2I_ENABLE_REQ
260  */
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 */
270  u8 rsvd2[3];
271 };
272 
273 /*
274  * BFI_FCPORT_H2I_SET_SVC_PARAMS_REQ
275  */
277  struct bfi_mhdr_s mh; /* msg header */
278  __be16 tx_bbcredit; /* Tx credits */
279  u8 bb_scn; /* BB_SC FC credit recovery */
281 };
282 
283 /*
284  * BFI_FCPORT_I2H_EVENT
285  */
287  struct bfi_mhdr_s mh; /* common msg header */
289 };
290 
291 /*
292  * BFI_FCPORT_I2H_TRUNK_SCN
293  */
296  u8 fctl; /* bfa_trunk_link_fctl_t */
297  u8 state; /* bfa_trunk_link_state_t */
298  u8 speed; /* bfa_port_speed_t */
301 };
302 
303 #define BFI_FCPORT_MAX_LINKS 2
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];
310 };
311 
312 /*
313  * fcport H2I message
314  */
316  struct bfi_mhdr_s *mhdr;
322 };
323 
324 /*
325  * fcport I2H message
326  */
328  struct bfi_msg_s *msg;
336 };
337 
340 };
341 
344 };
345 
346 #define BFA_FCXP_MAX_SGES 2
347 
348 /*
349  * FCXP send request structure
350  */
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 */
366 };
367 
368 /*
369  * FCXP send response structure
370  */
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 */
379 };
380 
383 };
384 
387 };
388 
389 #define BFA_UF_MAX_SGES 2
390 
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 */
396 };
397 
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 */
404 };
405 
410 };
411 
416 };
417 
419  struct bfi_mhdr_s mh; /* common msg header */
430 };
431 
433  struct bfi_mhdr_s mh; /* common msg header */
448  u8 brcd_switch; /* attached peer is brcd switch */
449  u8 bb_scn; /* atatched port's bb_scn */
451 };
452 
454  struct bfi_mhdr_s mh; /* common msg header */
456  u8 rsvd[3];
458 };
459 
461  struct bfi_mhdr_s mh; /* common msg header */
464  u8 rsvd[2];
465 };
466 
468  struct bfi_mhdr_s mh; /* common msg header */
470  u8 rsvd[3];
471 };
472 
474  struct bfi_mhdr_s mh; /* common msg header */
477 };
478 
480  struct bfi_mhdr_s *msg;
484 };
485 
487  struct bfi_msg_s *msg;
491 };
492 
497 };
498 
506 };
507 
509  struct bfi_mhdr_s mh; /* common msg header */
510  u16 bfa_handle; /* host rport handle */
511  __be16 max_frmsz; /* max rcv pdu size */
512  u32 pid:24, /* remote port ID */
513  lp_fwtag:8; /* local port tag */
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 
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 
531  struct bfi_mhdr_s mh; /* common msg header */
532  u16 fw_handle; /* firmware rport handle */
533  u8 speed; /* rport's speed via RPSC */
535 };
536 
538  struct bfi_mhdr_s mh; /* common msg header */
539  u16 fw_handle; /* firmware rport handle */
541 };
542 
544  struct bfi_mhdr_s mh; /* common msg header */
545  u16 bfa_handle; /* host rport handle */
546  u8 status; /* rport deletion status */
548 };
549 
551  struct bfi_mhdr_s mh; /* common msg header */
552  u16 bfa_handle; /* host rport handle */
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 
559  struct bfi_mhdr_s mh;
564 };
565 
567  struct bfi_msg_s *msg;
570  struct bfi_rport_speed_req_s *speed_req;
571 };
572 
574  struct bfi_msg_s *msg;
579 };
580 
581 /*
582  * Initiator mode I-T nexus interface defines.
583  */
584 
586  BFI_ITN_H2I_CREATE_REQ = 1, /* i-t nexus creation */
587  BFI_ITN_H2I_DELETE_REQ = 2, /* i-t nexus deletion */
588 };
589 
594 };
595 
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 */
603 };
604 
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 
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 */
617 };
618 
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 
627  struct bfi_mhdr_s mh; /* common msg header */
628  u16 bfa_handle; /* bfa handle for itnim */
630 };
631 
635  struct bfi_msg_s *msg;
636 };
637 
642  struct bfi_msg_s *msg;
643 };
644 
645 /*
646  * Initiator mode IO interface defines.
647  */
648 
650  BFI_IOIM_H2I_IOABORT_REQ = 1, /* IO abort request */
651  BFI_IOIM_H2I_IOCLEANUP_REQ = 2, /* IO cleanup request */
652 };
653 
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 
659 /*
660  * IO command DIF info
661  */
664 };
665 
666 /*
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  */
676  struct bfi_mhdr_s mh; /* Common msg header */
677  __be16 io_tag; /* I/O tag */
678  u16 rport_hdl; /* itnim/rport firmware handle */
679  struct fcp_cmnd_s cmnd; /* IO request info */
680 
681  /*
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  */
688  u8 rsvd_a[2];
690 };
691 
692 /*
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  */
775 };
776 
777 /*
778  * I/O response message
779  */
781  struct bfi_mhdr_s mh; /* common msg header */
782  __be16 io_tag; /* completed IO tag */
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 */
791  __be32 residue; /* IO residual length in bytes */
793 };
794 
796  struct bfi_mhdr_s mh; /* Common msg header */
797  __be16 io_tag; /* I/O tag */
798  u16 abort_tag; /* unique request tag */
799 };
800 
801 /*
802  * Initiator mode task management command interface defines.
803  */
804 
806  BFI_TSKIM_H2I_TM_REQ = 1, /* task-mgmt command */
807  BFI_TSKIM_H2I_ABORT_REQ = 2, /* task-mgmt command */
808 };
809 
812 };
813 
815  struct bfi_mhdr_s mh; /* Common msg header */
816  __be16 tsk_tag; /* task management tag */
817  u16 itn_fhdl; /* itn firmware handle */
818  struct scsi_lun lun; /* LU number */
819  u8 tm_flags; /* see enum fcp_tm_cmnd */
820  u8 t_secs; /* Timeout value in seconds */
821  u8 rsvd[2];
822 };
823 
825  struct bfi_mhdr_s mh; /* Common msg header */
826  __be16 tsk_tag; /* task management tag */
828 };
829 
831  /*
832  * Following are FCP-4 spec defined status codes,
833  * **DO NOT CHANGE THEM **
834  */
838 
839  /*
840  * Defined by BFA
841  */
842  BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
843  BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
844  BFI_TSKIM_STS_UTAG = 12, /* unknown tag for request */
845 };
846 
848  struct bfi_mhdr_s mh; /* Common msg header */
849  __be16 tsk_tag; /* task mgmt cmnd tag */
850  u8 tsk_status; /* @ref bfi_tskim_status */
852 };
853 
854 #pragma pack()
855 
856 /*
857  * Crossbow PCI MSI-X vector defines
858  */
859 enum {
865 };
866 
867 /*
868  * Catapult FC PCI MSI-X vector defines
869  */
870 enum {
877 };
878 
879 #endif /* __BFI_MS_H__ */