|
@@ -763,6 +763,9 @@ s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index)
|
|
|
{
|
|
|
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
|
|
|
|
+ if (index > 3)
|
|
|
+ return IXGBE_ERR_PARAM;
|
|
|
+
|
|
|
/* To turn on the LED, set mode to ON. */
|
|
|
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
|
led_reg |= IXGBE_LED_ON << IXGBE_LED_MODE_SHIFT(index);
|
|
@@ -781,6 +784,9 @@ s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index)
|
|
|
{
|
|
|
u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
|
|
|
|
|
+ if (index > 3)
|
|
|
+ return IXGBE_ERR_PARAM;
|
|
|
+
|
|
|
/* To turn off the LED, set mode to OFF. */
|
|
|
led_reg &= ~IXGBE_LED_MODE_MASK(index);
|
|
|
led_reg |= IXGBE_LED_OFF << IXGBE_LED_MODE_SHIFT(index);
|
|
@@ -2698,6 +2704,9 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
|
|
|
bool locked = false;
|
|
|
s32 ret_val;
|
|
|
|
|
|
+ if (index > 3)
|
|
|
+ return IXGBE_ERR_PARAM;
|
|
|
+
|
|
|
/*
|
|
|
* Link must be up to auto-blink the LEDs;
|
|
|
* Force it if link is down.
|
|
@@ -2741,6 +2750,9 @@ s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
|
|
|
bool locked = false;
|
|
|
s32 ret_val;
|
|
|
|
|
|
+ if (index > 3)
|
|
|
+ return IXGBE_ERR_PARAM;
|
|
|
+
|
|
|
ret_val = hw->mac.ops.prot_autoc_read(hw, &locked, &autoc_reg);
|
|
|
if (ret_val)
|
|
|
return ret_val;
|