aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa.h
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-24 23:24:08 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 18:02:28 -0400
commit3fd459804ff8e002db2671900debd0fc6dc6c443 (patch)
tree34d71220521bedb451182ae98a32c16906881503 /drivers/scsi/bfa/bfa.h
parent10a07379247078448c076690657a076076bf89aa (diff)
[SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support.
- Introduced partitioning of the BFA resources. - Added h/w queue ID in CPE messages, firmware uses h/w queue ID from messages to pick a matching RME queue. - Added message header to bfa_reqq_produce(). h/w queue ID is set in the message header and firmware modules use h/w queue ID from message header instead of from cpqe event. - Made changes to allow using all 256 queues of Brocade-1860 asic. Previously only a single queue per queue group was used. - Added function tag to BFI message header. Only used by FC BFI messages. Used to translate host tag to firmware tag. bfa_lpuid() is changed to bfa_fn_lpu() that encodes both PCI function and port ID in BFI message header. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa.h')
-rw-r--r--drivers/scsi/bfa/bfa.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index 42769bc07ff4..ee072d99b8f9 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -54,7 +54,8 @@ void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
54 ((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \ 54 ((void *)((struct bfi_msg_s *)((__bfa)->iocfc.req_cq_ba[__reqq].kva) \
55 + bfa_reqq_pi((__bfa), (__reqq))))) 55 + bfa_reqq_pi((__bfa), (__reqq)))))
56 56
57#define bfa_reqq_produce(__bfa, __reqq) do { \ 57#define bfa_reqq_produce(__bfa, __reqq, __mh) do { \
58 (__mh).mtag.h2i.qid = (__bfa)->iocfc.hw_qid[__reqq];\
58 (__bfa)->iocfc.req_cq_pi[__reqq]++; \ 59 (__bfa)->iocfc.req_cq_pi[__reqq]++; \
59 (__bfa)->iocfc.req_cq_pi[__reqq] &= \ 60 (__bfa)->iocfc.req_cq_pi[__reqq] &= \
60 ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \ 61 ((__bfa)->iocfc.cfg.drvcfg.num_reqq_elems - 1); \
@@ -272,6 +273,7 @@ struct bfa_iocfc_s {
272 int action; 273 int action;
273 u32 req_cq_pi[BFI_IOC_MAX_CQS]; 274 u32 req_cq_pi[BFI_IOC_MAX_CQS];
274 u32 rsp_cq_ci[BFI_IOC_MAX_CQS]; 275 u32 rsp_cq_ci[BFI_IOC_MAX_CQS];
276 u8 hw_qid[BFI_IOC_MAX_CQS];
275 struct bfa_cb_qe_s init_hcb_qe; 277 struct bfa_cb_qe_s init_hcb_qe;
276 struct bfa_cb_qe_s stop_hcb_qe; 278 struct bfa_cb_qe_s stop_hcb_qe;
277 struct bfa_cb_qe_s dis_hcb_qe; 279 struct bfa_cb_qe_s dis_hcb_qe;
@@ -294,8 +296,8 @@ struct bfa_iocfc_s {
294 struct bfa_faa_args_s faa_args; 296 struct bfa_faa_args_s faa_args;
295}; 297};
296 298
297#define bfa_lpuid(__bfa) \ 299#define bfa_fn_lpu(__bfa) \
298 bfa_ioc_portid(&(__bfa)->ioc) 300 bfi_fn_lpu(bfa_ioc_pcifn(&(__bfa)->ioc), bfa_ioc_portid(&(__bfa)->ioc))
299#define bfa_msix_init(__bfa, __nvecs) \ 301#define bfa_msix_init(__bfa, __nvecs) \
300 ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs)) 302 ((__bfa)->iocfc.hwif.hw_msix_init(__bfa, __nvecs))
301#define bfa_msix_ctrl_install(__bfa) \ 303#define bfa_msix_ctrl_install(__bfa) \
@@ -304,11 +306,18 @@ struct bfa_iocfc_s {
304 ((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa)) 306 ((__bfa)->iocfc.hwif.hw_msix_queue_install(__bfa))
305#define bfa_msix_uninstall(__bfa) \ 307#define bfa_msix_uninstall(__bfa) \
306 ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa)) 308 ((__bfa)->iocfc.hwif.hw_msix_uninstall(__bfa))
309#define bfa_isr_rspq_ack(__bfa, __queue) do { \
310 if ((__bfa)->iocfc.hwif.hw_rspq_ack) \
311 (__bfa)->iocfc.hwif.hw_rspq_ack(__bfa, __queue); \
312} while (0)
313#define bfa_isr_reqq_ack(__bfa, __queue) do { \
314 if ((__bfa)->iocfc.hwif.hw_reqq_ack) \
315 (__bfa)->iocfc.hwif.hw_reqq_ack(__bfa, __queue); \
316} while (0)
307#define bfa_isr_mode_set(__bfa, __msix) do { \ 317#define bfa_isr_mode_set(__bfa, __msix) do { \
308 if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \ 318 if ((__bfa)->iocfc.hwif.hw_isr_mode_set) \
309 (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \ 319 (__bfa)->iocfc.hwif.hw_isr_mode_set(__bfa, __msix); \
310} while (0) 320} while (0)
311
312#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \ 321#define bfa_msix_getvecs(__bfa, __vecmap, __nvecs, __maxvec) \
313 ((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \ 322 ((__bfa)->iocfc.hwif.hw_msix_getvecs(__bfa, __vecmap, \
314 __nvecs, __maxvec)) 323 __nvecs, __maxvec))
@@ -340,7 +349,6 @@ void bfa_msix_rspq(struct bfa_s *bfa, int vec);
340void bfa_msix_lpu_err(struct bfa_s *bfa, int vec); 349void bfa_msix_lpu_err(struct bfa_s *bfa, int vec);
341 350
342void bfa_hwcb_reginit(struct bfa_s *bfa); 351void 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); 352void bfa_hwcb_rspq_ack(struct bfa_s *bfa, int rspq);
345void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs); 353void bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs);
346void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa); 354void bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa);