aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfa.h')
-rw-r--r--drivers/scsi/bfa/bfa.h50
1 files changed, 17 insertions, 33 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index ee072d99b8f9..67742dca675f 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -172,34 +172,6 @@ struct bfa_pciid_s {
172 172
173extern char bfa_version[]; 173extern char bfa_version[];
174 174
175/*
176 * BFA memory resources
177 */
178enum bfa_mem_type {
179 BFA_MEM_TYPE_KVA = 1, /* Kernel Virtual Memory *(non-dma-able) */
180 BFA_MEM_TYPE_DMA = 2, /* DMA-able memory */
181 BFA_MEM_TYPE_MAX = BFA_MEM_TYPE_DMA,
182};
183
184struct bfa_mem_elem_s {
185 enum bfa_mem_type mem_type; /* see enum bfa_mem_type */
186 u32 mem_len; /* Total Length in Bytes */
187 u8 *kva; /* kernel virtual address */
188 u64 dma; /* dma address if DMA memory */
189 u8 *kva_curp; /* kva allocation cursor */
190 u64 dma_curp; /* dma allocation cursor */
191};
192
193struct bfa_meminfo_s {
194 struct bfa_mem_elem_s meminfo[BFA_MEM_TYPE_MAX];
195};
196#define bfa_meminfo_kva(_m) \
197 ((_m)->meminfo[BFA_MEM_TYPE_KVA - 1].kva_curp)
198#define bfa_meminfo_dma_virt(_m) \
199 ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].kva_curp)
200#define bfa_meminfo_dma_phys(_m) \
201 ((_m)->meminfo[BFA_MEM_TYPE_DMA - 1].dma_curp)
202
203struct bfa_iocfc_regs_s { 175struct bfa_iocfc_regs_s {
204 void __iomem *intr_status; 176 void __iomem *intr_status;
205 void __iomem *intr_mask; 177 void __iomem *intr_mask;
@@ -294,8 +266,19 @@ struct bfa_iocfc_s {
294 void *updateq_cbarg; /* bios callback arg */ 266 void *updateq_cbarg; /* bios callback arg */
295 u32 intr_mask; 267 u32 intr_mask;
296 struct bfa_faa_args_s faa_args; 268 struct bfa_faa_args_s faa_args;
269 struct bfa_mem_dma_s ioc_dma;
270 struct bfa_mem_dma_s iocfc_dma;
271 struct bfa_mem_dma_s reqq_dma[BFI_IOC_MAX_CQS];
272 struct bfa_mem_dma_s rspq_dma[BFI_IOC_MAX_CQS];
273 struct bfa_mem_kva_s kva_seg;
297}; 274};
298 275
276#define BFA_MEM_IOC_DMA(_bfa) (&((_bfa)->iocfc.ioc_dma))
277#define BFA_MEM_IOCFC_DMA(_bfa) (&((_bfa)->iocfc.iocfc_dma))
278#define BFA_MEM_REQQ_DMA(_bfa, _qno) (&((_bfa)->iocfc.reqq_dma[(_qno)]))
279#define BFA_MEM_RSPQ_DMA(_bfa, _qno) (&((_bfa)->iocfc.rspq_dma[(_qno)]))
280#define BFA_MEM_IOCFC_KVA(_bfa) (&((_bfa)->iocfc.kva_seg))
281
299#define bfa_fn_lpu(__bfa) \ 282#define bfa_fn_lpu(__bfa) \
300 bfi_fn_lpu(bfa_ioc_pcifn(&(__bfa)->ioc), bfa_ioc_portid(&(__bfa)->ioc)) 283 bfi_fn_lpu(bfa_ioc_pcifn(&(__bfa)->ioc), bfa_ioc_portid(&(__bfa)->ioc))
301#define bfa_msix_init(__bfa, __nvecs) \ 284#define bfa_msix_init(__bfa, __nvecs) \
@@ -329,17 +312,17 @@ struct bfa_iocfc_s {
329/* 312/*
330 * FC specific IOC functions. 313 * FC specific IOC functions.
331 */ 314 */
332void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, 315void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg,
333 u32 *dm_len); 316 struct bfa_meminfo_s *meminfo,
317 struct bfa_s *bfa);
334void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, 318void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
335 struct bfa_iocfc_cfg_s *cfg, 319 struct bfa_iocfc_cfg_s *cfg,
336 struct bfa_meminfo_s *meminfo,
337 struct bfa_pcidev_s *pcidev); 320 struct bfa_pcidev_s *pcidev);
338void bfa_iocfc_init(struct bfa_s *bfa); 321void bfa_iocfc_init(struct bfa_s *bfa);
339void bfa_iocfc_start(struct bfa_s *bfa); 322void bfa_iocfc_start(struct bfa_s *bfa);
340void bfa_iocfc_stop(struct bfa_s *bfa); 323void bfa_iocfc_stop(struct bfa_s *bfa);
341void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg); 324void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
342void bfa_iocfc_set_snsbase(struct bfa_s *bfa, u64 snsbase_pa); 325void bfa_iocfc_set_snsbase(struct bfa_s *bfa, int seg_no, u64 snsbase_pa);
343bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa); 326bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
344void bfa_iocfc_reset_queues(struct bfa_s *bfa); 327void bfa_iocfc_reset_queues(struct bfa_s *bfa);
345 328
@@ -418,7 +401,8 @@ void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
418void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg); 401void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
419void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg); 402void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
420void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, 403void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
421 struct bfa_meminfo_s *meminfo); 404 struct bfa_meminfo_s *meminfo,
405 struct bfa_s *bfa);
422void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, 406void bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
423 struct bfa_meminfo_s *meminfo, 407 struct bfa_meminfo_s *meminfo,
424 struct bfa_pcidev_s *pcidev); 408 struct bfa_pcidev_s *pcidev);