src/dpdk/drivers/net/igc/base/igc_mac.c
s32 igc_setup_led_generic(struct igc_hw *hw)
{
	u32 ledctl;

	DEBUGFUNC("igc_setup_led_generic");

	if (hw->mac.ops.setup_led != igc_setup_led_generic)
		return -IGC_ERR_CONFIG;

	if (hw->phy.media_type == igc_media_type_fiber) {
		ledctl = IGC_READ_REG(hw, IGC_LEDCTL);
		hw->mac.ledctl_default = ledctl;
		/* Turn off LED0 */
		ledctl &= ~(IGC_LEDCTL_LED0_IVRT | IGC_LEDCTL_LED0_BLINK |
			    IGC_LEDCTL_LED0_MODE_MASK);
		ledctl |= (IGC_LEDCTL_MODE_LED_OFF <<
			   IGC_LEDCTL_LED0_MODE_SHIFT);
		IGC_WRITE_REG(hw, IGC_LEDCTL, ledctl);
	} else if (hw->phy.media_type == igc_media_type_copper) {
		IGC_WRITE_REG(hw, IGC_LEDCTL, hw->mac.ledctl_mode1);
	}

	return IGC_SUCCESS;
}
/**
 *  igc_setup_led_generic - Configures SW controllable LED
 *  @hw: pointer to the HW structure
 *
 *  This prepares the SW controllable LED for use and saves the current state
 *  of the LED so it can be later restored.
 **/
Configures SW controllable LED
@hw: pointer to the HW structure

This prepares the SW controllable LED for use and saves the current state
of the LED so it can be later restored.
Configures SW controllable LED @hw : pointer to the HW structure This prepares the SW controllable LED for use and saves the current state of the LED so it can be later restored .
s32 igc_setup_led_generic(struct igc_hw *hw)
{
	u32 ledctl;
	DEBUGFUNC("igc_setup_led_generic");
	if (hw->mac.ops.setup_led != igc_setup_led_generic)
		return -IGC_ERR_CONFIG;
	if (hw->phy.media_type == igc_media_type_fiber) {
		ledctl = IGC_READ_REG(hw, IGC_LEDCTL);
		hw->mac.ledctl_default = ledctl;
		ledctl &= ~(IGC_LEDCTL_LED0_IVRT | IGC_LEDCTL_LED0_BLINK |
			    IGC_LEDCTL_LED0_MODE_MASK);
		ledctl |= (IGC_LEDCTL_MODE_LED_OFF <<
			   IGC_LEDCTL_LED0_MODE_SHIFT);
		IGC_WRITE_REG(hw, IGC_LEDCTL, ledctl);
	} else if (hw->phy.media_type == igc_media_type_copper) {
		IGC_WRITE_REG(hw, IGC_LEDCTL, hw->mac.ledctl_mode1);
	}
	return IGC_SUCCESS;
}
s32 igc_setup_led_generic ( struct igc_hw * hw ) { u32 ledctl ; DEBUGFUNC ( " " ) ; if ( hw -> mac . ops . setup_led != igc_setup_led_generic ) return - IGC_ERR_CONFIG ; if ( hw -> phy . media_type == igc_media_type_fiber ) { ledctl = IGC_READ_REG ( hw , IGC_LEDCTL ) ; hw -> mac . ledctl_default = ledctl ; ledctl &= ~ ( IGC_LEDCTL_LED0_IVRT | IGC_LEDCTL_LED0_BLINK | IGC_LEDCTL_LED0_MODE_MASK ) ; ledctl |= ( IGC_LEDCTL_MODE_LED_OFF << IGC_LEDCTL_LED0_MODE_SHIFT ) ; IGC_WRITE_REG ( hw , IGC_LEDCTL , ledctl ) ; } else if ( hw -> phy . media_type == igc_media_type_copper ) { IGC_WRITE_REG ( hw , IGC_LEDCTL , hw -> mac . ledctl_mode1 ) ; } return IGC_SUCCESS ; }
igc_setup_led_generic - Configures SW controllable LED
  @hw: pointer to the HW structure
igc_setup_led_generic - Configures SW controllable LED @hw : pointer to the HW structure
/* Turn off LED0 */