Skip to content

Commit 3559d81

Browse files
hkallweitdavem330
authored andcommitted
r8169: simplify rtl_hw_start_8169
Currently done: - if mac_version in (01, 02, 03, 04) RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb); - if mac_version in (01, 02, 03, 04) rtl_set_rx_tx_config_registers(tp); - if mac_version not in (01, 02, 03, 04) RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb); rtl_set_rx_tx_config_registers(tp); So we do exactly the same independent of chip version and can simplify the code. In addition remove the call to rtl_init_rxcfg(), it's called in rtl_init_one() already and the set bits are never touched later. rtl_init_8168/8101 don't include this call either. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 12d42c5 commit 3559d81

File tree

1 file changed

+2
-20
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+2
-20
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5409,24 +5409,11 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
54095409
pci_write_config_byte(tp->pci_dev, PCI_CACHE_LINE_SIZE, 0x08);
54105410

54115411
RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
5412-
if (tp->mac_version == RTL_GIGA_MAC_VER_01 ||
5413-
tp->mac_version == RTL_GIGA_MAC_VER_02 ||
5414-
tp->mac_version == RTL_GIGA_MAC_VER_03 ||
5415-
tp->mac_version == RTL_GIGA_MAC_VER_04)
5416-
RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
5417-
5418-
rtl_init_rxcfg(tp);
54195412

54205413
RTL_W8(tp, EarlyTxThres, NoEarlyTx);
54215414

54225415
rtl_set_rx_max_size(tp);
54235416

5424-
if (tp->mac_version == RTL_GIGA_MAC_VER_01 ||
5425-
tp->mac_version == RTL_GIGA_MAC_VER_02 ||
5426-
tp->mac_version == RTL_GIGA_MAC_VER_03 ||
5427-
tp->mac_version == RTL_GIGA_MAC_VER_04)
5428-
rtl_set_rx_tx_config_registers(tp);
5429-
54305417
tp->cp_cmd |= PCIMulRW;
54315418

54325419
if (tp->mac_version == RTL_GIGA_MAC_VER_02 ||
@@ -5447,14 +5434,9 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
54475434
RTL_W16(tp, IntrMitigate, 0x0000);
54485435

54495436
rtl_set_rx_tx_desc_registers(tp);
5437+
rtl_set_rx_tx_config_registers(tp);
54505438

5451-
if (tp->mac_version != RTL_GIGA_MAC_VER_01 &&
5452-
tp->mac_version != RTL_GIGA_MAC_VER_02 &&
5453-
tp->mac_version != RTL_GIGA_MAC_VER_03 &&
5454-
tp->mac_version != RTL_GIGA_MAC_VER_04) {
5455-
RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
5456-
rtl_set_rx_tx_config_registers(tp);
5457-
}
5439+
RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
54585440

54595441
RTL_W8(tp, Cfg9346, Cfg9346_Lock);
54605442

0 commit comments

Comments
 (0)