1/* 2 * Copyright (c) 2005-2009 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_IOCFC_H__ 19#define __BFA_DEFS_IOCFC_H__ 20 21#include <protocol/types.h> 22#include <defs/bfa_defs_types.h> 23#include <defs/bfa_defs_version.h> 24#include <defs/bfa_defs_adapter.h> 25#include <defs/bfa_defs_pm.h> 26 27#define BFA_IOCFC_INTR_DELAY 1125 28#define BFA_IOCFC_INTR_LATENCY 225 29#define BFA_IOCFCOE_INTR_DELAY 25 30#define BFA_IOCFCOE_INTR_LATENCY 5 31 32/** 33 * Interrupt coalescing configuration. 34 */ 35struct bfa_iocfc_intr_attr_s { 36 bfa_boolean_t coalesce; /* enable/disable coalescing */ 37 u16 latency; /* latency in microseconds */ 38 u16 delay; /* delay in microseconds */ 39}; 40 41/** 42 * 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 */ 50 u16 num_iotm_reqs; /* number of TM IO reqs */ 51 u16 num_tsktm_reqs; /* TM task management requests*/ 52 u16 num_fcxp_reqs; /* unassisted FC exchanges */ 53 u16 num_uf_bufs; /* unsolicited recv buffers */ 54 u8 num_cqs; 55 u8 fw_tick_res; /*!< FW clock resolution in ms */ 56 u8 rsvd[4]; 57 58}; 59 60struct bfa_iocfc_drvcfg_s { 61 u16 num_reqq_elems; /* number of req queue elements */ 62 u16 num_rspq_elems; /* number of rsp queue elements */ 63 u16 num_sgpgs; /* number of total SG pages */ 64 u16 num_sboot_tgts; /* number of SAN boot targets */ 65 u16 num_sboot_luns; /* number of SAN boot luns */ 66 u16 ioc_recover; /* IOC recovery mode */ 67 u16 min_cfg; /* minimum configuration */ 68 u16 path_tov; /* device path timeout */ 69 bfa_boolean_t delay_comp; /* delay completion of 70 failed inflight IOs */ 71 u32 rsvd; 72}; 73/** 74 * IOC configuration 75 */ 76struct bfa_iocfc_cfg_s { 77 struct bfa_iocfc_fwcfg_s fwcfg; /* firmware side config */ 78 struct bfa_iocfc_drvcfg_s drvcfg; /* driver side config */ 79}; 80 81/** 82 * IOC firmware IO stats 83 */ 84struct bfa_fw_io_stats_s { 85 u32 host_abort; /* IO aborted by host driver*/ 86 u32 host_cleanup; /* IO clean up by host driver */ 87 88 u32 fw_io_timeout; /* IOs timedout */ 89 u32 fw_frm_parse; /* frame parsed by f/w */ 90 u32 fw_frm_data; /* fcp_data frame parsed by f/w */ 91 u32 fw_frm_rsp; /* fcp_rsp frame parsed by f/w */ 92 u32 fw_frm_xfer_rdy; /* xfer_rdy frame parsed by f/w */ 93 u32 fw_frm_bls_acc; /* BLS ACC frame parsed by f/w */ 94 u32 fw_frm_tgt_abort; /* target ABTS parsed by f/w */ 95 u32 fw_frm_unknown; /* unknown parsed by f/w */ 96 u32 fw_data_dma; /* f/w DMA'ed the data frame */ 97 u32 fw_frm_drop; /* f/w drop the frame */ 98 99 u32 rec_timeout; /* FW rec timed out */ 100 u32 error_rec; /* FW sending rec on 101 * an error condition*/ 102 u32 wait_for_si; /* FW wait for SI */ 103 u32 rec_rsp_inval; /* REC rsp invalid */ 104 u32 seqr_io_abort; /* target does not know cmd so abort */ 105 u32 seqr_io_retry; /* SEQR failed so retry IO */ 106 107 u32 itn_cisc_upd_rsp; /* ITN cisc updated on fcp_rsp */ 108 u32 itn_cisc_upd_data; /* ITN cisc updated on fcp_data */ 109 u32 itn_cisc_upd_xfer_rdy; /* ITN cisc updated on fcp_data */ 110 111 u32 fcp_data_lost; /* fcp data lost */ 112 113 u32 ro_set_in_xfer_rdy; /* Target set RO in Xfer_rdy frame */ 114 u32 xfer_rdy_ooo_err; /* Out of order Xfer_rdy received */ 115 u32 xfer_rdy_unknown_err; /* unknown error in xfer_rdy frame */ 116 117 u32 io_abort_timeout; /* ABTS timedout */ 118 u32 sler_initiated; /* SLER initiated */ 119 120 u32 unexp_fcp_rsp; /* fcp response in wrong state */ 121 122 u32 fcp_rsp_under_run; /* fcp rsp IO underrun */ 123 u32 fcp_rsp_under_run_wr; /* fcp rsp IO underrun for write */ 124 u32 fcp_rsp_under_run_err; /* fcp rsp IO underrun error */ 125 u32 fcp_rsp_resid_inval; /* invalid residue */ 126 u32 fcp_rsp_over_run; /* fcp rsp IO overrun */ 127 u32 fcp_rsp_over_run_err; /* fcp rsp IO overrun error */ 128 u32 fcp_rsp_proto_err; /* protocol error in fcp rsp */ 129 u32 fcp_rsp_sense_err; /* error in sense info in fcp rsp */ 130 u32 fcp_conf_req; /* FCP conf requested */ 131 132 u32 tgt_aborted_io; /* target initiated abort */ 133 134 u32 ioh_edtov_timeout_event;/* IOH edtov timer popped */ 135 u32 ioh_fcp_rsp_excp_event; /* IOH FCP_RSP exception */ 136 u32 ioh_fcp_conf_event; /* IOH FCP_CONF */ 137 u32 ioh_mult_frm_rsp_event; /* IOH multi_frame FCP_RSP */ 138 u32 ioh_hit_class2_event; /* IOH hit class2 */ 139 u32 ioh_miss_other_event; /* IOH miss other */ 140 u32 ioh_seq_cnt_err_event; /* IOH seq cnt error */ 141 u32 ioh_len_err_event; /* IOH len error - fcp_dl != 142 * bytes xfered */ 143 u32 ioh_seq_len_err_event; /* IOH seq len error */ 144 u32 ioh_data_oor_event; /* Data out of range */ 145 u32 ioh_ro_ooo_event; /* Relative offset out of range */ 146 u32 ioh_cpu_owned_event; /* IOH hit -iost owned by f/w */ 147 u32 ioh_unexp_frame_event; /* unexpected frame recieved 148 * count */ 149 u32 ioh_err_int; /* IOH error int during data-phase 150 * for scsi write 151 */ 152}; 153 154/** 155 * IOC port firmware stats 156 */ 157 158struct bfa_fw_port_fpg_stats_s { 159 u32 intr_evt; 160 u32 intr; 161 u32 intr_excess; 162 u32 intr_cause0; 163 u32 intr_other; 164 u32 intr_other_ign; 165 u32 sig_lost; 166 u32 sig_regained; 167 u32 sync_lost; 168 u32 sync_to; 169 u32 sync_regained; 170 u32 div2_overflow; 171 u32 div2_underflow; 172 u32 efifo_overflow; 173 u32 efifo_underflow; 174 u32 idle_rx; 175 u32 lrr_rx; 176 u32 lr_rx; 177 u32 ols_rx; 178 u32 nos_rx; 179 u32 lip_rx; 180 u32 arbf0_rx; 181 u32 arb_rx; 182 u32 mrk_rx; 183 u32 const_mrk_rx; 184 u32 prim_unknown; 185}; 186 187 188struct bfa_fw_port_lksm_stats_s { 189 u32 hwsm_success; /* hwsm state machine success */ 190 u32 hwsm_fails; /* hwsm fails */ 191 u32 hwsm_wdtov; /* hwsm timed out */ 192 u32 swsm_success; /* swsm success */ 193 u32 swsm_fails; /* swsm fails */ 194 u32 swsm_wdtov; /* swsm timed out */ 195 u32 busybufs; /* link init failed due to busybuf */ 196 u32 buf_waits; /* bufwait state entries */ 197 u32 link_fails; /* link failures */ 198 u32 psp_errors; /* primitive sequence protocol errors */ 199 u32 lr_unexp; /* No. of times LR rx-ed unexpectedly */ 200 u32 lrr_unexp; /* No. of times LRR rx-ed unexpectedly */ 201 u32 lr_tx; /* No. of times LR tx started */ 202 u32 lrr_tx; /* No. of times LRR tx started */ 203 u32 ols_tx; /* No. of times OLS tx started */ 204 u32 nos_tx; /* No. of times NOS tx started */ 205 u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ 206 u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ 207}; 208 209 210struct bfa_fw_port_snsm_stats_s { 211 u32 hwsm_success; /* Successful hwsm terminations */ 212 u32 hwsm_fails; /* hwsm fail count */ 213 u32 hwsm_wdtov; /* hwsm timed out */ 214 u32 swsm_success; /* swsm success */ 215 u32 swsm_wdtov; /* swsm timed out */ 216 u32 error_resets; /* error resets initiated by upsm */ 217 u32 sync_lost; /* Sync loss count */ 218 u32 sig_lost; /* Signal loss count */ 219}; 220 221 222struct bfa_fw_port_physm_stats_s { 223 u32 module_inserts; /* Module insert count */ 224 u32 module_xtracts; /* Module extracts count */ 225 u32 module_invalids; /* Invalid module inserted count */ 226 u32 module_read_ign; /* Module validation status ignored */ 227 u32 laser_faults; /* Laser fault count */ 228 u32 rsvd; 229}; 230 231 232struct bfa_fw_fip_stats_s { 233 u32 vlan_req; /* vlan discovery requests */ 234 u32 vlan_notify; /* vlan notifications */ 235 u32 vlan_err; /* vlan response error */ 236 u32 vlan_timeouts; /* vlan disvoery timeouts */ 237 u32 vlan_invalids; /* invalid vlan in discovery advert. */ 238 u32 disc_req; /* Discovery solicit requests */ 239 u32 disc_rsp; /* Discovery solicit response */ 240 u32 disc_err; /* Discovery advt. parse errors */ 241 u32 disc_unsol; /* Discovery unsolicited */ 242 u32 disc_timeouts; /* Discovery timeouts */ 243 u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */ 244 u32 linksvc_unsupp; /* Unsupported link service req */ 245 u32 linksvc_err; /* Parse error in link service req */ 246 u32 logo_req; /* FIP logos received */ 247 u32 clrvlink_req; /* Clear virtual link req */ 248 u32 op_unsupp; /* Unsupported FIP operation */ 249 u32 untagged; /* Untagged frames (ignored) */ 250 u32 invalid_version; /*!< Invalid FIP version */ 251}; 252 253 254struct bfa_fw_lps_stats_s { 255 u32 mac_invalids; /* Invalid mac assigned */ 256 u32 rsvd; 257}; 258 259 260struct bfa_fw_fcoe_stats_s { 261 u32 cee_linkups; /* CEE link up count */ 262 u32 cee_linkdns; /* CEE link down count */ 263 u32 fip_linkups; /* FIP link up count */ 264 u32 fip_linkdns; /* FIP link up count */ 265 u32 fip_fails; /* FIP fail count */ 266 u32 mac_invalids; /* Invalid mac assigned */ 267}; 268 269/** 270 * IOC firmware FCoE port stats 271 */ 272struct bfa_fw_fcoe_port_stats_s { 273 struct bfa_fw_fcoe_stats_s fcoe_stats; 274 struct bfa_fw_fip_stats_s fip_stats; 275}; 276 277/** 278 * IOC firmware FC port stats 279 */ 280struct bfa_fw_fc_port_stats_s { 281 struct bfa_fw_port_fpg_stats_s fpg_stats; 282 struct bfa_fw_port_physm_stats_s physm_stats; 283 struct bfa_fw_port_snsm_stats_s snsm_stats; 284 struct bfa_fw_port_lksm_stats_s lksm_stats; 285}; 286 287/** 288 * IOC firmware FC port stats 289 */ 290union bfa_fw_port_stats_s { 291 struct bfa_fw_fc_port_stats_s fc_stats; 292 struct bfa_fw_fcoe_port_stats_s fcoe_stats; 293}; 294 295/** 296 * IOC firmware stats 297 */ 298struct bfa_fw_stats_s { 299 struct bfa_fw_ioc_stats_s ioc_stats; 300 struct bfa_fw_io_stats_s io_stats; 301 union bfa_fw_port_stats_s port_stats; 302}; 303 304/** 305 * IOC statistics 306 */ 307struct bfa_iocfc_stats_s { 308 struct bfa_fw_stats_s fw_stats; /* firmware IOC stats */ 309}; 310 311/** 312 * IOC attributes returned in queries 313 */ 314struct bfa_iocfc_attr_s { 315 struct bfa_iocfc_cfg_s config; /* IOCFC config */ 316 struct bfa_iocfc_intr_attr_s intr_attr; /* interrupt attr */ 317}; 318 319#define BFA_IOCFC_PATHTOV_MAX 60 320#define BFA_IOCFC_QDEPTH_MAX 2000 321 322#endif /* __BFA_DEFS_IOC_H__ */ 323