diff options
Diffstat (limited to 'drivers/net/qla3xxx.c')
-rw-r--r-- | drivers/net/qla3xxx.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 30adf726743c..a5791114b7bd 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1456,16 +1456,11 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev) | |||
1456 | PHYAddr[qdev->mac_index]); | 1456 | PHYAddr[qdev->mac_index]); |
1457 | reg &= ~PHY_GIG_ALL_PARAMS; | 1457 | reg &= ~PHY_GIG_ALL_PARAMS; |
1458 | 1458 | ||
1459 | if(portConfiguration & | 1459 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { |
1460 | PORT_CONFIG_FULL_DUPLEX_ENABLED & | 1460 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) |
1461 | PORT_CONFIG_1000MB_SPEED) { | 1461 | reg |= PHY_GIG_ADV_1000F; |
1462 | reg |= PHY_GIG_ADV_1000F; | 1462 | else |
1463 | } | 1463 | reg |= PHY_GIG_ADV_1000H; |
1464 | |||
1465 | if(portConfiguration & | ||
1466 | PORT_CONFIG_HALF_DUPLEX_ENABLED & | ||
1467 | PORT_CONFIG_1000MB_SPEED) { | ||
1468 | reg |= PHY_GIG_ADV_1000H; | ||
1469 | } | 1464 | } |
1470 | 1465 | ||
1471 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, | 1466 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, |
@@ -1645,8 +1640,11 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev) | |||
1645 | return 0; | 1640 | return 0; |
1646 | } | 1641 | } |
1647 | 1642 | ||
1648 | static void ql_link_state_machine(struct ql3_adapter *qdev) | 1643 | static void ql_link_state_machine_work(struct work_struct *work) |
1649 | { | 1644 | { |
1645 | struct ql3_adapter *qdev = | ||
1646 | container_of(work, struct ql3_adapter, link_state_work.work); | ||
1647 | |||
1650 | u32 curr_link_state; | 1648 | u32 curr_link_state; |
1651 | unsigned long hw_flags; | 1649 | unsigned long hw_flags; |
1652 | 1650 | ||
@@ -1661,6 +1659,10 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1661 | "state.\n", qdev->ndev->name); | 1659 | "state.\n", qdev->ndev->name); |
1662 | 1660 | ||
1663 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1661 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1662 | |||
1663 | /* Restart timer on 2 second interval. */ | ||
1664 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);\ | ||
1665 | |||
1664 | return; | 1666 | return; |
1665 | } | 1667 | } |
1666 | 1668 | ||
@@ -1705,6 +1707,9 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1705 | break; | 1707 | break; |
1706 | } | 1708 | } |
1707 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1709 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1710 | |||
1711 | /* Restart timer on 2 second interval. */ | ||
1712 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
1708 | } | 1713 | } |
1709 | 1714 | ||
1710 | /* | 1715 | /* |
@@ -3941,19 +3946,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev) | |||
3941 | static void ql3xxx_timer(unsigned long ptr) | 3946 | static void ql3xxx_timer(unsigned long ptr) |
3942 | { | 3947 | { |
3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; | 3948 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; |
3944 | 3949 | queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); | |
3945 | if (test_bit(QL_RESET_ACTIVE,&qdev->flags)) { | ||
3946 | printk(KERN_DEBUG PFX | ||
3947 | "%s: Reset in progress.\n", | ||
3948 | qdev->ndev->name); | ||
3949 | goto end; | ||
3950 | } | ||
3951 | |||
3952 | ql_link_state_machine(qdev); | ||
3953 | |||
3954 | /* Restart timer on 2 second interval. */ | ||
3955 | end: | ||
3956 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
3957 | } | 3950 | } |
3958 | 3951 | ||
3959 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, | 3952 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, |
@@ -4103,6 +4096,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
4103 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4096 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
4104 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); | 4097 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
4105 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); | 4098 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
4099 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); | ||
4106 | 4100 | ||
4107 | init_timer(&qdev->adapter_timer); | 4101 | init_timer(&qdev->adapter_timer); |
4108 | qdev->adapter_timer.function = ql3xxx_timer; | 4102 | qdev->adapter_timer.function = ql3xxx_timer; |