src/dpdk/drivers/net/ixgbe/base/ixgbe_x540.c
s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index)
{
	u32 macc_reg;
	u32 ledctl_reg;
	ixgbe_link_speed speed;
	bool link_up;

	DEBUGFUNC("ixgbe_blink_led_start_X540");

	if (index > 3)
		return IXGBE_ERR_PARAM;

	/*
	 * Link should be up in order for the blink bit in the LED control
	 * register to work. Force link and speed in the MAC if link is down.
	 * This will be reversed when we stop the blinking.
	 */
	hw->mac.ops.check_link(hw, &speed, &link_up, false);
	if (link_up == false) {
		macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC);
		macc_reg |= IXGBE_MACC_FLU | IXGBE_MACC_FSV_10G | IXGBE_MACC_FS;
		IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg);
	}
	/* Set the LED to LINK_UP + BLINK. */
	ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
	ledctl_reg &= ~IXGBE_LED_MODE_MASK(index);
	ledctl_reg |= IXGBE_LED_BLINK(index);
	IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg);
	IXGBE_WRITE_FLUSH(hw);

	return IXGBE_SUCCESS;
}
/**
 * ixgbe_blink_led_start_X540 - Blink LED based on index.
 * @hw: pointer to hardware structure
 * @index: led number to blink
 *
 * Devices that implement the version 2 interface:
 *  X540
 **/
Blink LED based on index.
@hw: pointer to hardware structure
@index: led number to blink

Devices that implement the version 2 interface:
X540
Blink LED based on index . @hw : pointer to hardware structure @index : led number to blink Devices that implement the version 2 interface : X540
s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index)
{
	u32 macc_reg;
	u32 ledctl_reg;
	ixgbe_link_speed speed;
	bool link_up;
	DEBUGFUNC("ixgbe_blink_led_start_X540");
	if (index > 3)
		return IXGBE_ERR_PARAM;
	hw->mac.ops.check_link(hw, &speed, &link_up, false);
	if (link_up == false) {
		macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC);
		macc_reg |= IXGBE_MACC_FLU | IXGBE_MACC_FSV_10G | IXGBE_MACC_FS;
		IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg);
	}
	ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
	ledctl_reg &= ~IXGBE_LED_MODE_MASK(index);
	ledctl_reg |= IXGBE_LED_BLINK(index);
	IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg);
	IXGBE_WRITE_FLUSH(hw);
	return IXGBE_SUCCESS;
}
s32 ixgbe_blink_led_start_X540 ( struct ixgbe_hw * hw , u32 index ) { u32 macc_reg ; u32 ledctl_reg ; ixgbe_link_speed speed ; bool link_up ; DEBUGFUNC ( " " ) ; if ( index > 3 ) return IXGBE_ERR_PARAM ; hw -> mac . ops . check_link ( hw , & speed , & link_up , false ) ; if ( link_up == false ) { macc_reg = IXGBE_READ_REG ( hw , IXGBE_MACC ) ; macc_reg |= IXGBE_MACC_FLU | IXGBE_MACC_FSV_10G | IXGBE_MACC_FS ; IXGBE_WRITE_REG ( hw , IXGBE_MACC , macc_reg ) ; } ledctl_reg = IXGBE_READ_REG ( hw , IXGBE_LEDCTL ) ; ledctl_reg &= ~ IXGBE_LED_MODE_MASK ( index ) ; ledctl_reg |= IXGBE_LED_BLINK ( index ) ; IXGBE_WRITE_REG ( hw , IXGBE_LEDCTL , ledctl_reg ) ; IXGBE_WRITE_FLUSH ( hw ) ; return IXGBE_SUCCESS ; }
ixgbe_blink_led_start_X540 - Blink LED based on index.
ixgbe_blink_led_start_X540 - Blink LED based on index .
/*
	 * Link should be up in order for the blink bit in the LED control
	 * register to work. Force link and speed in the MAC if link is down.
	 * This will be reversed when we stop the blinking.
	 */ /* Set the LED to LINK_UP + BLINK. */