aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2007-05-07 10:43:01 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-08 12:21:29 -0400
commita157b1014f9eaf7f80f9105defed2117c5f6653c (patch)
treec65ab8056c96aa78dd68a15170369cabfa5c378e /drivers/scsi/qla2xxx
parent75edf81d337ea84a291f0fdae2777cfd07045eca (diff)
[SCSI] qla2xxx: Correct pci_set_msi() usage semantics.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 6ad15880c468..db998d84cd40 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -130,18 +130,17 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
130int 130int
131qla2100_pci_config(scsi_qla_host_t *ha) 131qla2100_pci_config(scsi_qla_host_t *ha)
132{ 132{
133 uint16_t w, mwi; 133 int ret;
134 uint16_t w;
134 uint32_t d; 135 uint32_t d;
135 unsigned long flags; 136 unsigned long flags;
136 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 137 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
137 138
138 pci_set_master(ha->pdev); 139 pci_set_master(ha->pdev);
139 mwi = 0; 140 ret = pci_set_mwi(ha->pdev);
140 if (pci_set_mwi(ha->pdev))
141 mwi = PCI_COMMAND_INVALIDATE;
142 141
143 pci_read_config_word(ha->pdev, PCI_COMMAND, &w); 142 pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
144 w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR); 143 w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
145 pci_write_config_word(ha->pdev, PCI_COMMAND, w); 144 pci_write_config_word(ha->pdev, PCI_COMMAND, w);
146 145
147 /* Reset expansion ROM address decode enable */ 146 /* Reset expansion ROM address decode enable */
@@ -166,22 +165,22 @@ qla2100_pci_config(scsi_qla_host_t *ha)
166int 165int
167qla2300_pci_config(scsi_qla_host_t *ha) 166qla2300_pci_config(scsi_qla_host_t *ha)
168{ 167{
169 uint16_t w, mwi; 168 int ret;
169 uint16_t w;
170 uint32_t d; 170 uint32_t d;
171 unsigned long flags = 0; 171 unsigned long flags = 0;
172 uint32_t cnt; 172 uint32_t cnt;
173 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 173 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
174 174
175 pci_set_master(ha->pdev); 175 pci_set_master(ha->pdev);
176 mwi = 0; 176 ret = pci_set_mwi(ha->pdev);
177 if (pci_set_mwi(ha->pdev))
178 mwi = PCI_COMMAND_INVALIDATE;
179 177
180 pci_read_config_word(ha->pdev, PCI_COMMAND, &w); 178 pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
181 w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR); 179 w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
182 180
183 if (IS_QLA2322(ha) || IS_QLA6322(ha)) 181 if (IS_QLA2322(ha) || IS_QLA6322(ha))
184 w &= ~PCI_COMMAND_INTX_DISABLE; 182 w &= ~PCI_COMMAND_INTX_DISABLE;
183 pci_write_config_word(ha->pdev, PCI_COMMAND, w);
185 184
186 /* 185 /*
187 * If this is a 2300 card and not 2312, reset the 186 * If this is a 2300 card and not 2312, reset the
@@ -210,7 +209,7 @@ qla2300_pci_config(scsi_qla_host_t *ha)
210 ha->fb_rev = RD_FB_CMD_REG(ha, reg); 209 ha->fb_rev = RD_FB_CMD_REG(ha, reg);
211 210
212 if (ha->fb_rev == FPM_2300) 211 if (ha->fb_rev == FPM_2300)
213 w &= ~PCI_COMMAND_INVALIDATE; 212 pci_clear_mwi(ha->pdev);
214 213
215 /* Deselect FPM registers. */ 214 /* Deselect FPM registers. */
216 WRT_REG_WORD(&reg->ctrl_status, 0x0); 215 WRT_REG_WORD(&reg->ctrl_status, 0x0);
@@ -227,7 +226,6 @@ qla2300_pci_config(scsi_qla_host_t *ha)
227 226
228 spin_unlock_irqrestore(&ha->hardware_lock, flags); 227 spin_unlock_irqrestore(&ha->hardware_lock, flags);
229 } 228 }
230 pci_write_config_word(ha->pdev, PCI_COMMAND, w);
231 229
232 pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80); 230 pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80);
233 231
@@ -253,19 +251,18 @@ qla2300_pci_config(scsi_qla_host_t *ha)
253int 251int
254qla24xx_pci_config(scsi_qla_host_t *ha) 252qla24xx_pci_config(scsi_qla_host_t *ha)
255{ 253{
256 uint16_t w, mwi; 254 int ret;
255 uint16_t w;
257 uint32_t d; 256 uint32_t d;
258 unsigned long flags = 0; 257 unsigned long flags = 0;
259 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; 258 struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
260 int pcix_cmd_reg, pcie_dctl_reg; 259 int pcix_cmd_reg, pcie_dctl_reg;
261 260
262 pci_set_master(ha->pdev); 261 pci_set_master(ha->pdev);
263 mwi = 0; 262 ret = pci_set_mwi(ha->pdev);
264 if (pci_set_mwi(ha->pdev))
265 mwi = PCI_COMMAND_INVALIDATE;
266 263
267 pci_read_config_word(ha->pdev, PCI_COMMAND, &w); 264 pci_read_config_word(ha->pdev, PCI_COMMAND, &w);
268 w |= mwi | (PCI_COMMAND_PARITY | PCI_COMMAND_SERR); 265 w |= (PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
269 w &= ~PCI_COMMAND_INTX_DISABLE; 266 w &= ~PCI_COMMAND_INTX_DISABLE;
270 pci_write_config_word(ha->pdev, PCI_COMMAND, w); 267 pci_write_config_word(ha->pdev, PCI_COMMAND, w);
271 268