mirror of
https://github.com/adulau/aha.git
synced 2025-01-02 14:13:18 +00:00
myri10ge: check that we can get an irq
Now that IRQ allocation is done in myri10ge_open(), we want to still check when loading the driver that IRQ allocation could succeed later. Additionaly, we fix the initialization and printing of netdev->irq. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
6ebc087a10
commit
21d05db175
1 changed files with 12 additions and 3 deletions
|
@ -2882,7 +2882,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
netdev->hard_start_xmit = myri10ge_xmit;
|
netdev->hard_start_xmit = myri10ge_xmit;
|
||||||
netdev->get_stats = myri10ge_get_stats;
|
netdev->get_stats = myri10ge_get_stats;
|
||||||
netdev->base_addr = mgp->iomem_base;
|
netdev->base_addr = mgp->iomem_base;
|
||||||
netdev->irq = pdev->irq;
|
|
||||||
netdev->change_mtu = myri10ge_change_mtu;
|
netdev->change_mtu = myri10ge_change_mtu;
|
||||||
netdev->set_multicast_list = myri10ge_set_multicast_list;
|
netdev->set_multicast_list = myri10ge_set_multicast_list;
|
||||||
netdev->set_mac_address = myri10ge_set_mac_address;
|
netdev->set_mac_address = myri10ge_set_mac_address;
|
||||||
|
@ -2892,6 +2891,15 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
netdev->poll = myri10ge_poll;
|
netdev->poll = myri10ge_poll;
|
||||||
netdev->weight = myri10ge_napi_weight;
|
netdev->weight = myri10ge_napi_weight;
|
||||||
|
|
||||||
|
/* make sure we can get an irq, and that MSI can be
|
||||||
|
* setup (if available). Also ensure netdev->irq
|
||||||
|
* is set to correct value if MSI is enabled */
|
||||||
|
status = myri10ge_request_irq(mgp);
|
||||||
|
if (status != 0)
|
||||||
|
goto abort_with_firmware;
|
||||||
|
netdev->irq = pdev->irq;
|
||||||
|
myri10ge_free_irq(mgp);
|
||||||
|
|
||||||
/* Save configuration space to be restored if the
|
/* Save configuration space to be restored if the
|
||||||
* nic resets due to a parity error */
|
* nic resets due to a parity error */
|
||||||
pci_save_state(pdev);
|
pci_save_state(pdev);
|
||||||
|
@ -2907,8 +2915,9 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
dev_err(&pdev->dev, "register_netdev failed: %d\n", status);
|
dev_err(&pdev->dev, "register_netdev failed: %d\n", status);
|
||||||
goto abort_with_state;
|
goto abort_with_state;
|
||||||
}
|
}
|
||||||
dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n",
|
dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n",
|
||||||
pdev->irq, mgp->tx.boundary, mgp->fw_name,
|
(mgp->msi_enabled ? "MSI" : "xPIC"),
|
||||||
|
netdev->irq, mgp->tx.boundary, mgp->fw_name,
|
||||||
(mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
|
(mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue