Skip to content

Commit d098538

Browse files
Sasha Neftinanguy11
authored andcommitted
igc: Remove igc_set_spd_dplx method
igc_set_spd_dplx method is not used. This patch comes to tidy up the driver code. Reported-by: Muhammad Husaini Zulkifli <[email protected]> Signed-off-by: Sasha Neftin <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent ecd17a8 commit d098538

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
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_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

0 commit comments

Comments
 (0)