Skip to content

Commit ddae9bc

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 01f4685 + 95073d0 commit ddae9bc

File tree

6 files changed

+4
-74
lines changed

6 files changed

+4
-74
lines changed

drivers/net/ethernet/intel/igc/igc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ int igc_reinit_queues(struct igc_adapter *adapter);
264264
void igc_write_rss_indir_tbl(struct igc_adapter *adapter);
265265
bool igc_has_link(struct igc_adapter *adapter);
266266
void igc_reset(struct igc_adapter *adapter);
267-
int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx);
268267
void igc_update_stats(struct igc_adapter *adapter);
269268
void igc_disable_rx_ring(struct igc_ring *ring);
270269
void igc_enable_rx_ring(struct igc_ring *ring);

drivers/net/ethernet/intel/igc/igc_base.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
182182

183183
igc_check_for_copper_link(hw);
184184

185-
phy->type = igc_phy_i225;
186-
187185
out:
188186
return ret_val;
189187
}

drivers/net/ethernet/intel/igc/igc_hw.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ enum igc_mac_type {
5353
igc_num_macs /* List is 1-based, so subtract 1 for true count. */
5454
};
5555

56-
enum igc_phy_type {
57-
igc_phy_unknown = 0,
58-
igc_phy_i225,
59-
};
60-
6156
enum igc_media_type {
6257
igc_media_type_unknown = 0,
6358
igc_media_type_copper = 1,
@@ -138,8 +133,6 @@ struct igc_nvm_info {
138133
struct igc_phy_info {
139134
struct igc_phy_operations ops;
140135

141-
enum igc_phy_type type;
142-
143136
u32 addr;
144137
u32 id;
145138
u32 reset_delay_us; /* in usec */

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6187,56 +6187,6 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
61876187
return value;
61886188
}
61896189

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-
62406190
/**
62416191
* igc_probe - Device Initialization Routine
62426192
* @pdev: PCI device information struct

drivers/net/ethernet/intel/igc/igc_phy.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
141141
* igc_check_downshift - Checks whether a downshift in speed occurred
142142
* @hw: pointer to the HW structure
143143
*
144-
* Success returns 0, Failure returns 1
145-
*
146144
* A downshift is detected by querying the PHY link health.
147145
*/
148-
s32 igc_check_downshift(struct igc_hw *hw)
146+
void igc_check_downshift(struct igc_hw *hw)
149147
{
150148
struct igc_phy_info *phy = &hw->phy;
151-
s32 ret_val;
152149

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;
162152
}
163153

164154
/**

drivers/net/ethernet/intel/igc/igc_phy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw);
1111
s32 igc_get_phy_id(struct igc_hw *hw);
1212
s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
1313
u32 usec_interval, bool *success);
14-
s32 igc_check_downshift(struct igc_hw *hw);
14+
void igc_check_downshift(struct igc_hw *hw);
1515
s32 igc_setup_copper_link(struct igc_hw *hw);
1616
void igc_power_up_phy_copper(struct igc_hw *hw);
1717
void igc_power_down_phy_copper(struct igc_hw *hw);

0 commit comments

Comments
 (0)