aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_hw_cb.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:52:12 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:46:19 -0400
commit775c7742adfd7726f05914198bf33eaa3b9f64bb (patch)
tree87c9373091ca11b5808dc28a2acb7d4a4efe33a2 /drivers/scsi/bfa/bfa_hw_cb.c
parentdd5aaf4536c5111784a18d935b9b5adeac9f914c (diff)
[SCSI] bfa: IOC and PLL init changes for Brocade-1860 Fabric Adapter.
- Introduced IOC poll mechanism which replaces current interrupt based FW READY method. - The timer based poll routine in IOC will query the ioc_fwstate register to see if there is a state change in FW, and sends the READY event. - Bug fixes in the new asic PLL initialization. - Added logic to handle CPE/RME queue interrupts before iocfc config done. 1. Use the queue_process flag to see if iocfc configuration is done in INTX mode. 2. Split the MSIX handler installation in two - one for IOC intr handler and the other for cpe/rme queue handler - and delay assigning queue handlers until iocfc config is done in MSIX mode. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_hw_cb.c')
-rw-r--r--drivers/scsi/bfa/bfa_hw_cb.c58
1 files changed, 43 insertions, 15 deletions
diff --git a/drivers/scsi/bfa/bfa_hw_cb.c b/drivers/scsi/bfa/bfa_hw_cb.c
index 4ef3cf2e7d98..15fbb13df96c 100644
--- a/drivers/scsi/bfa/bfa_hw_cb.c
+++ b/drivers/scsi/bfa/bfa_hw_cb.c
@@ -86,43 +86,71 @@ bfa_hwcb_msix_getvecs(struct bfa_s *bfa, u32 *msix_vecs_bmap,
86} 86}
87 87
88/* 88/*
89 * Dummy interrupt handler for handling spurious interrupts.
90 */
91static void
92bfa_hwcb_msix_dummy(struct bfa_s *bfa, int vec)
93{
94}
95
96/*
89 * No special setup required for crossbow -- vector assignments are implicit. 97 * No special setup required for crossbow -- vector assignments are implicit.
90 */ 98 */
91void 99void
92bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs) 100bfa_hwcb_msix_init(struct bfa_s *bfa, int nvecs)
93{ 101{
94 int i;
95
96 WARN_ON((nvecs != 1) && (nvecs != __HFN_NUMINTS)); 102 WARN_ON((nvecs != 1) && (nvecs != __HFN_NUMINTS));
97 103
98 bfa->msix.nvecs = nvecs; 104 bfa->msix.nvecs = nvecs;
99 if (nvecs == 1) { 105 bfa_hwcb_msix_uninstall(bfa);
100 for (i = 0; i < BFI_MSIX_CB_MAX; i++) 106}
107
108void
109bfa_hwcb_msix_ctrl_install(struct bfa_s *bfa)
110{
111 int i;
112
113 if (bfa->msix.nvecs == 0)
114 return;
115
116 if (bfa->msix.nvecs == 1) {
117 for (i = BFI_MSIX_RME_QMAX_CB+1; i < BFI_MSIX_CB_MAX; i++)
101 bfa->msix.handler[i] = bfa_msix_all; 118 bfa->msix.handler[i] = bfa_msix_all;
102 return; 119 return;
103 } 120 }
104 121
105 for (i = BFI_MSIX_CPE_QMIN_CB; i <= BFI_MSIX_CPE_QMAX_CB; i++) 122 for (i = BFI_MSIX_RME_QMAX_CB+1; i < BFI_MSIX_CB_MAX; i++)
106 bfa->msix.handler[i] = bfa_msix_reqq;
107
108 for (i = BFI_MSIX_RME_QMIN_CB; i <= BFI_MSIX_RME_QMAX_CB; i++)
109 bfa->msix.handler[i] = bfa_msix_rspq;
110
111 for (; i < BFI_MSIX_CB_MAX; i++)
112 bfa->msix.handler[i] = bfa_msix_lpu_err; 123 bfa->msix.handler[i] = bfa_msix_lpu_err;
113} 124}
114 125
115/*
116 * Crossbow -- dummy, interrupts are masked
117 */
118void 126void
119bfa_hwcb_msix_install(struct bfa_s *bfa) 127bfa_hwcb_msix_queue_install(struct bfa_s *bfa)
120{ 128{
129 int i;
130
131 if (bfa->msix.nvecs == 0)
132 return;
133
134 if (bfa->msix.nvecs == 1) {
135 for (i = BFI_MSIX_CPE_QMIN_CB; i <= BFI_MSIX_RME_QMAX_CB; i++)
136 bfa->msix.handler[i] = bfa_msix_all;
137 return;
138 }
139
140 for (i = BFI_MSIX_CPE_QMIN_CB; i <= BFI_MSIX_CPE_QMAX_CB; i++)
141 bfa->msix.handler[i] = bfa_msix_reqq;
142
143 for (i = BFI_MSIX_RME_QMIN_CB; i <= BFI_MSIX_RME_QMAX_CB; i++)
144 bfa->msix.handler[i] = bfa_msix_rspq;
121} 145}
122 146
123void 147void
124bfa_hwcb_msix_uninstall(struct bfa_s *bfa) 148bfa_hwcb_msix_uninstall(struct bfa_s *bfa)
125{ 149{
150 int i;
151
152 for (i = 0; i < BFI_MSIX_CB_MAX; i++)
153 bfa->msix.handler[i] = bfa_hwcb_msix_dummy;
126} 154}
127 155
128/* 156/*