src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed)
{
	u16 an_lp_status;
	s32 status;
	u16 word = hw->eeprom.ctrl_word_3;

	*lcd_speed = IXGBE_LINK_SPEED_UNKNOWN;

	status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS,
				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
				      &an_lp_status);

	if (status != IXGBE_SUCCESS)
		return status;

	/* If link partner advertised 1G, return 1G */
	if (an_lp_status & IXGBE_AUTO_NEG_LP_1000BASE_CAP) {
		*lcd_speed = IXGBE_LINK_SPEED_1GB_FULL;
		return status;
	}

	/* If 10G disabled for LPLU via NVM D10GMP, then return no valid LCD */
	if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) ||
	    (word & NVM_INIT_CTRL_3_D10GMP_PORT0))
		return status;

	/* Link partner not capable of lower speeds, return 10G */
	*lcd_speed = IXGBE_LINK_SPEED_10GB_FULL;
	return status;
}
/**
 * ixgbe_get_lcd_x550em - Determine lowest common denominator
 * @hw: pointer to hardware structure
 * @lcd_speed: pointer to lowest common link speed
 *
 * Determine lowest common link speed with link partner.
 **/
Determine lowest common denominator
@hw: pointer to hardware structure
@lcd_speed: pointer to lowest common link speed

Determine lowest common link speed with link partner.
Determine lowest common denominator @hw : pointer to hardware structure @lcd_speed : pointer to lowest common link speed Determine lowest common link speed with link partner .
s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed)
{
	u16 an_lp_status;
	s32 status;
	u16 word = hw->eeprom.ctrl_word_3;
	*lcd_speed = IXGBE_LINK_SPEED_UNKNOWN;
	status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS,
				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
				      &an_lp_status);
	if (status != IXGBE_SUCCESS)
		return status;
	if (an_lp_status & IXGBE_AUTO_NEG_LP_1000BASE_CAP) {
		*lcd_speed = IXGBE_LINK_SPEED_1GB_FULL;
		return status;
	}
	if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) ||
	    (word & NVM_INIT_CTRL_3_D10GMP_PORT0))
		return status;
	*lcd_speed = IXGBE_LINK_SPEED_10GB_FULL;
	return status;
}
s32 ixgbe_get_lcd_t_x550em ( struct ixgbe_hw * hw , ixgbe_link_speed * lcd_speed ) { u16 an_lp_status ; s32 status ; u16 word = hw -> eeprom . ctrl_word_3 ; * lcd_speed = IXGBE_LINK_SPEED_UNKNOWN ; status = hw -> phy . ops . read_reg ( hw , IXGBE_AUTO_NEG_LP_STATUS , IXGBE_MDIO_AUTO_NEG_DEV_TYPE , & an_lp_status ) ; if ( status != IXGBE_SUCCESS ) return status ; if ( an_lp_status & IXGBE_AUTO_NEG_LP_1000BASE_CAP ) { * lcd_speed = IXGBE_LINK_SPEED_1GB_FULL ; return status ; } if ( ( hw -> bus . lan_id && ( word & NVM_INIT_CTRL_3_D10GMP_PORT1 ) ) || ( word & NVM_INIT_CTRL_3_D10GMP_PORT0 ) ) return status ; * lcd_speed = IXGBE_LINK_SPEED_10GB_FULL ; return status ; }
ixgbe_get_lcd_x550em - Determine lowest common denominator
 @hw: pointer to hardware structure
 @lcd_speed: pointer to lowest common link speed
ixgbe_get_lcd_x550em - Determine lowest common denominator @hw : pointer to hardware structure @lcd_speed : pointer to lowest common link speed
/* If link partner advertised 1G, return 1G */ /* If 10G disabled for LPLU via NVM D10GMP, then return no valid LCD */ /* Link partner not capable of lower speeds, return 10G */