aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorCarolyn Wyborny <carolyn.wyborny@intel.com>2011-03-12 03:59:47 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-15 01:26:54 -0400
commit7ef5ed1ce96c3f9a95b7327279f94b0700c689ef (patch)
treee684d2f18bc22e1db178f70cc40f5e12ebed2ab8 /drivers/net/igb/igb_main.c
parent673b8b70cfae2cd0428a8ab5647571521348549a (diff)
igb: Add messaging for thermal sensor events on i350 devices
This feature adds messaging to the link status change to notify the user if the device returned from a downshift or power off event due to the Thermal Sensor feature in i350 parts. Feature is only available on internal copper ports. Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r--drivers/net/igb/igb_main.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 5366f2ab65f0..3d850af0cdda 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3550,7 +3550,7 @@ static void igb_watchdog_task(struct work_struct *work)
3550 watchdog_task); 3550 watchdog_task);
3551 struct e1000_hw *hw = &adapter->hw; 3551 struct e1000_hw *hw = &adapter->hw;
3552 struct net_device *netdev = adapter->netdev; 3552 struct net_device *netdev = adapter->netdev;
3553 u32 link; 3553 u32 link, ctrl_ext, thstat;
3554 int i; 3554 int i;
3555 3555
3556 link = igb_has_link(adapter); 3556 link = igb_has_link(adapter);
@@ -3574,6 +3574,25 @@ static void igb_watchdog_task(struct work_struct *work)
3574 ((ctrl & E1000_CTRL_RFCE) ? "RX" : 3574 ((ctrl & E1000_CTRL_RFCE) ? "RX" :
3575 ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None"))); 3575 ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None")));
3576 3576
3577 /* check for thermal sensor event on i350,
3578 * copper only */
3579 if (hw->mac.type == e1000_i350) {
3580 thstat = rd32(E1000_THSTAT);
3581 ctrl_ext = rd32(E1000_CTRL_EXT);
3582 if ((hw->phy.media_type ==
3583 e1000_media_type_copper) && !(ctrl_ext &
3584 E1000_CTRL_EXT_LINK_MODE_SGMII)) {
3585 if (thstat &
3586 E1000_THSTAT_LINK_THROTTLE) {
3587 printk(KERN_INFO "igb: %s The "
3588 "network adapter link "
3589 "speed was downshifted "
3590 "because it "
3591 "overheated.\n",
3592 netdev->name);
3593 }
3594 }
3595 }
3577 /* adjust timeout factor according to speed/duplex */ 3596 /* adjust timeout factor according to speed/duplex */
3578 adapter->tx_timeout_factor = 1; 3597 adapter->tx_timeout_factor = 1;
3579 switch (adapter->link_speed) { 3598 switch (adapter->link_speed) {
@@ -3599,6 +3618,22 @@ static void igb_watchdog_task(struct work_struct *work)
3599 if (netif_carrier_ok(netdev)) { 3618 if (netif_carrier_ok(netdev)) {
3600 adapter->link_speed = 0; 3619 adapter->link_speed = 0;
3601 adapter->link_duplex = 0; 3620 adapter->link_duplex = 0;
3621 /* check for thermal sensor event on i350
3622 * copper only*/
3623 if (hw->mac.type == e1000_i350) {
3624 thstat = rd32(E1000_THSTAT);
3625 ctrl_ext = rd32(E1000_CTRL_EXT);
3626 if ((hw->phy.media_type ==
3627 e1000_media_type_copper) && !(ctrl_ext &
3628 E1000_CTRL_EXT_LINK_MODE_SGMII)) {
3629 if (thstat & E1000_THSTAT_PWR_DOWN) {
3630 printk(KERN_ERR "igb: %s The "
3631 "network adapter was stopped "
3632 "because it overheated.\n",
3633 netdev->name);
3634 }
3635 }
3636 }
3602 /* Links status message must follow this format */ 3637 /* Links status message must follow this format */
3603 printk(KERN_INFO "igb: %s NIC Link is Down\n", 3638 printk(KERN_INFO "igb: %s NIC Link is Down\n",
3604 netdev->name); 3639 netdev->name);