Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+4 -74
-1
drivers/net/ethernet/intel/igc/igc.h
··· 264 264 void igc_write_rss_indir_tbl(struct igc_adapter *adapter); 265 265 bool igc_has_link(struct igc_adapter *adapter); 266 266 void igc_reset(struct igc_adapter *adapter); 267 - int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx); 268 267 void igc_update_stats(struct igc_adapter *adapter); 269 268 void igc_disable_rx_ring(struct igc_ring *ring); 270 269 void igc_enable_rx_ring(struct igc_ring *ring);
-2
drivers/net/ethernet/intel/igc/igc_base.c
··· 182 182 183 183 igc_check_for_copper_link(hw); 184 184 185 - phy->type = igc_phy_i225; 186 - 187 185 out: 188 186 return ret_val; 189 187 }
-7
drivers/net/ethernet/intel/igc/igc_hw.h
··· 53 53 igc_num_macs /* List is 1-based, so subtract 1 for true count. */ 54 54 }; 55 55 56 - enum igc_phy_type { 57 - igc_phy_unknown = 0, 58 - igc_phy_i225, 59 - }; 60 - 61 56 enum igc_media_type { 62 57 igc_media_type_unknown = 0, 63 58 igc_media_type_copper = 1, ··· 132 137 133 138 struct igc_phy_info { 134 139 struct igc_phy_operations ops; 135 - 136 - enum igc_phy_type type; 137 140 138 141 u32 addr; 139 142 u32 id;
-50
drivers/net/ethernet/intel/igc/igc_main.c
··· 6187 6187 return value; 6188 6188 } 6189 6189 6190 - int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx) 6191 - { 6192 - struct igc_mac_info *mac = &adapter->hw.mac; 6193 - 6194 - mac->autoneg = false; 6195 - 6196 - /* Make sure dplx is at most 1 bit and lsb of speed is not set 6197 - * for the switch() below to work 6198 - */ 6199 - if ((spd & 1) || (dplx & ~1)) 6200 - goto err_inval; 6201 - 6202 - switch (spd + dplx) { 6203 - case SPEED_10 + DUPLEX_HALF: 6204 - mac->forced_speed_duplex = ADVERTISE_10_HALF; 6205 - break; 6206 - case SPEED_10 + DUPLEX_FULL: 6207 - mac->forced_speed_duplex = ADVERTISE_10_FULL; 6208 - break; 6209 - case SPEED_100 + DUPLEX_HALF: 6210 - mac->forced_speed_duplex = ADVERTISE_100_HALF; 6211 - break; 6212 - case SPEED_100 + DUPLEX_FULL: 6213 - mac->forced_speed_duplex = ADVERTISE_100_FULL; 6214 - break; 6215 - case SPEED_1000 + DUPLEX_FULL: 6216 - mac->autoneg = true; 6217 - adapter->hw.phy.autoneg_advertised = ADVERTISE_1000_FULL; 6218 - break; 6219 - case SPEED_1000 + DUPLEX_HALF: /* not supported */ 6220 - goto err_inval; 6221 - case SPEED_2500 + DUPLEX_FULL: 6222 - mac->autoneg = true; 6223 - adapter->hw.phy.autoneg_advertised = ADVERTISE_2500_FULL; 6224 - break; 6225 - case SPEED_2500 + DUPLEX_HALF: /* not supported */ 6226 - default: 6227 - goto err_inval; 6228 - } 6229 - 6230 - /* clear MDI, MDI(-X) override is only allowed when autoneg enabled */ 6231 - adapter->hw.phy.mdix = AUTO_ALL_MODES; 6232 - 6233 - return 0; 6234 - 6235 - err_inval: 6236 - netdev_err(adapter->netdev, "Unsupported Speed/Duplex configuration\n"); 6237 - return -EINVAL; 6238 - } 6239 - 6240 6190 /** 6241 6191 * igc_probe - Device Initialization Routine 6242 6192 * @pdev: PCI device information struct
+3 -13
drivers/net/ethernet/intel/igc/igc_phy.c
··· 141 141 * igc_check_downshift - Checks whether a downshift in speed occurred 142 142 * @hw: pointer to the HW structure 143 143 * 144 - * Success returns 0, Failure returns 1 145 - * 146 144 * A downshift is detected by querying the PHY link health. 147 145 */ 148 - s32 igc_check_downshift(struct igc_hw *hw) 146 + void igc_check_downshift(struct igc_hw *hw) 149 147 { 150 148 struct igc_phy_info *phy = &hw->phy; 151 - s32 ret_val; 152 149 153 - switch (phy->type) { 154 - case igc_phy_i225: 155 - default: 156 - /* speed downshift not supported */ 157 - phy->speed_downgraded = false; 158 - ret_val = 0; 159 - } 160 - 161 - return ret_val; 150 + /* speed downshift not supported */ 151 + phy->speed_downgraded = false; 162 152 } 163 153 164 154 /**
+1 -1
drivers/net/ethernet/intel/igc/igc_phy.h
··· 11 11 s32 igc_get_phy_id(struct igc_hw *hw); 12 12 s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations, 13 13 u32 usec_interval, bool *success); 14 - s32 igc_check_downshift(struct igc_hw *hw); 14 + void igc_check_downshift(struct igc_hw *hw); 15 15 s32 igc_setup_copper_link(struct igc_hw *hw); 16 16 void igc_power_up_phy_copper(struct igc_hw *hw); 17 17 void igc_power_down_phy_copper(struct igc_hw *hw);