src/dpdk/drivers/net/ixgbe/base/ixgbe_x550.c
u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
{
	u64 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
	u16 ext_ability = 0;

	DEBUGFUNC("ixgbe_get_supported_physical_layer_X550em");

	hw->phy.ops.identify(hw);

	switch (hw->phy.type) {
	case ixgbe_phy_x550em_kr:
		if (hw->mac.type == ixgbe_mac_X550EM_a) {
			if (hw->phy.nw_mng_if_sel &
			    IXGBE_NW_MNG_IF_SEL_PHY_SPEED_2_5G) {
				physical_layer =
					IXGBE_PHYSICAL_LAYER_2500BASE_KX;
				break;
			} else if (hw->device_id ==
				   IXGBE_DEV_ID_X550EM_A_KR_L) {
				physical_layer =
					IXGBE_PHYSICAL_LAYER_1000BASE_KX;
				break;
			}
		}
		/* fall through */
	case ixgbe_phy_x550em_xfi:
		physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR |
				 IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_x550em_kx4:
		physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4 |
				 IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_x550em_ext_t:
		hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
				     IXGBE_MDIO_PMA_PMD_DEV_TYPE,
				     &ext_ability);
		if (ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY)
			physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
		if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY)
			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		break;
	case ixgbe_phy_fw:
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_10BASE_T;
		break;
	case ixgbe_phy_sgmii:
		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_ext_1g_t:
		physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		break;
	default:
		break;
	}

	if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
		physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw);

	return physical_layer;
}
/**
 * ixgbe_get_supported_physical_layer_X550em - Returns physical layer type
 * @hw: pointer to hardware structure
 *
 * Determines physical layer capabilities of the current configuration.
 **/
Returns physical layer type
@hw: pointer to hardware structure

Determines physical layer capabilities of the current configuration.
Returns physical layer type @hw : pointer to hardware structure Determines physical layer capabilities of the current configuration .
u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
{
	u64 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
	u16 ext_ability = 0;
	DEBUGFUNC("ixgbe_get_supported_physical_layer_X550em");
	hw->phy.ops.identify(hw);
	switch (hw->phy.type) {
	case ixgbe_phy_x550em_kr:
		if (hw->mac.type == ixgbe_mac_X550EM_a) {
			if (hw->phy.nw_mng_if_sel &
			    IXGBE_NW_MNG_IF_SEL_PHY_SPEED_2_5G) {
				physical_layer =
					IXGBE_PHYSICAL_LAYER_2500BASE_KX;
				break;
			} else if (hw->device_id ==
				   IXGBE_DEV_ID_X550EM_A_KR_L) {
				physical_layer =
					IXGBE_PHYSICAL_LAYER_1000BASE_KX;
				break;
			}
		}
	case ixgbe_phy_x550em_xfi:
		physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR |
				 IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_x550em_kx4:
		physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4 |
				 IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_x550em_ext_t:
		hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
				     IXGBE_MDIO_PMA_PMD_DEV_TYPE,
				     &ext_ability);
		if (ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY)
			physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
		if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY)
			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		break;
	case ixgbe_phy_fw:
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
			physical_layer |= IXGBE_PHYSICAL_LAYER_10BASE_T;
		break;
	case ixgbe_phy_sgmii:
		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
		break;
	case ixgbe_phy_ext_1g_t:
		physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
		break;
	default:
		break;
	}
	if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
		physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw);
	return physical_layer;
}
u64 ixgbe_get_supported_physical_layer_X550em ( struct ixgbe_hw * hw ) { u64 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN ; u16 ext_ability = 0 ; DEBUGFUNC ( " " ) ; hw -> phy . ops . identify ( hw ) ; switch ( hw -> phy . type ) { case ixgbe_phy_x550em_kr : if ( hw -> mac . type == ixgbe_mac_X550EM_a ) { if ( hw -> phy . nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_PHY_SPEED_2_5G ) { physical_layer = IXGBE_PHYSICAL_LAYER_2500BASE_KX ; break ; } else if ( hw -> device_id == IXGBE_DEV_ID_X550EM_A_KR_L ) { physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX ; break ; } } case ixgbe_phy_x550em_xfi : physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR | IXGBE_PHYSICAL_LAYER_1000BASE_KX ; break ; case ixgbe_phy_x550em_kx4 : physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4 | IXGBE_PHYSICAL_LAYER_1000BASE_KX ; break ; case ixgbe_phy_x550em_ext_t : hw -> phy . ops . read_reg ( hw , IXGBE_MDIO_PHY_EXT_ABILITY , IXGBE_MDIO_PMA_PMD_DEV_TYPE , & ext_ability ) ; if ( ext_ability & IXGBE_MDIO_PHY_10GBASET_ABILITY ) physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T ; if ( ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY ) physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T ; break ; case ixgbe_phy_fw : if ( hw -> phy . speeds_supported & IXGBE_LINK_SPEED_1GB_FULL ) physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T ; if ( hw -> phy . speeds_supported & IXGBE_LINK_SPEED_100_FULL ) physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX ; if ( hw -> phy . speeds_supported & IXGBE_LINK_SPEED_10_FULL ) physical_layer |= IXGBE_PHYSICAL_LAYER_10BASE_T ; break ; case ixgbe_phy_sgmii : physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX ; break ; case ixgbe_phy_ext_1g_t : physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T ; break ; default : break ; } if ( hw -> mac . ops . get_media_type ( hw ) == ixgbe_media_type_fiber ) physical_layer = ixgbe_get_supported_phy_sfp_layer_generic ( hw ) ; return physical_layer ; }
ixgbe_get_supported_physical_layer_X550em - Returns physical layer type
 @hw: pointer to hardware structure
ixgbe_get_supported_physical_layer_X550em - Returns physical layer type @hw : pointer to hardware structure
/* fall through */