diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-06-27 12:07:56 -0400 |
---|---|---|
committer | Auke Kok <juke-jan.h.kok@intel.com> | 2006-06-27 12:07:56 -0400 |
commit | f1b3a85354d3877fae45ef448e7e49c2efd692d5 (patch) | |
tree | ed0422f71c8c2b68b96ef5ccdfb2d15904e17eaf /drivers/net | |
parent | 7dfee0cb1d506897805b663dd95e9651619a4d4d (diff) |
e1000: fix adapter led blinking inconsistency
Several e1000 adapters were not blinking correctly or inconsistently. This
patch cleans this up and makes them all behave the same as far as possible.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 15 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 38 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.h | 1 |
3 files changed, 40 insertions, 14 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index cf5c5f46341f..060915532923 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -1786,21 +1786,8 @@ e1000_phys_id(struct net_device *netdev, uint32_t data) | |||
1786 | mod_timer(&adapter->blink_timer, jiffies); | 1786 | mod_timer(&adapter->blink_timer, jiffies); |
1787 | msleep_interruptible(data * 1000); | 1787 | msleep_interruptible(data * 1000); |
1788 | del_timer_sync(&adapter->blink_timer); | 1788 | del_timer_sync(&adapter->blink_timer); |
1789 | } else if (adapter->hw.mac_type < e1000_82573) { | ||
1790 | E1000_WRITE_REG(&adapter->hw, LEDCTL, | ||
1791 | (E1000_LEDCTL_LED2_BLINK_RATE | | ||
1792 | E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK | | ||
1793 | (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | | ||
1794 | (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) | | ||
1795 | (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT))); | ||
1796 | msleep_interruptible(data * 1000); | ||
1797 | } else { | 1789 | } else { |
1798 | E1000_WRITE_REG(&adapter->hw, LEDCTL, | 1790 | e1000_blink_led_start(&adapter->hw); |
1799 | (E1000_LEDCTL_LED2_BLINK_RATE | | ||
1800 | E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK | | ||
1801 | (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) | | ||
1802 | (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) | | ||
1803 | (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT))); | ||
1804 | msleep_interruptible(data * 1000); | 1791 | msleep_interruptible(data * 1000); |
1805 | } | 1792 | } |
1806 | 1793 | ||
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 749d621a07da..1c5b18478fb2 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -5537,6 +5537,44 @@ e1000_setup_led(struct e1000_hw *hw) | |||
5537 | } | 5537 | } |
5538 | 5538 | ||
5539 | /****************************************************************************** | 5539 | /****************************************************************************** |
5540 | * Used on 82571 and later Si that has LED blink bits. | ||
5541 | * Callers must use their own timer and should have already called | ||
5542 | * e1000_id_led_init() | ||
5543 | * Call e1000_cleanup led() to stop blinking | ||
5544 | * | ||
5545 | * hw - Struct containing variables accessed by shared code | ||
5546 | *****************************************************************************/ | ||
5547 | int32_t | ||
5548 | e1000_blink_led_start(struct e1000_hw *hw) | ||
5549 | { | ||
5550 | int16_t i; | ||
5551 | uint32_t ledctl_blink = 0; | ||
5552 | |||
5553 | DEBUGFUNC("e1000_id_led_blink_on"); | ||
5554 | |||
5555 | if (hw->mac_type < e1000_82571) { | ||
5556 | /* Nothing to do */ | ||
5557 | return E1000_SUCCESS; | ||
5558 | } | ||
5559 | if (hw->media_type == e1000_media_type_fiber) { | ||
5560 | /* always blink LED0 for PCI-E fiber */ | ||
5561 | ledctl_blink = E1000_LEDCTL_LED0_BLINK | | ||
5562 | (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED0_MODE_SHIFT); | ||
5563 | } else { | ||
5564 | /* set the blink bit for each LED that's "on" (0x0E) in ledctl_mode2 */ | ||
5565 | ledctl_blink = hw->ledctl_mode2; | ||
5566 | for (i=0; i < 4; i++) | ||
5567 | if (((hw->ledctl_mode2 >> (i * 8)) & 0xFF) == | ||
5568 | E1000_LEDCTL_MODE_LED_ON) | ||
5569 | ledctl_blink |= (E1000_LEDCTL_LED0_BLINK << (i * 8)); | ||
5570 | } | ||
5571 | |||
5572 | E1000_WRITE_REG(hw, LEDCTL, ledctl_blink); | ||
5573 | |||
5574 | return E1000_SUCCESS; | ||
5575 | } | ||
5576 | |||
5577 | /****************************************************************************** | ||
5540 | * Restores the saved state of the SW controlable LED. | 5578 | * Restores the saved state of the SW controlable LED. |
5541 | * | 5579 | * |
5542 | * hw - Struct containing variables accessed by shared code | 5580 | * hw - Struct containing variables accessed by shared code |
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h index 467c9ed944f8..941b47d61674 100644 --- a/drivers/net/e1000/e1000_hw.h +++ b/drivers/net/e1000/e1000_hw.h | |||
@@ -401,6 +401,7 @@ int32_t e1000_setup_led(struct e1000_hw *hw); | |||
401 | int32_t e1000_cleanup_led(struct e1000_hw *hw); | 401 | int32_t e1000_cleanup_led(struct e1000_hw *hw); |
402 | int32_t e1000_led_on(struct e1000_hw *hw); | 402 | int32_t e1000_led_on(struct e1000_hw *hw); |
403 | int32_t e1000_led_off(struct e1000_hw *hw); | 403 | int32_t e1000_led_off(struct e1000_hw *hw); |
404 | int32_t e1000_blink_led_start(struct e1000_hw *hw); | ||
404 | 405 | ||
405 | /* Adaptive IFS Functions */ | 406 | /* Adaptive IFS Functions */ |
406 | 407 | ||