mirror of
https://github.com/torvalds/linux.git
synced 2026-04-20 15:53:59 -04:00
ixgbe: Add support to retrieve and store LED link active
This patch adds support to get the LED link active via the LEDCTL register. If the LEDCTL register does not have LED link active (LED mode field = 0x0100) set then default LED link active returned. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
0c1b7de4f3
commit
805cedd663
@@ -390,6 +390,9 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)
|
||||
status = hw->mac.ops.start_hw(hw);
|
||||
}
|
||||
|
||||
/* Initialize the LED link active for LED blink support */
|
||||
hw->mac.ops.init_led_link_act(hw);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -772,6 +775,49 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw)
|
||||
return ixgbe_disable_pcie_master(hw);
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_init_led_link_act_generic - Store the LED index link/activity.
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
* Store the index for the link active LED. This will be used to support
|
||||
* blinking the LED.
|
||||
**/
|
||||
s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw)
|
||||
{
|
||||
struct ixgbe_mac_info *mac = &hw->mac;
|
||||
u32 led_reg, led_mode;
|
||||
u16 i;
|
||||
|
||||
led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||
|
||||
/* Get LED link active from the LEDCTL register */
|
||||
for (i = 0; i < 4; i++) {
|
||||
led_mode = led_reg >> IXGBE_LED_MODE_SHIFT(i);
|
||||
|
||||
if ((led_mode & IXGBE_LED_MODE_MASK_BASE) ==
|
||||
IXGBE_LED_LINK_ACTIVE) {
|
||||
mac->led_link_act = i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If LEDCTL register does not have the LED link active set, then use
|
||||
* known MAC defaults.
|
||||
*/
|
||||
switch (hw->mac.type) {
|
||||
case ixgbe_mac_x550em_a:
|
||||
mac->led_link_act = 0;
|
||||
break;
|
||||
case ixgbe_mac_X550EM_x:
|
||||
mac->led_link_act = 1;
|
||||
break;
|
||||
default:
|
||||
mac->led_link_act = 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_led_on_generic - Turns on the software controllable LEDs.
|
||||
* @hw: pointer to hardware structure
|
||||
|
||||
Reference in New Issue
Block a user