diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2010-07-11 08:01:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-11 20:07:45 -0400 |
commit | f7cabcdd51480282b58c09e5fe1c4835aaf98a66 (patch) | |
tree | cb25ebf487a101850d28ff8f855e69ebbe08c41d /drivers/net/cxgb4 | |
parent | 98e32a9ceea8e3a0cd6ea89c9ce8e09a74b03b78 (diff) |
cxgb4: move the choice of interrupt type before net_device registration
We need to settle on the kind of interrupts we'll be using, a choice that
also impacts the number of queues, before registering and making visible
the net_devices. Move the relevant code up a bit.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4')
-rw-r--r-- | drivers/net/cxgb4/cxgb4_main.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c index 26199979290d..743dc6faec56 100644 --- a/drivers/net/cxgb4/cxgb4_main.c +++ b/drivers/net/cxgb4/cxgb4_main.c | |||
@@ -3507,6 +3507,12 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3507 | adapter->params.offload = 0; | 3507 | adapter->params.offload = 0; |
3508 | } | 3508 | } |
3509 | 3509 | ||
3510 | /* See what interrupts we'll be using */ | ||
3511 | if (msi > 1 && enable_msix(adapter) == 0) | ||
3512 | adapter->flags |= USING_MSIX; | ||
3513 | else if (msi > 0 && pci_enable_msi(pdev) == 0) | ||
3514 | adapter->flags |= USING_MSI; | ||
3515 | |||
3510 | /* | 3516 | /* |
3511 | * The card is now ready to go. If any errors occur during device | 3517 | * The card is now ready to go. If any errors occur during device |
3512 | * registration we do not fail the whole card but rather proceed only | 3518 | * registration we do not fail the whole card but rather proceed only |
@@ -3542,12 +3548,6 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3542 | setup_debugfs(adapter); | 3548 | setup_debugfs(adapter); |
3543 | } | 3549 | } |
3544 | 3550 | ||
3545 | /* See what interrupts we'll be using */ | ||
3546 | if (msi > 1 && enable_msix(adapter) == 0) | ||
3547 | adapter->flags |= USING_MSIX; | ||
3548 | else if (msi > 0 && pci_enable_msi(pdev) == 0) | ||
3549 | adapter->flags |= USING_MSI; | ||
3550 | |||
3551 | if (is_offload(adapter)) | 3551 | if (is_offload(adapter)) |
3552 | attach_ulds(adapter); | 3552 | attach_ulds(adapter); |
3553 | 3553 | ||
@@ -3571,6 +3571,7 @@ sriov: | |||
3571 | free_netdev(adapter->port[i]); | 3571 | free_netdev(adapter->port[i]); |
3572 | if (adapter->flags & FW_OK) | 3572 | if (adapter->flags & FW_OK) |
3573 | t4_fw_bye(adapter, 0); | 3573 | t4_fw_bye(adapter, 0); |
3574 | disable_msi(adapter); | ||
3574 | out_unmap_bar: | 3575 | out_unmap_bar: |
3575 | iounmap(adapter->regs); | 3576 | iounmap(adapter->regs); |
3576 | out_free_adapter: | 3577 | out_free_adapter: |