bfa.h 15 KB

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