]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | Commit-Id: 458a9f617adfb2fc5f38e7673339115c4ba3290f |
2 | From: Francois Romieu <romieu@fr.zoreil.com> | |
3 | Date: Sat, 2 Aug 2008 15:50:02 +0200 | |
4 | Acked-by: Karsten Keil <kkeil@novell.com> | |
5 | Reference: bnc#448168 | |
6 | Subject: [PATCH] r8169: Tx performance tweak helper | |
7 | ||
8 | Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> | |
9 | Cc: Edward Hsu <edward_hsu@realtek.com.tw> | |
10 | ||
11 | --- | |
12 | drivers/net/r8169.c | 15 ++++++++++----- | |
13 | 1 file changed, 10 insertions(+), 5 deletions(-) | |
14 | ||
15 | --- a/drivers/net/r8169.c | |
16 | +++ b/drivers/net/r8169.c | |
17 | @@ -2079,12 +2079,20 @@ static void rtl_hw_start_8169(struct net | |
18 | RTL_W16(IntrMask, tp->intr_event); | |
19 | } | |
20 | ||
21 | +static void rtl_tx_performance_tweak(struct pci_dev *pdev, u8 force) | |
22 | +{ | |
23 | + u8 ctl; | |
24 | + | |
25 | + pci_read_config_byte(pdev, 0x69, &ctl); | |
26 | + ctl = (ctl & ~0x70) | force; | |
27 | + pci_write_config_byte(pdev, 0x69, ctl); | |
28 | +} | |
29 | + | |
30 | static void rtl_hw_start_8168(struct net_device *dev) | |
31 | { | |
32 | struct rtl8169_private *tp = netdev_priv(dev); | |
33 | void __iomem *ioaddr = tp->mmio_addr; | |
34 | struct pci_dev *pdev = tp->pci_dev; | |
35 | - u8 ctl; | |
36 | ||
37 | RTL_W8(Cfg9346, Cfg9346_Unlock); | |
38 | ||
39 | @@ -2098,10 +2106,7 @@ static void rtl_hw_start_8168(struct net | |
40 | ||
41 | RTL_W16(CPlusCmd, tp->cp_cmd); | |
42 | ||
43 | - /* Tx performance tweak. */ | |
44 | - pci_read_config_byte(pdev, 0x69, &ctl); | |
45 | - ctl = (ctl & ~0x70) | 0x50; | |
46 | - pci_write_config_byte(pdev, 0x69, ctl); | |
47 | + rtl_tx_performance_tweak(pdev, 0x50); | |
48 | ||
49 | RTL_W16(IntrMitigate, 0x5151); | |
50 |