src/dpdk/drivers/net/ixgbe/base/ixgbe_82599.c
s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
{
	struct ixgbe_mac_info *mac = &hw->mac;
	struct ixgbe_phy_info *phy = &hw->phy;
	s32 ret_val = IXGBE_SUCCESS;
	u32 esdp;

	DEBUGFUNC("ixgbe_init_phy_ops_82599");

	if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) {
		/* Store flag indicating I2C bus access control unit. */
		hw->phy.qsfp_shared_i2c_bus = TRUE;

		/* Initialize access to QSFP+ I2C bus */
		esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
		esdp |= IXGBE_ESDP_SDP0_DIR;
		esdp &= ~IXGBE_ESDP_SDP1_DIR;
		esdp &= ~IXGBE_ESDP_SDP0;
		esdp &= ~IXGBE_ESDP_SDP0_NATIVE;
		esdp &= ~IXGBE_ESDP_SDP1_NATIVE;
		IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
		IXGBE_WRITE_FLUSH(hw);

		phy->ops.read_i2c_byte = ixgbe_read_i2c_byte_82599;
		phy->ops.write_i2c_byte = ixgbe_write_i2c_byte_82599;
	}
	/* Identify the PHY or SFP module */
	ret_val = phy->ops.identify(hw);
	if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED)
		goto init_phy_ops_out;

	/* Setup function pointers based on detected SFP module and speeds */
	ixgbe_init_mac_link_ops_82599(hw);
	if (hw->phy.sfp_type != ixgbe_sfp_type_unknown)
		hw->phy.ops.reset = NULL;

	/* If copper media, overwrite with copper function pointers */
	if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) {
		mac->ops.setup_link = ixgbe_setup_copper_link_82599;
		mac->ops.get_link_capabilities =
				  ixgbe_get_copper_link_capabilities_generic;
	}

	/* Set necessary function pointers based on PHY type */
	switch (hw->phy.type) {
	case ixgbe_phy_tn:
		phy->ops.setup_link = ixgbe_setup_phy_link_tnx;
		phy->ops.check_link = ixgbe_check_phy_link_tnx;
		phy->ops.get_firmware_version =
			     ixgbe_get_phy_firmware_version_tnx;
		break;
	default:
		break;
	}
init_phy_ops_out:
	return ret_val;
}
/**
 * ixgbe_init_phy_ops_82599 - PHY/SFP specific init
 * @hw: pointer to hardware structure
 *
 * Initialize any function pointers that were not able to be
 * set during init_shared_code because the PHY/SFP type was
 * not known.  Perform the SFP init if necessary.
 *
 **/
PHY/SFP specific init
@hw: pointer to hardware structure

Initialize any function pointers that were not able to be
set during init_shared_code because the PHY/SFP type was
not known.  Perform the SFP init if necessary.
PHY / SFP specific init @hw : pointer to hardware structure Initialize any function pointers that were not able to be set during init_shared_code because the PHY / SFP type was not known . Perform the SFP init if necessary .
s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
{
	struct ixgbe_mac_info *mac = &hw->mac;
	struct ixgbe_phy_info *phy = &hw->phy;
	s32 ret_val = IXGBE_SUCCESS;
	u32 esdp;
	DEBUGFUNC("ixgbe_init_phy_ops_82599");
	if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) {
		hw->phy.qsfp_shared_i2c_bus = TRUE;
		esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
		esdp |= IXGBE_ESDP_SDP0_DIR;
		esdp &= ~IXGBE_ESDP_SDP1_DIR;
		esdp &= ~IXGBE_ESDP_SDP0;
		esdp &= ~IXGBE_ESDP_SDP0_NATIVE;
		esdp &= ~IXGBE_ESDP_SDP1_NATIVE;
		IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
		IXGBE_WRITE_FLUSH(hw);
		phy->ops.read_i2c_byte = ixgbe_read_i2c_byte_82599;
		phy->ops.write_i2c_byte = ixgbe_write_i2c_byte_82599;
	}
	ret_val = phy->ops.identify(hw);
	if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED)
		goto init_phy_ops_out;
	ixgbe_init_mac_link_ops_82599(hw);
	if (hw->phy.sfp_type != ixgbe_sfp_type_unknown)
		hw->phy.ops.reset = NULL;
	if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) {
		mac->ops.setup_link = ixgbe_setup_copper_link_82599;
		mac->ops.get_link_capabilities =
				  ixgbe_get_copper_link_capabilities_generic;
	}
	switch (hw->phy.type) {
	case ixgbe_phy_tn:
		phy->ops.setup_link = ixgbe_setup_phy_link_tnx;
		phy->ops.check_link = ixgbe_check_phy_link_tnx;
		phy->ops.get_firmware_version =
			     ixgbe_get_phy_firmware_version_tnx;
		break;
	default:
		break;
	}
init_phy_ops_out:
	return ret_val;
}
s32 ixgbe_init_phy_ops_82599 ( struct ixgbe_hw * hw ) { struct ixgbe_mac_info * mac = & hw -> mac ; struct ixgbe_phy_info * phy = & hw -> phy ; s32 ret_val = IXGBE_SUCCESS ; u32 esdp ; DEBUGFUNC ( " " ) ; if ( hw -> device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP ) { hw -> phy . qsfp_shared_i2c_bus = TRUE ; esdp = IXGBE_READ_REG ( hw , IXGBE_ESDP ) ; esdp |= IXGBE_ESDP_SDP0_DIR ; esdp &= ~ IXGBE_ESDP_SDP1_DIR ; esdp &= ~ IXGBE_ESDP_SDP0 ; esdp &= ~ IXGBE_ESDP_SDP0_NATIVE ; esdp &= ~ IXGBE_ESDP_SDP1_NATIVE ; IXGBE_WRITE_REG ( hw , IXGBE_ESDP , esdp ) ; IXGBE_WRITE_FLUSH ( hw ) ; phy -> ops . read_i2c_byte = ixgbe_read_i2c_byte_82599 ; phy -> ops . write_i2c_byte = ixgbe_write_i2c_byte_82599 ; } ret_val = phy -> ops . identify ( hw ) ; if ( ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED ) goto init_phy_ops_out ; ixgbe_init_mac_link_ops_82599 ( hw ) ; if ( hw -> phy . sfp_type != ixgbe_sfp_type_unknown ) hw -> phy . ops . reset = NULL ; if ( mac -> ops . get_media_type ( hw ) == ixgbe_media_type_copper ) { mac -> ops . setup_link = ixgbe_setup_copper_link_82599 ; mac -> ops . get_link_capabilities = ixgbe_get_copper_link_capabilities_generic ; } switch ( hw -> phy . type ) { case ixgbe_phy_tn : phy -> ops . setup_link = ixgbe_setup_phy_link_tnx ; phy -> ops . check_link = ixgbe_check_phy_link_tnx ; phy -> ops . get_firmware_version = ixgbe_get_phy_firmware_version_tnx ; break ; default : break ; } init_phy_ops_out : return ret_val ; }
ixgbe_init_phy_ops_82599 - PHY/SFP specific init
 @hw: pointer to hardware structure
ixgbe_init_phy_ops_82599 - PHY / SFP specific init @hw : pointer to hardware structure
/* Store flag indicating I2C bus access control unit. */ /* Initialize access to QSFP+ I2C bus */ /* Identify the PHY or SFP module */ /* Setup function pointers based on detected SFP module and speeds */ /* If copper media, overwrite with copper function pointers */ /* Set necessary function pointers based on PHY type */