diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2008-08-02 09:50:02 -0400 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2008-08-17 09:53:04 -0400 |
commit | 458a9f617adfb2fc5f38e7673339115c4ba3290f (patch) | |
tree | 1bae55f41064383b1bffd6163486e0a6bc8dec5c /drivers/net | |
parent | ccdffb9a88b2907b159538d7bfd6256621db4f84 (diff) |
r8169: Tx performance tweak helper
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/r8169.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index dac2677eeede..26fa6e0c6d96 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2054,12 +2054,20 @@ static void rtl_hw_start_8169(struct net_device *dev) | |||
2054 | RTL_W16(IntrMask, tp->intr_event); | 2054 | RTL_W16(IntrMask, tp->intr_event); |
2055 | } | 2055 | } |
2056 | 2056 | ||
2057 | static void rtl_tx_performance_tweak(struct pci_dev *pdev, u8 force) | ||
2058 | { | ||
2059 | u8 ctl; | ||
2060 | |||
2061 | pci_read_config_byte(pdev, 0x69, &ctl); | ||
2062 | ctl = (ctl & ~0x70) | force; | ||
2063 | pci_write_config_byte(pdev, 0x69, ctl); | ||
2064 | } | ||
2065 | |||
2057 | static void rtl_hw_start_8168(struct net_device *dev) | 2066 | static void rtl_hw_start_8168(struct net_device *dev) |
2058 | { | 2067 | { |
2059 | struct rtl8169_private *tp = netdev_priv(dev); | 2068 | struct rtl8169_private *tp = netdev_priv(dev); |
2060 | void __iomem *ioaddr = tp->mmio_addr; | 2069 | void __iomem *ioaddr = tp->mmio_addr; |
2061 | struct pci_dev *pdev = tp->pci_dev; | 2070 | struct pci_dev *pdev = tp->pci_dev; |
2062 | u8 ctl; | ||
2063 | 2071 | ||
2064 | RTL_W8(Cfg9346, Cfg9346_Unlock); | 2072 | RTL_W8(Cfg9346, Cfg9346_Unlock); |
2065 | 2073 | ||
@@ -2073,10 +2081,7 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
2073 | 2081 | ||
2074 | RTL_W16(CPlusCmd, tp->cp_cmd); | 2082 | RTL_W16(CPlusCmd, tp->cp_cmd); |
2075 | 2083 | ||
2076 | /* Tx performance tweak. */ | 2084 | rtl_tx_performance_tweak(pdev, 0x50); |
2077 | pci_read_config_byte(pdev, 0x69, &ctl); | ||
2078 | ctl = (ctl & ~0x70) | 0x50; | ||
2079 | pci_write_config_byte(pdev, 0x69, ctl); | ||
2080 | 2085 | ||
2081 | RTL_W16(IntrMitigate, 0x5151); | 2086 | RTL_W16(IntrMitigate, 0x5151); |
2082 | 2087 | ||