src/dpdk/drivers/net/txgbe/base/txgbe_phy.c
static s32 txgbe_read_phy_if(struct txgbe_hw *hw)
{
	hw->phy.media_type = hw->phy.get_media_type(hw);

	/* Save NW management interface connected on board. This is used
	 * to determine internal PHY mode.
	 */
	hw->phy.nw_mng_if_sel = rd32(hw, TXGBE_ETHPHYIF);

	/* If MDIO is connected to external PHY, then set PHY address. */
	if (hw->phy.nw_mng_if_sel & TXGBE_ETHPHYIF_MDIO_ACT)
		hw->phy.addr = TXGBE_ETHPHYIF_MDIO_BASE(hw->phy.nw_mng_if_sel);

	if (!hw->phy.phy_semaphore_mask) {
		if (hw->bus.lan_id)
			hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
		else
			hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
	}

	return 0;
}
/**
 *  txgbe_read_phy_if - Read TXGBE_ETHPHYIF register
 *  @hw: pointer to hardware structure
 *
 *  Read TXGBE_ETHPHYIF register and save field values,
 *  and check for valid field values.
 **/
Read TXGBE_ETHPHYIF register
@hw: pointer to hardware structure

Read TXGBE_ETHPHYIF register and save field values,
and check for valid field values.
Read TXGBE_ETHPHYIF register @hw : pointer to hardware structure Read TXGBE_ETHPHYIF register and save field values and check for valid field values .
static s32 txgbe_read_phy_if(struct txgbe_hw *hw)
{
	hw->phy.media_type = hw->phy.get_media_type(hw);
	hw->phy.nw_mng_if_sel = rd32(hw, TXGBE_ETHPHYIF);
	if (hw->phy.nw_mng_if_sel & TXGBE_ETHPHYIF_MDIO_ACT)
		hw->phy.addr = TXGBE_ETHPHYIF_MDIO_BASE(hw->phy.nw_mng_if_sel);
	if (!hw->phy.phy_semaphore_mask) {
		if (hw->bus.lan_id)
			hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
		else
			hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
	}
	return 0;
}
static s32 txgbe_read_phy_if ( struct txgbe_hw * hw ) { hw -> phy . media_type = hw -> phy . get_media_type ( hw ) ; hw -> phy . nw_mng_if_sel = rd32 ( hw , TXGBE_ETHPHYIF ) ; if ( hw -> phy . nw_mng_if_sel & TXGBE_ETHPHYIF_MDIO_ACT ) hw -> phy . addr = TXGBE_ETHPHYIF_MDIO_BASE ( hw -> phy . nw_mng_if_sel ) ; if ( ! hw -> phy . phy_semaphore_mask ) { if ( hw -> bus . lan_id ) hw -> phy . phy_semaphore_mask = TXGBE_MNGSEM_SWPHY ; else hw -> phy . phy_semaphore_mask = TXGBE_MNGSEM_SWPHY ; } return 0 ; }
txgbe_read_phy_if - Read TXGBE_ETHPHYIF register
  @hw: pointer to hardware structure
txgbe_read_phy_if - Read TXGBE_ETHPHYIF register @hw : pointer to hardware structure
/* Save NW management interface connected on board. This is used
	 * to determine internal PHY mode.
	 */ /* If MDIO is connected to external PHY, then set PHY address. */