Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a5c27e6 authored by Mark Rustad's avatar Mark Rustad Committed by Jeff Kirsher
Browse files

ixgbe: Use method pointer to access IOSF devices



Provide method pointers and use them to access IOSF-attached
devices. A new MAC will introduce a new access method.

Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 207969b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -3332,6 +3332,8 @@ struct ixgbe_mac_operations {
	s32 (*dmac_config)(struct ixgbe_hw *hw);
	s32 (*dmac_config)(struct ixgbe_hw *hw);
	s32 (*dmac_update_tcs)(struct ixgbe_hw *hw);
	s32 (*dmac_update_tcs)(struct ixgbe_hw *hw);
	s32 (*dmac_config_tcs)(struct ixgbe_hw *hw);
	s32 (*dmac_config_tcs)(struct ixgbe_hw *hw);
	s32 (*read_iosf_sb_reg)(struct ixgbe_hw *, u32, u32, u32 *);
	s32 (*write_iosf_sb_reg)(struct ixgbe_hw *, u32, u32, u32);
};
};


struct ixgbe_phy_operations {
struct ixgbe_phy_operations {
+18 −14
Original line number Original line Diff line number Diff line
@@ -1615,7 +1615,7 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
	s32 status;
	s32 status;
	u32 reg_val;
	u32 reg_val;


	status = ixgbe_read_iosf_sb_reg_x550(hw,
	status = hw->mac.ops.read_iosf_sb_reg(hw,
					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
					IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
					IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
	if (status)
	if (status)
@@ -1637,7 +1637,7 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,


	/* Restart auto-negotiation. */
	/* Restart auto-negotiation. */
	reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;
	reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;
	status = ixgbe_write_iosf_sb_reg_x550(hw,
	status = hw->mac.ops.write_iosf_sb_reg(hw,
					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
					IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
					IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);


@@ -1654,7 +1654,7 @@ static s32 ixgbe_setup_kx4_x550em(struct ixgbe_hw *hw)
	s32 status;
	s32 status;
	u32 reg_val;
	u32 reg_val;


	status = ixgbe_read_iosf_sb_reg_x550(hw, IXGBE_KX4_LINK_CNTL_1,
	status = hw->mac.ops.read_iosf_sb_reg(hw, IXGBE_KX4_LINK_CNTL_1,
					      IXGBE_SB_IOSF_TARGET_KX4_PCS0 +
					      IXGBE_SB_IOSF_TARGET_KX4_PCS0 +
					      hw->bus.lan_id, &reg_val);
					      hw->bus.lan_id, &reg_val);
	if (status)
	if (status)
@@ -1675,7 +1675,7 @@ static s32 ixgbe_setup_kx4_x550em(struct ixgbe_hw *hw)


	/* Restart auto-negotiation. */
	/* Restart auto-negotiation. */
	reg_val |= IXGBE_KX4_LINK_CNTL_1_TETH_AN_RESTART;
	reg_val |= IXGBE_KX4_LINK_CNTL_1_TETH_AN_RESTART;
	status = ixgbe_write_iosf_sb_reg_x550(hw, IXGBE_KX4_LINK_CNTL_1,
	status = hw->mac.ops.write_iosf_sb_reg(hw, IXGBE_KX4_LINK_CNTL_1,
					       IXGBE_SB_IOSF_TARGET_KX4_PCS0 +
					       IXGBE_SB_IOSF_TARGET_KX4_PCS0 +
					       hw->bus.lan_id, reg_val);
					       hw->bus.lan_id, reg_val);


@@ -1897,9 +1897,10 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_KR)
	if (hw->device_id != IXGBE_DEV_ID_X550EM_X_KR)
		return 0;
		return 0;


	rc = ixgbe_read_iosf_sb_reg_x550(hw,
	rc = hw->mac.ops.read_iosf_sb_reg(hw,
					  IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
					  IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
					 IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_val);
					  IXGBE_SB_IOSF_TARGET_KR_PHY,
					  &reg_val);
	if (rc)
	if (rc)
		return rc;
		return rc;


@@ -1909,9 +1910,10 @@ static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw)
		reg_val |= IXGBE_KRM_AN_CNTL_1_SYM_PAUSE;
		reg_val |= IXGBE_KRM_AN_CNTL_1_SYM_PAUSE;
	if (asm_dir)
	if (asm_dir)
		reg_val |= IXGBE_KRM_AN_CNTL_1_ASM_PAUSE;
		reg_val |= IXGBE_KRM_AN_CNTL_1_ASM_PAUSE;
	rc = ixgbe_write_iosf_sb_reg_x550(hw,
	rc = hw->mac.ops.write_iosf_sb_reg(hw,
					   IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
					   IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
					  IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);
					   IXGBE_SB_IOSF_TARGET_KR_PHY,
					   reg_val);


	/* This device does not fully support AN. */
	/* This device does not fully support AN. */
	hw->fc.disable_fc_autoneg = true;
	hw->fc.disable_fc_autoneg = true;
@@ -2449,6 +2451,8 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {
	.release_swfw_sync	= &ixgbe_release_swfw_sync_X550em,
	.release_swfw_sync	= &ixgbe_release_swfw_sync_X550em,
	.init_swfw_sync		= &ixgbe_init_swfw_sync_X540,
	.init_swfw_sync		= &ixgbe_init_swfw_sync_X540,
	.setup_fc		= NULL, /* defined later */
	.setup_fc		= NULL, /* defined later */
	.read_iosf_sb_reg	= ixgbe_read_iosf_sb_reg_x550,
	.write_iosf_sb_reg	= ixgbe_write_iosf_sb_reg_x550,
};
};


#define X550_COMMON_EEP \
#define X550_COMMON_EEP \