bfa_defs_svc.h 45 KB

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