bfa_defs_iocfc.h 11 KB

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