aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 27539ddf94c4..637ac8b89bac 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -215,9 +215,9 @@ netxen_napi_disable(struct netxen_adapter *adapter)
215 215
216 for (ring = 0; ring < adapter->max_sds_rings; ring++) { 216 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
217 sds_ring = &recv_ctx->sds_rings[ring]; 217 sds_ring = &recv_ctx->sds_rings[ring];
218 napi_disable(&sds_ring->napi);
219 netxen_nic_disable_int(sds_ring); 218 netxen_nic_disable_int(sds_ring);
220 synchronize_irq(sds_ring->irq); 219 napi_synchronize(&sds_ring->napi);
220 napi_disable(&sds_ring->napi);
221 } 221 }
222} 222}
223 223
@@ -833,11 +833,11 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
833 833
834 adapter->ahw.linkup = 0; 834 adapter->ahw.linkup = 0;
835 835
836 netxen_napi_enable(adapter);
837
838 if (adapter->max_sds_rings > 1) 836 if (adapter->max_sds_rings > 1)
839 netxen_config_rss(adapter, 1); 837 netxen_config_rss(adapter, 1);
840 838
839 netxen_napi_enable(adapter);
840
841 if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION) 841 if (adapter->capabilities & NX_FW_CAPABILITY_LINK_NOTIFICATION)
842 netxen_linkevent_request(adapter, 1); 842 netxen_linkevent_request(adapter, 1);
843 else 843 else
@@ -851,8 +851,9 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
851static void 851static void
852netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev) 852netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
853{ 853{
854 spin_lock(&adapter->tx_clean_lock);
854 netif_carrier_off(netdev); 855 netif_carrier_off(netdev);
855 netif_stop_queue(netdev); 856 netif_tx_disable(netdev);
856 857
857 if (adapter->stop_port) 858 if (adapter->stop_port)
858 adapter->stop_port(adapter); 859 adapter->stop_port(adapter);
@@ -863,9 +864,10 @@ netxen_nic_down(struct netxen_adapter *adapter, struct net_device *netdev)
863 netxen_napi_disable(adapter); 864 netxen_napi_disable(adapter);
864 865
865 netxen_release_tx_buffers(adapter); 866 netxen_release_tx_buffers(adapter);
867 spin_unlock(&adapter->tx_clean_lock);
866 868
867 FLUSH_SCHEDULED_WORK();
868 del_timer_sync(&adapter->watchdog_timer); 869 del_timer_sync(&adapter->watchdog_timer);
870 FLUSH_SCHEDULED_WORK();
869} 871}
870 872
871 873
@@ -943,8 +945,8 @@ err_out_free_sw:
943static void 945static void
944netxen_nic_detach(struct netxen_adapter *adapter) 946netxen_nic_detach(struct netxen_adapter *adapter)
945{ 947{
946 netxen_release_rx_buffers(adapter);
947 netxen_free_hw_resources(adapter); 948 netxen_free_hw_resources(adapter);
949 netxen_release_rx_buffers(adapter);
948 netxen_nic_free_irq(adapter); 950 netxen_nic_free_irq(adapter);
949 netxen_free_sw_resources(adapter); 951 netxen_free_sw_resources(adapter);
950 952
@@ -1533,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1533 printk(KERN_ALERT 1535 printk(KERN_ALERT
1534 "%s: Device temperature %d degrees C exceeds" 1536 "%s: Device temperature %d degrees C exceeds"
1535 " maximum allowed. Hardware has been shut down.\n", 1537 " maximum allowed. Hardware has been shut down.\n",
1536 netxen_nic_driver_name, temp_val); 1538 netdev->name, temp_val);
1539
1540 netif_device_detach(netdev);
1541 netxen_nic_down(adapter, netdev);
1542 netxen_nic_detach(adapter);
1537 1543
1538 netif_carrier_off(netdev);
1539 netif_stop_queue(netdev);
1540 rv = 1; 1544 rv = 1;
1541 } else if (temp_state == NX_TEMP_WARN) { 1545 } else if (temp_state == NX_TEMP_WARN) {
1542 if (adapter->temp == NX_TEMP_NORMAL) { 1546 if (adapter->temp == NX_TEMP_NORMAL) {
@@ -1544,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1544 "%s: Device temperature %d degrees C " 1548 "%s: Device temperature %d degrees C "
1545 "exceeds operating range." 1549 "exceeds operating range."
1546 " Immediate action needed.\n", 1550 " Immediate action needed.\n",
1547 netxen_nic_driver_name, temp_val); 1551 netdev->name, temp_val);
1548 } 1552 }
1549 } else { 1553 } else {
1550 if (adapter->temp == NX_TEMP_WARN) { 1554 if (adapter->temp == NX_TEMP_WARN) {
1551 printk(KERN_INFO 1555 printk(KERN_INFO
1552 "%s: Device temperature is now %d degrees C" 1556 "%s: Device temperature is now %d degrees C"
1553 " in normal range.\n", netxen_nic_driver_name, 1557 " in normal range.\n", netdev->name,
1554 temp_val); 1558 temp_val);
1555 } 1559 }
1556 } 1560 }
@@ -1623,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
1623 struct netxen_adapter *adapter = 1627 struct netxen_adapter *adapter =
1624 container_of(work, struct netxen_adapter, watchdog_task); 1628 container_of(work, struct netxen_adapter, watchdog_task);
1625 1629
1626 if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) 1630 if (netxen_nic_check_temp(adapter))
1627 return; 1631 return;
1628 1632
1629 if (!adapter->has_link_events) 1633 if (!adapter->has_link_events)
@@ -1645,6 +1649,9 @@ static void netxen_tx_timeout_task(struct work_struct *work)
1645 struct netxen_adapter *adapter = 1649 struct netxen_adapter *adapter =
1646 container_of(work, struct netxen_adapter, tx_timeout_task); 1650 container_of(work, struct netxen_adapter, tx_timeout_task);
1647 1651
1652 if (!netif_running(adapter->netdev))
1653 return;
1654
1648 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n", 1655 printk(KERN_ERR "%s %s: transmit timeout, resetting.\n",
1649 netxen_nic_driver_name, adapter->netdev->name); 1656 netxen_nic_driver_name, adapter->netdev->name);
1650 1657
@@ -1757,7 +1764,8 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
1757 1764
1758 if ((work_done < budget) && tx_complete) { 1765 if ((work_done < budget) && tx_complete) {
1759 napi_complete(&sds_ring->napi); 1766 napi_complete(&sds_ring->napi);
1760 netxen_nic_enable_int(sds_ring); 1767 if (netif_running(adapter->netdev))
1768 netxen_nic_enable_int(sds_ring);
1761 } 1769 }
1762 1770
1763 return work_done; 1771 return work_done;