aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-07-17 11:27:08 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-20 11:23:33 -0400
commite4135c2da11c337e3759f98727c4819ba2a849fa (patch)
tree1b90f6fc2bbd0d21309b3ce526bd97adc65a1af4 /drivers
parentb2af9cb06d4de1b507ec0fd779ec2ecedee1480a (diff)
netxen: fix thermal check and shutdown
Check temperature for all PCI functions, that can allow graceful shutdown of all interfaces on the overheated card. Old code was only monitoring temperature for function 0 only. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 370c52f27760..637ac8b89bac 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1535,10 +1535,12 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1535 printk(KERN_ALERT 1535 printk(KERN_ALERT
1536 "%s: Device temperature %d degrees C exceeds" 1536 "%s: Device temperature %d degrees C exceeds"
1537 " maximum allowed. Hardware has been shut down.\n", 1537 " maximum allowed. Hardware has been shut down.\n",
1538 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);
1539 1543
1540 netif_carrier_off(netdev);
1541 netif_stop_queue(netdev);
1542 rv = 1; 1544 rv = 1;
1543 } else if (temp_state == NX_TEMP_WARN) { 1545 } else if (temp_state == NX_TEMP_WARN) {
1544 if (adapter->temp == NX_TEMP_NORMAL) { 1546 if (adapter->temp == NX_TEMP_NORMAL) {
@@ -1546,13 +1548,13 @@ static int netxen_nic_check_temp(struct netxen_adapter *adapter)
1546 "%s: Device temperature %d degrees C " 1548 "%s: Device temperature %d degrees C "
1547 "exceeds operating range." 1549 "exceeds operating range."
1548 " Immediate action needed.\n", 1550 " Immediate action needed.\n",
1549 netxen_nic_driver_name, temp_val); 1551 netdev->name, temp_val);
1550 } 1552 }
1551 } else { 1553 } else {
1552 if (adapter->temp == NX_TEMP_WARN) { 1554 if (adapter->temp == NX_TEMP_WARN) {
1553 printk(KERN_INFO 1555 printk(KERN_INFO
1554 "%s: Device temperature is now %d degrees C" 1556 "%s: Device temperature is now %d degrees C"
1555 " in normal range.\n", netxen_nic_driver_name, 1557 " in normal range.\n", netdev->name,
1556 temp_val); 1558 temp_val);
1557 } 1559 }
1558 } 1560 }
@@ -1625,7 +1627,7 @@ void netxen_watchdog_task(struct work_struct *work)
1625 struct netxen_adapter *adapter = 1627 struct netxen_adapter *adapter =
1626 container_of(work, struct netxen_adapter, watchdog_task); 1628 container_of(work, struct netxen_adapter, watchdog_task);
1627 1629
1628 if ((adapter->portnum == 0) && netxen_nic_check_temp(adapter)) 1630 if (netxen_nic_check_temp(adapter))
1629 return; 1631 return;
1630 1632
1631 if (!adapter->has_link_events) 1633 if (!adapter->has_link_events)