src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
{
	u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
	u16 phy_speeds;
	u16 phy_id_lo;
	s32 rc;
	u16 i;

	rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info);
	if (rc)
		return rc;

	hw->phy.speeds_supported = 0;
	phy_speeds = info[0] & FW_PHY_INFO_SPEED_MASK;
	for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) {
		if (phy_speeds & ixgbe_fw_map[i].fw_speed)
			hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
	}
	if (!hw->phy.autoneg_advertised)
		hw->phy.autoneg_advertised = hw->phy.speeds_supported;

	hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
	phy_id_lo = info[1] & FW_PHY_INFO_ID_LO_MASK;
	hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
	hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
	if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
		return IXGBE_ERR_PHY_ADDR_INVALID;
	return IXGBE_SUCCESS;
}
/**
 * ixgbe_get_phy_id_fw - Get the phy ID via firmware command
 * @hw: pointer to hardware structure
 *
 * Returns error code
 */
Get the phy ID via firmware command
@hw: pointer to hardware structure

Returns error code
Get the phy ID via firmware command @hw : pointer to hardware structure Returns error code
static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
{
	u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
	u16 phy_speeds;
	u16 phy_id_lo;
	s32 rc;
	u16 i;
	rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info);
	if (rc)
		return rc;
	hw->phy.speeds_supported = 0;
	phy_speeds = info[0] & FW_PHY_INFO_SPEED_MASK;
	for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) {
		if (phy_speeds & ixgbe_fw_map[i].fw_speed)
			hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
	}
	if (!hw->phy.autoneg_advertised)
		hw->phy.autoneg_advertised = hw->phy.speeds_supported;
	hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
	phy_id_lo = info[1] & FW_PHY_INFO_ID_LO_MASK;
	hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
	hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
	if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
		return IXGBE_ERR_PHY_ADDR_INVALID;
	return IXGBE_SUCCESS;
}
static s32 ixgbe_get_phy_id_fw ( struct ixgbe_hw * hw ) { u32 info [ FW_PHY_ACT_DATA_COUNT ] = { 0 } ; u16 phy_speeds ; u16 phy_id_lo ; s32 rc ; u16 i ; rc = ixgbe_fw_phy_activity ( hw , FW_PHY_ACT_GET_PHY_INFO , & info ) ; if ( rc ) return rc ; hw -> phy . speeds_supported = 0 ; phy_speeds = info [ 0 ] & FW_PHY_INFO_SPEED_MASK ; for ( i = 0 ; i < sizeof ( ixgbe_fw_map ) / sizeof ( ixgbe_fw_map [ 0 ] ) ; ++ i ) { if ( phy_speeds & ixgbe_fw_map [ i ] . fw_speed ) hw -> phy . speeds_supported |= ixgbe_fw_map [ i ] . phy_speed ; } if ( ! hw -> phy . autoneg_advertised ) hw -> phy . autoneg_advertised = hw -> phy . speeds_supported ; hw -> phy . id = info [ 0 ] & FW_PHY_INFO_ID_HI_MASK ; phy_id_lo = info [ 1 ] & FW_PHY_INFO_ID_LO_MASK ; hw -> phy . id |= phy_id_lo & IXGBE_PHY_REVISION_MASK ; hw -> phy . revision = phy_id_lo & ~ IXGBE_PHY_REVISION_MASK ; if ( ! hw -> phy . id || hw -> phy . id == IXGBE_PHY_REVISION_MASK ) return IXGBE_ERR_PHY_ADDR_INVALID ; return IXGBE_SUCCESS ; }
ixgbe_get_phy_id_fw - Get the phy ID via firmware command
 @hw: pointer to hardware structure
ixgbe_get_phy_id_fw - Get the phy ID via firmware command @hw : pointer to hardware structure