switch (vnic_dev_get_intr_mode(fnic->vdev)) {
case VNIC_DEV_INTR_MODE_INTX:
case VNIC_DEV_INTR_MODE_MSI:
- free_irq(fnic->pdev->irq, fnic);
+ free_irq(pci_irq_vector(fnic->pdev, 0), fnic);
break;
case VNIC_DEV_INTR_MODE_MSIX:
for (i = 0; i < ARRAY_SIZE(fnic->msix); i++)
if (fnic->msix[i].requested)
- free_irq(fnic->msix_entry[i].vector,
+ free_irq(pci_irq_vector(fnic->pdev, i),
fnic->msix[i].devid);
break;
switch (vnic_dev_get_intr_mode(fnic->vdev)) {
case VNIC_DEV_INTR_MODE_INTX:
- err = request_irq(fnic->pdev->irq, &fnic_isr_legacy,
- IRQF_SHARED, DRV_NAME, fnic);
+ err = request_irq(pci_irq_vector(fnic->pdev, 0),
+ &fnic_isr_legacy, IRQF_SHARED, DRV_NAME, fnic);
break;
case VNIC_DEV_INTR_MODE_MSI:
- err = request_irq(fnic->pdev->irq, &fnic_isr_msi,
+ err = request_irq(pci_irq_vector(fnic->pdev, 0), &fnic_isr_msi,
0, fnic->name, fnic);
break;
fnic->msix[FNIC_MSIX_ERR_NOTIFY].devid = fnic;
for (i = 0; i < ARRAY_SIZE(fnic->msix); i++) {
- err = request_irq(fnic->msix_entry[i].vector,
+ err = request_irq(pci_irq_vector(fnic->pdev, i),
fnic->msix[i].isr, 0,
fnic->msix[i].devname,
fnic->msix[i].devid);
unsigned int n = ARRAY_SIZE(fnic->rq);
unsigned int m = ARRAY_SIZE(fnic->wq);
unsigned int o = ARRAY_SIZE(fnic->wq_copy);
- unsigned int i;
/*
* Set interrupt mode (INTx, MSI, MSI-X) depending
* We need n RQs, m WQs, o Copy WQs, n+m+o CQs, and n+m+o+1 INTRs
* (last INTR is used for WQ/RQ errors and notification area)
*/
-
- BUG_ON(ARRAY_SIZE(fnic->msix_entry) < n + m + o + 1);
- for (i = 0; i < n + m + o + 1; i++)
- fnic->msix_entry[i].entry = i;
-
if (fnic->rq_count >= n &&
fnic->raw_wq_count >= m &&
fnic->wq_copy_count >= o &&
fnic->cq_count >= n + m + o) {
- if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
- n + m + o + 1)) {
+ int vecs = n + m + o + 1;
+
+ if (pci_alloc_irq_vectors(fnic->pdev, vecs, vecs,
+ PCI_IRQ_MSIX) < 0) {
fnic->rq_count = n;
fnic->raw_wq_count = m;
fnic->wq_copy_count = o;
fnic->wq_count = m + o;
fnic->cq_count = n + m + o;
- fnic->intr_count = n + m + o + 1;
+ fnic->intr_count = vecs;
fnic->err_intr_offset = FNIC_MSIX_ERR_NOTIFY;
FNIC_ISR_DBG(KERN_DEBUG, fnic->lport->host,
fnic->wq_copy_count >= 1 &&
fnic->cq_count >= 3 &&
fnic->intr_count >= 1 &&
- !pci_enable_msi(fnic->pdev)) {
-
+ pci_alloc_irq_vectors(fnic->pdev, 1, 1, PCI_IRQ_MSI) < 0) {
fnic->rq_count = 1;
fnic->raw_wq_count = 1;
fnic->wq_copy_count = 1;
void fnic_clear_intr_mode(struct fnic *fnic)
{
- switch (vnic_dev_get_intr_mode(fnic->vdev)) {
- case VNIC_DEV_INTR_MODE_MSIX:
- pci_disable_msix(fnic->pdev);
- break;
- case VNIC_DEV_INTR_MODE_MSI:
- pci_disable_msi(fnic->pdev);
- break;
- default:
- break;
- }
-
+ pci_free_irq_vectors(fnic->pdev);
vnic_dev_set_intr_mode(fnic->vdev, VNIC_DEV_INTR_MODE_INTX);
}