diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b85ab4a8f2a3..c76dd29c8e9a 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -1228,7 +1228,10 @@ static void rtl8169_hw_phy_config(struct net_device *dev) | |||
1228 | return; | 1228 | return; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | /* phy config for RTL8169s mac_version C chip */ | 1231 | if ((tp->mac_version != RTL_GIGA_MAC_VER_02) && |
1232 | (tp->mac_version != RTL_GIGA_MAC_VER_03)) | ||
1233 | return; | ||
1234 | |||
1232 | mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 | 1235 | mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 |
1233 | mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 | 1236 | mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 |
1234 | mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 | 1237 | mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 |
@@ -1915,7 +1918,11 @@ static void rtl_hw_start_8169(struct net_device *dev) | |||
1915 | 1918 | ||
1916 | rtl_set_rx_max_size(ioaddr); | 1919 | rtl_set_rx_max_size(ioaddr); |
1917 | 1920 | ||
1918 | rtl_set_rx_tx_config_registers(tp); | 1921 | if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || |
1922 | (tp->mac_version == RTL_GIGA_MAC_VER_02) || | ||
1923 | (tp->mac_version == RTL_GIGA_MAC_VER_03) || | ||
1924 | (tp->mac_version == RTL_GIGA_MAC_VER_04)) | ||
1925 | rtl_set_rx_tx_config_registers(tp); | ||
1919 | 1926 | ||
1920 | tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; | 1927 | tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; |
1921 | 1928 | ||
@@ -1938,6 +1945,14 @@ static void rtl_hw_start_8169(struct net_device *dev) | |||
1938 | 1945 | ||
1939 | rtl_set_rx_tx_desc_registers(tp, ioaddr); | 1946 | rtl_set_rx_tx_desc_registers(tp, ioaddr); |
1940 | 1947 | ||
1948 | if ((tp->mac_version != RTL_GIGA_MAC_VER_01) && | ||
1949 | (tp->mac_version != RTL_GIGA_MAC_VER_02) && | ||
1950 | (tp->mac_version != RTL_GIGA_MAC_VER_03) && | ||
1951 | (tp->mac_version != RTL_GIGA_MAC_VER_04)) { | ||
1952 | RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); | ||
1953 | rtl_set_rx_tx_config_registers(tp); | ||
1954 | } | ||
1955 | |||
1941 | RTL_W8(Cfg9346, Cfg9346_Lock); | 1956 | RTL_W8(Cfg9346, Cfg9346_Lock); |
1942 | 1957 | ||
1943 | /* Initially a 10 us delay. Turned it into a PCI commit. - FR */ | 1958 | /* Initially a 10 us delay. Turned it into a PCI commit. - FR */ |
@@ -1952,8 +1967,6 @@ static void rtl_hw_start_8169(struct net_device *dev) | |||
1952 | 1967 | ||
1953 | /* Enable all known interrupts by setting the interrupt mask. */ | 1968 | /* Enable all known interrupts by setting the interrupt mask. */ |
1954 | RTL_W16(IntrMask, tp->intr_event); | 1969 | RTL_W16(IntrMask, tp->intr_event); |
1955 | |||
1956 | RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); | ||
1957 | } | 1970 | } |
1958 | 1971 | ||
1959 | static void rtl_hw_start_8168(struct net_device *dev) | 1972 | static void rtl_hw_start_8168(struct net_device *dev) |
@@ -2567,6 +2580,15 @@ static void rtl8169_tx_interrupt(struct net_device *dev, | |||
2567 | (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { | 2580 | (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { |
2568 | netif_wake_queue(dev); | 2581 | netif_wake_queue(dev); |
2569 | } | 2582 | } |
2583 | /* | ||
2584 | * 8168 hack: TxPoll requests are lost when the Tx packets are | ||
2585 | * too close. Let's kick an extra TxPoll request when a burst | ||
2586 | * of start_xmit activity is detected (if it is not detected, | ||
2587 | * it is slow enough). -- FR | ||
2588 | */ | ||
2589 | smp_rmb(); | ||
2590 | if (tp->cur_tx != dirty_tx) | ||
2591 | RTL_W8(TxPoll, NPQ); | ||
2570 | } | 2592 | } |
2571 | } | 2593 | } |
2572 | 2594 | ||