diff options
author | Brice Goglin <brice@myri.com> | 2007-01-09 15:05:04 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-01-18 12:02:41 -0500 |
commit | 21d05db175202adb166b047f35cbb96dbf9b86a5 (patch) | |
tree | 49c6d50aaf0871e7d7e41c08573e7c535c59160f /drivers/net/myri10ge | |
parent | 6ebc087a10c3953d59a61f362bd532f2d9468d1b (diff) |
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>
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b06e0eba52f6..b21c8df4e3f2 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2882,7 +2882,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2882 | netdev->hard_start_xmit = myri10ge_xmit; | 2882 | netdev->hard_start_xmit = myri10ge_xmit; |
2883 | netdev->get_stats = myri10ge_get_stats; | 2883 | netdev->get_stats = myri10ge_get_stats; |
2884 | netdev->base_addr = mgp->iomem_base; | 2884 | netdev->base_addr = mgp->iomem_base; |
2885 | netdev->irq = pdev->irq; | ||
2886 | netdev->change_mtu = myri10ge_change_mtu; | 2885 | netdev->change_mtu = myri10ge_change_mtu; |
2887 | netdev->set_multicast_list = myri10ge_set_multicast_list; | 2886 | netdev->set_multicast_list = myri10ge_set_multicast_list; |
2888 | netdev->set_mac_address = myri10ge_set_mac_address; | 2887 | 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) | |||
2892 | netdev->poll = myri10ge_poll; | 2891 | netdev->poll = myri10ge_poll; |
2893 | netdev->weight = myri10ge_napi_weight; | 2892 | netdev->weight = myri10ge_napi_weight; |
2894 | 2893 | ||
2894 | /* make sure we can get an irq, and that MSI can be | ||
2895 | * setup (if available). Also ensure netdev->irq | ||
2896 | * is set to correct value if MSI is enabled */ | ||
2897 | status = myri10ge_request_irq(mgp); | ||
2898 | if (status != 0) | ||
2899 | goto abort_with_firmware; | ||
2900 | netdev->irq = pdev->irq; | ||
2901 | myri10ge_free_irq(mgp); | ||
2902 | |||
2895 | /* Save configuration space to be restored if the | 2903 | /* Save configuration space to be restored if the |
2896 | * nic resets due to a parity error */ | 2904 | * nic resets due to a parity error */ |
2897 | pci_save_state(pdev); | 2905 | pci_save_state(pdev); |
@@ -2907,8 +2915,9 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2907 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); | 2915 | dev_err(&pdev->dev, "register_netdev failed: %d\n", status); |
2908 | goto abort_with_state; | 2916 | goto abort_with_state; |
2909 | } | 2917 | } |
2910 | dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n", | 2918 | dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", |
2911 | pdev->irq, mgp->tx.boundary, mgp->fw_name, | 2919 | (mgp->msi_enabled ? "MSI" : "xPIC"), |
2920 | netdev->irq, mgp->tx.boundary, mgp->fw_name, | ||
2912 | (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); | 2921 | (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); |
2913 | 2922 | ||
2914 | return 0; | 2923 | return 0; |