i40e: during LED interaction ignore activity LED src modes

Modify our get and set LED functions so they ignore activity LEDs,
as we are required to blink the link LEDs only.

Change-ID: I647ea67a6fc95cbbab6e3cd01d81ec9ae096a9ad
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Matt Jared 2015-02-26 16:11:30 +00:00 committed by Jeff Kirsher
parent c668a12c7b
commit b84d5cd819

View file

@ -1083,8 +1083,11 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx)
return gpio_val; return gpio_val;
} }
#define I40E_LED0 22 #define I40E_COMBINED_ACTIVITY 0xA
#define I40E_FILTER_ACTIVITY 0xE
#define I40E_LINK_ACTIVITY 0xC #define I40E_LINK_ACTIVITY 0xC
#define I40E_MAC_ACTIVITY 0xD
#define I40E_LED0 22
/** /**
* i40e_led_get - return current on/off mode * i40e_led_get - return current on/off mode
@ -1097,6 +1100,7 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx)
**/ **/
u32 i40e_led_get(struct i40e_hw *hw) u32 i40e_led_get(struct i40e_hw *hw)
{ {
u32 current_mode = 0;
u32 mode = 0; u32 mode = 0;
int i; int i;
@ -1109,6 +1113,20 @@ u32 i40e_led_get(struct i40e_hw *hw)
if (!gpio_val) if (!gpio_val)
continue; continue;
/* ignore gpio LED src mode entries related to the activity
* LEDs
*/
current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
>> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
switch (current_mode) {
case I40E_COMBINED_ACTIVITY:
case I40E_FILTER_ACTIVITY:
case I40E_MAC_ACTIVITY:
continue;
default:
break;
}
mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT;
break; break;
@ -1128,6 +1146,7 @@ u32 i40e_led_get(struct i40e_hw *hw)
**/ **/
void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
{ {
u32 current_mode = 0;
int i; int i;
if (mode & 0xfffffff0) if (mode & 0xfffffff0)
@ -1142,6 +1161,20 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
if (!gpio_val) if (!gpio_val)
continue; continue;
/* ignore gpio LED src mode entries related to the activity
* LEDs
*/
current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
>> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
switch (current_mode) {
case I40E_COMBINED_ACTIVITY:
case I40E_FILTER_ACTIVITY:
case I40E_MAC_ACTIVITY:
continue;
default:
break;
}
gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK; gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK;
/* this & is a bit of paranoia, but serves as a range check */ /* this & is a bit of paranoia, but serves as a range check */
gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) & gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &