2 * Copyright (c) 2005-2009 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.
18 #ifndef __BFA_DEFS_IOCFC_H__
19 #define __BFA_DEFS_IOCFC_H__
21 #include <protocol/types.h>
22 #include <defs/bfa_defs_types.h>
23 #include <defs/bfa_defs_version.h>
24 #include <defs/bfa_defs_adapter.h>
25 #include <defs/bfa_defs_pm.h>
27 #define BFA_IOCFC_INTR_DELAY 1125
28 #define BFA_IOCFC_INTR_LATENCY 225
31 * Interrupt coalescing configuration.
33 struct bfa_iocfc_intr_attr_s
{
34 bfa_boolean_t coalesce
; /* enable/disable coalescing */
35 u16 latency
; /* latency in microseconds */
36 u16 delay
; /* delay in microseconds */
40 * IOC firmware configuraton
42 struct bfa_iocfc_fwcfg_s
{
43 u16 num_fabrics
; /* number of fabrics */
44 u16 num_lports
; /* number of local lports */
45 u16 num_rports
; /* number of remote ports */
46 u16 num_ioim_reqs
; /* number of IO reqs */
47 u16 num_tskim_reqs
; /* task management requests */
48 u16 num_iotm_reqs
; /* number of TM IO reqs */
49 u16 num_tsktm_reqs
; /* TM task management requests*/
50 u16 num_fcxp_reqs
; /* unassisted FC exchanges */
51 u16 num_uf_bufs
; /* unsolicited recv buffers */
56 struct bfa_iocfc_drvcfg_s
{
57 u16 num_reqq_elems
; /* number of req queue elements */
58 u16 num_rspq_elems
; /* number of rsp queue elements */
59 u16 num_sgpgs
; /* number of total SG pages */
60 u16 num_sboot_tgts
; /* number of SAN boot targets */
61 u16 num_sboot_luns
; /* number of SAN boot luns */
62 u16 ioc_recover
; /* IOC recovery mode */
63 u16 min_cfg
; /* minimum configuration */
64 u16 path_tov
; /* device path timeout */
65 bfa_boolean_t delay_comp
; /* delay completion of
66 failed inflight IOs */
72 struct bfa_iocfc_cfg_s
{
73 struct bfa_iocfc_fwcfg_s fwcfg
; /* firmware side config */
74 struct bfa_iocfc_drvcfg_s drvcfg
; /* driver side config */
78 * IOC firmware IO stats
80 struct bfa_fw_io_stats_s
{
81 u32 host_abort
; /* IO aborted by host driver*/
82 u32 host_cleanup
; /* IO clean up by host driver */
84 u32 fw_io_timeout
; /* IOs timedout */
85 u32 fw_frm_parse
; /* frame parsed by f/w */
86 u32 fw_frm_data
; /* fcp_data frame parsed by f/w */
87 u32 fw_frm_rsp
; /* fcp_rsp frame parsed by f/w */
88 u32 fw_frm_xfer_rdy
; /* xfer_rdy frame parsed by f/w */
89 u32 fw_frm_bls_acc
; /* BLS ACC frame parsed by f/w */
90 u32 fw_frm_tgt_abort
; /* target ABTS parsed by f/w */
91 u32 fw_frm_unknown
; /* unknown parsed by f/w */
92 u32 fw_data_dma
; /* f/w DMA'ed the data frame */
93 u32 fw_frm_drop
; /* f/w drop the frame */
95 u32 rec_timeout
; /* FW rec timed out */
96 u32 error_rec
; /* FW sending rec on
97 * an error condition*/
98 u32 wait_for_si
; /* FW wait for SI */
99 u32 rec_rsp_inval
; /* REC rsp invalid */
100 u32 seqr_io_abort
; /* target does not know cmd so abort */
101 u32 seqr_io_retry
; /* SEQR failed so retry IO */
103 u32 itn_cisc_upd_rsp
; /* ITN cisc updated on fcp_rsp */
104 u32 itn_cisc_upd_data
; /* ITN cisc updated on fcp_data */
105 u32 itn_cisc_upd_xfer_rdy
; /* ITN cisc updated on fcp_data */
107 u32 fcp_data_lost
; /* fcp data lost */
109 u32 ro_set_in_xfer_rdy
; /* Target set RO in Xfer_rdy frame */
110 u32 xfer_rdy_ooo_err
; /* Out of order Xfer_rdy received */
111 u32 xfer_rdy_unknown_err
; /* unknown error in xfer_rdy frame */
113 u32 io_abort_timeout
; /* ABTS timedout */
114 u32 sler_initiated
; /* SLER initiated */
116 u32 unexp_fcp_rsp
; /* fcp response in wrong state */
118 u32 fcp_rsp_under_run
; /* fcp rsp IO underrun */
119 u32 fcp_rsp_under_run_wr
; /* fcp rsp IO underrun for write */
120 u32 fcp_rsp_under_run_err
; /* fcp rsp IO underrun error */
121 u32 fcp_rsp_resid_inval
; /* invalid residue */
122 u32 fcp_rsp_over_run
; /* fcp rsp IO overrun */
123 u32 fcp_rsp_over_run_err
; /* fcp rsp IO overrun error */
124 u32 fcp_rsp_proto_err
; /* protocol error in fcp rsp */
125 u32 fcp_rsp_sense_err
; /* error in sense info in fcp rsp */
126 u32 fcp_conf_req
; /* FCP conf requested */
128 u32 tgt_aborted_io
; /* target initiated abort */
130 u32 ioh_edtov_timeout_event
;/* IOH edtov timer popped */
131 u32 ioh_fcp_rsp_excp_event
; /* IOH FCP_RSP exception */
132 u32 ioh_fcp_conf_event
; /* IOH FCP_CONF */
133 u32 ioh_mult_frm_rsp_event
; /* IOH multi_frame FCP_RSP */
134 u32 ioh_hit_class2_event
; /* IOH hit class2 */
135 u32 ioh_miss_other_event
; /* IOH miss other */
136 u32 ioh_seq_cnt_err_event
; /* IOH seq cnt error */
137 u32 ioh_len_err_event
; /* IOH len error - fcp_dl !=
139 u32 ioh_seq_len_err_event
; /* IOH seq len error */
140 u32 ioh_data_oor_event
; /* Data out of range */
141 u32 ioh_ro_ooo_event
; /* Relative offset out of range */
142 u32 ioh_cpu_owned_event
; /* IOH hit -iost owned by f/w */
143 u32 ioh_unexp_frame_event
; /* unexpected frame recieved
145 u32 ioh_err_int
; /* IOH error int during data-phase
151 * IOC port firmware stats
154 struct bfa_fw_port_fpg_stats_s
{
184 struct bfa_fw_port_lksm_stats_s
{
185 u32 hwsm_success
; /* hwsm state machine success */
186 u32 hwsm_fails
; /* hwsm fails */
187 u32 hwsm_wdtov
; /* hwsm timed out */
188 u32 swsm_success
; /* swsm success */
189 u32 swsm_fails
; /* swsm fails */
190 u32 swsm_wdtov
; /* swsm timed out */
191 u32 busybufs
; /* link init failed due to busybuf */
192 u32 buf_waits
; /* bufwait state entries */
193 u32 link_fails
; /* link failures */
194 u32 psp_errors
; /* primitive sequence protocol errors */
195 u32 lr_unexp
; /* No. of times LR rx-ed unexpectedly */
196 u32 lrr_unexp
; /* No. of times LRR rx-ed unexpectedly */
197 u32 lr_tx
; /* No. of times LR tx started */
198 u32 lrr_tx
; /* No. of times LRR tx started */
199 u32 ols_tx
; /* No. of times OLS tx started */
200 u32 nos_tx
; /* No. of times NOS tx started */
204 struct bfa_fw_port_snsm_stats_s
{
205 u32 hwsm_success
; /* Successful hwsm terminations */
206 u32 hwsm_fails
; /* hwsm fail count */
207 u32 hwsm_wdtov
; /* hwsm timed out */
208 u32 swsm_success
; /* swsm success */
209 u32 swsm_wdtov
; /* swsm timed out */
210 u32 error_resets
; /* error resets initiated by upsm */
211 u32 sync_lost
; /* Sync loss count */
212 u32 sig_lost
; /* Signal loss count */
216 struct bfa_fw_port_physm_stats_s
{
217 u32 module_inserts
; /* Module insert count */
218 u32 module_xtracts
; /* Module extracts count */
219 u32 module_invalids
; /* Invalid module inserted count */
220 u32 module_read_ign
; /* Module validation status ignored */
221 u32 laser_faults
; /* Laser fault count */
226 struct bfa_fw_fip_stats_s
{
227 u32 disc_req
; /* Discovery solicit requests */
228 u32 disc_rsp
; /* Discovery solicit response */
229 u32 disc_err
; /* Discovery advt. parse errors */
230 u32 disc_unsol
; /* Discovery unsolicited */
231 u32 disc_timeouts
; /* Discovery timeouts */
232 u32 linksvc_unsupp
; /* Unsupported link service req */
233 u32 linksvc_err
; /* Parse error in link service req */
234 u32 logo_req
; /* Number of FIP logos received */
235 u32 clrvlink_req
; /* Clear virtual link req */
236 u32 op_unsupp
; /* Unsupported FIP operation */
237 u32 untagged
; /* Untagged frames (ignored) */
242 struct bfa_fw_lps_stats_s
{
243 u32 mac_invalids
; /* Invalid mac assigned */
248 struct bfa_fw_fcoe_stats_s
{
249 u32 cee_linkups
; /* CEE link up count */
250 u32 cee_linkdns
; /* CEE link down count */
251 u32 fip_linkups
; /* FIP link up count */
252 u32 fip_linkdns
; /* FIP link up count */
253 u32 fip_fails
; /* FIP fail count */
254 u32 mac_invalids
; /* Invalid mac assigned */
258 * IOC firmware FCoE port stats
260 struct bfa_fw_fcoe_port_stats_s
{
261 struct bfa_fw_fcoe_stats_s fcoe_stats
;
262 struct bfa_fw_fip_stats_s fip_stats
;
266 * IOC firmware FC port stats
268 struct bfa_fw_fc_port_stats_s
{
269 struct bfa_fw_port_fpg_stats_s fpg_stats
;
270 struct bfa_fw_port_physm_stats_s physm_stats
;
271 struct bfa_fw_port_snsm_stats_s snsm_stats
;
272 struct bfa_fw_port_lksm_stats_s lksm_stats
;
276 * IOC firmware FC port stats
278 union bfa_fw_port_stats_s
{
279 struct bfa_fw_fc_port_stats_s fc_stats
;
280 struct bfa_fw_fcoe_port_stats_s fcoe_stats
;
286 struct bfa_fw_stats_s
{
287 struct bfa_fw_ioc_stats_s ioc_stats
;
288 struct bfa_fw_io_stats_s io_stats
;
289 union bfa_fw_port_stats_s port_stats
;
295 struct bfa_iocfc_stats_s
{
296 struct bfa_fw_stats_s fw_stats
; /* firmware IOC stats */
300 * IOC attributes returned in queries
302 struct bfa_iocfc_attr_s
{
303 struct bfa_iocfc_cfg_s config
; /* IOCFC config */
304 struct bfa_iocfc_intr_attr_s intr_attr
; /* interrupt attr */
307 #define BFA_IOCFC_PATHTOV_MAX 60
308 #define BFA_IOCFC_QDEPTH_MAX 2000
310 #endif /* __BFA_DEFS_IOC_H__ */