Skip to content

Commit

Permalink
r8169: correct settings of rtl8102e.
Browse files Browse the repository at this point in the history
Adjust and remove certain settings of RTL8102E which are for previous chips.

Signed-off-by: Hayes Wang <[email protected]>
Acked-off-by: Francois Romieu <[email protected]>
  • Loading branch information
hayesorz authored and Francois Romieu committed Feb 23, 2011
1 parent fac5b3c commit d24e9aa
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_mwi_2;
}

tp->cp_cmd = PCIMulRW | RxChkSum;
tp->cp_cmd = RxChkSum;

if ((sizeof(dma_addr_t) > 4) &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
Expand Down Expand Up @@ -3848,8 +3848,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
Cxpl_dbg_sel | \
ASF | \
PktCntrDisable | \
PCIDAC | \
PCIMulRW)
Mac_dbgo_sel)

static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
{
Expand Down Expand Up @@ -3879,8 +3878,6 @@ static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
if ((cfg1 & LEDS0) && (cfg1 & LEDS1))
RTL_W8(Config1, cfg1 & ~LEDS0);

RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);

rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
}

Expand All @@ -3892,8 +3889,6 @@ static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)

RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable);
RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);

RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK);
}

static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev)
Expand All @@ -3919,6 +3914,8 @@ static void rtl_hw_start_8101(struct net_device *dev)
}
}

RTL_W8(Cfg9346, Cfg9346_Unlock);

switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_07:
rtl_hw_start_8102e_1(ioaddr, pdev);
Expand All @@ -3933,14 +3930,13 @@ static void rtl_hw_start_8101(struct net_device *dev)
break;
}

RTL_W8(Cfg9346, Cfg9346_Unlock);
RTL_W8(Cfg9346, Cfg9346_Lock);

RTL_W8(MaxTxPacketSize, TxPacketMax);

rtl_set_rx_max_size(ioaddr, rx_buf_sz);

tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;

tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK;
RTL_W16(CPlusCmd, tp->cp_cmd);

RTL_W16(IntrMitigate, 0x0000);
Expand All @@ -3950,14 +3946,10 @@ static void rtl_hw_start_8101(struct net_device *dev)
RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
rtl_set_rx_tx_config_registers(tp);

RTL_W8(Cfg9346, Cfg9346_Lock);

RTL_R8(IntrMask);

rtl_set_rx_mode(dev);

RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);

RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);

RTL_W16(IntrMask, tp->intr_event);
Expand Down

0 comments on commit d24e9aa

Please sign in to comment.