diff options
Diffstat (limited to 'drivers/net/qla3xxx.c')
-rw-r--r-- | drivers/net/qla3xxx.c | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 30adf726743c..cf0774de6c41 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 | /* |
@@ -2315,14 +2320,9 @@ static int ql_poll(struct napi_struct *napi, int budget) | |||
2315 | unsigned long hw_flags; | 2320 | unsigned long hw_flags; |
2316 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | 2321 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; |
2317 | 2322 | ||
2318 | if (!netif_carrier_ok(ndev)) | ||
2319 | goto quit_polling; | ||
2320 | |||
2321 | ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget); | 2323 | ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget); |
2322 | 2324 | ||
2323 | if (tx_cleaned + rx_cleaned != budget || | 2325 | if (tx_cleaned + rx_cleaned != budget) { |
2324 | !netif_running(ndev)) { | ||
2325 | quit_polling: | ||
2326 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 2326 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); |
2327 | __netif_rx_complete(ndev, napi); | 2327 | __netif_rx_complete(ndev, napi); |
2328 | ql_update_small_bufq_prod_index(qdev); | 2328 | ql_update_small_bufq_prod_index(qdev); |
@@ -3941,19 +3941,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev) | |||
3941 | static void ql3xxx_timer(unsigned long ptr) | 3941 | static void ql3xxx_timer(unsigned long ptr) |
3942 | { | 3942 | { |
3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; | 3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; |
3944 | 3944 | 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 | } | 3945 | } |
3958 | 3946 | ||
3959 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, | 3947 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, |
@@ -4103,6 +4091,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
4103 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4091 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
4104 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); | 4092 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
4105 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); | 4093 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
4094 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); | ||
4106 | 4095 | ||
4107 | init_timer(&qdev->adapter_timer); | 4096 | init_timer(&qdev->adapter_timer); |
4108 | qdev->adapter_timer.function = ql3xxx_timer; | 4097 | qdev->adapter_timer.function = ql3xxx_timer; |