Commit ddae9bc4 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
1GbE Intel Wired LAN Driver Updates 2022-05-10

This series contains updates to igc driver only.

Sasha cleans up the code by removing an unused function and removing an
enum for PHY type as there is only one PHY. The return type for
igc_check_downshift() is changed to void as it always returns success.

* '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  igc: Change type of the 'igc_check_downshift' method
  igc: Remove unused phy_type enum
  igc: Remove igc_set_spd_dplx method
====================

Link: https://lore.kernel.org/r/20220510210656.2168393-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 01f46857 95073d08
...@@ -264,7 +264,6 @@ int igc_reinit_queues(struct igc_adapter *adapter); ...@@ -264,7 +264,6 @@ int igc_reinit_queues(struct igc_adapter *adapter);
void igc_write_rss_indir_tbl(struct igc_adapter *adapter); void igc_write_rss_indir_tbl(struct igc_adapter *adapter);
bool igc_has_link(struct igc_adapter *adapter); bool igc_has_link(struct igc_adapter *adapter);
void igc_reset(struct igc_adapter *adapter); void igc_reset(struct igc_adapter *adapter);
int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx);
void igc_update_stats(struct igc_adapter *adapter); void igc_update_stats(struct igc_adapter *adapter);
void igc_disable_rx_ring(struct igc_ring *ring); void igc_disable_rx_ring(struct igc_ring *ring);
void igc_enable_rx_ring(struct igc_ring *ring); void igc_enable_rx_ring(struct igc_ring *ring);
......
...@@ -182,8 +182,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw) ...@@ -182,8 +182,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
igc_check_for_copper_link(hw); igc_check_for_copper_link(hw);
phy->type = igc_phy_i225;
out: out:
return ret_val; return ret_val;
} }
......
...@@ -53,11 +53,6 @@ enum igc_mac_type { ...@@ -53,11 +53,6 @@ enum igc_mac_type {
igc_num_macs /* List is 1-based, so subtract 1 for true count. */ igc_num_macs /* List is 1-based, so subtract 1 for true count. */
}; };
enum igc_phy_type {
igc_phy_unknown = 0,
igc_phy_i225,
};
enum igc_media_type { enum igc_media_type {
igc_media_type_unknown = 0, igc_media_type_unknown = 0,
igc_media_type_copper = 1, igc_media_type_copper = 1,
...@@ -138,8 +133,6 @@ struct igc_nvm_info { ...@@ -138,8 +133,6 @@ struct igc_nvm_info {
struct igc_phy_info { struct igc_phy_info {
struct igc_phy_operations ops; struct igc_phy_operations ops;
enum igc_phy_type type;
u32 addr; u32 addr;
u32 id; u32 id;
u32 reset_delay_us; /* in usec */ u32 reset_delay_us; /* in usec */
......
...@@ -6187,56 +6187,6 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg) ...@@ -6187,56 +6187,6 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
return value; return value;
} }
int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx)
{
struct igc_mac_info *mac = &adapter->hw.mac;
mac->autoneg = false;
/* Make sure dplx is at most 1 bit and lsb of speed is not set
* for the switch() below to work
*/
if ((spd & 1) || (dplx & ~1))
goto err_inval;
switch (spd + dplx) {
case SPEED_10 + DUPLEX_HALF:
mac->forced_speed_duplex = ADVERTISE_10_HALF;
break;
case SPEED_10 + DUPLEX_FULL:
mac->forced_speed_duplex = ADVERTISE_10_FULL;
break;
case SPEED_100 + DUPLEX_HALF:
mac->forced_speed_duplex = ADVERTISE_100_HALF;
break;
case SPEED_100 + DUPLEX_FULL:
mac->forced_speed_duplex = ADVERTISE_100_FULL;
break;
case SPEED_1000 + DUPLEX_FULL:
mac->autoneg = true;
adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL;
break;
case SPEED_1000 + DUPLEX_HALF: /* not supported */
goto err_inval;
case SPEED_2500 + DUPLEX_FULL:
mac->autoneg = true;
adapter->hw.phy.autoneg_advertised = ADVERTISE_2500_FULL;
break;
case SPEED_2500 + DUPLEX_HALF: /* not supported */
default:
goto err_inval;
}
/* clear MDI, MDI(-X) override is only allowed when autoneg enabled */
adapter->hw.phy.mdix = AUTO_ALL_MODES;
return 0;
err_inval:
netdev_err(adapter->netdev, "Unsupported Speed/Duplex configuration\n");
return -EINVAL;
}
/** /**
* igc_probe - Device Initialization Routine * igc_probe - Device Initialization Routine
* @pdev: PCI device information struct * @pdev: PCI device information struct
......
...@@ -141,24 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw) ...@@ -141,24 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
* igc_check_downshift - Checks whether a downshift in speed occurred * igc_check_downshift - Checks whether a downshift in speed occurred
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
* Success returns 0, Failure returns 1
*
* A downshift is detected by querying the PHY link health. * A downshift is detected by querying the PHY link health.
*/ */
s32 igc_check_downshift(struct igc_hw *hw) void igc_check_downshift(struct igc_hw *hw)
{ {
struct igc_phy_info *phy = &hw->phy; struct igc_phy_info *phy = &hw->phy;
s32 ret_val;
switch (phy->type) { /* speed downshift not supported */
case igc_phy_i225: phy->speed_downgraded = false;
default:
/* speed downshift not supported */
phy->speed_downgraded = false;
ret_val = 0;
}
return ret_val;
} }
/** /**
......
...@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw); ...@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw);
s32 igc_get_phy_id(struct igc_hw *hw); s32 igc_get_phy_id(struct igc_hw *hw);
s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations, s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
u32 usec_interval, bool *success); u32 usec_interval, bool *success);
s32 igc_check_downshift(struct igc_hw *hw); void igc_check_downshift(struct igc_hw *hw);
s32 igc_setup_copper_link(struct igc_hw *hw); s32 igc_setup_copper_link(struct igc_hw *hw);
void igc_power_up_phy_copper(struct igc_hw *hw); void igc_power_up_phy_copper(struct igc_hw *hw);
void igc_power_down_phy_copper(struct igc_hw *hw); void igc_power_down_phy_copper(struct igc_hw *hw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment