blob: 42769bc07ff43b8bf03d30cf23fecfef4a7c1528 [file] [log] [blame]
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07001/*
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
Maggie Zhangf16a1752010-12-09 19:12:32 -080020#include "bfad_drv.h"
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070021#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
27struct bfa_s;
28
29typedef void (*bfa_isr_func_t) (struct bfa_s *bfa, struct bfi_msg_s *m);
30typedef void (*bfa_cb_cbfn_t) (void *cbarg, bfa_boolean_t complete);
31
Jing Huangacdc79a2010-10-18 17:15:55 -070032/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070033 * Interrupt message handlers
34 */
35void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070036
Jing Huangacdc79a2010-10-18 17:15:55 -070037/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070038 * Request and response queue related defines
39 */
40#define BFA_REQQ_NELEMS_MIN (4)
41#define BFA_RSPQ_NELEMS_MIN (4)
42
43#define bfa_reqq_pi(__bfa, __reqq) ((__bfa)->iocfc.req_cq_pi[__reqq])
44#define bfa_reqq_ci(__bfa, __reqq) \
45 (*(u32 *)((__bfa)->iocfc.req_cq_shadow_ci[__reqq].kva))
46
47#define bfa_reqq_full(__bfa, __reqq) \
48 (((bfa_reqq_pi(__bfa, __reqq) + 1) & \
49 ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1)) == \
50 bfa_reqq_ci(__bfa, __reqq))
51
52#define bfa_reqq_next(__bfa, __reqq) \
53 (bfa_reqq_full(__bfa, __reqq) ? NULL : \
54 ((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \
55 + bfa_reqq_pi((__bfa), (__reqq)))))
56
57#define bfa_reqq_produce(__bfa, __reqq) do { \
58 (__bfa)->iocfc.req_cq_pi[__reqq]++; \
59 (__bfa)->iocfc.req_cq_pi[__reqq] &= \
Jing Huangacdc79a2010-10-18 17:15:55 -070060 ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
61 writel((__bfa)->iocfc.req_cq_pi[__reqq], \
Jing Huang53440262010-10-18 17:12:29 -070062 (__bfa)->iocfc.bfa_regs.cpe_q_pi[__reqq]); \
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070063 mmiowb(); \
64 } while (0)
65
66#define bfa_rspq_pi(__bfa, __rspq) \
67 (*(u32 *)((__bfa)->iocfc.rsp_cq_shadow_pi[__rspq].kva))
68
69#define bfa_rspq_ci(__bfa, __rspq) ((__bfa)->iocfc.rsp_cq_ci[__rspq])
70#define bfa_rspq_elem(__bfa, __rspq, __ci) \
71 (&((struct bfi_msg_s *)((__bfa)->iocfc.rsp_cq_ba[__rspq].kva))[__ci])
72
73#define CQ_INCR(__index, __size) do { \
74 (__index)++; \
75 (__index) &= ((__size) - 1); \
76} while (0)
77
Jing Huangacdc79a2010-10-18 17:15:55 -070078/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070079 * Queue element to wait for room in request queue. FIFO order is
80 * maintained when fullfilling requests.
81 */
82struct bfa_reqq_wait_s {
83 struct list_head qe;
84 void (*qresume) (void *cbarg);
85 void *cbarg;
86};
87
Jing Huangacdc79a2010-10-18 17:15:55 -070088/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070089 * Circular queue usage assignments
90 */
91enum {
92 BFA_REQQ_IOC = 0, /* all low-priority IOC msgs */
93 BFA_REQQ_FCXP = 0, /* all FCXP messages */
94 BFA_REQQ_LPS = 0, /* all lport service msgs */
95 BFA_REQQ_PORT = 0, /* all port messages */
96 BFA_REQQ_FLASH = 0, /* for flash module */
97 BFA_REQQ_DIAG = 0, /* for diag module */
98 BFA_REQQ_RPORT = 0, /* all port messages */
99 BFA_REQQ_SBOOT = 0, /* all san boot messages */
100 BFA_REQQ_QOS_LO = 1, /* all low priority IO */
101 BFA_REQQ_QOS_MD = 2, /* all medium priority IO */
102 BFA_REQQ_QOS_HI = 3, /* all high priority IO */
103};
104
105static inline void
106bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
107 void *cbarg)
108{
109 wqe->qresume = qresume;
110 wqe->cbarg = cbarg;
111}
112
113#define bfa_reqq(__bfa, __reqq) (&(__bfa)->reqq_waitq[__reqq])
114
Jing Huangacdc79a2010-10-18 17:15:55 -0700115/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700116 * static inline void
117 * bfa_reqq_wait(struct bfa_s *bfa, int reqq, struct bfa_reqq_wait_s *wqe)
118 */
119#define bfa_reqq_wait(__bfa, __reqq, __wqe) do { \
120 \
121 struct list_head *waitq = bfa_reqq(__bfa, __reqq); \
122 \
Jing Huangd4b671c2010-12-26 21:46:35 -0800123 WARN_ON(((__reqq) >= BFI_IOC_MAX_CQS)); \
124 WARN_ON(!((__wqe)->qresume && (__wqe)->cbarg)); \
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700125 \
126 list_add_tail(&(__wqe)->qe, waitq); \
127 } while (0)
128
129#define bfa_reqq_wcancel(__wqe) list_del(&(__wqe)->qe)
130
131
Jing Huangacdc79a2010-10-18 17:15:55 -0700132/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700133 * Generic BFA callback element.
134 */
135struct bfa_cb_qe_s {
136 struct list_head qe;
137 bfa_cb_cbfn_t cbfn;
138 bfa_boolean_t once;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700139 void *cbarg;
140};
141
142#define bfa_cb_queue(__bfa, __hcb_qe, __cbfn, __cbarg) do { \
143 (__hcb_qe)->cbfn = (__cbfn); \
144 (__hcb_qe)->cbarg = (__cbarg); \
145 list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \
146 } while (0)
147
148#define bfa_cb_dequeue(__hcb_qe) list_del(&(__hcb_qe)->qe)
149
150#define bfa_cb_queue_once(__bfa, __hcb_qe, __cbfn, __cbarg) do { \
151 (__hcb_qe)->cbfn = (__cbfn); \
152 (__hcb_qe)->cbarg = (__cbarg); \
153 if (!(__hcb_qe)->once) { \
154 list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \
155 (__hcb_qe)->once = BFA_TRUE; \
156 } \
157 } while (0)
158
159#define bfa_cb_queue_done(__hcb_qe) do { \
160 (__hcb_qe)->once = BFA_FALSE; \
161 } while (0)
162
163
Jing Huangacdc79a2010-10-18 17:15:55 -0700164/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700165 * PCI devices supported by the current BFA
166 */
167struct bfa_pciid_s {
168 u16 device_id;
169 u16 vendor_id;
170};
171
172extern char bfa_version[];
173
Jing Huangacdc79a2010-10-18 17:15:55 -0700174/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700175 * BFA memory resources
176 */
177enum bfa_mem_type {
178 BFA_MEM_TYPE_KVA = 1, /* Kernel Virtual Memory *(non-dma-able) */
179 BFA_MEM_TYPE_DMA = 2, /* DMA-able memory */
180 BFA_MEM_TYPE_MAX = BFA_MEM_TYPE_DMA,
181};
182
183struct bfa_mem_elem_s {
184 enum bfa_mem_type mem_type; /* see enum bfa_mem_type */
185 u32 mem_len; /* Total Length in Bytes */
186 u8 *kva; /* kernel virtual address */
187 u64 dma; /* dma address if DMA memory */
188 u8 *kva_curp; /* kva allocation cursor */
189 u64 dma_curp; /* dma allocation cursor */
190};
191
192struct bfa_meminfo_s {
193 struct bfa_mem_elem_s meminfo[BFA_MEM_TYPE_MAX];
194};
195#define bfa_meminfo_kva(_m) \
196 ((_m)->meminfo[BFA_MEM_TYPE_KVA - 1].kva_curp)
197#define bfa_meminfo_dma_virt(_m) \
198 ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].kva_curp)
199#define bfa_meminfo_dma_phys(_m) \
200 ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].dma_curp)
201
202struct bfa_iocfc_regs_s {
Jing Huang53440262010-10-18 17:12:29 -0700203 void __iomem *intr_status;
Jing Huangacdc79a2010-10-18 17:15:55 -0700204 void __iomem *intr_mask;
Jing Huang53440262010-10-18 17:12:29 -0700205 void __iomem *cpe_q_pi[BFI_IOC_MAX_CQS];
206 void __iomem *cpe_q_ci[BFI_IOC_MAX_CQS];
Jing Huang53440262010-10-18 17:12:29 -0700207 void __iomem *cpe_q_ctrl[BFI_IOC_MAX_CQS];
208 void __iomem *rme_q_ci[BFI_IOC_MAX_CQS];
209 void __iomem *rme_q_pi[BFI_IOC_MAX_CQS];
Jing Huang53440262010-10-18 17:12:29 -0700210 void __iomem *rme_q_ctrl[BFI_IOC_MAX_CQS];
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700211};
212
Jing Huangacdc79a2010-10-18 17:15:55 -0700213/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700214 * MSIX vector handlers
215 */
216#define BFA_MSIX_MAX_VECTORS 22
217typedef void (*bfa_msix_handler_t)(struct bfa_s *bfa, int vec);
218struct bfa_msix_s {
219 int nvecs;
220 bfa_msix_handler_t handler[BFA_MSIX_MAX_VECTORS];
221};
222
Jing Huangacdc79a2010-10-18 17:15:55 -0700223/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700224 * Chip specific interfaces
225 */
226struct bfa_hwif_s {
227 void (*hw_reginit)(struct bfa_s *bfa);
228 void (*hw_reqq_ack)(struct bfa_s *bfa, int reqq);
229 void (*hw_rspq_ack)(struct bfa_s *bfa, int rspq);
230 void (*hw_msix_init)(struct bfa_s *bfa, int nvecs);
Krishna Gudipati775c7742011-06-13 15:52:12 -0700231 void (*hw_msix_ctrl_install)(struct bfa_s *bfa);
232 void (*hw_msix_queue_install)(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700233 void (*hw_msix_uninstall)(struct bfa_s *bfa);
234 void (*hw_isr_mode_set)(struct bfa_s *bfa, bfa_boolean_t msix);
235 void (*hw_msix_getvecs)(struct bfa_s *bfa, u32 *vecmap,
236 u32 *nvecs, u32 *maxvec);
237 void (*hw_msix_get_rme_range) (struct bfa_s *bfa, u32 *start,
238 u32 *end);
Krishna Gudipati11189202011-06-13 15:50:35 -0700239 int cpe_vec_q0;
240 int rme_vec_q0;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700241};
242typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status);
243
Krishna Gudipatia7141342011-06-24 20:23:19 -0700244struct bfa_faa_cbfn_s {
245 bfa_cb_iocfc_t faa_cbfn;
246 void *faa_cbarg;
247};
248
249#define BFA_FAA_ENABLED 1
250#define BFA_FAA_DISABLED 2
251
252/*
253 * FAA attributes
254 */
255struct bfa_faa_attr_s {
256 wwn_t faa;
257 u8 faa_state;
258 u8 pwwn_source;
259 u8 rsvd[6];
260};
261
262struct bfa_faa_args_s {
263 struct bfa_faa_attr_s *faa_attr;
264 struct bfa_faa_cbfn_s faa_cb;
265 u8 faa_state;
266 bfa_boolean_t busy;
267};
268
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700269struct bfa_iocfc_s {
270 struct bfa_s *bfa;
271 struct bfa_iocfc_cfg_s cfg;
272 int action;
273 u32 req_cq_pi[BFI_IOC_MAX_CQS];
274 u32 rsp_cq_ci[BFI_IOC_MAX_CQS];
275 struct bfa_cb_qe_s init_hcb_qe;
276 struct bfa_cb_qe_s stop_hcb_qe;
277 struct bfa_cb_qe_s dis_hcb_qe;
278 struct bfa_cb_qe_s stats_hcb_qe;
279 bfa_boolean_t cfgdone;
280
281 struct bfa_dma_s cfg_info;
282 struct bfi_iocfc_cfg_s *cfginfo;
283 struct bfa_dma_s cfgrsp_dma;
284 struct bfi_iocfc_cfgrsp_s *cfgrsp;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700285 struct bfa_dma_s req_cq_ba[BFI_IOC_MAX_CQS];
286 struct bfa_dma_s req_cq_shadow_ci[BFI_IOC_MAX_CQS];
287 struct bfa_dma_s rsp_cq_ba[BFI_IOC_MAX_CQS];
288 struct bfa_dma_s rsp_cq_shadow_pi[BFI_IOC_MAX_CQS];
289 struct bfa_iocfc_regs_s bfa_regs; /* BFA device registers */
290 struct bfa_hwif_s hwif;
291 bfa_cb_iocfc_t updateq_cbfn; /* bios callback function */
292 void *updateq_cbarg; /* bios callback arg */
293 u32 intr_mask;
Krishna Gudipatia7141342011-06-24 20:23:19 -0700294 struct bfa_faa_args_s faa_args;
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700295};
296
297#define bfa_lpuid(__bfa) \
298 bfa_ioc_portid(&(__bfa)->ioc)
299#define bfa_msix_init(__bfa, __nvecs) \
300 ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs))
Krishna Gudipati775c7742011-06-13 15:52:12 -0700301#define bfa_msix_ctrl_install(__bfa) \
302 ((__bfa)->iocfc.hwif.hw_msix_ctrl_install(__bfa))
303#define bfa_msix_queue_install(__bfa) \
304 ((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa))
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700305#define bfa_msix_uninstall(__bfa) \
306 ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa))
Krishna Gudipati11189202011-06-13 15:50:35 -0700307#define bfa_isr_mode_set(__bfa, __msix) do { \
308 if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \
309 (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \
310} while (0)
311
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700312#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \
313 ((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \
314 __nvecs, __maxvec))
315#define bfa_msix_get_rme_range(__bfa, __start, __end) \
316 ((__bfa)->iocfc.hwif.hw_msix_get_rme_range(__bfa, __start, __end))
317#define bfa_msix(__bfa, __vec) \
318 ((__bfa)->msix.handler[__vec](__bfa, __vec))
319
320/*
321 * FC specific IOC functions.
322 */
323void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
324 u32 *dm_len);
325void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
326 struct bfa_iocfc_cfg_s *cfg,
327 struct bfa_meminfo_s *meminfo,
328 struct bfa_pcidev_s *pcidev);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700329void bfa_iocfc_init(struct bfa_s *bfa);
330void bfa_iocfc_start(struct bfa_s *bfa);
331void bfa_iocfc_stop(struct bfa_s *bfa);
332void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
333void bfa_iocfc_set_snsbase(struct bfa_s *bfa, u64 snsbase_pa);
334bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
335void bfa_iocfc_reset_queues(struct bfa_s *bfa);
336
337void bfa_msix_all(struct bfa_s *bfa, int vec);
338void bfa_msix_reqq(struct bfa_s *bfa, int vec);
339void bfa_msix_rspq(struct bfa_s *bfa, int vec);
340void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);
341
342void bfa_hwcb_reginit(struct bfa_s *bfa);
343void bfa_hwcb_reqq_ack(struct bfa_s *bfa, int rspq);
344void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq);
345void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
Krishna Gudipati775c7742011-06-13 15:52:12 -0700346void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa);
347void bfa_hwcb_msix_queue_install(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700348void bfa_hwcb_msix_uninstall(struct bfa_s *bfa);
349void bfa_hwcb_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
350void bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
351 u32 *maxvec);
352void bfa_hwcb_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
353 u32 *end);
354void bfa_hwct_reginit(struct bfa_s *bfa);
Krishna Gudipati11189202011-06-13 15:50:35 -0700355void bfa_hwct2_reginit(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700356void bfa_hwct_reqq_ack(struct bfa_s *bfa, int rspq);
357void bfa_hwct_rspq_ack(struct bfa_s *bfa, int rspq);
358void bfa_hwct_msix_init(struct bfa_s *bfa, int nvecs);
Krishna Gudipati775c7742011-06-13 15:52:12 -0700359void bfa_hwct_msix_ctrl_install(struct bfa_s *bfa);
360void bfa_hwct_msix_queue_install(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700361void bfa_hwct_msix_uninstall(struct bfa_s *bfa);
362void bfa_hwct_isr_mode_set(struct bfa_s *bfa, bfa_boolean_t msix);
363void bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs,
364 u32 *maxvec);
365void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start,
366 u32 *end);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700367void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns);
368wwn_t bfa_iocfc_get_pwwn(struct bfa_s *bfa);
369wwn_t bfa_iocfc_get_nwwn(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700370int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
371 struct bfi_pbc_vport_s *pbc_vport);
372
373
Jing Huangacdc79a2010-10-18 17:15:55 -0700374/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700375 *----------------------------------------------------------------------
376 * BFA public interfaces
377 *----------------------------------------------------------------------
378 */
379#define bfa_stats(_mod, _stats) ((_mod)->stats._stats++)
380#define bfa_ioc_get_stats(__bfa, __ioc_stats) \
381 bfa_ioc_fetch_stats(&(__bfa)->ioc, __ioc_stats)
382#define bfa_ioc_clear_stats(__bfa) \
383 bfa_ioc_clr_stats(&(__bfa)->ioc)
384#define bfa_get_nports(__bfa) \
385 bfa_ioc_get_nports(&(__bfa)->ioc)
386#define bfa_get_adapter_manufacturer(__bfa, __manufacturer) \
387 bfa_ioc_get_adapter_manufacturer(&(__bfa)->ioc, __manufacturer)
388#define bfa_get_adapter_model(__bfa, __model) \
389 bfa_ioc_get_adapter_model(&(__bfa)->ioc, __model)
390#define bfa_get_adapter_serial_num(__bfa, __serial_num) \
391 bfa_ioc_get_adapter_serial_num(&(__bfa)->ioc, __serial_num)
392#define bfa_get_adapter_fw_ver(__bfa, __fw_ver) \
393 bfa_ioc_get_adapter_fw_ver(&(__bfa)->ioc, __fw_ver)
394#define bfa_get_adapter_optrom_ver(__bfa, __optrom_ver) \
395 bfa_ioc_get_adapter_optrom_ver(&(__bfa)->ioc, __optrom_ver)
396#define bfa_get_pci_chip_rev(__bfa, __chip_rev) \
397 bfa_ioc_get_pci_chip_rev(&(__bfa)->ioc, __chip_rev)
398#define bfa_get_ioc_state(__bfa) \
399 bfa_ioc_get_state(&(__bfa)->ioc)
400#define bfa_get_type(__bfa) \
401 bfa_ioc_get_type(&(__bfa)->ioc)
402#define bfa_get_mac(__bfa) \
403 bfa_ioc_get_mac(&(__bfa)->ioc)
404#define bfa_get_mfg_mac(__bfa) \
405 bfa_ioc_get_mfg_mac(&(__bfa)->ioc)
406#define bfa_get_fw_clock_res(__bfa) \
407 ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res)
408
409void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
410void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
411void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
412void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
413 struct bfa_meminfo_s *meminfo);
414void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
415 struct bfa_meminfo_s *meminfo,
416 struct bfa_pcidev_s *pcidev);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700417void bfa_detach(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700418void bfa_cb_init(void *bfad, bfa_status_t status);
419void bfa_cb_updateq(void *bfad, bfa_status_t status);
420
421bfa_boolean_t bfa_intx(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700422void bfa_isr_enable(struct bfa_s *bfa);
423void bfa_isr_disable(struct bfa_s *bfa);
424
425void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q);
426void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q);
427void bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q);
428
429typedef void (*bfa_cb_ioc_t) (void *cbarg, enum bfa_status status);
430void bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700431
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700432
433bfa_status_t bfa_iocfc_israttr_set(struct bfa_s *bfa,
434 struct bfa_iocfc_intr_attr_s *attr);
435
436void bfa_iocfc_enable(struct bfa_s *bfa);
437void bfa_iocfc_disable(struct bfa_s *bfa);
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700438#define bfa_timer_start(_bfa, _timer, _timercb, _arg, _timeout) \
439 bfa_timer_begin(&(_bfa)->timer_mod, _timer, _timercb, _arg, _timeout)
440
Krishna Gudipatia36c61f2010-09-15 11:50:55 -0700441#endif /* __BFA_H__ */