blob: 263438bd8b6ea9dc2321eb71f93ac621e32f296d [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 __BFA_DEFS_SVC_H__
19#define __BFA_DEFS_SVC_H__
20
21#include "bfa_defs.h"
22#include "bfa_fc.h"
23#include "bfi.h"
24
25#define BFA_IOCFC_INTR_DELAY 1125
26#define BFA_IOCFC_INTR_LATENCY 225
27#define BFA_IOCFCOE_INTR_DELAY 25
28#define BFA_IOCFCOE_INTR_LATENCY 5
29
Jing Huangacdc79a2010-10-18 17:15:55 -070030/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070031 * Interrupt coalescing configuration.
32 */
33#pragma pack(1)
34struct bfa_iocfc_intr_attr_s {
35 u8 coalesce; /* enable/disable coalescing */
36 u8 rsvd[3];
Maggie50444a32010-11-29 18:26:32 -080037 __be16 latency; /* latency in microseconds */
38 __be16 delay; /* delay in microseconds */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070039};
40
Jing Huangacdc79a2010-10-18 17:15:55 -070041/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070042 * IOC firmware configuraton
43 */
44struct bfa_iocfc_fwcfg_s {
45 u16 num_fabrics; /* number of fabrics */
46 u16 num_lports; /* number of local lports */
47 u16 num_rports; /* number of remote ports */
48 u16 num_ioim_reqs; /* number of IO reqs */
49 u16 num_tskim_reqs; /* task management requests */
Krishna Gudipatie2187d72011-06-13 15:53:58 -070050 u16 num_fwtio_reqs; /* number of TM IO reqs in FW */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070051 u16 num_fcxp_reqs; /* unassisted FC exchanges */
52 u16 num_uf_bufs; /* unsolicited recv buffers */
53 u8 num_cqs;
54 u8 fw_tick_res; /* FW clock resolution in ms */
Krishna Gudipatie2187d72011-06-13 15:53:58 -070055 u8 rsvd[2];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070056};
57#pragma pack()
58
59struct bfa_iocfc_drvcfg_s {
60 u16 num_reqq_elems; /* number of req queue elements */
61 u16 num_rspq_elems; /* number of rsp queue elements */
62 u16 num_sgpgs; /* number of total SG pages */
63 u16 num_sboot_tgts; /* number of SAN boot targets */
64 u16 num_sboot_luns; /* number of SAN boot luns */
65 u16 ioc_recover; /* IOC recovery mode */
66 u16 min_cfg; /* minimum configuration */
67 u16 path_tov; /* device path timeout */
Krishna Gudipati60138062011-06-24 20:25:15 -070068 u16 num_tio_reqs; /*!< number of TM IO reqs */
69 u8 port_mode;
70 u8 rsvd_a;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070071 bfa_boolean_t delay_comp; /* delay completion of
72 failed inflight IOs */
Krishna Gudipati60138062011-06-24 20:25:15 -070073 u16 num_ttsk_reqs; /* TM task management requests */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070074 u32 rsvd;
75};
76
Jing Huangacdc79a2010-10-18 17:15:55 -070077/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070078 * IOC configuration
79 */
80struct bfa_iocfc_cfg_s {
81 struct bfa_iocfc_fwcfg_s fwcfg; /* firmware side config */
82 struct bfa_iocfc_drvcfg_s drvcfg; /* driver side config */
83};
84
Jing Huangacdc79a2010-10-18 17:15:55 -070085/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070086 * IOC firmware IO stats
87 */
Krishna Gudipati60138062011-06-24 20:25:15 -070088struct bfa_fw_ioim_stats_s {
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070089 u32 host_abort; /* IO aborted by host driver*/
90 u32 host_cleanup; /* IO clean up by host driver */
91
92 u32 fw_io_timeout; /* IOs timedout */
93 u32 fw_frm_parse; /* frame parsed by f/w */
94 u32 fw_frm_data; /* fcp_data frame parsed by f/w */
95 u32 fw_frm_rsp; /* fcp_rsp frame parsed by f/w */
96 u32 fw_frm_xfer_rdy; /* xfer_rdy frame parsed by f/w */
97 u32 fw_frm_bls_acc; /* BLS ACC frame parsed by f/w */
98 u32 fw_frm_tgt_abort; /* target ABTS parsed by f/w */
99 u32 fw_frm_unknown; /* unknown parsed by f/w */
100 u32 fw_data_dma; /* f/w DMA'ed the data frame */
101 u32 fw_frm_drop; /* f/w drop the frame */
102
103 u32 rec_timeout; /* FW rec timed out */
104 u32 error_rec; /* FW sending rec on
105 * an error condition*/
106 u32 wait_for_si; /* FW wait for SI */
107 u32 rec_rsp_inval; /* REC rsp invalid */
108 u32 seqr_io_abort; /* target does not know cmd so abort */
109 u32 seqr_io_retry; /* SEQR failed so retry IO */
110
111 u32 itn_cisc_upd_rsp; /* ITN cisc updated on fcp_rsp */
112 u32 itn_cisc_upd_data; /* ITN cisc updated on fcp_data */
113 u32 itn_cisc_upd_xfer_rdy; /* ITN cisc updated on fcp_data */
114
115 u32 fcp_data_lost; /* fcp data lost */
116
117 u32 ro_set_in_xfer_rdy; /* Target set RO in Xfer_rdy frame */
118 u32 xfer_rdy_ooo_err; /* Out of order Xfer_rdy received */
119 u32 xfer_rdy_unknown_err; /* unknown error in xfer_rdy frame */
120
121 u32 io_abort_timeout; /* ABTS timedout */
122 u32 sler_initiated; /* SLER initiated */
123
124 u32 unexp_fcp_rsp; /* fcp response in wrong state */
125
126 u32 fcp_rsp_under_run; /* fcp rsp IO underrun */
127 u32 fcp_rsp_under_run_wr; /* fcp rsp IO underrun for write */
128 u32 fcp_rsp_under_run_err; /* fcp rsp IO underrun error */
129 u32 fcp_rsp_resid_inval; /* invalid residue */
130 u32 fcp_rsp_over_run; /* fcp rsp IO overrun */
131 u32 fcp_rsp_over_run_err; /* fcp rsp IO overrun error */
132 u32 fcp_rsp_proto_err; /* protocol error in fcp rsp */
133 u32 fcp_rsp_sense_err; /* error in sense info in fcp rsp */
134 u32 fcp_conf_req; /* FCP conf requested */
135
136 u32 tgt_aborted_io; /* target initiated abort */
137
138 u32 ioh_edtov_timeout_event;/* IOH edtov timer popped */
139 u32 ioh_fcp_rsp_excp_event; /* IOH FCP_RSP exception */
140 u32 ioh_fcp_conf_event; /* IOH FCP_CONF */
141 u32 ioh_mult_frm_rsp_event; /* IOH multi_frame FCP_RSP */
142 u32 ioh_hit_class2_event; /* IOH hit class2 */
143 u32 ioh_miss_other_event; /* IOH miss other */
144 u32 ioh_seq_cnt_err_event; /* IOH seq cnt error */
145 u32 ioh_len_err_event; /* IOH len error - fcp_dl !=
146 * bytes xfered */
147 u32 ioh_seq_len_err_event; /* IOH seq len error */
148 u32 ioh_data_oor_event; /* Data out of range */
149 u32 ioh_ro_ooo_event; /* Relative offset out of range */
150 u32 ioh_cpu_owned_event; /* IOH hit -iost owned by f/w */
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300151 u32 ioh_unexp_frame_event; /* unexpected frame received
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700152 * count */
153 u32 ioh_err_int; /* IOH error int during data-phase
154 * for scsi write
155 */
156};
157
Krishna Gudipati60138062011-06-24 20:25:15 -0700158struct bfa_fw_tio_stats_s {
159 u32 tio_conf_proc; /* TIO CONF processed */
160 u32 tio_conf_drop; /* TIO CONF dropped */
161 u32 tio_cleanup_req; /* TIO cleanup requested */
162 u32 tio_cleanup_comp; /* TIO cleanup completed */
163 u32 tio_abort_rsp; /* TIO abort response */
164 u32 tio_abort_rsp_comp; /* TIO abort rsp completed */
165 u32 tio_abts_req; /* TIO ABTS requested */
166 u32 tio_abts_ack; /* TIO ABTS ack-ed */
167 u32 tio_abts_ack_nocomp; /* TIO ABTS ack-ed but not completed */
168 u32 tio_abts_tmo; /* TIO ABTS timeout */
169 u32 tio_snsdata_dma; /* TIO sense data DMA */
170 u32 tio_rxwchan_wait; /* TIO waiting for RX wait channel */
171 u32 tio_rxwchan_avail; /* TIO RX wait channel available */
172 u32 tio_hit_bls; /* TIO IOH BLS event */
173 u32 tio_uf_recv; /* TIO received UF */
174 u32 tio_rd_invalid_sm; /* TIO read reqst in wrong state machine */
175 u32 tio_wr_invalid_sm;/* TIO write reqst in wrong state machine */
176
177 u32 ds_rxwchan_wait; /* DS waiting for RX wait channel */
178 u32 ds_rxwchan_avail; /* DS RX wait channel available */
179 u32 ds_unaligned_rd; /* DS unaligned read */
180 u32 ds_rdcomp_invalid_sm; /* DS read completed in wrong state machine */
181 u32 ds_wrcomp_invalid_sm; /* DS write completed in wrong state machine */
182 u32 ds_flush_req; /* DS flush requested */
183 u32 ds_flush_comp; /* DS flush completed */
184 u32 ds_xfrdy_exp; /* DS XFER_RDY expired */
185 u32 ds_seq_cnt_err; /* DS seq cnt error */
186 u32 ds_seq_len_err; /* DS seq len error */
187 u32 ds_data_oor; /* DS data out of order */
188 u32 ds_hit_bls; /* DS hit BLS */
189 u32 ds_edtov_timer_exp; /* DS edtov expired */
190 u32 ds_cpu_owned; /* DS cpu owned */
191 u32 ds_hit_class2; /* DS hit class2 */
192 u32 ds_length_err; /* DS length error */
193 u32 ds_ro_ooo_err; /* DS relative offset out-of-order error */
194 u32 ds_rectov_timer_exp; /* DS rectov expired */
195 u32 ds_unexp_fr_err; /* DS unexp frame error */
196};
197
198/*
199 * IOC firmware IO stats
200 */
201struct bfa_fw_io_stats_s {
202 struct bfa_fw_ioim_stats_s ioim_stats;
203 struct bfa_fw_tio_stats_s tio_stats;
204};
205
Jing Huangacdc79a2010-10-18 17:15:55 -0700206/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700207 * IOC port firmware stats
208 */
209
210struct bfa_fw_port_fpg_stats_s {
211 u32 intr_evt;
212 u32 intr;
213 u32 intr_excess;
214 u32 intr_cause0;
215 u32 intr_other;
216 u32 intr_other_ign;
217 u32 sig_lost;
218 u32 sig_regained;
219 u32 sync_lost;
220 u32 sync_to;
221 u32 sync_regained;
222 u32 div2_overflow;
223 u32 div2_underflow;
224 u32 efifo_overflow;
225 u32 efifo_underflow;
226 u32 idle_rx;
227 u32 lrr_rx;
228 u32 lr_rx;
229 u32 ols_rx;
230 u32 nos_rx;
231 u32 lip_rx;
232 u32 arbf0_rx;
233 u32 arb_rx;
234 u32 mrk_rx;
235 u32 const_mrk_rx;
236 u32 prim_unknown;
237};
238
239
240struct bfa_fw_port_lksm_stats_s {
241 u32 hwsm_success; /* hwsm state machine success */
242 u32 hwsm_fails; /* hwsm fails */
243 u32 hwsm_wdtov; /* hwsm timed out */
244 u32 swsm_success; /* swsm success */
245 u32 swsm_fails; /* swsm fails */
246 u32 swsm_wdtov; /* swsm timed out */
247 u32 busybufs; /* link init failed due to busybuf */
248 u32 buf_waits; /* bufwait state entries */
249 u32 link_fails; /* link failures */
250 u32 psp_errors; /* primitive sequence protocol errors */
251 u32 lr_unexp; /* No. of times LR rx-ed unexpectedly */
252 u32 lrr_unexp; /* No. of times LRR rx-ed unexpectedly */
253 u32 lr_tx; /* No. of times LR tx started */
254 u32 lrr_tx; /* No. of times LRR tx started */
255 u32 ols_tx; /* No. of times OLS tx started */
256 u32 nos_tx; /* No. of times NOS tx started */
257 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */
258 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */
Krishna Gudipati60138062011-06-24 20:25:15 -0700259 u32 bbsc_lr; /* LKSM LR tx for credit recovery */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700260};
261
262struct bfa_fw_port_snsm_stats_s {
263 u32 hwsm_success; /* Successful hwsm terminations */
264 u32 hwsm_fails; /* hwsm fail count */
265 u32 hwsm_wdtov; /* hwsm timed out */
266 u32 swsm_success; /* swsm success */
267 u32 swsm_wdtov; /* swsm timed out */
268 u32 error_resets; /* error resets initiated by upsm */
269 u32 sync_lost; /* Sync loss count */
270 u32 sig_lost; /* Signal loss count */
Krishna Gudipatif2ee7602011-07-20 17:01:34 -0700271 u32 asn8g_attempts; /* SNSM HWSM at 8Gbps attempts */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700272};
273
274struct bfa_fw_port_physm_stats_s {
275 u32 module_inserts; /* Module insert count */
276 u32 module_xtracts; /* Module extracts count */
277 u32 module_invalids; /* Invalid module inserted count */
278 u32 module_read_ign; /* Module validation status ignored */
279 u32 laser_faults; /* Laser fault count */
280 u32 rsvd;
281};
282
283struct bfa_fw_fip_stats_s {
284 u32 vlan_req; /* vlan discovery requests */
285 u32 vlan_notify; /* vlan notifications */
286 u32 vlan_err; /* vlan response error */
287 u32 vlan_timeouts; /* vlan disvoery timeouts */
288 u32 vlan_invalids; /* invalid vlan in discovery advert. */
289 u32 disc_req; /* Discovery solicit requests */
290 u32 disc_rsp; /* Discovery solicit response */
291 u32 disc_err; /* Discovery advt. parse errors */
292 u32 disc_unsol; /* Discovery unsolicited */
293 u32 disc_timeouts; /* Discovery timeouts */
294 u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */
295 u32 linksvc_unsupp; /* Unsupported link service req */
296 u32 linksvc_err; /* Parse error in link service req */
297 u32 logo_req; /* FIP logos received */
298 u32 clrvlink_req; /* Clear virtual link req */
299 u32 op_unsupp; /* Unsupported FIP operation */
300 u32 untagged; /* Untagged frames (ignored) */
301 u32 invalid_version; /* Invalid FIP version */
302};
303
304struct bfa_fw_lps_stats_s {
305 u32 mac_invalids; /* Invalid mac assigned */
306 u32 rsvd;
307};
308
309struct bfa_fw_fcoe_stats_s {
310 u32 cee_linkups; /* CEE link up count */
311 u32 cee_linkdns; /* CEE link down count */
312 u32 fip_linkups; /* FIP link up count */
313 u32 fip_linkdns; /* FIP link up count */
314 u32 fip_fails; /* FIP fail count */
315 u32 mac_invalids; /* Invalid mac assigned */
316};
317
Jing Huangacdc79a2010-10-18 17:15:55 -0700318/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700319 * IOC firmware FCoE port stats
320 */
321struct bfa_fw_fcoe_port_stats_s {
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -0700322 struct bfa_fw_fcoe_stats_s fcoe_stats;
323 struct bfa_fw_fip_stats_s fip_stats;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700324};
325
Jing Huangacdc79a2010-10-18 17:15:55 -0700326/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700327 * IOC firmware FC uport stats
328 */
329struct bfa_fw_fc_uport_stats_s {
330 struct bfa_fw_port_snsm_stats_s snsm_stats;
331 struct bfa_fw_port_lksm_stats_s lksm_stats;
332};
333
Jing Huangacdc79a2010-10-18 17:15:55 -0700334/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700335 * IOC firmware FC port stats
336 */
337union bfa_fw_fc_port_stats_s {
338 struct bfa_fw_fc_uport_stats_s fc_stats;
339 struct bfa_fw_fcoe_port_stats_s fcoe_stats;
340};
341
Jing Huangacdc79a2010-10-18 17:15:55 -0700342/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700343 * IOC firmware port stats
344 */
345struct bfa_fw_port_stats_s {
346 struct bfa_fw_port_fpg_stats_s fpg_stats;
347 struct bfa_fw_port_physm_stats_s physm_stats;
348 union bfa_fw_fc_port_stats_s fc_port;
349};
350
Jing Huangacdc79a2010-10-18 17:15:55 -0700351/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700352 * fcxchg module statistics
353 */
354struct bfa_fw_fcxchg_stats_s {
355 u32 ua_tag_inv;
356 u32 ua_state_inv;
357};
358
359struct bfa_fw_lpsm_stats_s {
360 u32 cls_rx;
361 u32 cls_tx;
362};
363
Jing Huangacdc79a2010-10-18 17:15:55 -0700364/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700365 * Trunk statistics
366 */
367struct bfa_fw_trunk_stats_s {
368 u32 emt_recvd; /* Trunk EMT received */
369 u32 emt_accepted; /* Trunk EMT Accepted */
370 u32 emt_rejected; /* Trunk EMT rejected */
371 u32 etp_recvd; /* Trunk ETP received */
372 u32 etp_accepted; /* Trunk ETP Accepted */
373 u32 etp_rejected; /* Trunk ETP rejected */
374 u32 lr_recvd; /* Trunk LR received */
375 u32 rsvd; /* padding for 64 bit alignment */
376};
377
378struct bfa_fw_advsm_stats_s {
379 u32 flogi_sent; /* Flogi sent */
380 u32 flogi_acc_recvd; /* Flogi Acc received */
381 u32 flogi_rjt_recvd; /* Flogi rejects received */
382 u32 flogi_retries; /* Flogi retries */
383
384 u32 elp_recvd; /* ELP received */
385 u32 elp_accepted; /* ELP Accepted */
386 u32 elp_rejected; /* ELP rejected */
387 u32 elp_dropped; /* ELP dropped */
388};
389
Jing Huangacdc79a2010-10-18 17:15:55 -0700390/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700391 * IOCFC firmware stats
392 */
393struct bfa_fw_iocfc_stats_s {
394 u32 cfg_reqs; /* cfg request */
395 u32 updq_reqs; /* update queue request */
396 u32 ic_reqs; /* interrupt coalesce reqs */
397 u32 unknown_reqs;
398 u32 set_intr_reqs; /* set interrupt reqs */
399};
400
Jing Huangacdc79a2010-10-18 17:15:55 -0700401/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700402 * IOC attributes returned in queries
403 */
404struct bfa_iocfc_attr_s {
405 struct bfa_iocfc_cfg_s config; /* IOCFC config */
406 struct bfa_iocfc_intr_attr_s intr_attr; /* interrupt attr */
407};
408
Jing Huangacdc79a2010-10-18 17:15:55 -0700409/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700410 * Eth_sndrcv mod stats
411 */
412struct bfa_fw_eth_sndrcv_stats_s {
413 u32 crc_err;
414 u32 rsvd; /* 64bit align */
415};
416
Jing Huangacdc79a2010-10-18 17:15:55 -0700417/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700418 * CT MAC mod stats
419 */
420struct bfa_fw_mac_mod_stats_s {
421 u32 mac_on; /* MAC got turned-on */
422 u32 link_up; /* link-up */
423 u32 signal_off; /* lost signal */
424 u32 dfe_on; /* DFE on */
425 u32 mac_reset; /* # of MAC reset to bring lnk up */
426 u32 pcs_reset; /* # of PCS reset to bring lnk up */
427 u32 loopback; /* MAC got into serdes loopback */
428 u32 lb_mac_reset;
429 /* # of MAC reset to bring link up in loopback */
430 u32 lb_pcs_reset;
431 /* # of PCS reset to bring link up in loopback */
432 u32 rsvd; /* 64bit align */
433};
434
Jing Huangacdc79a2010-10-18 17:15:55 -0700435/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700436 * CT MOD stats
437 */
438struct bfa_fw_ct_mod_stats_s {
439 u32 rxa_rds_undrun; /* RxA RDS underrun */
440 u32 rad_bpc_ovfl; /* RAD BPC overflow */
441 u32 rad_rlb_bpc_ovfl; /* RAD RLB BPC overflow */
442 u32 bpc_fcs_err; /* BPC FCS_ERR */
443 u32 txa_tso_hdr; /* TxA TSO header too long */
444 u32 rsvd; /* 64bit align */
445};
446
Jing Huangacdc79a2010-10-18 17:15:55 -0700447/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700448 * IOC firmware stats
449 */
450struct bfa_fw_stats_s {
451 struct bfa_fw_ioc_stats_s ioc_stats;
452 struct bfa_fw_iocfc_stats_s iocfc_stats;
453 struct bfa_fw_io_stats_s io_stats;
454 struct bfa_fw_port_stats_s port_stats;
455 struct bfa_fw_fcxchg_stats_s fcxchg_stats;
456 struct bfa_fw_lpsm_stats_s lpsm_stats;
457 struct bfa_fw_lps_stats_s lps_stats;
458 struct bfa_fw_trunk_stats_s trunk_stats;
459 struct bfa_fw_advsm_stats_s advsm_stats;
460 struct bfa_fw_mac_mod_stats_s macmod_stats;
461 struct bfa_fw_ct_mod_stats_s ctmod_stats;
462 struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats;
463};
464
465#define BFA_IOCFC_PATHTOV_MAX 60
466#define BFA_IOCFC_QDEPTH_MAX 2000
467
Jing Huangacdc79a2010-10-18 17:15:55 -0700468/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700469 * QoS states
470 */
471enum bfa_qos_state {
Krishna Gudipati3ec4f2c2011-07-20 17:03:09 -0700472 BFA_QOS_DISABLED = 0, /* QoS is disabled */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700473 BFA_QOS_ONLINE = 1, /* QoS is online */
474 BFA_QOS_OFFLINE = 2, /* QoS is offline */
475};
476
Jing Huangacdc79a2010-10-18 17:15:55 -0700477/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700478 * QoS Priority levels.
479 */
480enum bfa_qos_priority {
481 BFA_QOS_UNKNOWN = 0,
482 BFA_QOS_HIGH = 1, /* QoS Priority Level High */
483 BFA_QOS_MED = 2, /* QoS Priority Level Medium */
484 BFA_QOS_LOW = 3, /* QoS Priority Level Low */
485};
486
Jing Huangacdc79a2010-10-18 17:15:55 -0700487/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700488 * QoS bandwidth allocation for each priority level
489 */
490enum bfa_qos_bw_alloc {
491 BFA_QOS_BW_HIGH = 60, /* bandwidth allocation for High */
492 BFA_QOS_BW_MED = 30, /* bandwidth allocation for Medium */
493 BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */
494};
495#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -0700496/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700497 * QoS attribute returned in QoS Query
498 */
499struct bfa_qos_attr_s {
500 u8 state; /* QoS current state */
501 u8 rsvd[3];
502 u32 total_bb_cr; /* Total BB Credits */
503};
504
Jing Huangacdc79a2010-10-18 17:15:55 -0700505/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700506 * These fields should be displayed only from the CLI.
507 * There will be a separate BFAL API (get_qos_vc_attr ?)
508 * to retrieve this.
509 *
510 */
511#define BFA_QOS_MAX_VC 16
512
513struct bfa_qos_vc_info_s {
514 u8 vc_credit;
515 u8 borrow_credit;
516 u8 priority;
517 u8 resvd;
518};
519
520struct bfa_qos_vc_attr_s {
521 u16 total_vc_count; /* Total VC Count */
522 u16 shared_credit;
523 u32 elp_opmode_flags;
524 struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC]; /* as many as
525 * total_vc_count */
526};
527
Jing Huangacdc79a2010-10-18 17:15:55 -0700528/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700529 * QoS statistics
530 */
531struct bfa_qos_stats_s {
532 u32 flogi_sent; /* QoS Flogi sent */
533 u32 flogi_acc_recvd; /* QoS Flogi Acc received */
534 u32 flogi_rjt_recvd; /* QoS Flogi rejects received */
535 u32 flogi_retries; /* QoS Flogi retries */
536
537 u32 elp_recvd; /* QoS ELP received */
538 u32 elp_accepted; /* QoS ELP Accepted */
539 u32 elp_rejected; /* QoS ELP rejected */
540 u32 elp_dropped; /* QoS ELP dropped */
541
542 u32 qos_rscn_recvd; /* QoS RSCN received */
543 u32 rsvd; /* padding for 64 bit alignment */
544};
545
Jing Huangacdc79a2010-10-18 17:15:55 -0700546/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700547 * FCoE statistics
548 */
549struct bfa_fcoe_stats_s {
550 u64 secs_reset; /* Seconds since stats reset */
551 u64 cee_linkups; /* CEE link up */
552 u64 cee_linkdns; /* CEE link down */
553 u64 fip_linkups; /* FIP link up */
554 u64 fip_linkdns; /* FIP link down */
555 u64 fip_fails; /* FIP failures */
556 u64 mac_invalids; /* Invalid mac assignments */
557 u64 vlan_req; /* Vlan requests */
558 u64 vlan_notify; /* Vlan notifications */
559 u64 vlan_err; /* Vlan notification errors */
560 u64 vlan_timeouts; /* Vlan request timeouts */
561 u64 vlan_invalids; /* Vlan invalids */
562 u64 disc_req; /* Discovery requests */
563 u64 disc_rsp; /* Discovery responses */
564 u64 disc_err; /* Discovery error frames */
565 u64 disc_unsol; /* Discovery unsolicited */
566 u64 disc_timeouts; /* Discovery timeouts */
567 u64 disc_fcf_unavail; /* Discovery FCF not avail */
568 u64 linksvc_unsupp; /* FIP link service req unsupp. */
569 u64 linksvc_err; /* FIP link service req errors */
570 u64 logo_req; /* FIP logos received */
571 u64 clrvlink_req; /* Clear virtual link requests */
572 u64 op_unsupp; /* FIP operation unsupp. */
573 u64 untagged; /* FIP untagged frames */
574 u64 txf_ucast; /* Tx FCoE unicast frames */
575 u64 txf_ucast_vlan; /* Tx FCoE unicast vlan frames */
576 u64 txf_ucast_octets; /* Tx FCoE unicast octets */
577 u64 txf_mcast; /* Tx FCoE multicast frames */
578 u64 txf_mcast_vlan; /* Tx FCoE multicast vlan frames */
579 u64 txf_mcast_octets; /* Tx FCoE multicast octets */
580 u64 txf_bcast; /* Tx FCoE broadcast frames */
581 u64 txf_bcast_vlan; /* Tx FCoE broadcast vlan frames */
582 u64 txf_bcast_octets; /* Tx FCoE broadcast octets */
583 u64 txf_timeout; /* Tx timeouts */
584 u64 txf_parity_errors; /* Transmit parity err */
585 u64 txf_fid_parity_errors; /* Transmit FID parity err */
586 u64 rxf_ucast_octets; /* Rx FCoE unicast octets */
587 u64 rxf_ucast; /* Rx FCoE unicast frames */
588 u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */
589 u64 rxf_mcast_octets; /* Rx FCoE multicast octets */
590 u64 rxf_mcast; /* Rx FCoE multicast frames */
591 u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */
592 u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */
593 u64 rxf_bcast; /* Rx FCoE broadcast frames */
594 u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
595};
596
Jing Huangacdc79a2010-10-18 17:15:55 -0700597/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700598 * QoS or FCoE stats (fcport stats excluding physical FC port stats)
599 */
600union bfa_fcport_stats_u {
601 struct bfa_qos_stats_s fcqos;
602 struct bfa_fcoe_stats_s fcoe;
603};
604#pragma pack()
605
606struct bfa_fcpim_del_itn_stats_s {
607 u32 del_itn_iocomp_aborted; /* Aborted IO requests */
608 u32 del_itn_iocomp_timedout; /* IO timeouts */
609 u32 del_itn_iocom_sqer_needed; /* IO retry for SQ error recovery */
610 u32 del_itn_iocom_res_free; /* Delayed freeing of IO resources */
611 u32 del_itn_iocom_hostabrts; /* Host IO abort requests */
612 u32 del_itn_total_ios; /* Total IO count */
613 u32 del_io_iocdowns; /* IO cleaned-up due to IOC down */
614 u32 del_tm_iocdowns; /* TM cleaned-up due to IOC down */
615};
616
617struct bfa_itnim_iostats_s {
618
619 u32 total_ios; /* Total IO Requests */
620 u32 input_reqs; /* Data in-bound requests */
621 u32 output_reqs; /* Data out-bound requests */
622 u32 io_comps; /* Total IO Completions */
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300623 u32 wr_throughput; /* Write data transferred in bytes */
624 u32 rd_throughput; /* Read data transferred in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700625
626 u32 iocomp_ok; /* Slowpath IO completions */
627 u32 iocomp_underrun; /* IO underrun */
628 u32 iocomp_overrun; /* IO overrun */
629 u32 qwait; /* IO Request-Q wait */
630 u32 qresumes; /* IO Request-Q wait done */
631 u32 no_iotags; /* No free IO tag */
632 u32 iocomp_timedout; /* IO timeouts */
633 u32 iocom_nexus_abort; /* IO failure due to target offline */
634 u32 iocom_proto_err; /* IO protocol errors */
635 u32 iocom_dif_err; /* IO SBC-3 protection errors */
636
637 u32 iocom_sqer_needed; /* fcp-2 error recovery failed */
638 u32 iocom_res_free; /* Delayed freeing of IO tag */
639
640
641 u32 io_aborts; /* Host IO abort requests */
642 u32 iocom_hostabrts; /* Host IO abort completions */
643 u32 io_cleanups; /* IO clean-up requests */
644 u32 path_tov_expired; /* IO path tov expired */
645 u32 iocomp_aborted; /* IO abort completions */
646 u32 io_iocdowns; /* IO cleaned-up due to IOC down */
647 u32 iocom_utags; /* IO comp with unknown tags */
648
649 u32 io_tmaborts; /* Abort request due to TM command */
650 u32 tm_io_comps; /* Abort completion due to TM command */
651
652 u32 creates; /* IT Nexus create requests */
653 u32 fw_create; /* IT Nexus FW create requests */
654 u32 create_comps; /* IT Nexus FW create completions */
655 u32 onlines; /* IT Nexus onlines */
656 u32 offlines; /* IT Nexus offlines */
657 u32 fw_delete; /* IT Nexus FW delete requests */
658 u32 delete_comps; /* IT Nexus FW delete completions */
659 u32 deletes; /* IT Nexus delete requests */
660 u32 sler_events; /* SLER events */
661 u32 ioc_disabled; /* Num IOC disables */
662 u32 cleanup_comps; /* IT Nexus cleanup completions */
663
664 u32 tm_cmnds; /* TM Requests */
665 u32 tm_fw_rsps; /* TM Completions */
666 u32 tm_success; /* TM initiated IO cleanup success */
667 u32 tm_failures; /* TM initiated IO cleanup failure */
668 u32 no_tskims; /* No free TM tag */
669 u32 tm_qwait; /* TM Request-Q wait */
670 u32 tm_qresumes; /* TM Request-Q wait done */
671
672 u32 tm_iocdowns; /* TM cleaned-up due to IOC down */
673 u32 tm_cleanups; /* TM cleanup requests */
674 u32 tm_cleanup_comps; /* TM cleanup completions */
675};
676
677/* Modify char* port_stt[] in bfal_port.c if a new state was added */
678enum bfa_port_states {
679 BFA_PORT_ST_UNINIT = 1,
680 BFA_PORT_ST_ENABLING_QWAIT = 2,
681 BFA_PORT_ST_ENABLING = 3,
682 BFA_PORT_ST_LINKDOWN = 4,
683 BFA_PORT_ST_LINKUP = 5,
684 BFA_PORT_ST_DISABLING_QWAIT = 6,
685 BFA_PORT_ST_DISABLING = 7,
686 BFA_PORT_ST_DISABLED = 8,
687 BFA_PORT_ST_STOPPED = 9,
688 BFA_PORT_ST_IOCDOWN = 10,
689 BFA_PORT_ST_IOCDIS = 11,
690 BFA_PORT_ST_FWMISMATCH = 12,
691 BFA_PORT_ST_PREBOOT_DISABLED = 13,
692 BFA_PORT_ST_TOGGLING_QWAIT = 14,
Krishna Gudipatia7141342011-06-24 20:23:19 -0700693 BFA_PORT_ST_ACQ_ADDR = 15,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700694 BFA_PORT_ST_MAX_STATE,
695};
696
Jing Huangacdc79a2010-10-18 17:15:55 -0700697/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700698 * Port operational type (in sync with SNIA port type).
699 */
700enum bfa_port_type {
701 BFA_PORT_TYPE_UNKNOWN = 1, /* port type is unknown */
702 BFA_PORT_TYPE_NPORT = 5, /* P2P with switched fabric */
703 BFA_PORT_TYPE_NLPORT = 6, /* public loop */
704 BFA_PORT_TYPE_LPORT = 20, /* private loop */
705 BFA_PORT_TYPE_P2P = 21, /* P2P with no switched fabric */
706 BFA_PORT_TYPE_VPORT = 22, /* NPIV - virtual port */
707};
708
Jing Huangacdc79a2010-10-18 17:15:55 -0700709/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700710 * Port topology setting. A port's topology and fabric login status
711 * determine its operational type.
712 */
713enum bfa_port_topology {
714 BFA_PORT_TOPOLOGY_NONE = 0, /* No valid topology */
715 BFA_PORT_TOPOLOGY_P2P = 1, /* P2P only */
716 BFA_PORT_TOPOLOGY_LOOP = 2, /* LOOP topology */
717 BFA_PORT_TOPOLOGY_AUTO = 3, /* auto topology selection */
718};
719
Jing Huangacdc79a2010-10-18 17:15:55 -0700720/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700721 * Physical port loopback types.
722 */
723enum bfa_port_opmode {
724 BFA_PORT_OPMODE_NORMAL = 0x00, /* normal non-loopback mode */
725 BFA_PORT_OPMODE_LB_INT = 0x01, /* internal loop back */
726 BFA_PORT_OPMODE_LB_SLW = 0x02, /* serial link wrapback (serdes) */
727 BFA_PORT_OPMODE_LB_EXT = 0x04, /* external loop back (serdes) */
728 BFA_PORT_OPMODE_LB_CBL = 0x08, /* cabled loop back */
729 BFA_PORT_OPMODE_LB_NLINT = 0x20, /* NL_Port internal loopback */
730};
731
732#define BFA_PORT_OPMODE_LB_HARD(_mode) \
733 ((_mode == BFA_PORT_OPMODE_LB_INT) || \
734 (_mode == BFA_PORT_OPMODE_LB_SLW) || \
735 (_mode == BFA_PORT_OPMODE_LB_EXT))
736
Jing Huangacdc79a2010-10-18 17:15:55 -0700737/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700738 * Port link state
739 */
740enum bfa_port_linkstate {
741 BFA_PORT_LINKUP = 1, /* Physical port/Trunk link up */
742 BFA_PORT_LINKDOWN = 2, /* Physical port/Trunk link down */
743};
744
Jing Huangacdc79a2010-10-18 17:15:55 -0700745/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700746 * Port link state reason code
747 */
748enum bfa_port_linkstate_rsn {
749 BFA_PORT_LINKSTATE_RSN_NONE = 0,
750 BFA_PORT_LINKSTATE_RSN_DISABLED = 1,
751 BFA_PORT_LINKSTATE_RSN_RX_NOS = 2,
752 BFA_PORT_LINKSTATE_RSN_RX_OLS = 3,
753 BFA_PORT_LINKSTATE_RSN_RX_LIP = 4,
754 BFA_PORT_LINKSTATE_RSN_RX_LIPF7 = 5,
755 BFA_PORT_LINKSTATE_RSN_SFP_REMOVED = 6,
756 BFA_PORT_LINKSTATE_RSN_PORT_FAULT = 7,
757 BFA_PORT_LINKSTATE_RSN_RX_LOS = 8,
758 BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9,
759 BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10,
760 BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11,
761
762
763
764 /* CEE related reason codes/errors */
765 CEE_LLDP_INFO_AGED_OUT = 20,
766 CEE_LLDP_SHUTDOWN_TLV_RCVD = 21,
767 CEE_PEER_NOT_ADVERTISE_DCBX = 22,
768 CEE_PEER_NOT_ADVERTISE_PG = 23,
769 CEE_PEER_NOT_ADVERTISE_PFC = 24,
770 CEE_PEER_NOT_ADVERTISE_FCOE = 25,
771 CEE_PG_NOT_COMPATIBLE = 26,
772 CEE_PFC_NOT_COMPATIBLE = 27,
773 CEE_FCOE_NOT_COMPATIBLE = 28,
774 CEE_BAD_PG_RCVD = 29,
775 CEE_BAD_BW_RCVD = 30,
776 CEE_BAD_PFC_RCVD = 31,
777 CEE_BAD_APP_PRI_RCVD = 32,
778 CEE_FCOE_PRI_PFC_OFF = 33,
779 CEE_DUP_CONTROL_TLV_RCVD = 34,
780 CEE_DUP_FEAT_TLV_RCVD = 35,
781 CEE_APPLY_NEW_CFG = 36, /* reason, not error */
782 CEE_PROTOCOL_INIT = 37, /* reason, not error */
783 CEE_PHY_LINK_DOWN = 38,
784 CEE_LLS_FCOE_ABSENT = 39,
785 CEE_LLS_FCOE_DOWN = 40,
786 CEE_ISCSI_NOT_COMPATIBLE = 41,
787 CEE_ISCSI_PRI_PFC_OFF = 42,
788 CEE_ISCSI_PRI_OVERLAP_FCOE_PRI = 43
789};
790#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -0700791/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700792 * Physical port configuration
793 */
794struct bfa_port_cfg_s {
795 u8 topology; /* bfa_port_topology */
796 u8 speed; /* enum bfa_port_speed */
797 u8 trunked; /* trunked or not */
798 u8 qos_enabled; /* qos enabled or not */
799 u8 cfg_hardalpa; /* is hard alpa configured */
800 u8 hardalpa; /* configured hard alpa */
Maggie50444a32010-11-29 18:26:32 -0800801 __be16 maxfrsize; /* maximum frame size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700802 u8 rx_bbcredit; /* receive buffer credits */
803 u8 tx_bbcredit; /* transmit buffer credits */
804 u8 ratelimit; /* ratelimit enabled or not */
805 u8 trl_def_speed; /* ratelimit default speed */
Krishna Gudipatid7be54c2011-06-24 20:24:52 -0700806 u8 bb_scn; /* BB_SCN value from FLOGI Exchg */
807 u8 bb_scn_state; /* Config state of BB_SCN */
Krishna Gudipatia7141342011-06-24 20:23:19 -0700808 u8 faa_state; /* FAA enabled/disabled */
Krishna Gudipatid7be54c2011-06-24 20:24:52 -0700809 u8 rsvd[1];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700810 u16 path_tov; /* device path timeout */
811 u16 q_depth; /* SCSI Queue depth */
812};
813#pragma pack()
814
Jing Huangacdc79a2010-10-18 17:15:55 -0700815/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700816 * Port attribute values.
817 */
818struct bfa_port_attr_s {
819 /*
820 * Static fields
821 */
822 wwn_t nwwn; /* node wwn */
823 wwn_t pwwn; /* port wwn */
824 wwn_t factorynwwn; /* factory node wwn */
825 wwn_t factorypwwn; /* factory port wwn */
826 enum fc_cos cos_supported; /* supported class of services */
827 u32 rsvd;
828 struct fc_symname_s port_symname; /* port symbolic name */
829 enum bfa_port_speed speed_supported; /* supported speeds */
830 bfa_boolean_t pbind_enabled;
831
832 /*
833 * Configured values
834 */
835 struct bfa_port_cfg_s pport_cfg; /* pport cfg */
836
837 /*
838 * Dynamic field - info from BFA
839 */
840 enum bfa_port_states port_state; /* current port state */
841 enum bfa_port_speed speed; /* current speed */
842 enum bfa_port_topology topology; /* current topology */
843 bfa_boolean_t beacon; /* current beacon status */
844 bfa_boolean_t link_e2e_beacon; /* link beacon is on */
Krishna Gudipatibe540a92011-06-13 15:53:04 -0700845 bfa_boolean_t bbsc_op_status; /* fc credit recovery oper state */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700846
847 /*
848 * Dynamic field - info from FCS
849 */
850 u32 pid; /* port ID */
851 enum bfa_port_type port_type; /* current topology */
852 u32 loopback; /* external loopback */
853 u32 authfail; /* auth fail state */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700854
855 /* FCoE specific */
856 u16 fcoe_vlan;
Krishna Gudipatid7be54c2011-06-24 20:24:52 -0700857 u8 rsvd1[2];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700858};
859
Jing Huangacdc79a2010-10-18 17:15:55 -0700860/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700861 * Port FCP mappings.
862 */
863struct bfa_port_fcpmap_s {
864 char osdevname[256];
865 u32 bus;
866 u32 target;
867 u32 oslun;
868 u32 fcid;
869 wwn_t nwwn;
870 wwn_t pwwn;
871 u64 fcplun;
872 char luid[256];
873};
874
Jing Huangacdc79a2010-10-18 17:15:55 -0700875/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700876 * Port RNID info.
877 */
878struct bfa_port_rnid_s {
879 wwn_t wwn;
880 u32 unittype;
881 u32 portid;
882 u32 attached_nodes_num;
883 u16 ip_version;
884 u16 udp_port;
885 u8 ipaddr[16];
886 u16 rsvd;
887 u16 topologydiscoveryflags;
888};
889
890#pragma pack(1)
891struct bfa_fcport_fcf_s {
892 wwn_t name; /* FCF name */
893 wwn_t fabric_name; /* Fabric Name */
894 u8 fipenabled; /* FIP enabled or not */
895 u8 fipfailed; /* FIP failed or not */
896 u8 resv[2];
897 u8 pri; /* FCF priority */
898 u8 version; /* FIP version used */
899 u8 available; /* Available for login */
900 u8 fka_disabled; /* FKA is disabled */
901 u8 maxsz_verified; /* FCoE max size verified */
902 u8 fc_map[3]; /* FC map */
Maggie50444a32010-11-29 18:26:32 -0800903 __be16 vlan; /* FCoE vlan tag/priority */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700904 u32 fka_adv_per; /* FIP ka advert. period */
905 mac_t mac; /* FCF mac */
906};
907
Jing Huangacdc79a2010-10-18 17:15:55 -0700908/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700909 * Trunk states for BCU/BFAL
910 */
911enum bfa_trunk_state {
912 BFA_TRUNK_DISABLED = 0, /* Trunk is not configured */
913 BFA_TRUNK_ONLINE = 1, /* Trunk is online */
914 BFA_TRUNK_OFFLINE = 2, /* Trunk is offline */
915};
916
Jing Huangacdc79a2010-10-18 17:15:55 -0700917/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700918 * VC attributes for trunked link
919 */
920struct bfa_trunk_vc_attr_s {
921 u32 bb_credit;
922 u32 elp_opmode_flags;
923 u32 req_credit;
924 u16 vc_credits[8];
925};
926
Jing Huangacdc79a2010-10-18 17:15:55 -0700927/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700928 * Link state information
929 */
930struct bfa_port_link_s {
931 u8 linkstate; /* Link state bfa_port_linkstate */
932 u8 linkstate_rsn; /* bfa_port_linkstate_rsn_t */
933 u8 topology; /* P2P/LOOP bfa_port_topology */
934 u8 speed; /* Link speed (1/2/4/8 G) */
935 u32 linkstate_opt; /* Linkstate optional data (debug) */
936 u8 trunked; /* Trunked or not (1 or 0) */
937 u8 resvd[3];
938 struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
939 union {
940 struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */
941 struct bfa_trunk_vc_attr_s trunk_vc_attr;
942 struct bfa_fcport_fcf_s fcf; /* FCF information (for FCoE) */
943 } vc_fcf;
944};
945#pragma pack()
946
947enum bfa_trunk_link_fctl {
948 BFA_TRUNK_LINK_FCTL_NORMAL,
949 BFA_TRUNK_LINK_FCTL_VC,
950 BFA_TRUNK_LINK_FCTL_VC_QOS,
951};
952
953enum bfa_trunk_link_state {
954 BFA_TRUNK_LINK_STATE_UP = 1, /* link part of trunk */
955 BFA_TRUNK_LINK_STATE_DN_LINKDN = 2, /* physical link down */
956 BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3, /* trunk group different */
957 BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4, /* speed mismatch */
958 BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5, /* remote port not trunked */
959};
960
961#define BFA_TRUNK_MAX_PORTS 2
962struct bfa_trunk_link_attr_s {
963 wwn_t trunk_wwn;
964 enum bfa_trunk_link_fctl fctl;
965 enum bfa_trunk_link_state link_state;
966 enum bfa_port_speed speed;
967 u32 deskew;
968};
969
970struct bfa_trunk_attr_s {
971 enum bfa_trunk_state state;
972 enum bfa_port_speed speed;
973 u32 port_id;
974 u32 rsvd;
975 struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
976};
977
978struct bfa_rport_hal_stats_s {
979 u32 sm_un_cr; /* uninit: create events */
980 u32 sm_un_unexp; /* uninit: exception events */
981 u32 sm_cr_on; /* created: online events */
982 u32 sm_cr_del; /* created: delete events */
983 u32 sm_cr_hwf; /* created: IOC down */
984 u32 sm_cr_unexp; /* created: exception events */
985 u32 sm_fwc_rsp; /* fw create: f/w responses */
986 u32 sm_fwc_del; /* fw create: delete events */
987 u32 sm_fwc_off; /* fw create: offline events */
988 u32 sm_fwc_hwf; /* fw create: IOC down */
989 u32 sm_fwc_unexp; /* fw create: exception events*/
990 u32 sm_on_off; /* online: offline events */
991 u32 sm_on_del; /* online: delete events */
992 u32 sm_on_hwf; /* online: IOC down events */
993 u32 sm_on_unexp; /* online: exception events */
994 u32 sm_fwd_rsp; /* fw delete: fw responses */
995 u32 sm_fwd_del; /* fw delete: delete events */
996 u32 sm_fwd_hwf; /* fw delete: IOC down events */
997 u32 sm_fwd_unexp; /* fw delete: exception events*/
998 u32 sm_off_del; /* offline: delete events */
999 u32 sm_off_on; /* offline: online events */
1000 u32 sm_off_hwf; /* offline: IOC down events */
1001 u32 sm_off_unexp; /* offline: exception events */
1002 u32 sm_del_fwrsp; /* delete: fw responses */
1003 u32 sm_del_hwf; /* delete: IOC down events */
1004 u32 sm_del_unexp; /* delete: exception events */
1005 u32 sm_delp_fwrsp; /* delete pend: fw responses */
1006 u32 sm_delp_hwf; /* delete pend: IOC downs */
1007 u32 sm_delp_unexp; /* delete pend: exceptions */
1008 u32 sm_offp_fwrsp; /* off-pending: fw responses */
1009 u32 sm_offp_del; /* off-pending: deletes */
1010 u32 sm_offp_hwf; /* off-pending: IOC downs */
1011 u32 sm_offp_unexp; /* off-pending: exceptions */
1012 u32 sm_iocd_off; /* IOC down: offline events */
1013 u32 sm_iocd_del; /* IOC down: delete events */
1014 u32 sm_iocd_on; /* IOC down: online events */
1015 u32 sm_iocd_unexp; /* IOC down: exceptions */
1016 u32 rsvd;
1017};
1018#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -07001019/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001020 * Rport's QoS attributes
1021 */
1022struct bfa_rport_qos_attr_s {
1023 u8 qos_priority; /* rport's QoS priority */
1024 u8 rsvd[3];
1025 u32 qos_flow_id; /* QoS flow Id */
1026};
1027#pragma pack()
1028
1029#define BFA_IOBUCKET_MAX 14
1030
1031struct bfa_itnim_latency_s {
1032 u32 min[BFA_IOBUCKET_MAX];
1033 u32 max[BFA_IOBUCKET_MAX];
1034 u32 count[BFA_IOBUCKET_MAX];
1035 u32 avg[BFA_IOBUCKET_MAX];
1036};
1037
1038struct bfa_itnim_ioprofile_s {
1039 u32 clock_res_mul;
1040 u32 clock_res_div;
1041 u32 index;
1042 u32 io_profile_start_time; /* IO profile start time */
1043 u32 iocomps[BFA_IOBUCKET_MAX]; /* IO completed */
1044 struct bfa_itnim_latency_s io_latency;
1045};
1046
Jing Huangacdc79a2010-10-18 17:15:55 -07001047/*
Krishna Gudipati61e62e22011-06-24 20:29:07 -07001048 * vHBA port attribute values.
1049 */
1050struct bfa_vhba_attr_s {
1051 wwn_t nwwn; /* node wwn */
1052 wwn_t pwwn; /* port wwn */
1053 u32 pid; /* port ID */
1054 bfa_boolean_t io_profile; /* get it from fcpim mod */
1055 bfa_boolean_t plog_enabled; /* portlog is enabled */
1056 u16 path_tov;
1057 u8 rsvd[2];
1058};
1059
1060/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001061 * FC physical port statistics.
1062 */
1063struct bfa_port_fc_stats_s {
1064 u64 secs_reset; /* Seconds since stats is reset */
1065 u64 tx_frames; /* Tx frames */
1066 u64 tx_words; /* Tx words */
1067 u64 tx_lip; /* Tx LIP */
1068 u64 tx_nos; /* Tx NOS */
1069 u64 tx_ols; /* Tx OLS */
1070 u64 tx_lr; /* Tx LR */
1071 u64 tx_lrr; /* Tx LRR */
1072 u64 rx_frames; /* Rx frames */
1073 u64 rx_words; /* Rx words */
1074 u64 lip_count; /* Rx LIP */
1075 u64 nos_count; /* Rx NOS */
1076 u64 ols_count; /* Rx OLS */
1077 u64 lr_count; /* Rx LR */
1078 u64 lrr_count; /* Rx LRR */
1079 u64 invalid_crcs; /* Rx CRC err frames */
1080 u64 invalid_crc_gd_eof; /* Rx CRC err good EOF frames */
1081 u64 undersized_frm; /* Rx undersized frames */
1082 u64 oversized_frm; /* Rx oversized frames */
1083 u64 bad_eof_frm; /* Rx frames with bad EOF */
1084 u64 error_frames; /* Errored frames */
1085 u64 dropped_frames; /* Dropped frames */
1086 u64 link_failures; /* Link Failure (LF) count */
1087 u64 loss_of_syncs; /* Loss of sync count */
1088 u64 loss_of_signals; /* Loss of signal count */
1089 u64 primseq_errs; /* Primitive sequence protocol err. */
1090 u64 bad_os_count; /* Invalid ordered sets */
1091 u64 err_enc_out; /* Encoding err nonframe_8b10b */
1092 u64 err_enc; /* Encoding err frame_8b10b */
Krishna Gudipatibe540a92011-06-13 15:53:04 -07001093 u64 bbsc_frames_lost; /* Credit Recovery-Frames Lost */
1094 u64 bbsc_credits_lost; /* Credit Recovery-Credits Lost */
1095 u64 bbsc_link_resets; /* Credit Recovery-Link Resets */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001096};
1097
Jing Huangacdc79a2010-10-18 17:15:55 -07001098/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001099 * Eth Physical Port statistics.
1100 */
1101struct bfa_port_eth_stats_s {
1102 u64 secs_reset; /* Seconds since stats is reset */
1103 u64 frame_64; /* Frames 64 bytes */
1104 u64 frame_65_127; /* Frames 65-127 bytes */
1105 u64 frame_128_255; /* Frames 128-255 bytes */
1106 u64 frame_256_511; /* Frames 256-511 bytes */
1107 u64 frame_512_1023; /* Frames 512-1023 bytes */
1108 u64 frame_1024_1518; /* Frames 1024-1518 bytes */
1109 u64 frame_1519_1522; /* Frames 1519-1522 bytes */
1110 u64 tx_bytes; /* Tx bytes */
1111 u64 tx_packets; /* Tx packets */
1112 u64 tx_mcast_packets; /* Tx multicast packets */
1113 u64 tx_bcast_packets; /* Tx broadcast packets */
1114 u64 tx_control_frame; /* Tx control frame */
1115 u64 tx_drop; /* Tx drops */
1116 u64 tx_jabber; /* Tx jabber */
1117 u64 tx_fcs_error; /* Tx FCS errors */
1118 u64 tx_fragments; /* Tx fragments */
1119 u64 rx_bytes; /* Rx bytes */
1120 u64 rx_packets; /* Rx packets */
1121 u64 rx_mcast_packets; /* Rx multicast packets */
1122 u64 rx_bcast_packets; /* Rx broadcast packets */
1123 u64 rx_control_frames; /* Rx control frames */
1124 u64 rx_unknown_opcode; /* Rx unknown opcode */
1125 u64 rx_drop; /* Rx drops */
1126 u64 rx_jabber; /* Rx jabber */
1127 u64 rx_fcs_error; /* Rx FCS errors */
1128 u64 rx_alignment_error; /* Rx alignment errors */
1129 u64 rx_frame_length_error; /* Rx frame len errors */
1130 u64 rx_code_error; /* Rx code errors */
1131 u64 rx_fragments; /* Rx fragments */
1132 u64 rx_pause; /* Rx pause */
1133 u64 rx_zero_pause; /* Rx zero pause */
1134 u64 tx_pause; /* Tx pause */
1135 u64 tx_zero_pause; /* Tx zero pause */
1136 u64 rx_fcoe_pause; /* Rx FCoE pause */
1137 u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */
1138 u64 tx_fcoe_pause; /* Tx FCoE pause */
1139 u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
1140 u64 rx_iscsi_pause; /* Rx iSCSI pause */
1141 u64 rx_iscsi_zero_pause; /* Rx iSCSI zero pause */
1142 u64 tx_iscsi_pause; /* Tx iSCSI pause */
1143 u64 tx_iscsi_zero_pause; /* Tx iSCSI zero pause */
1144};
1145
Jing Huangacdc79a2010-10-18 17:15:55 -07001146/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001147 * Port statistics.
1148 */
1149union bfa_port_stats_u {
1150 struct bfa_port_fc_stats_s fc;
1151 struct bfa_port_eth_stats_s eth;
1152};
1153
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -07001154struct bfa_port_cfg_mode_s {
1155 u16 max_pf;
1156 u16 max_vf;
1157 enum bfa_mode_s mode;
1158};
1159
Krishna Gudipati148d6102011-06-24 20:25:36 -07001160#pragma pack(1)
1161
1162#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
1163#define BFA_CEE_DCBX_MAX_PRIORITY (8)
1164#define BFA_CEE_DCBX_MAX_PGID (8)
1165
1166struct bfa_cee_lldp_str_s {
1167 u8 sub_type;
1168 u8 len;
1169 u8 rsvd[2];
1170 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
1171};
1172
1173struct bfa_cee_lldp_cfg_s {
1174 struct bfa_cee_lldp_str_s chassis_id;
1175 struct bfa_cee_lldp_str_s port_id;
1176 struct bfa_cee_lldp_str_s port_desc;
1177 struct bfa_cee_lldp_str_s sys_name;
1178 struct bfa_cee_lldp_str_s sys_desc;
1179 struct bfa_cee_lldp_str_s mgmt_addr;
1180 u16 time_to_live;
1181 u16 enabled_system_cap;
1182};
1183
1184/* CEE/DCBX parameters */
1185struct bfa_cee_dcbx_cfg_s {
1186 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1187 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1188 u8 pfc_primap; /* bitmap of priorties with PFC enabled */
1189 u8 fcoe_primap; /* bitmap of priorities used for FcoE traffic */
1190 u8 iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
1191 u8 dcbx_version; /* operating version:CEE or preCEE */
1192 u8 lls_fcoe; /* FCoE Logical Link Status */
1193 u8 lls_lan; /* LAN Logical Link Status */
1194 u8 rsvd[2];
1195};
1196
1197/* CEE Query */
1198struct bfa_cee_attr_s {
1199 u8 cee_status;
1200 u8 error_reason;
1201 struct bfa_cee_lldp_cfg_s lldp_remote;
1202 struct bfa_cee_dcbx_cfg_s dcbx_remote;
1203 mac_t src_mac;
1204 u8 link_speed;
1205 u8 nw_priority;
1206 u8 filler[2];
1207};
1208
1209/* LLDP/DCBX/CEE Statistics */
1210struct bfa_cee_stats_s {
1211 u32 lldp_tx_frames; /* LLDP Tx Frames */
1212 u32 lldp_rx_frames; /* LLDP Rx Frames */
1213 u32 lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
1214 u32 lldp_rx_frames_new; /* LLDP Rx Frames new */
1215 u32 lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
1216 u32 lldp_rx_shutdown_tlvs; /* LLDP Rx shutdown TLVs */
1217 u32 lldp_info_aged_out; /* LLDP remote info aged */
1218 u32 dcbx_phylink_ups; /* DCBX phy link ups */
1219 u32 dcbx_phylink_downs; /* DCBX phy link downs */
1220 u32 dcbx_rx_tlvs; /* DCBX Rx TLVs */
1221 u32 dcbx_rx_tlvs_invalid; /* DCBX Rx TLVs invalid */
1222 u32 dcbx_control_tlv_error; /* DCBX control TLV errors */
1223 u32 dcbx_feature_tlv_error; /* DCBX feature TLV errors */
1224 u32 dcbx_cee_cfg_new; /* DCBX new CEE cfg rcvd */
1225 u32 cee_status_down; /* DCB status down */
1226 u32 cee_status_up; /* DCB status up */
1227 u32 cee_hw_cfg_changed; /* DCB hw cfg changed */
1228 u32 cee_rx_invalid_cfg; /* DCB invalid cfg */
1229};
1230
1231#pragma pack()
1232
Krishna Gudipati7826f302011-07-20 16:59:13 -07001233/*
1234 * AEN related definitions
1235 */
1236#define BFAD_NL_VENDOR_ID (((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) \
1237 | BFA_PCI_VENDOR_ID_BROCADE)
1238
1239/* BFA remote port events */
1240enum bfa_rport_aen_event {
1241 BFA_RPORT_AEN_ONLINE = 1, /* RPort online event */
1242 BFA_RPORT_AEN_OFFLINE = 2, /* RPort offline event */
1243 BFA_RPORT_AEN_DISCONNECT = 3, /* RPort disconnect event */
1244 BFA_RPORT_AEN_QOS_PRIO = 4, /* QOS priority change event */
1245 BFA_RPORT_AEN_QOS_FLOWID = 5, /* QOS flow Id change event */
1246};
1247
1248struct bfa_rport_aen_data_s {
1249 u16 vf_id; /* vf_id of this logical port */
1250 u16 rsvd[3];
1251 wwn_t ppwwn; /* WWN of its physical port */
1252 wwn_t lpwwn; /* WWN of this logical port */
1253 wwn_t rpwwn; /* WWN of this remote port */
1254 union {
1255 struct bfa_rport_qos_attr_s qos;
1256 } priv;
1257};
1258
1259union bfa_aen_data_u {
1260 struct bfa_adapter_aen_data_s adapter;
1261 struct bfa_port_aen_data_s port;
1262 struct bfa_lport_aen_data_s lport;
1263 struct bfa_rport_aen_data_s rport;
1264 struct bfa_itnim_aen_data_s itnim;
1265 struct bfa_audit_aen_data_s audit;
1266 struct bfa_ioc_aen_data_s ioc;
1267};
1268
1269#define BFA_AEN_MAX_ENTRY 512
1270
1271struct bfa_aen_entry_s {
1272 struct list_head qe;
1273 enum bfa_aen_category aen_category;
1274 u32 aen_type;
1275 union bfa_aen_data_u aen_data;
1276 struct timeval aen_tv;
1277 u32 seq_num;
1278 u32 bfad_num;
1279};
1280
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001281#endif /* __BFA_DEFS_SVC_H__ */