aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlge/qlge_main.c')
-rw-r--r--drivers/net/qlge/qlge_main.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 7783c5db81dc..3d0efea32111 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3142,14 +3142,14 @@ static int ql_route_initialize(struct ql_adapter *qdev)
3142{ 3142{
3143 int status = 0; 3143 int status = 0;
3144 3144
3145 status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); 3145 /* Clear all the entries in the routing table. */
3146 status = ql_clear_routing_entries(qdev);
3146 if (status) 3147 if (status)
3147 return status; 3148 return status;
3148 3149
3149 /* Clear all the entries in the routing table. */ 3150 status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK);
3150 status = ql_clear_routing_entries(qdev);
3151 if (status) 3151 if (status)
3152 goto exit; 3152 return status;
3153 3153
3154 status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1); 3154 status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1);
3155 if (status) { 3155 if (status) {
@@ -3380,12 +3380,10 @@ static int ql_adapter_down(struct ql_adapter *qdev)
3380 3380
3381 ql_free_rx_buffers(qdev); 3381 ql_free_rx_buffers(qdev);
3382 3382
3383 spin_lock(&qdev->hw_lock);
3384 status = ql_adapter_reset(qdev); 3383 status = ql_adapter_reset(qdev);
3385 if (status) 3384 if (status)
3386 QPRINTK(qdev, IFDOWN, ERR, "reset(func #%d) FAILED!\n", 3385 QPRINTK(qdev, IFDOWN, ERR, "reset(func #%d) FAILED!\n",
3387 qdev->func); 3386 qdev->func);
3388 spin_unlock(&qdev->hw_lock);
3389 return status; 3387 return status;
3390} 3388}
3391 3389
@@ -3705,7 +3703,7 @@ static void ql_asic_reset_work(struct work_struct *work)
3705 struct ql_adapter *qdev = 3703 struct ql_adapter *qdev =
3706 container_of(work, struct ql_adapter, asic_reset_work.work); 3704 container_of(work, struct ql_adapter, asic_reset_work.work);
3707 int status; 3705 int status;
3708 3706 rtnl_lock();
3709 status = ql_adapter_down(qdev); 3707 status = ql_adapter_down(qdev);
3710 if (status) 3708 if (status)
3711 goto error; 3709 goto error;
@@ -3713,12 +3711,12 @@ static void ql_asic_reset_work(struct work_struct *work)
3713 status = ql_adapter_up(qdev); 3711 status = ql_adapter_up(qdev);
3714 if (status) 3712 if (status)
3715 goto error; 3713 goto error;
3716 3714 rtnl_unlock();
3717 return; 3715 return;
3718error: 3716error:
3719 QPRINTK(qdev, IFUP, ALERT, 3717 QPRINTK(qdev, IFUP, ALERT,
3720 "Driver up/down cycle failed, closing device\n"); 3718 "Driver up/down cycle failed, closing device\n");
3721 rtnl_lock(); 3719
3722 set_bit(QL_ADAPTER_UP, &qdev->flags); 3720 set_bit(QL_ADAPTER_UP, &qdev->flags);
3723 dev_close(qdev->ndev); 3721 dev_close(qdev->ndev);
3724 rtnl_unlock(); 3722 rtnl_unlock();
@@ -3834,11 +3832,14 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3834 return err; 3832 return err;
3835 } 3833 }
3836 3834
3835 qdev->ndev = ndev;
3836 qdev->pdev = pdev;
3837 pci_set_drvdata(pdev, ndev);
3837 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); 3838 pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
3838 if (pos <= 0) { 3839 if (pos <= 0) {
3839 dev_err(&pdev->dev, PFX "Cannot find PCI Express capability, " 3840 dev_err(&pdev->dev, PFX "Cannot find PCI Express capability, "
3840 "aborting.\n"); 3841 "aborting.\n");
3841 goto err_out; 3842 return pos;
3842 } else { 3843 } else {
3843 pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &val16); 3844 pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &val16);
3844 val16 &= ~PCI_EXP_DEVCTL_NOSNOOP_EN; 3845 val16 &= ~PCI_EXP_DEVCTL_NOSNOOP_EN;
@@ -3851,7 +3852,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3851 err = pci_request_regions(pdev, DRV_NAME); 3852 err = pci_request_regions(pdev, DRV_NAME);
3852 if (err) { 3853 if (err) {
3853 dev_err(&pdev->dev, "PCI region request failed.\n"); 3854 dev_err(&pdev->dev, "PCI region request failed.\n");
3854 goto err_out; 3855 return err;
3855 } 3856 }
3856 3857
3857 pci_set_master(pdev); 3858 pci_set_master(pdev);
@@ -3869,7 +3870,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3869 goto err_out; 3870 goto err_out;
3870 } 3871 }
3871 3872
3872 pci_set_drvdata(pdev, ndev);
3873 qdev->reg_base = 3873 qdev->reg_base =
3874 ioremap_nocache(pci_resource_start(pdev, 1), 3874 ioremap_nocache(pci_resource_start(pdev, 1),
3875 pci_resource_len(pdev, 1)); 3875 pci_resource_len(pdev, 1));
@@ -3889,8 +3889,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3889 goto err_out; 3889 goto err_out;
3890 } 3890 }
3891 3891
3892 qdev->ndev = ndev;
3893 qdev->pdev = pdev;
3894 err = ql_get_board_info(qdev); 3892 err = ql_get_board_info(qdev);
3895 if (err) { 3893 if (err) {
3896 dev_err(&pdev->dev, "Register access failed.\n"); 3894 dev_err(&pdev->dev, "Register access failed.\n");