src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_blink_led_generic(struct igc_hw *hw)
{
	u32 ledctl_blink = 0;
	u32 i;

	DEBUGFUNC("igc_blink_led_generic");

	if (hw->phy.media_type == igc_media_type_fiber) {
		/* always blink LED0 for PCI-E fiber */
		ledctl_blink = IGC_LEDCTL_LED0_BLINK |
		     (IGC_LEDCTL_MODE_LED_ON << IGC_LEDCTL_LED0_MODE_SHIFT);
	} else {
		/* Set the blink bit for each LED that's "on" (0x0E)
		 * (or "off" if inverted) in ledctl_mode2.  The blink
		 * logic in hardware only works when mode is set to "on"
		 * so it must be changed accordingly when the mode is
		 * "off" and inverted.
		 */
		ledctl_blink = hw->mac.ledctl_mode2;
		for (i = 0; i < 32; i += 8) {
			u32 mode = (hw->mac.ledctl_mode2 >> i) &
			    IGC_LEDCTL_LED0_MODE_MASK;
			u32 led_default = hw->mac.ledctl_default >> i;

			if ((!(led_default & IGC_LEDCTL_LED0_IVRT) &&
			     mode == IGC_LEDCTL_MODE_LED_ON) ||
			    ((led_default & IGC_LEDCTL_LED0_IVRT) &&
			     mode == IGC_LEDCTL_MODE_LED_OFF)) {
				ledctl_blink &=
				    ~(IGC_LEDCTL_LED0_MODE_MASK << i);
				ledctl_blink |= (IGC_LEDCTL_LED0_BLINK |
						 IGC_LEDCTL_MODE_LED_ON) << i;
			}
		}
	}

	IGC_WRITE_REG(hw, IGC_LEDCTL, ledctl_blink);

	return IGC_SUCCESS;
}
/**
 *  igc_blink_led_generic - Blink LED
 *  @hw: pointer to the HW structure
 *
 *  Blink the LEDs which are set to be on.
 **/
Blink LED
@hw: pointer to the HW structure

Blink the LEDs which are set to be on.
Blink LED @hw : pointer to the HW structure Blink the LEDs which are set to be on .
s32 igc_blink_led_generic(struct igc_hw *hw)
{
	u32 ledctl_blink = 0;
	u32 i;
	DEBUGFUNC("igc_blink_led_generic");
	if (hw->phy.media_type == igc_media_type_fiber) {
		ledctl_blink = IGC_LEDCTL_LED0_BLINK |
		     (IGC_LEDCTL_MODE_LED_ON << IGC_LEDCTL_LED0_MODE_SHIFT);
	} else {
		ledctl_blink = hw->mac.ledctl_mode2;
		for (i = 0; i < 32; i += 8) {
			u32 mode = (hw->mac.ledctl_mode2 >> i) &
			    IGC_LEDCTL_LED0_MODE_MASK;
			u32 led_default = hw->mac.ledctl_default >> i;
			if ((!(led_default & IGC_LEDCTL_LED0_IVRT) &&
			     mode == IGC_LEDCTL_MODE_LED_ON) ||
			    ((led_default & IGC_LEDCTL_LED0_IVRT) &&
			     mode == IGC_LEDCTL_MODE_LED_OFF)) {
				ledctl_blink &=
				    ~(IGC_LEDCTL_LED0_MODE_MASK << i);
				ledctl_blink |= (IGC_LEDCTL_LED0_BLINK |
						 IGC_LEDCTL_MODE_LED_ON) << i;
			}
		}
	}
	IGC_WRITE_REG(hw, IGC_LEDCTL, ledctl_blink);
	return IGC_SUCCESS;
}
s32 igc_blink_led_generic ( struct igc_hw * hw ) { u32 ledctl_blink = 0 ; u32 i ; DEBUGFUNC ( " " ) ; if ( hw -> phy . media_type == igc_media_type_fiber ) { ledctl_blink = IGC_LEDCTL_LED0_BLINK | ( IGC_LEDCTL_MODE_LED_ON << IGC_LEDCTL_LED0_MODE_SHIFT ) ; } else { ledctl_blink = hw -> mac . ledctl_mode2 ; for ( i = 0 ; i < 32 ; i += 8 ) { u32 mode = ( hw -> mac . ledctl_mode2 >> i ) & IGC_LEDCTL_LED0_MODE_MASK ; u32 led_default = hw -> mac . ledctl_default >> i ; if ( ( ! ( led_default & IGC_LEDCTL_LED0_IVRT ) && mode == IGC_LEDCTL_MODE_LED_ON ) || ( ( led_default & IGC_LEDCTL_LED0_IVRT ) && mode == IGC_LEDCTL_MODE_LED_OFF ) ) { ledctl_blink &= ~ ( IGC_LEDCTL_LED0_MODE_MASK << i ) ; ledctl_blink |= ( IGC_LEDCTL_LED0_BLINK | IGC_LEDCTL_MODE_LED_ON ) << i ; } } } IGC_WRITE_REG ( hw , IGC_LEDCTL , ledctl_blink ) ; return IGC_SUCCESS ; }
igc_blink_led_generic - Blink LED
  @hw: pointer to the HW structure
igc_blink_led_generic - Blink LED @hw : pointer to the HW structure
/* always blink LED0 for PCI-E fiber */ /* Set the blink bit for each LED that's "on" (0x0E)
		 * (or "off" if inverted) in ledctl_mode2.  The blink
		 * logic in hardware only works when mode is set to "on"
		 * so it must be changed accordingly when the mode is
		 * "off" and inverted.
		 */