blob: ec03c8cd8dacd0ecb3961ba1233816880bc46c4a [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];
Jing Huang275a63a2011-11-16 12:28:49 -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 {
Jing Huang275a63a2011-11-16 12:28:49 -080045 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 */
50 u16 num_fwtio_reqs; /* number of TM IO reqs in FW */
51 u16 num_fcxp_reqs; /* unassisted FC exchanges */
52 u16 num_uf_bufs; /* unsolicited recv buffers */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070053 u8 num_cqs;
54 u8 fw_tick_res; /* FW clock resolution in ms */
Krishna Gudipatidb9d8a72012-03-13 17:39:36 -070055 u8 rsvd[6];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070056};
57#pragma pack()
58
59struct bfa_iocfc_drvcfg_s {
Jing Huang275a63a2011-11-16 12:28:49 -080060 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 */
68 u16 num_tio_reqs; /* number of TM IO reqs */
Krishna Gudipati60138062011-06-24 20:25:15 -070069 u8 port_mode;
70 u8 rsvd_a;
Jing Huang275a63a2011-11-16 12:28:49 -080071 bfa_boolean_t delay_comp; /* delay completion of failed
72 * 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 */
Jing Huang275a63a2011-11-16 12:28:49 -0800104 u32 error_rec; /* FW sending rec on
105 * an error condition*/
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700106 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 */
Jing Huang275a63a2011-11-16 12:28:49 -0800127 u32 fcp_rsp_under_run_wr; /* fcp rsp IO underrun for write */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700128 u32 fcp_rsp_under_run_err; /* fcp rsp IO underrun error */
Jing Huang275a63a2011-11-16 12:28:49 -0800129 u32 fcp_rsp_resid_inval; /* invalid residue */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700130 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 */
Jing Huang275a63a2011-11-16 12:28:49 -0800145 u32 ioh_len_err_event; /* IOH len error - fcp_dl !=
146 * bytes xfered */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700147 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
Jing Huang275a63a2011-11-16 12:28:49 -0800152 * count */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700153 u32 ioh_err_int; /* IOH error int during data-phase
Jing Huang275a63a2011-11-16 12:28:49 -0800154 * for scsi write */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700155};
156
Krishna Gudipati60138062011-06-24 20:25:15 -0700157struct bfa_fw_tio_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800158 u32 tio_conf_proc; /* TIO CONF processed */
Krishna Gudipati60138062011-06-24 20:25:15 -0700159 u32 tio_conf_drop; /* TIO CONF dropped */
160 u32 tio_cleanup_req; /* TIO cleanup requested */
161 u32 tio_cleanup_comp; /* TIO cleanup completed */
162 u32 tio_abort_rsp; /* TIO abort response */
163 u32 tio_abort_rsp_comp; /* TIO abort rsp completed */
164 u32 tio_abts_req; /* TIO ABTS requested */
165 u32 tio_abts_ack; /* TIO ABTS ack-ed */
Jing Huang275a63a2011-11-16 12:28:49 -0800166 u32 tio_abts_ack_nocomp;/* TIO ABTS ack-ed but not completed */
Krishna Gudipati60138062011-06-24 20:25:15 -0700167 u32 tio_abts_tmo; /* TIO ABTS timeout */
168 u32 tio_snsdata_dma; /* TIO sense data DMA */
Jing Huang275a63a2011-11-16 12:28:49 -0800169 u32 tio_rxwchan_wait; /* TIO waiting for RX wait channel */
170 u32 tio_rxwchan_avail; /* TIO RX wait channel available */
Krishna Gudipati60138062011-06-24 20:25:15 -0700171 u32 tio_hit_bls; /* TIO IOH BLS event */
172 u32 tio_uf_recv; /* TIO received UF */
Jing Huang275a63a2011-11-16 12:28:49 -0800173 u32 tio_rd_invalid_sm; /* TIO read reqst in wrong state machine */
174 u32 tio_wr_invalid_sm; /* TIO write reqst in wrong state machine */
Krishna Gudipati60138062011-06-24 20:25:15 -0700175
Jing Huang275a63a2011-11-16 12:28:49 -0800176 u32 ds_rxwchan_wait; /* DS waiting for RX wait channel */
177 u32 ds_rxwchan_avail; /* DS RX wait channel available */
Krishna Gudipati60138062011-06-24 20:25:15 -0700178 u32 ds_unaligned_rd; /* DS unaligned read */
Jing Huang275a63a2011-11-16 12:28:49 -0800179 u32 ds_rdcomp_invalid_sm; /* DS read completed in wrong state
180 * machine */
181 u32 ds_wrcomp_invalid_sm; /* DS write completed in wrong state
182 * machine */
Krishna Gudipati60138062011-06-24 20:25:15 -0700183 u32 ds_flush_req; /* DS flush requested */
184 u32 ds_flush_comp; /* DS flush completed */
185 u32 ds_xfrdy_exp; /* DS XFER_RDY expired */
186 u32 ds_seq_cnt_err; /* DS seq cnt error */
187 u32 ds_seq_len_err; /* DS seq len error */
188 u32 ds_data_oor; /* DS data out of order */
Jing Huang275a63a2011-11-16 12:28:49 -0800189 u32 ds_hit_bls; /* DS hit BLS */
Krishna Gudipati60138062011-06-24 20:25:15 -0700190 u32 ds_edtov_timer_exp; /* DS edtov expired */
191 u32 ds_cpu_owned; /* DS cpu owned */
192 u32 ds_hit_class2; /* DS hit class2 */
193 u32 ds_length_err; /* DS length error */
194 u32 ds_ro_ooo_err; /* DS relative offset out-of-order error */
Jing Huang275a63a2011-11-16 12:28:49 -0800195 u32 ds_rectov_timer_exp;/* DS rectov expired */
Krishna Gudipati60138062011-06-24 20:25:15 -0700196 u32 ds_unexp_fr_err; /* DS unexp frame error */
197};
198
199/*
200 * IOC firmware IO stats
201 */
202struct bfa_fw_io_stats_s {
203 struct bfa_fw_ioim_stats_s ioim_stats;
204 struct bfa_fw_tio_stats_s tio_stats;
205};
206
Jing Huangacdc79a2010-10-18 17:15:55 -0700207/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700208 * IOC port firmware stats
209 */
210
211struct bfa_fw_port_fpg_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800212 u32 intr_evt;
213 u32 intr;
214 u32 intr_excess;
215 u32 intr_cause0;
216 u32 intr_other;
217 u32 intr_other_ign;
218 u32 sig_lost;
219 u32 sig_regained;
220 u32 sync_lost;
221 u32 sync_to;
222 u32 sync_regained;
223 u32 div2_overflow;
224 u32 div2_underflow;
225 u32 efifo_overflow;
226 u32 efifo_underflow;
227 u32 idle_rx;
228 u32 lrr_rx;
229 u32 lr_rx;
230 u32 ols_rx;
231 u32 nos_rx;
232 u32 lip_rx;
233 u32 arbf0_rx;
234 u32 arb_rx;
235 u32 mrk_rx;
236 u32 const_mrk_rx;
237 u32 prim_unknown;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700238};
239
240
241struct bfa_fw_port_lksm_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800242 u32 hwsm_success; /* hwsm state machine success */
243 u32 hwsm_fails; /* hwsm fails */
244 u32 hwsm_wdtov; /* hwsm timed out */
245 u32 swsm_success; /* swsm success */
246 u32 swsm_fails; /* swsm fails */
247 u32 swsm_wdtov; /* swsm timed out */
248 u32 busybufs; /* link init failed due to busybuf */
249 u32 buf_waits; /* bufwait state entries */
250 u32 link_fails; /* link failures */
251 u32 psp_errors; /* primitive sequence protocol errors */
252 u32 lr_unexp; /* No. of times LR rx-ed unexpectedly */
253 u32 lrr_unexp; /* No. of times LRR rx-ed unexpectedly */
254 u32 lr_tx; /* No. of times LR tx started */
255 u32 lrr_tx; /* No. of times LRR tx started */
256 u32 ols_tx; /* No. of times OLS tx started */
257 u32 nos_tx; /* No. of times NOS tx started */
258 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */
259 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */
260 u32 bbsc_lr; /* LKSM LR tx for credit recovery */
Krishna Gudipati4a49b042012-09-21 17:27:01 -0700261 u32 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700262};
263
264struct bfa_fw_port_snsm_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800265 u32 hwsm_success; /* Successful hwsm terminations */
266 u32 hwsm_fails; /* hwsm fail count */
267 u32 hwsm_wdtov; /* hwsm timed out */
268 u32 swsm_success; /* swsm success */
269 u32 swsm_wdtov; /* swsm timed out */
270 u32 error_resets; /* error resets initiated by upsm */
271 u32 sync_lost; /* Sync loss count */
272 u32 sig_lost; /* Signal loss count */
273 u32 asn8g_attempts; /* SNSM HWSM at 8Gbps attempts */
Krishna Gudipati4a49b042012-09-21 17:27:01 -0700274 u32 adapt_success; /* SNSM adaptation success */
275 u32 adapt_fails; /* SNSM adaptation failures */
276 u32 adapt_ign_fails; /* SNSM adaptation failures ignored */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700277};
278
279struct bfa_fw_port_physm_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800280 u32 module_inserts; /* Module insert count */
281 u32 module_xtracts; /* Module extracts count */
282 u32 module_invalids; /* Invalid module inserted count */
283 u32 module_read_ign; /* Module validation status ignored */
284 u32 laser_faults; /* Laser fault count */
285 u32 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700286};
287
288struct bfa_fw_fip_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800289 u32 vlan_req; /* vlan discovery requests */
290 u32 vlan_notify; /* vlan notifications */
291 u32 vlan_err; /* vlan response error */
292 u32 vlan_timeouts; /* vlan disvoery timeouts */
293 u32 vlan_invalids; /* invalid vlan in discovery advert. */
294 u32 disc_req; /* Discovery solicit requests */
295 u32 disc_rsp; /* Discovery solicit response */
296 u32 disc_err; /* Discovery advt. parse errors */
297 u32 disc_unsol; /* Discovery unsolicited */
298 u32 disc_timeouts; /* Discovery timeouts */
299 u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */
300 u32 linksvc_unsupp; /* Unsupported link service req */
301 u32 linksvc_err; /* Parse error in link service req */
302 u32 logo_req; /* FIP logos received */
303 u32 clrvlink_req; /* Clear virtual link req */
304 u32 op_unsupp; /* Unsupported FIP operation */
305 u32 untagged; /* Untagged frames (ignored) */
306 u32 invalid_version; /* Invalid FIP version */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700307};
308
309struct bfa_fw_lps_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800310 u32 mac_invalids; /* Invalid mac assigned */
311 u32 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700312};
313
314struct bfa_fw_fcoe_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800315 u32 cee_linkups; /* CEE link up count */
316 u32 cee_linkdns; /* CEE link down count */
317 u32 fip_linkups; /* FIP link up count */
318 u32 fip_linkdns; /* FIP link up count */
319 u32 fip_fails; /* FIP fail count */
320 u32 mac_invalids; /* Invalid mac assigned */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700321};
322
Jing Huangacdc79a2010-10-18 17:15:55 -0700323/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700324 * IOC firmware FCoE port stats
325 */
326struct bfa_fw_fcoe_port_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800327 struct bfa_fw_fcoe_stats_s fcoe_stats;
328 struct bfa_fw_fip_stats_s fip_stats;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700329};
330
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -0700331/**
332 * @brief LPSM statistics
333 */
334struct bfa_fw_lpsm_stats_s {
335 u32 cls_rx; /* LPSM cls_rx */
336 u32 cls_tx; /* LPSM cls_tx */
337 u32 arbf0_rx; /* LPSM abrf0 rcvd */
338 u32 arbf0_tx; /* LPSM abrf0 xmit */
339 u32 init_rx; /* LPSM loop init start */
340 u32 unexp_hwst; /* LPSM unknown hw state */
341 u32 unexp_frame; /* LPSM unknown_frame */
342 u32 unexp_prim; /* LPSM unexpected primitive */
343 u32 prev_alpa_unavail; /* LPSM prev alpa unavailable */
344 u32 alpa_unavail; /* LPSM alpa not available */
345 u32 lip_rx; /* LPSM lip rcvd */
346 u32 lip_f7f7_rx; /* LPSM lip f7f7 rcvd */
347 u32 lip_f8_rx; /* LPSM lip f8 rcvd */
348 u32 lip_f8f7_rx; /* LPSM lip f8f7 rcvd */
349 u32 lip_other_rx; /* LPSM lip other rcvd */
350 u32 lip_tx; /* LPSM lip xmit */
351 u32 retry_tov; /* LPSM retry TOV */
352 u32 lip_tov; /* LPSM LIP wait TOV */
353 u32 idle_tov; /* LPSM idle wait TOV */
354 u32 arbf0_tov; /* LPSM arbfo wait TOV */
355 u32 stop_loop_tov; /* LPSM stop loop wait TOV */
356 u32 lixa_tov; /* LPSM lisa wait TOV */
357 u32 lixx_tov; /* LPSM lilp/lirp wait TOV */
358 u32 cls_tov; /* LPSM cls wait TOV */
359 u32 sler; /* LPSM SLER recvd */
360 u32 failed; /* LPSM failed */
361 u32 success; /* LPSM online */
362};
363
Jing Huangacdc79a2010-10-18 17:15:55 -0700364/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700365 * IOC firmware FC uport stats
366 */
367struct bfa_fw_fc_uport_stats_s {
368 struct bfa_fw_port_snsm_stats_s snsm_stats;
369 struct bfa_fw_port_lksm_stats_s lksm_stats;
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -0700370 struct bfa_fw_lpsm_stats_s lpsm_stats;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700371};
372
Jing Huangacdc79a2010-10-18 17:15:55 -0700373/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700374 * IOC firmware FC port stats
375 */
376union bfa_fw_fc_port_stats_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800377 struct bfa_fw_fc_uport_stats_s fc_stats;
378 struct bfa_fw_fcoe_port_stats_s fcoe_stats;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700379};
380
Jing Huangacdc79a2010-10-18 17:15:55 -0700381/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700382 * IOC firmware port stats
383 */
384struct bfa_fw_port_stats_s {
385 struct bfa_fw_port_fpg_stats_s fpg_stats;
386 struct bfa_fw_port_physm_stats_s physm_stats;
387 union bfa_fw_fc_port_stats_s fc_port;
388};
389
Jing Huangacdc79a2010-10-18 17:15:55 -0700390/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700391 * fcxchg module statistics
392 */
393struct bfa_fw_fcxchg_stats_s {
394 u32 ua_tag_inv;
395 u32 ua_state_inv;
396};
397
Jing Huangacdc79a2010-10-18 17:15:55 -0700398/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700399 * Trunk statistics
400 */
401struct bfa_fw_trunk_stats_s {
402 u32 emt_recvd; /* Trunk EMT received */
Jing Huang275a63a2011-11-16 12:28:49 -0800403 u32 emt_accepted; /* Trunk EMT Accepted */
404 u32 emt_rejected; /* Trunk EMT rejected */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700405 u32 etp_recvd; /* Trunk ETP received */
Jing Huang275a63a2011-11-16 12:28:49 -0800406 u32 etp_accepted; /* Trunk ETP Accepted */
407 u32 etp_rejected; /* Trunk ETP rejected */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700408 u32 lr_recvd; /* Trunk LR received */
Jing Huang275a63a2011-11-16 12:28:49 -0800409 u32 rsvd; /* padding for 64 bit alignment */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700410};
411
412struct bfa_fw_advsm_stats_s {
413 u32 flogi_sent; /* Flogi sent */
414 u32 flogi_acc_recvd; /* Flogi Acc received */
415 u32 flogi_rjt_recvd; /* Flogi rejects received */
Jing Huang275a63a2011-11-16 12:28:49 -0800416 u32 flogi_retries; /* Flogi retries */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700417
418 u32 elp_recvd; /* ELP received */
Jing Huang275a63a2011-11-16 12:28:49 -0800419 u32 elp_accepted; /* ELP Accepted */
420 u32 elp_rejected; /* ELP rejected */
421 u32 elp_dropped; /* ELP dropped */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700422};
423
Jing Huangacdc79a2010-10-18 17:15:55 -0700424/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700425 * IOCFC firmware stats
426 */
427struct bfa_fw_iocfc_stats_s {
428 u32 cfg_reqs; /* cfg request */
429 u32 updq_reqs; /* update queue request */
430 u32 ic_reqs; /* interrupt coalesce reqs */
431 u32 unknown_reqs;
432 u32 set_intr_reqs; /* set interrupt reqs */
433};
434
Jing Huangacdc79a2010-10-18 17:15:55 -0700435/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700436 * IOC attributes returned in queries
437 */
438struct bfa_iocfc_attr_s {
439 struct bfa_iocfc_cfg_s config; /* IOCFC config */
440 struct bfa_iocfc_intr_attr_s intr_attr; /* interrupt attr */
441};
442
Jing Huangacdc79a2010-10-18 17:15:55 -0700443/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700444 * Eth_sndrcv mod stats
445 */
446struct bfa_fw_eth_sndrcv_stats_s {
447 u32 crc_err;
448 u32 rsvd; /* 64bit align */
449};
450
Jing Huangacdc79a2010-10-18 17:15:55 -0700451/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700452 * CT MAC mod stats
453 */
454struct bfa_fw_mac_mod_stats_s {
455 u32 mac_on; /* MAC got turned-on */
456 u32 link_up; /* link-up */
457 u32 signal_off; /* lost signal */
458 u32 dfe_on; /* DFE on */
459 u32 mac_reset; /* # of MAC reset to bring lnk up */
460 u32 pcs_reset; /* # of PCS reset to bring lnk up */
461 u32 loopback; /* MAC got into serdes loopback */
462 u32 lb_mac_reset;
463 /* # of MAC reset to bring link up in loopback */
464 u32 lb_pcs_reset;
465 /* # of PCS reset to bring link up in loopback */
466 u32 rsvd; /* 64bit align */
467};
468
Jing Huangacdc79a2010-10-18 17:15:55 -0700469/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700470 * CT MOD stats
471 */
472struct bfa_fw_ct_mod_stats_s {
473 u32 rxa_rds_undrun; /* RxA RDS underrun */
474 u32 rad_bpc_ovfl; /* RAD BPC overflow */
475 u32 rad_rlb_bpc_ovfl; /* RAD RLB BPC overflow */
476 u32 bpc_fcs_err; /* BPC FCS_ERR */
477 u32 txa_tso_hdr; /* TxA TSO header too long */
478 u32 rsvd; /* 64bit align */
479};
480
Jing Huangacdc79a2010-10-18 17:15:55 -0700481/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700482 * IOC firmware stats
483 */
484struct bfa_fw_stats_s {
485 struct bfa_fw_ioc_stats_s ioc_stats;
486 struct bfa_fw_iocfc_stats_s iocfc_stats;
487 struct bfa_fw_io_stats_s io_stats;
488 struct bfa_fw_port_stats_s port_stats;
489 struct bfa_fw_fcxchg_stats_s fcxchg_stats;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700490 struct bfa_fw_lps_stats_s lps_stats;
491 struct bfa_fw_trunk_stats_s trunk_stats;
492 struct bfa_fw_advsm_stats_s advsm_stats;
493 struct bfa_fw_mac_mod_stats_s macmod_stats;
494 struct bfa_fw_ct_mod_stats_s ctmod_stats;
495 struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats;
496};
497
498#define BFA_IOCFC_PATHTOV_MAX 60
499#define BFA_IOCFC_QDEPTH_MAX 2000
500
Jing Huangacdc79a2010-10-18 17:15:55 -0700501/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700502 * QoS states
503 */
504enum bfa_qos_state {
Krishna Gudipati3ec4f2c2011-07-20 17:03:09 -0700505 BFA_QOS_DISABLED = 0, /* QoS is disabled */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700506 BFA_QOS_ONLINE = 1, /* QoS is online */
507 BFA_QOS_OFFLINE = 2, /* QoS is offline */
508};
509
Jing Huangacdc79a2010-10-18 17:15:55 -0700510/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700511 * QoS Priority levels.
512 */
513enum bfa_qos_priority {
514 BFA_QOS_UNKNOWN = 0,
515 BFA_QOS_HIGH = 1, /* QoS Priority Level High */
516 BFA_QOS_MED = 2, /* QoS Priority Level Medium */
517 BFA_QOS_LOW = 3, /* QoS Priority Level Low */
518};
519
Jing Huangacdc79a2010-10-18 17:15:55 -0700520/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700521 * QoS bandwidth allocation for each priority level
522 */
523enum bfa_qos_bw_alloc {
524 BFA_QOS_BW_HIGH = 60, /* bandwidth allocation for High */
525 BFA_QOS_BW_MED = 30, /* bandwidth allocation for Medium */
526 BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */
527};
528#pragma pack(1)
Krishna Gudipati6894f012012-09-21 17:26:31 -0700529
530struct bfa_qos_bw_s {
531 u8 qos_bw_set;
532 u8 high;
533 u8 med;
534 u8 low;
535};
536
Jing Huangacdc79a2010-10-18 17:15:55 -0700537/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700538 * QoS attribute returned in QoS Query
539 */
540struct bfa_qos_attr_s {
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -0700541 u8 state; /* QoS current state */
542 u8 rsvd1[3];
543 u32 total_bb_cr; /* Total BB Credits */
Krishna Gudipati6894f012012-09-21 17:26:31 -0700544 struct bfa_qos_bw_s qos_bw; /* QOS bw cfg */
545 struct bfa_qos_bw_s qos_bw_op; /* QOS bw operational */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700546};
547
Jing Huangacdc79a2010-10-18 17:15:55 -0700548/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700549 * These fields should be displayed only from the CLI.
550 * There will be a separate BFAL API (get_qos_vc_attr ?)
551 * to retrieve this.
552 *
553 */
554#define BFA_QOS_MAX_VC 16
555
556struct bfa_qos_vc_info_s {
557 u8 vc_credit;
558 u8 borrow_credit;
559 u8 priority;
560 u8 resvd;
561};
562
563struct bfa_qos_vc_attr_s {
564 u16 total_vc_count; /* Total VC Count */
565 u16 shared_credit;
566 u32 elp_opmode_flags;
Jing Huang275a63a2011-11-16 12:28:49 -0800567 struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC]; /* as many as
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700568 * total_vc_count */
569};
570
Jing Huangacdc79a2010-10-18 17:15:55 -0700571/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700572 * QoS statistics
573 */
574struct bfa_qos_stats_s {
575 u32 flogi_sent; /* QoS Flogi sent */
576 u32 flogi_acc_recvd; /* QoS Flogi Acc received */
Jing Huang275a63a2011-11-16 12:28:49 -0800577 u32 flogi_rjt_recvd; /* QoS Flogi rejects received */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700578 u32 flogi_retries; /* QoS Flogi retries */
579
580 u32 elp_recvd; /* QoS ELP received */
581 u32 elp_accepted; /* QoS ELP Accepted */
Jing Huang275a63a2011-11-16 12:28:49 -0800582 u32 elp_rejected; /* QoS ELP rejected */
583 u32 elp_dropped; /* QoS ELP dropped */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700584
Jing Huang275a63a2011-11-16 12:28:49 -0800585 u32 qos_rscn_recvd; /* QoS RSCN received */
586 u32 rsvd; /* padding for 64 bit alignment */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700587};
588
Jing Huangacdc79a2010-10-18 17:15:55 -0700589/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700590 * FCoE statistics
591 */
592struct bfa_fcoe_stats_s {
593 u64 secs_reset; /* Seconds since stats reset */
Jing Huang275a63a2011-11-16 12:28:49 -0800594 u64 cee_linkups; /* CEE link up */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700595 u64 cee_linkdns; /* CEE link down */
Jing Huang275a63a2011-11-16 12:28:49 -0800596 u64 fip_linkups; /* FIP link up */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700597 u64 fip_linkdns; /* FIP link down */
598 u64 fip_fails; /* FIP failures */
599 u64 mac_invalids; /* Invalid mac assignments */
600 u64 vlan_req; /* Vlan requests */
601 u64 vlan_notify; /* Vlan notifications */
602 u64 vlan_err; /* Vlan notification errors */
603 u64 vlan_timeouts; /* Vlan request timeouts */
604 u64 vlan_invalids; /* Vlan invalids */
605 u64 disc_req; /* Discovery requests */
Jing Huang275a63a2011-11-16 12:28:49 -0800606 u64 disc_rsp; /* Discovery responses */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700607 u64 disc_err; /* Discovery error frames */
608 u64 disc_unsol; /* Discovery unsolicited */
609 u64 disc_timeouts; /* Discovery timeouts */
610 u64 disc_fcf_unavail; /* Discovery FCF not avail */
Jing Huang275a63a2011-11-16 12:28:49 -0800611 u64 linksvc_unsupp; /* FIP link service req unsupp */
612 u64 linksvc_err; /* FIP link service req errors */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700613 u64 logo_req; /* FIP logos received */
Jing Huang275a63a2011-11-16 12:28:49 -0800614 u64 clrvlink_req; /* Clear virtual link requests */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700615 u64 op_unsupp; /* FIP operation unsupp. */
Jing Huang275a63a2011-11-16 12:28:49 -0800616 u64 untagged; /* FIP untagged frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700617 u64 txf_ucast; /* Tx FCoE unicast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800618 u64 txf_ucast_vlan; /* Tx FCoE unicast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700619 u64 txf_ucast_octets; /* Tx FCoE unicast octets */
620 u64 txf_mcast; /* Tx FCoE multicast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800621 u64 txf_mcast_vlan; /* Tx FCoE multicast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700622 u64 txf_mcast_octets; /* Tx FCoE multicast octets */
623 u64 txf_bcast; /* Tx FCoE broadcast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800624 u64 txf_bcast_vlan; /* Tx FCoE broadcast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700625 u64 txf_bcast_octets; /* Tx FCoE broadcast octets */
Jing Huang275a63a2011-11-16 12:28:49 -0800626 u64 txf_timeout; /* Tx timeouts */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700627 u64 txf_parity_errors; /* Transmit parity err */
Jing Huang275a63a2011-11-16 12:28:49 -0800628 u64 txf_fid_parity_errors; /* Transmit FID parity err */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700629 u64 rxf_ucast_octets; /* Rx FCoE unicast octets */
630 u64 rxf_ucast; /* Rx FCoE unicast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800631 u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700632 u64 rxf_mcast_octets; /* Rx FCoE multicast octets */
633 u64 rxf_mcast; /* Rx FCoE multicast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800634 u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700635 u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */
636 u64 rxf_bcast; /* Rx FCoE broadcast frames */
Jing Huang275a63a2011-11-16 12:28:49 -0800637 u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700638};
639
Jing Huangacdc79a2010-10-18 17:15:55 -0700640/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700641 * QoS or FCoE stats (fcport stats excluding physical FC port stats)
642 */
643union bfa_fcport_stats_u {
644 struct bfa_qos_stats_s fcqos;
645 struct bfa_fcoe_stats_s fcoe;
646};
647#pragma pack()
648
649struct bfa_fcpim_del_itn_stats_s {
650 u32 del_itn_iocomp_aborted; /* Aborted IO requests */
651 u32 del_itn_iocomp_timedout; /* IO timeouts */
652 u32 del_itn_iocom_sqer_needed; /* IO retry for SQ error recovery */
653 u32 del_itn_iocom_res_free; /* Delayed freeing of IO resources */
654 u32 del_itn_iocom_hostabrts; /* Host IO abort requests */
655 u32 del_itn_total_ios; /* Total IO count */
656 u32 del_io_iocdowns; /* IO cleaned-up due to IOC down */
657 u32 del_tm_iocdowns; /* TM cleaned-up due to IOC down */
658};
659
660struct bfa_itnim_iostats_s {
661
662 u32 total_ios; /* Total IO Requests */
663 u32 input_reqs; /* Data in-bound requests */
664 u32 output_reqs; /* Data out-bound requests */
665 u32 io_comps; /* Total IO Completions */
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300666 u32 wr_throughput; /* Write data transferred in bytes */
667 u32 rd_throughput; /* Read data transferred in bytes */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700668
669 u32 iocomp_ok; /* Slowpath IO completions */
670 u32 iocomp_underrun; /* IO underrun */
671 u32 iocomp_overrun; /* IO overrun */
672 u32 qwait; /* IO Request-Q wait */
673 u32 qresumes; /* IO Request-Q wait done */
674 u32 no_iotags; /* No free IO tag */
675 u32 iocomp_timedout; /* IO timeouts */
676 u32 iocom_nexus_abort; /* IO failure due to target offline */
677 u32 iocom_proto_err; /* IO protocol errors */
678 u32 iocom_dif_err; /* IO SBC-3 protection errors */
679
680 u32 iocom_sqer_needed; /* fcp-2 error recovery failed */
681 u32 iocom_res_free; /* Delayed freeing of IO tag */
682
683
684 u32 io_aborts; /* Host IO abort requests */
685 u32 iocom_hostabrts; /* Host IO abort completions */
686 u32 io_cleanups; /* IO clean-up requests */
687 u32 path_tov_expired; /* IO path tov expired */
688 u32 iocomp_aborted; /* IO abort completions */
689 u32 io_iocdowns; /* IO cleaned-up due to IOC down */
690 u32 iocom_utags; /* IO comp with unknown tags */
691
692 u32 io_tmaborts; /* Abort request due to TM command */
693 u32 tm_io_comps; /* Abort completion due to TM command */
694
695 u32 creates; /* IT Nexus create requests */
696 u32 fw_create; /* IT Nexus FW create requests */
697 u32 create_comps; /* IT Nexus FW create completions */
698 u32 onlines; /* IT Nexus onlines */
699 u32 offlines; /* IT Nexus offlines */
700 u32 fw_delete; /* IT Nexus FW delete requests */
701 u32 delete_comps; /* IT Nexus FW delete completions */
702 u32 deletes; /* IT Nexus delete requests */
703 u32 sler_events; /* SLER events */
704 u32 ioc_disabled; /* Num IOC disables */
705 u32 cleanup_comps; /* IT Nexus cleanup completions */
706
707 u32 tm_cmnds; /* TM Requests */
708 u32 tm_fw_rsps; /* TM Completions */
709 u32 tm_success; /* TM initiated IO cleanup success */
710 u32 tm_failures; /* TM initiated IO cleanup failure */
711 u32 no_tskims; /* No free TM tag */
712 u32 tm_qwait; /* TM Request-Q wait */
713 u32 tm_qresumes; /* TM Request-Q wait done */
714
715 u32 tm_iocdowns; /* TM cleaned-up due to IOC down */
716 u32 tm_cleanups; /* TM cleanup requests */
717 u32 tm_cleanup_comps; /* TM cleanup completions */
Krishna Gudipati8ca2dd82011-12-20 18:55:07 -0800718 u32 rsvd[6];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700719};
720
721/* Modify char* port_stt[] in bfal_port.c if a new state was added */
722enum bfa_port_states {
723 BFA_PORT_ST_UNINIT = 1,
724 BFA_PORT_ST_ENABLING_QWAIT = 2,
725 BFA_PORT_ST_ENABLING = 3,
726 BFA_PORT_ST_LINKDOWN = 4,
727 BFA_PORT_ST_LINKUP = 5,
728 BFA_PORT_ST_DISABLING_QWAIT = 6,
729 BFA_PORT_ST_DISABLING = 7,
730 BFA_PORT_ST_DISABLED = 8,
731 BFA_PORT_ST_STOPPED = 9,
732 BFA_PORT_ST_IOCDOWN = 10,
733 BFA_PORT_ST_IOCDIS = 11,
734 BFA_PORT_ST_FWMISMATCH = 12,
735 BFA_PORT_ST_PREBOOT_DISABLED = 13,
736 BFA_PORT_ST_TOGGLING_QWAIT = 14,
Krishna Gudipati04ea6572012-09-21 17:26:18 -0700737 BFA_PORT_ST_FAA_MISCONFIG = 15,
Krishna Gudipatie3535462012-09-21 17:26:07 -0700738 BFA_PORT_ST_DPORT = 16,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700739 BFA_PORT_ST_MAX_STATE,
740};
741
Jing Huangacdc79a2010-10-18 17:15:55 -0700742/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700743 * Port operational type (in sync with SNIA port type).
744 */
745enum bfa_port_type {
746 BFA_PORT_TYPE_UNKNOWN = 1, /* port type is unknown */
747 BFA_PORT_TYPE_NPORT = 5, /* P2P with switched fabric */
748 BFA_PORT_TYPE_NLPORT = 6, /* public loop */
749 BFA_PORT_TYPE_LPORT = 20, /* private loop */
750 BFA_PORT_TYPE_P2P = 21, /* P2P with no switched fabric */
751 BFA_PORT_TYPE_VPORT = 22, /* NPIV - virtual port */
752};
753
Jing Huangacdc79a2010-10-18 17:15:55 -0700754/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700755 * Port topology setting. A port's topology and fabric login status
756 * determine its operational type.
757 */
758enum bfa_port_topology {
759 BFA_PORT_TOPOLOGY_NONE = 0, /* No valid topology */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -0700760 BFA_PORT_TOPOLOGY_P2P_OLD_VER = 1, /* P2P def for older ver */
761 BFA_PORT_TOPOLOGY_LOOP = 2, /* LOOP topology */
762 BFA_PORT_TOPOLOGY_AUTO_OLD_VER = 3, /* auto def for older ver */
763 BFA_PORT_TOPOLOGY_AUTO = 4, /* auto topology selection */
764 BFA_PORT_TOPOLOGY_P2P = 5, /* P2P only */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700765};
766
Jing Huangacdc79a2010-10-18 17:15:55 -0700767/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700768 * Physical port loopback types.
769 */
770enum bfa_port_opmode {
771 BFA_PORT_OPMODE_NORMAL = 0x00, /* normal non-loopback mode */
772 BFA_PORT_OPMODE_LB_INT = 0x01, /* internal loop back */
773 BFA_PORT_OPMODE_LB_SLW = 0x02, /* serial link wrapback (serdes) */
774 BFA_PORT_OPMODE_LB_EXT = 0x04, /* external loop back (serdes) */
775 BFA_PORT_OPMODE_LB_CBL = 0x08, /* cabled loop back */
776 BFA_PORT_OPMODE_LB_NLINT = 0x20, /* NL_Port internal loopback */
777};
778
779#define BFA_PORT_OPMODE_LB_HARD(_mode) \
780 ((_mode == BFA_PORT_OPMODE_LB_INT) || \
781 (_mode == BFA_PORT_OPMODE_LB_SLW) || \
782 (_mode == BFA_PORT_OPMODE_LB_EXT))
783
Jing Huangacdc79a2010-10-18 17:15:55 -0700784/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700785 * Port link state
786 */
787enum bfa_port_linkstate {
788 BFA_PORT_LINKUP = 1, /* Physical port/Trunk link up */
789 BFA_PORT_LINKDOWN = 2, /* Physical port/Trunk link down */
790};
791
Jing Huangacdc79a2010-10-18 17:15:55 -0700792/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700793 * Port link state reason code
794 */
795enum bfa_port_linkstate_rsn {
796 BFA_PORT_LINKSTATE_RSN_NONE = 0,
797 BFA_PORT_LINKSTATE_RSN_DISABLED = 1,
798 BFA_PORT_LINKSTATE_RSN_RX_NOS = 2,
799 BFA_PORT_LINKSTATE_RSN_RX_OLS = 3,
800 BFA_PORT_LINKSTATE_RSN_RX_LIP = 4,
801 BFA_PORT_LINKSTATE_RSN_RX_LIPF7 = 5,
802 BFA_PORT_LINKSTATE_RSN_SFP_REMOVED = 6,
803 BFA_PORT_LINKSTATE_RSN_PORT_FAULT = 7,
804 BFA_PORT_LINKSTATE_RSN_RX_LOS = 8,
805 BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9,
806 BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10,
807 BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11,
Krishna Gudipati04ea6572012-09-21 17:26:18 -0700808 BFA_PORT_LINKSTATE_RSN_FAA_MISCONFIG = 12,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700809
810
811
812 /* CEE related reason codes/errors */
813 CEE_LLDP_INFO_AGED_OUT = 20,
814 CEE_LLDP_SHUTDOWN_TLV_RCVD = 21,
815 CEE_PEER_NOT_ADVERTISE_DCBX = 22,
816 CEE_PEER_NOT_ADVERTISE_PG = 23,
817 CEE_PEER_NOT_ADVERTISE_PFC = 24,
818 CEE_PEER_NOT_ADVERTISE_FCOE = 25,
819 CEE_PG_NOT_COMPATIBLE = 26,
820 CEE_PFC_NOT_COMPATIBLE = 27,
821 CEE_FCOE_NOT_COMPATIBLE = 28,
822 CEE_BAD_PG_RCVD = 29,
823 CEE_BAD_BW_RCVD = 30,
824 CEE_BAD_PFC_RCVD = 31,
825 CEE_BAD_APP_PRI_RCVD = 32,
826 CEE_FCOE_PRI_PFC_OFF = 33,
827 CEE_DUP_CONTROL_TLV_RCVD = 34,
828 CEE_DUP_FEAT_TLV_RCVD = 35,
829 CEE_APPLY_NEW_CFG = 36, /* reason, not error */
830 CEE_PROTOCOL_INIT = 37, /* reason, not error */
831 CEE_PHY_LINK_DOWN = 38,
832 CEE_LLS_FCOE_ABSENT = 39,
833 CEE_LLS_FCOE_DOWN = 40,
834 CEE_ISCSI_NOT_COMPATIBLE = 41,
835 CEE_ISCSI_PRI_PFC_OFF = 42,
836 CEE_ISCSI_PRI_OVERLAP_FCOE_PRI = 43
837};
Krishna Gudipati83763d52011-07-20 17:04:03 -0700838
839#define MAX_LUN_MASK_CFG 16
840
841/*
842 * Initially flash content may be fff. On making LUN mask enable and disable
843 * state chnage. when report lun command is being processed it goes from
844 * BFA_LUN_MASK_ACTIVE to BFA_LUN_MASK_FETCH and comes back to
845 * BFA_LUN_MASK_ACTIVE.
846 */
847enum bfa_ioim_lun_mask_state_s {
848 BFA_IOIM_LUN_MASK_INACTIVE = 0,
849 BFA_IOIM_LUN_MASK_ACTIVE = 1,
850 BFA_IOIM_LUN_MASK_FETCHED = 2,
851};
852
853enum bfa_lunmask_state_s {
854 BFA_LUNMASK_DISABLED = 0x00,
855 BFA_LUNMASK_ENABLED = 0x01,
856 BFA_LUNMASK_MINCFG = 0x02,
857 BFA_LUNMASK_UNINITIALIZED = 0xff,
858};
859
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700860#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -0700861/*
Krishna Gudipati45c5dc12011-07-20 17:03:46 -0700862 * LUN mask configuration
863 */
864struct bfa_lun_mask_s {
865 wwn_t lp_wwn;
866 wwn_t rp_wwn;
Krishna Gudipati83763d52011-07-20 17:04:03 -0700867 struct scsi_lun lun;
Krishna Gudipati45c5dc12011-07-20 17:03:46 -0700868 u8 ua;
869 u8 rsvd[3];
870 u16 rp_tag;
871 u8 lp_tag;
872 u8 state;
873};
874
875#define MAX_LUN_MASK_CFG 16
876struct bfa_lunmask_cfg_s {
877 u32 status;
878 u32 rsvd;
879 struct bfa_lun_mask_s lun_list[MAX_LUN_MASK_CFG];
880};
881
Krishna Gudipati7ace27a2012-09-21 17:26:41 -0700882struct bfa_throttle_cfg_s {
883 u16 is_valid;
884 u16 value;
885 u32 rsvd;
886};
887
888struct bfa_defs_fcpim_throttle_s {
889 u16 max_value;
890 u16 cur_value;
891 u16 cfg_value;
892 u16 rsvd;
893};
894
Krishna Gudipati45c5dc12011-07-20 17:03:46 -0700895/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700896 * Physical port configuration
897 */
898struct bfa_port_cfg_s {
899 u8 topology; /* bfa_port_topology */
900 u8 speed; /* enum bfa_port_speed */
901 u8 trunked; /* trunked or not */
902 u8 qos_enabled; /* qos enabled or not */
903 u8 cfg_hardalpa; /* is hard alpa configured */
904 u8 hardalpa; /* configured hard alpa */
Maggie50444a32010-11-29 18:26:32 -0800905 __be16 maxfrsize; /* maximum frame size */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700906 u8 rx_bbcredit; /* receive buffer credits */
907 u8 tx_bbcredit; /* transmit buffer credits */
908 u8 ratelimit; /* ratelimit enabled or not */
909 u8 trl_def_speed; /* ratelimit default speed */
Jing Huang275a63a2011-11-16 12:28:49 -0800910 u8 bb_scn; /* BB_SCN value from FLOGI Exchg */
911 u8 bb_scn_state; /* Config state of BB_SCN */
912 u8 faa_state; /* FAA enabled/disabled */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -0700913 u8 rsvd1;
Jing Huang275a63a2011-11-16 12:28:49 -0800914 u16 path_tov; /* device path timeout */
915 u16 q_depth; /* SCSI Queue depth */
Krishna Gudipati6894f012012-09-21 17:26:31 -0700916 struct bfa_qos_bw_s qos_bw; /* QOS bandwidth */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700917};
918#pragma pack()
919
Jing Huangacdc79a2010-10-18 17:15:55 -0700920/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700921 * Port attribute values.
922 */
923struct bfa_port_attr_s {
924 /*
925 * Static fields
926 */
Jing Huang275a63a2011-11-16 12:28:49 -0800927 wwn_t nwwn; /* node wwn */
928 wwn_t pwwn; /* port wwn */
929 wwn_t factorynwwn; /* factory node wwn */
930 wwn_t factorypwwn; /* factory port wwn */
931 enum fc_cos cos_supported; /* supported class of
932 * services */
933 u32 rsvd;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700934 struct fc_symname_s port_symname; /* port symbolic name */
Jing Huang275a63a2011-11-16 12:28:49 -0800935 enum bfa_port_speed speed_supported; /* supported speeds */
936 bfa_boolean_t pbind_enabled;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700937
938 /*
939 * Configured values
940 */
Jing Huang275a63a2011-11-16 12:28:49 -0800941 struct bfa_port_cfg_s pport_cfg; /* pport cfg */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700942
943 /*
944 * Dynamic field - info from BFA
945 */
946 enum bfa_port_states port_state; /* current port state */
947 enum bfa_port_speed speed; /* current speed */
948 enum bfa_port_topology topology; /* current topology */
949 bfa_boolean_t beacon; /* current beacon status */
Jing Huang275a63a2011-11-16 12:28:49 -0800950 bfa_boolean_t link_e2e_beacon; /* link beacon is on */
951 bfa_boolean_t bbsc_op_status; /* fc credit recovery oper
952 * state */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700953
954 /*
955 * Dynamic field - info from FCS
956 */
Jing Huang275a63a2011-11-16 12:28:49 -0800957 u32 pid; /* port ID */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700958 enum bfa_port_type port_type; /* current topology */
Jing Huang275a63a2011-11-16 12:28:49 -0800959 u32 loopback; /* external loopback */
960 u32 authfail; /* auth fail state */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700961
962 /* FCoE specific */
Jing Huang275a63a2011-11-16 12:28:49 -0800963 u16 fcoe_vlan;
Krishna Gudipati6894f012012-09-21 17:26:31 -0700964 u8 rsvd1[6];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700965};
966
Jing Huangacdc79a2010-10-18 17:15:55 -0700967/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700968 * Port FCP mappings.
969 */
970struct bfa_port_fcpmap_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800971 char osdevname[256];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700972 u32 bus;
973 u32 target;
974 u32 oslun;
975 u32 fcid;
Jing Huang275a63a2011-11-16 12:28:49 -0800976 wwn_t nwwn;
977 wwn_t pwwn;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700978 u64 fcplun;
Jing Huang275a63a2011-11-16 12:28:49 -0800979 char luid[256];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700980};
981
Jing Huangacdc79a2010-10-18 17:15:55 -0700982/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700983 * Port RNID info.
984 */
985struct bfa_port_rnid_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800986 wwn_t wwn;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700987 u32 unittype;
988 u32 portid;
989 u32 attached_nodes_num;
990 u16 ip_version;
991 u16 udp_port;
Jing Huang275a63a2011-11-16 12:28:49 -0800992 u8 ipaddr[16];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700993 u16 rsvd;
994 u16 topologydiscoveryflags;
995};
996
997#pragma pack(1)
998struct bfa_fcport_fcf_s {
Jing Huang275a63a2011-11-16 12:28:49 -0800999 wwn_t name; /* FCF name */
1000 wwn_t fabric_name; /* Fabric Name */
1001 u8 fipenabled; /* FIP enabled or not */
1002 u8 fipfailed; /* FIP failed or not */
1003 u8 resv[2];
1004 u8 pri; /* FCF priority */
1005 u8 version; /* FIP version used */
1006 u8 available; /* Available for login */
1007 u8 fka_disabled; /* FKA is disabled */
1008 u8 maxsz_verified; /* FCoE max size verified */
1009 u8 fc_map[3]; /* FC map */
1010 __be16 vlan; /* FCoE vlan tag/priority */
1011 u32 fka_adv_per; /* FIP ka advert. period */
1012 mac_t mac; /* FCF mac */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001013};
1014
Jing Huangacdc79a2010-10-18 17:15:55 -07001015/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001016 * Trunk states for BCU/BFAL
1017 */
1018enum bfa_trunk_state {
1019 BFA_TRUNK_DISABLED = 0, /* Trunk is not configured */
1020 BFA_TRUNK_ONLINE = 1, /* Trunk is online */
1021 BFA_TRUNK_OFFLINE = 2, /* Trunk is offline */
1022};
1023
Jing Huangacdc79a2010-10-18 17:15:55 -07001024/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001025 * VC attributes for trunked link
1026 */
1027struct bfa_trunk_vc_attr_s {
1028 u32 bb_credit;
1029 u32 elp_opmode_flags;
1030 u32 req_credit;
1031 u16 vc_credits[8];
1032};
1033
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001034struct bfa_fcport_loop_info_s {
1035 u8 myalpa; /* alpa claimed */
1036 u8 alpabm_val; /* alpa bitmap valid or not (1 or 0) */
1037 u8 resvd[6];
1038 struct fc_alpabm_s alpabm; /* alpa bitmap */
1039};
1040
Jing Huangacdc79a2010-10-18 17:15:55 -07001041/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001042 * Link state information
1043 */
1044struct bfa_port_link_s {
1045 u8 linkstate; /* Link state bfa_port_linkstate */
1046 u8 linkstate_rsn; /* bfa_port_linkstate_rsn_t */
1047 u8 topology; /* P2P/LOOP bfa_port_topology */
1048 u8 speed; /* Link speed (1/2/4/8 G) */
Jing Huang275a63a2011-11-16 12:28:49 -08001049 u32 linkstate_opt; /* Linkstate optional data (debug) */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001050 u8 trunked; /* Trunked or not (1 or 0) */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001051 u8 resvd[7];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001052 struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
1053 union {
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001054 struct bfa_fcport_loop_info_s loop_info;
1055 union {
1056 struct bfa_qos_vc_attr_s qos_vc_attr;
1057 /* VC info from ELP */
1058 struct bfa_trunk_vc_attr_s trunk_vc_attr;
1059 struct bfa_fcport_fcf_s fcf;
1060 /* FCF information (for FCoE) */
1061 } vc_fcf;
1062 } attr;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001063};
1064#pragma pack()
1065
1066enum bfa_trunk_link_fctl {
1067 BFA_TRUNK_LINK_FCTL_NORMAL,
1068 BFA_TRUNK_LINK_FCTL_VC,
1069 BFA_TRUNK_LINK_FCTL_VC_QOS,
1070};
1071
1072enum bfa_trunk_link_state {
1073 BFA_TRUNK_LINK_STATE_UP = 1, /* link part of trunk */
1074 BFA_TRUNK_LINK_STATE_DN_LINKDN = 2, /* physical link down */
1075 BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3, /* trunk group different */
1076 BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4, /* speed mismatch */
1077 BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5, /* remote port not trunked */
1078};
1079
1080#define BFA_TRUNK_MAX_PORTS 2
1081struct bfa_trunk_link_attr_s {
1082 wwn_t trunk_wwn;
1083 enum bfa_trunk_link_fctl fctl;
1084 enum bfa_trunk_link_state link_state;
1085 enum bfa_port_speed speed;
1086 u32 deskew;
1087};
1088
1089struct bfa_trunk_attr_s {
1090 enum bfa_trunk_state state;
1091 enum bfa_port_speed speed;
1092 u32 port_id;
1093 u32 rsvd;
1094 struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
1095};
1096
1097struct bfa_rport_hal_stats_s {
1098 u32 sm_un_cr; /* uninit: create events */
1099 u32 sm_un_unexp; /* uninit: exception events */
1100 u32 sm_cr_on; /* created: online events */
1101 u32 sm_cr_del; /* created: delete events */
1102 u32 sm_cr_hwf; /* created: IOC down */
1103 u32 sm_cr_unexp; /* created: exception events */
1104 u32 sm_fwc_rsp; /* fw create: f/w responses */
1105 u32 sm_fwc_del; /* fw create: delete events */
1106 u32 sm_fwc_off; /* fw create: offline events */
1107 u32 sm_fwc_hwf; /* fw create: IOC down */
Jing Huang275a63a2011-11-16 12:28:49 -08001108 u32 sm_fwc_unexp; /* fw create: exception events*/
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001109 u32 sm_on_off; /* online: offline events */
1110 u32 sm_on_del; /* online: delete events */
1111 u32 sm_on_hwf; /* online: IOC down events */
1112 u32 sm_on_unexp; /* online: exception events */
1113 u32 sm_fwd_rsp; /* fw delete: fw responses */
1114 u32 sm_fwd_del; /* fw delete: delete events */
1115 u32 sm_fwd_hwf; /* fw delete: IOC down events */
Jing Huang275a63a2011-11-16 12:28:49 -08001116 u32 sm_fwd_unexp; /* fw delete: exception events*/
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001117 u32 sm_off_del; /* offline: delete events */
1118 u32 sm_off_on; /* offline: online events */
1119 u32 sm_off_hwf; /* offline: IOC down events */
Jing Huang275a63a2011-11-16 12:28:49 -08001120 u32 sm_off_unexp; /* offline: exception events */
1121 u32 sm_del_fwrsp; /* delete: fw responses */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001122 u32 sm_del_hwf; /* delete: IOC down events */
Jing Huang275a63a2011-11-16 12:28:49 -08001123 u32 sm_del_unexp; /* delete: exception events */
1124 u32 sm_delp_fwrsp; /* delete pend: fw responses */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001125 u32 sm_delp_hwf; /* delete pend: IOC downs */
Jing Huang275a63a2011-11-16 12:28:49 -08001126 u32 sm_delp_unexp; /* delete pend: exceptions */
1127 u32 sm_offp_fwrsp; /* off-pending: fw responses */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001128 u32 sm_offp_del; /* off-pending: deletes */
1129 u32 sm_offp_hwf; /* off-pending: IOC downs */
Jing Huang275a63a2011-11-16 12:28:49 -08001130 u32 sm_offp_unexp; /* off-pending: exceptions */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001131 u32 sm_iocd_off; /* IOC down: offline events */
1132 u32 sm_iocd_del; /* IOC down: delete events */
1133 u32 sm_iocd_on; /* IOC down: online events */
Jing Huang275a63a2011-11-16 12:28:49 -08001134 u32 sm_iocd_unexp; /* IOC down: exceptions */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001135 u32 rsvd;
1136};
1137#pragma pack(1)
Jing Huangacdc79a2010-10-18 17:15:55 -07001138/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001139 * Rport's QoS attributes
1140 */
1141struct bfa_rport_qos_attr_s {
Jing Huang275a63a2011-11-16 12:28:49 -08001142 u8 qos_priority; /* rport's QoS priority */
1143 u8 rsvd[3];
1144 u32 qos_flow_id; /* QoS flow Id */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001145};
1146#pragma pack()
1147
1148#define BFA_IOBUCKET_MAX 14
1149
1150struct bfa_itnim_latency_s {
1151 u32 min[BFA_IOBUCKET_MAX];
1152 u32 max[BFA_IOBUCKET_MAX];
1153 u32 count[BFA_IOBUCKET_MAX];
1154 u32 avg[BFA_IOBUCKET_MAX];
1155};
1156
1157struct bfa_itnim_ioprofile_s {
1158 u32 clock_res_mul;
1159 u32 clock_res_div;
1160 u32 index;
1161 u32 io_profile_start_time; /* IO profile start time */
1162 u32 iocomps[BFA_IOBUCKET_MAX]; /* IO completed */
1163 struct bfa_itnim_latency_s io_latency;
1164};
1165
Jing Huangacdc79a2010-10-18 17:15:55 -07001166/*
Krishna Gudipati61e62e22011-06-24 20:29:07 -07001167 * vHBA port attribute values.
1168 */
1169struct bfa_vhba_attr_s {
1170 wwn_t nwwn; /* node wwn */
1171 wwn_t pwwn; /* port wwn */
1172 u32 pid; /* port ID */
1173 bfa_boolean_t io_profile; /* get it from fcpim mod */
1174 bfa_boolean_t plog_enabled; /* portlog is enabled */
1175 u16 path_tov;
1176 u8 rsvd[2];
1177};
1178
1179/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001180 * FC physical port statistics.
1181 */
1182struct bfa_port_fc_stats_s {
1183 u64 secs_reset; /* Seconds since stats is reset */
1184 u64 tx_frames; /* Tx frames */
1185 u64 tx_words; /* Tx words */
1186 u64 tx_lip; /* Tx LIP */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001187 u64 tx_lip_f7f7; /* Tx LIP_F7F7 */
1188 u64 tx_lip_f8f7; /* Tx LIP_F8F7 */
1189 u64 tx_arbf0; /* Tx ARB F0 */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001190 u64 tx_nos; /* Tx NOS */
1191 u64 tx_ols; /* Tx OLS */
1192 u64 tx_lr; /* Tx LR */
1193 u64 tx_lrr; /* Tx LRR */
1194 u64 rx_frames; /* Rx frames */
1195 u64 rx_words; /* Rx words */
1196 u64 lip_count; /* Rx LIP */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001197 u64 rx_lip_f7f7; /* Rx LIP_F7F7 */
1198 u64 rx_lip_f8f7; /* Rx LIP_F8F7 */
1199 u64 rx_arbf0; /* Rx ARB F0 */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001200 u64 nos_count; /* Rx NOS */
1201 u64 ols_count; /* Rx OLS */
1202 u64 lr_count; /* Rx LR */
1203 u64 lrr_count; /* Rx LRR */
1204 u64 invalid_crcs; /* Rx CRC err frames */
1205 u64 invalid_crc_gd_eof; /* Rx CRC err good EOF frames */
1206 u64 undersized_frm; /* Rx undersized frames */
1207 u64 oversized_frm; /* Rx oversized frames */
1208 u64 bad_eof_frm; /* Rx frames with bad EOF */
1209 u64 error_frames; /* Errored frames */
1210 u64 dropped_frames; /* Dropped frames */
1211 u64 link_failures; /* Link Failure (LF) count */
1212 u64 loss_of_syncs; /* Loss of sync count */
1213 u64 loss_of_signals; /* Loss of signal count */
1214 u64 primseq_errs; /* Primitive sequence protocol err. */
1215 u64 bad_os_count; /* Invalid ordered sets */
1216 u64 err_enc_out; /* Encoding err nonframe_8b10b */
1217 u64 err_enc; /* Encoding err frame_8b10b */
Krishna Gudipatibe540a92011-06-13 15:53:04 -07001218 u64 bbsc_frames_lost; /* Credit Recovery-Frames Lost */
1219 u64 bbsc_credits_lost; /* Credit Recovery-Credits Lost */
1220 u64 bbsc_link_resets; /* Credit Recovery-Link Resets */
Krishna Gudipatibc0e2c22012-09-21 17:23:59 -07001221 u64 loop_timeouts; /* Loop timeouts */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001222};
1223
Jing Huangacdc79a2010-10-18 17:15:55 -07001224/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001225 * Eth Physical Port statistics.
1226 */
1227struct bfa_port_eth_stats_s {
1228 u64 secs_reset; /* Seconds since stats is reset */
1229 u64 frame_64; /* Frames 64 bytes */
1230 u64 frame_65_127; /* Frames 65-127 bytes */
1231 u64 frame_128_255; /* Frames 128-255 bytes */
1232 u64 frame_256_511; /* Frames 256-511 bytes */
1233 u64 frame_512_1023; /* Frames 512-1023 bytes */
1234 u64 frame_1024_1518; /* Frames 1024-1518 bytes */
1235 u64 frame_1519_1522; /* Frames 1519-1522 bytes */
1236 u64 tx_bytes; /* Tx bytes */
1237 u64 tx_packets; /* Tx packets */
1238 u64 tx_mcast_packets; /* Tx multicast packets */
1239 u64 tx_bcast_packets; /* Tx broadcast packets */
1240 u64 tx_control_frame; /* Tx control frame */
1241 u64 tx_drop; /* Tx drops */
1242 u64 tx_jabber; /* Tx jabber */
1243 u64 tx_fcs_error; /* Tx FCS errors */
1244 u64 tx_fragments; /* Tx fragments */
1245 u64 rx_bytes; /* Rx bytes */
1246 u64 rx_packets; /* Rx packets */
1247 u64 rx_mcast_packets; /* Rx multicast packets */
1248 u64 rx_bcast_packets; /* Rx broadcast packets */
1249 u64 rx_control_frames; /* Rx control frames */
1250 u64 rx_unknown_opcode; /* Rx unknown opcode */
1251 u64 rx_drop; /* Rx drops */
1252 u64 rx_jabber; /* Rx jabber */
1253 u64 rx_fcs_error; /* Rx FCS errors */
1254 u64 rx_alignment_error; /* Rx alignment errors */
1255 u64 rx_frame_length_error; /* Rx frame len errors */
1256 u64 rx_code_error; /* Rx code errors */
1257 u64 rx_fragments; /* Rx fragments */
1258 u64 rx_pause; /* Rx pause */
1259 u64 rx_zero_pause; /* Rx zero pause */
1260 u64 tx_pause; /* Tx pause */
1261 u64 tx_zero_pause; /* Tx zero pause */
1262 u64 rx_fcoe_pause; /* Rx FCoE pause */
1263 u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */
1264 u64 tx_fcoe_pause; /* Tx FCoE pause */
1265 u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
1266 u64 rx_iscsi_pause; /* Rx iSCSI pause */
1267 u64 rx_iscsi_zero_pause; /* Rx iSCSI zero pause */
1268 u64 tx_iscsi_pause; /* Tx iSCSI pause */
1269 u64 tx_iscsi_zero_pause; /* Tx iSCSI zero pause */
1270};
1271
Jing Huangacdc79a2010-10-18 17:15:55 -07001272/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001273 * Port statistics.
1274 */
1275union bfa_port_stats_u {
1276 struct bfa_port_fc_stats_s fc;
1277 struct bfa_port_eth_stats_s eth;
1278};
1279
Krishna Gudipati1a4d8e12011-06-24 20:22:28 -07001280struct bfa_port_cfg_mode_s {
1281 u16 max_pf;
1282 u16 max_vf;
1283 enum bfa_mode_s mode;
1284};
1285
Krishna Gudipati148d6102011-06-24 20:25:36 -07001286#pragma pack(1)
1287
1288#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
1289#define BFA_CEE_DCBX_MAX_PRIORITY (8)
1290#define BFA_CEE_DCBX_MAX_PGID (8)
1291
1292struct bfa_cee_lldp_str_s {
1293 u8 sub_type;
1294 u8 len;
1295 u8 rsvd[2];
1296 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
1297};
1298
1299struct bfa_cee_lldp_cfg_s {
1300 struct bfa_cee_lldp_str_s chassis_id;
1301 struct bfa_cee_lldp_str_s port_id;
1302 struct bfa_cee_lldp_str_s port_desc;
1303 struct bfa_cee_lldp_str_s sys_name;
1304 struct bfa_cee_lldp_str_s sys_desc;
1305 struct bfa_cee_lldp_str_s mgmt_addr;
1306 u16 time_to_live;
1307 u16 enabled_system_cap;
1308};
1309
1310/* CEE/DCBX parameters */
1311struct bfa_cee_dcbx_cfg_s {
1312 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1313 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1314 u8 pfc_primap; /* bitmap of priorties with PFC enabled */
1315 u8 fcoe_primap; /* bitmap of priorities used for FcoE traffic */
1316 u8 iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
1317 u8 dcbx_version; /* operating version:CEE or preCEE */
1318 u8 lls_fcoe; /* FCoE Logical Link Status */
1319 u8 lls_lan; /* LAN Logical Link Status */
1320 u8 rsvd[2];
1321};
1322
1323/* CEE Query */
1324struct bfa_cee_attr_s {
1325 u8 cee_status;
1326 u8 error_reason;
1327 struct bfa_cee_lldp_cfg_s lldp_remote;
1328 struct bfa_cee_dcbx_cfg_s dcbx_remote;
1329 mac_t src_mac;
1330 u8 link_speed;
1331 u8 nw_priority;
1332 u8 filler[2];
1333};
1334
1335/* LLDP/DCBX/CEE Statistics */
1336struct bfa_cee_stats_s {
1337 u32 lldp_tx_frames; /* LLDP Tx Frames */
1338 u32 lldp_rx_frames; /* LLDP Rx Frames */
1339 u32 lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
1340 u32 lldp_rx_frames_new; /* LLDP Rx Frames new */
1341 u32 lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
1342 u32 lldp_rx_shutdown_tlvs; /* LLDP Rx shutdown TLVs */
1343 u32 lldp_info_aged_out; /* LLDP remote info aged */
1344 u32 dcbx_phylink_ups; /* DCBX phy link ups */
1345 u32 dcbx_phylink_downs; /* DCBX phy link downs */
1346 u32 dcbx_rx_tlvs; /* DCBX Rx TLVs */
1347 u32 dcbx_rx_tlvs_invalid; /* DCBX Rx TLVs invalid */
1348 u32 dcbx_control_tlv_error; /* DCBX control TLV errors */
1349 u32 dcbx_feature_tlv_error; /* DCBX feature TLV errors */
1350 u32 dcbx_cee_cfg_new; /* DCBX new CEE cfg rcvd */
1351 u32 cee_status_down; /* DCB status down */
1352 u32 cee_status_up; /* DCB status up */
1353 u32 cee_hw_cfg_changed; /* DCB hw cfg changed */
1354 u32 cee_rx_invalid_cfg; /* DCB invalid cfg */
1355};
1356
1357#pragma pack()
1358
Krishna Gudipati7826f302011-07-20 16:59:13 -07001359/*
1360 * AEN related definitions
1361 */
1362#define BFAD_NL_VENDOR_ID (((u64)0x01 << SCSI_NL_VID_TYPE_SHIFT) \
1363 | BFA_PCI_VENDOR_ID_BROCADE)
1364
1365/* BFA remote port events */
1366enum bfa_rport_aen_event {
1367 BFA_RPORT_AEN_ONLINE = 1, /* RPort online event */
1368 BFA_RPORT_AEN_OFFLINE = 2, /* RPort offline event */
1369 BFA_RPORT_AEN_DISCONNECT = 3, /* RPort disconnect event */
1370 BFA_RPORT_AEN_QOS_PRIO = 4, /* QOS priority change event */
1371 BFA_RPORT_AEN_QOS_FLOWID = 5, /* QOS flow Id change event */
1372};
1373
1374struct bfa_rport_aen_data_s {
1375 u16 vf_id; /* vf_id of this logical port */
1376 u16 rsvd[3];
1377 wwn_t ppwwn; /* WWN of its physical port */
1378 wwn_t lpwwn; /* WWN of this logical port */
1379 wwn_t rpwwn; /* WWN of this remote port */
1380 union {
1381 struct bfa_rport_qos_attr_s qos;
1382 } priv;
1383};
1384
1385union bfa_aen_data_u {
1386 struct bfa_adapter_aen_data_s adapter;
1387 struct bfa_port_aen_data_s port;
1388 struct bfa_lport_aen_data_s lport;
1389 struct bfa_rport_aen_data_s rport;
1390 struct bfa_itnim_aen_data_s itnim;
1391 struct bfa_audit_aen_data_s audit;
1392 struct bfa_ioc_aen_data_s ioc;
1393};
1394
1395#define BFA_AEN_MAX_ENTRY 512
1396
1397struct bfa_aen_entry_s {
1398 struct list_head qe;
1399 enum bfa_aen_category aen_category;
1400 u32 aen_type;
1401 union bfa_aen_data_u aen_data;
1402 struct timeval aen_tv;
1403 u32 seq_num;
1404 u32 bfad_num;
1405};
1406
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001407#endif /* __BFA_DEFS_SVC_H__ */