bfa.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. /*
  2. * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
  3. * Copyright (c) 2014- QLogic Corporation.
  4. * All rights reserved
  5. * www.qlogic.com
  6. *
  7. * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License (GPL) Version 2 as
  11. * published by the Free Software Foundation
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #ifndef __BFA_H__
  19. #define __BFA_H__
  20. #include "bfad_drv.h"
  21. #include "bfa_cs.h"
  22. #include "bfa_plog.h"
  23. #include "bfa_defs_svc.h"
  24. #include "bfi.h"
  25. #include "bfa_ioc.h"
  26. struct bfa_s;
  27. typedef void (*bfa_isr_func_t) (struct bfa_s *bfa, struct bfi_msg_s *m);
  28. typedef void (*bfa_cb_cbfn_status_t) (void *cbarg, bfa_status_t status);
  29. /*
  30. * Interrupt message handlers
  31. */
  32. void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
  33. /*
  34. * Request and response queue related defines
  35. */
  36. #define BFA_REQQ_NELEMS_MIN (4)
  37. #define BFA_RSPQ_NELEMS_MIN (4)
  38. #define bfa_reqq_pi(__bfa, __reqq) ((__bfa)->iocfc.req_cq_pi[__reqq])
  39. #define bfa_reqq_ci(__bfa, __reqq) \
  40. (*(u32 *)((__bfa)->iocfc.req_cq_shadow_ci[__reqq].kva))
  41. #define bfa_reqq_full(__bfa, __reqq) \
  42. (((bfa_reqq_pi(__bfa, __reqq) + 1) & \
  43. ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1)) == \
  44. bfa_reqq_ci(__bfa, __reqq))
  45. #define bfa_reqq_next(__bfa, __reqq) \
  46. (bfa_reqq_full(__bfa, __reqq) ? NULL : \
  47. ((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \
  48. + bfa_reqq_pi((__bfa), (__reqq)))))
  49. #define bfa_reqq_produce(__bfa, __reqq, __mh) do { \
  50. (__mh).mtag.h2i.qid = (__bfa)->iocfc.hw_qid[__reqq];\
  51. (__bfa)->iocfc.req_cq_pi[__reqq]++; \
  52. (__bfa)->iocfc.req_cq_pi[__reqq] &= \
  53. ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
  54. writel((__bfa)->iocfc.req_cq_pi[__reqq], \
  55. (__bfa)->iocfc.bfa_regs.cpe_q_pi[__reqq]); \
  56. mmiowb(); \
  57. } while (0)
  58. #define bfa_rspq_pi(__bfa, __rspq) \
  59. (*(u32 *)((__bfa)->iocfc.rsp_cq_shadow_pi[__rspq].kva))
  60. #define bfa_rspq_ci(__bfa, __rspq) ((__bfa)->iocfc.rsp_cq_ci[__rspq])
  61. #define bfa_rspq_elem(__bfa, __rspq, __ci) \
  62. (&((struct bfi_msg_s *)((__bfa)->iocfc.rsp_cq_ba[__rspq].kva))[__ci])
  63. #define CQ_INCR(__index, __size) do { \
  64. (__index)++; \
  65. (__index) &= ((__size) - 1); \
  66. } while (0)
  67. /*
  68. * Circular queue usage assignments
  69. */
  70. enum {
  71. BFA_REQQ_IOC = 0, /* all low-priority IOC msgs */
  72. BFA_REQQ_FCXP = 0, /* all FCXP messages */
  73. BFA_REQQ_LPS = 0, /* all lport service msgs */
  74. BFA_REQQ_PORT = 0, /* all port messages */
  75. BFA_REQQ_FLASH = 0, /* for flash module */
  76. BFA_REQQ_DIAG = 0, /* for diag module */
  77. BFA_REQQ_RPORT = 0, /* all port messages */
  78. BFA_REQQ_SBOOT = 0, /* all san boot messages */
  79. BFA_REQQ_QOS_LO = 1, /* all low priority IO */
  80. BFA_REQQ_QOS_MD = 2, /* all medium priority IO */
  81. BFA_REQQ_QOS_HI = 3, /* all high priority IO */
  82. };
  83. static inline void
  84. bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
  85. void *cbarg)
  86. {
  87. wqe->qresume = qresume;
  88. wqe->cbarg = cbarg;
  89. }
  90. #define bfa_reqq(__bfa, __reqq) (&(__bfa)->reqq_waitq[__reqq])
  91. /*
  92. * static inline void
  93. * bfa_reqq_wait(struct bfa_s *bfa, int reqq, struct bfa_reqq_wait_s *wqe)
  94. */
  95. #define bfa_reqq_wait(__bfa, __reqq, __wqe) do { \
  96. \
  97. struct list_head *waitq = bfa_reqq(__bfa, __reqq); \
  98. \
  99. WARN_ON(((__reqq) >= BFI_IOC_MAX_CQS)); \
  100. WARN_ON(!((__wqe)->qresume && (__wqe)->cbarg)); \
  101. \
  102. list_add_tail(&(__wqe)->qe, waitq); \
  103. } while (0)
  104. #define bfa_reqq_wcancel(__wqe) list_del(&(__wqe)->qe)
  105. #define bfa_cb_queue(__bfa, __hcb_qe, __cbfn, __cbarg) do { \
  106. (__hcb_qe)->cbfn = (__cbfn); \
  107. (__hcb_qe)->cbarg = (__cbarg); \
  108. (__hcb_qe)->pre_rmv = BFA_FALSE; \
  109. list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \
  110. } while (0)
  111. #define bfa_cb_dequeue(__hcb_qe) list_del(&(__hcb_qe)->qe)
  112. #define bfa_cb_queue_once(__bfa, __hcb_qe, __cbfn, __cbarg) do { \
  113. (__hcb_qe)->cbfn = (__cbfn); \
  114. (__hcb_qe)->cbarg = (__cbarg); \
  115. if (!(__hcb_qe)->once) { \
  116. list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \
  117. (__hcb_qe)->once = BFA_TRUE; \
  118. } \
  119. } while (0)
  120. #define bfa_cb_queue_status(__bfa, __hcb_qe, __status) do { \
  121. (__hcb_qe)->fw_status = (__status); \
  122. list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \
  123. } while (0)
  124. #define bfa_cb_queue_done(__hcb_qe) do { \
  125. (__hcb_qe)->once = BFA_FALSE; \
  126. } while (0)
  127. /*
  128. * PCI devices supported by the current BFA
  129. */
  130. struct bfa_pciid_s {
  131. u16 device_id;
  132. u16 vendor_id;
  133. };
  134. extern char bfa_version[];
  135. struct bfa_iocfc_regs_s {
  136. void __iomem *intr_status;
  137. void __iomem *intr_mask;
  138. void __iomem *cpe_q_pi[BFI_IOC_MAX_CQS];
  139. void __iomem *cpe_q_ci[BFI_IOC_MAX_CQS];
  140. void __iomem *cpe_q_ctrl[BFI_IOC_MAX_CQS];
  141. void __iomem *rme_q_ci[BFI_IOC_MAX_CQS];
  142. void __iomem *rme_q_pi[BFI_IOC_MAX_CQS];
  143. void __iomem *rme_q_ctrl[BFI_IOC_MAX_CQS];
  144. };
  145. /*
  146. * MSIX vector handlers
  147. */
  148. #define BFA_MSIX_MAX_VECTORS 22
  149. typedef void (*bfa_msix_handler_t)(struct bfa_s *bfa, int vec);
  150. struct bfa_msix_s {
  151. int nvecs;
  152. bfa_msix_handler_t handler[BFA_MSIX_MAX_VECTORS];
  153. };
  154. /*
  155. * Chip specific interfaces
  156. */
  157. struct bfa_hwif_s {
  158. void (*hw_reginit)(struct bfa_s *bfa);
  159. void (*hw_reqq_ack)(struct bfa_s *bfa, int reqq);
  160. void (*hw_rspq_ack)(struct bfa_s *bfa, int rspq, u32 ci);
  161. void (*hw_msix_init)(struct bfa_s *bfa, int nvecs);
  162. void (*hw_msix_ctrl_install)(struct bfa_s *bfa);
  163. void (*hw_msix_queue_install)(struct bfa_s *bfa);
  164. void (*hw_msix_uninstall)(struct bfa_s *bfa);
  165. void (*hw_isr_mode_set)(struct bfa_s *bfa, bfa_boolean_t msix);
  166. void (*hw_msix_getvecs)(struct bfa_s *bfa, u32 *vecmap,
  167. u32 *nvecs, u32 *maxvec);
  168. void (*hw_msix_get_rme_range) (struct bfa_s *bfa, u32 *start,
  169. u32 *end);
  170. int cpe_vec_q0;
  171. int rme_vec_q0;
  172. };
  173. typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status);
  174. struct bfa_faa_cbfn_s {
  175. bfa_cb_iocfc_t faa_cbfn;
  176. void *faa_cbarg;
  177. };
  178. #define BFA_FAA_ENABLED 1
  179. #define BFA_FAA_DISABLED 2
  180. /*
  181. * FAA attributes
  182. */
  183. struct bfa_faa_attr_s {
  184. wwn_t faa;
  185. u8 faa_state;
  186. u8 pwwn_source;
  187. u8 rsvd[6];
  188. };
  189. struct bfa_faa_args_s {
  190. struct bfa_faa_attr_s *faa_attr;
  191. struct bfa_faa_cbfn_s faa_cb;
  192. u8 faa_state;
  193. bfa_boolean_t busy;
  194. };
  195. struct bfa_iocfc_s {
  196. bfa_fsm_t fsm;
  197. struct bfa_s *bfa;
  198. struct bfa_iocfc_cfg_s cfg;
  199. u32 req_cq_pi[BFI_IOC_MAX_CQS];
  200. u32 rsp_cq_ci[BFI_IOC_MAX_CQS];
  201. u8 hw_qid[BFI_IOC_MAX_CQS];
  202. struct bfa_cb_qe_s init_hcb_qe;
  203. struct bfa_cb_qe_s stop_hcb_qe;
  204. struct bfa_cb_qe_s dis_hcb_qe;
  205. struct bfa_cb_qe_s en_hcb_qe;
  206. struct bfa_cb_qe_s stats_hcb_qe;
  207. bfa_boolean_t submod_enabled;
  208. bfa_boolean_t cb_reqd; /* Driver call back reqd */
  209. bfa_status_t op_status; /* Status of bfa iocfc op */
  210. struct bfa_dma_s cfg_info;
  211. struct bfi_iocfc_cfg_s *cfginfo;
  212. struct bfa_dma_s cfgrsp_dma;
  213. struct bfi_iocfc_cfgrsp_s *cfgrsp;
  214. struct bfa_dma_s req_cq_ba[BFI_IOC_MAX_CQS];
  215. struct bfa_dma_s req_cq_shadow_ci[BFI_IOC_MAX_CQS];
  216. struct bfa_dma_s rsp_cq_ba[BFI_IOC_MAX_CQS];
  217. struct bfa_dma_s rsp_cq_shadow_pi[BFI_IOC_MAX_CQS];
  218. struct bfa_iocfc_regs_s bfa_regs; /* BFA device registers */
  219. struct bfa_hwif_s hwif;
  220. bfa_cb_iocfc_t updateq_cbfn; /* bios callback function */
  221. void *updateq_cbarg; /* bios callback arg */
  222. u32 intr_mask;
  223. struct bfa_faa_args_s faa_args;
  224. struct bfa_mem_dma_s ioc_dma;
  225. struct bfa_mem_dma_s iocfc_dma;
  226. struct bfa_mem_dma_s reqq_dma[BFI_IOC_MAX_CQS];
  227. struct bfa_mem_dma_s rspq_dma[BFI_IOC_MAX_CQS];
  228. struct bfa_mem_kva_s kva_seg;
  229. };
  230. #define BFA_MEM_IOC_DMA(_bfa) (&((_bfa)->iocfc.ioc_dma))
  231. #define BFA_MEM_IOCFC_DMA(_bfa) (&((_bfa)->iocfc.iocfc_dma))
  232. #define BFA_MEM_REQQ_DMA(_bfa, _qno) (&((_bfa)->iocfc.reqq_dma[(_qno)]))
  233. #define BFA_MEM_RSPQ_DMA(_bfa, _qno) (&((_bfa)->iocfc.rspq_dma[(_qno)]))
  234. #define BFA_MEM_IOCFC_KVA(_bfa) (&((_bfa)->iocfc.kva_seg))
  235. #define bfa_fn_lpu(__bfa) \
  236. bfi_fn_lpu(bfa_ioc_pcifn(&(__bfa)->ioc), bfa_ioc_portid(&(__bfa)->ioc))
  237. #define bfa_msix_init(__bfa, __nvecs) \
  238. ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs))
  239. #define bfa_msix_ctrl_install(__bfa) \
  240. ((__bfa)->iocfc.hwif.hw_msix_ctrl_install(__bfa))
  241. #define bfa_msix_queue_install(__bfa) \
  242. ((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa))
  243. #define bfa_msix_uninstall(__bfa) \
  244. ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa))
  245. #define bfa_isr_rspq_ack(__bfa, __queue, __ci) \
  246. ((__bfa)->iocfc.hwif.hw_rspq_ack(__bfa, __queue, __ci))
  247. #define bfa_isr_reqq_ack(__bfa, __queue) do { \
  248. if ((__bfa)->iocfc.hwif.hw_reqq_ack) \
  249. (__bfa)->iocfc.hwif.hw_reqq_ack(__bfa, __queue); \
  250. } while (0)
  251. #define bfa_isr_mode_set(__bfa, __msix) do { \
  252. if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \
  253. (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \
  254. } while (0)
  255. #define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \
  256. ((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \
  257. __nvecs, __maxvec))
  258. #define bfa_msix_get_rme_range(__bfa, __start, __end) \
  259. ((__bfa)->iocfc.hwif.hw_msix_get_rme_range(__bfa, __start, __end))
  260. #define bfa_msix(__bfa, __vec) \
  261. ((__bfa)->msix.handler[__vec](__bfa, __vec))
  262. /*
  263. * FC specific IOC functions.
  264. */
  265. void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg,
  266. struct bfa_meminfo_s *meminfo,
  267. struct bfa_s *bfa);
  268. void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
  269. struct bfa_iocfc_cfg_s *cfg,
  270. struct bfa_pcidev_s *pcidev);
  271. void bfa_iocfc_init(struct bfa_s *bfa);
  272. void bfa_iocfc_start(struct bfa_s *bfa);
  273. void bfa_iocfc_stop(struct bfa_s *bfa);
  274. void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
  275. void bfa_iocfc_set_snsbase(struct bfa_s *bfa, int seg_no, u64 snsbase_pa);
  276. bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
  277. void bfa_iocfc_reset_queues(struct bfa_s *bfa);
  278. void bfa_msix_all(struct bfa_s *bfa, int vec);
  279. void bfa_msix_reqq(struct bfa_s *bfa, int vec);
  280. void bfa_msix_rspq(struct bfa_s *bfa, int vec);
  281. void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);
  282. void bfa_hwcb_reginit(struct bfa_s *bfa);
  283. void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
  284. void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
  285. void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa);
  286. void bfa_hwcb_msix_queue_install(struct bfa_s *bfa);
  287. void bfa_hwcb_msix_uninstall(struct bfa_s *bfa);
  288. void bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
  289. void bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
  290. u32 *maxvec);
  291. void bfa_hwcb_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
  292. u32 *end);
  293. void bfa_hwct_reginit(struct bfa_s *bfa);
  294. void bfa_hwct2_reginit(struct bfa_s *bfa);
  295. void bfa_hwct_reqq_ack(struct bfa_s *bfa, int rspq);
  296. void bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
  297. void bfa_hwct2_rspq_ack(struct bfa_s *bfa, int rspq, u32 ci);
  298. void bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs);
  299. void bfa_hwct_msix_ctrl_install(struct bfa_s *bfa);
  300. void bfa_hwct_msix_queue_install(struct bfa_s *bfa);
  301. void bfa_hwct_msix_uninstall(struct bfa_s *bfa);
  302. void bfa_hwct_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
  303. void bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
  304. u32 *maxvec);
  305. void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
  306. u32 *end);
  307. void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns);
  308. int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
  309. struct bfi_pbc_vport_s *pbc_vport);
  310. /*
  311. *----------------------------------------------------------------------
  312. * BFA public interfaces
  313. *----------------------------------------------------------------------
  314. */
  315. #define bfa_stats(_mod, _stats) ((_mod)->stats._stats++)
  316. #define bfa_ioc_get_stats(__bfa, __ioc_stats) \
  317. bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats)
  318. #define bfa_ioc_clear_stats(__bfa) \
  319. bfa_ioc_clr_stats(&(__bfa)->ioc)
  320. #define bfa_get_nports(__bfa) \
  321. bfa_ioc_get_nports(&(__bfa)->ioc)
  322. #define bfa_get_adapter_manufacturer(__bfa, __manufacturer) \
  323. bfa_ioc_get_adapter_manufacturer(&(__bfa)->ioc, __manufacturer)
  324. #define bfa_get_adapter_model(__bfa, __model) \
  325. bfa_ioc_get_adapter_model(&(__bfa)->ioc, __model)
  326. #define bfa_get_adapter_serial_num(__bfa, __serial_num) \
  327. bfa_ioc_get_adapter_serial_num(&(__bfa)->ioc, __serial_num)
  328. #define bfa_get_adapter_fw_ver(__bfa, __fw_ver) \
  329. bfa_ioc_get_adapter_fw_ver(&(__bfa)->ioc, __fw_ver)
  330. #define bfa_get_adapter_optrom_ver(__bfa, __optrom_ver) \
  331. bfa_ioc_get_adapter_optrom_ver(&(__bfa)->ioc, __optrom_ver)
  332. #define bfa_get_pci_chip_rev(__bfa, __chip_rev) \
  333. bfa_ioc_get_pci_chip_rev(&(__bfa)->ioc, __chip_rev)
  334. #define bfa_get_ioc_state(__bfa) \
  335. bfa_ioc_get_state(&(__bfa)->ioc)
  336. #define bfa_get_type(__bfa) \
  337. bfa_ioc_get_type(&(__bfa)->ioc)
  338. #define bfa_get_mac(__bfa) \
  339. bfa_ioc_get_mac(&(__bfa)->ioc)
  340. #define bfa_get_mfg_mac(__bfa) \
  341. bfa_ioc_get_mfg_mac(&(__bfa)->ioc)
  342. #define bfa_get_fw_clock_res(__bfa) \
  343. ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res)
  344. /*
  345. * lun mask macros return NULL when min cfg is enabled and there is
  346. * no memory allocated for lunmask.
  347. */
  348. #define bfa_get_lun_mask(__bfa) \
  349. ((&(__bfa)->modules.dconf_mod)->min_cfg) ? NULL : \
  350. (&(BFA_DCONF_MOD(__bfa)->dconf->lun_mask))
  351. #define bfa_get_lun_mask_list(_bfa) \
  352. ((&(_bfa)->modules.dconf_mod)->min_cfg) ? NULL : \
  353. (bfa_get_lun_mask(_bfa)->lun_list)
  354. #define bfa_get_lun_mask_status(_bfa) \
  355. (((&(_bfa)->modules.dconf_mod)->min_cfg) \
  356. ? BFA_LUNMASK_MINCFG : ((bfa_get_lun_mask(_bfa))->status))
  357. void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
  358. void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
  359. void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
  360. void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
  361. struct bfa_meminfo_s *meminfo,
  362. struct bfa_s *bfa);
  363. void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
  364. struct bfa_meminfo_s *meminfo,
  365. struct bfa_pcidev_s *pcidev);
  366. void bfa_detach(struct bfa_s *bfa);
  367. void bfa_cb_init(void *bfad, bfa_status_t status);
  368. void bfa_cb_updateq(void *bfad, bfa_status_t status);
  369. bfa_boolean_t bfa_intx(struct bfa_s *bfa);
  370. void bfa_isr_enable(struct bfa_s *bfa);
  371. void bfa_isr_disable(struct bfa_s *bfa);
  372. void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q);
  373. void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q);
  374. void bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q);
  375. typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status);
  376. void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr);
  377. bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa,
  378. struct bfa_iocfc_intr_attr_s *attr);
  379. void bfa_iocfc_enable(struct bfa_s *bfa);
  380. void bfa_iocfc_disable(struct bfa_s *bfa);
  381. #define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \
  382. bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout)
  383. struct bfa_cb_pending_q_s {
  384. struct bfa_cb_qe_s hcb_qe;
  385. void *data; /* Driver buffer */
  386. };
  387. /* Common macros to operate on pending stats/attr apis */
  388. #define bfa_pending_q_init(__qe, __cbfn, __cbarg, __data) do { \
  389. bfa_q_qe_init(&((__qe)->hcb_qe.qe)); \
  390. (__qe)->hcb_qe.cbfn = (__cbfn); \
  391. (__qe)->hcb_qe.cbarg = (__cbarg); \
  392. (__qe)->hcb_qe.pre_rmv = BFA_TRUE; \
  393. (__qe)->data = (__data); \
  394. } while (0)
  395. #endif /* __BFA_H__ */