[kernel] r14470 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all/r8169 patches/features/all/r8169 patches/series
Ben Hutchings
benh at alioth.debian.org
Wed Oct 28 01:27:58 UTC 2009
Author: benh
Date: Wed Oct 28 01:27:56 2009
New Revision: 14470
Log:
r8169: Apply various upstream bug fixes
r8169: Add support for RTL8101e (v2), RTL8102e (v1,v2,v3),
RTL8168c/8111c (v3,v4), RTL8168cp/8111cp (v2,v3), RTL8168d (v1)
(Closes: #552465; may fix #516187)
Added:
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-01-add-hw-start-helpers-for-the-8168-and-the-8101.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-02-wake-up-the-PHY-of-the-8168.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-03-update-phy-init-parameters.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-04-new-phy-init-parameters-for-the-8168b.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-05-shuffle-some-registers-handling-around-8168-op.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-06-make-room-for-more-specific-8168-hardware-star.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-07-sync-existing-8168-device-hardware-start-seque.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-08-Don-t-update-statistics-counters-when-interfac.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-09-reset-IntrStatus-after-chip-reset.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-10-Use-a-different-default-for-each-family.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-11-phy-init-for-the-8169sce.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-12-phy-init-for-the-8169scd.patch
dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-13-phy-init-for-the-8169s.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-01-add-8168-8101-registers-description.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-02-additional-8101-and-8102-support.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-03-add-a-new-8168c-flavor.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-04-add-a-new-8168c-flavor-bis.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-05-add-a-new-8168cp-flavor.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-06-change-default-behavior-for-mildly-identified-.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-07-support-additional-8168cp-chipset.patch
dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-08-preliminary-8168d-support.patch
Modified:
dists/lenny/linux-2.6/debian/changelog
dists/lenny/linux-2.6/debian/patches/series/21
Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog Tue Oct 27 16:35:16 2009 (r14469)
+++ dists/lenny/linux-2.6/debian/changelog Wed Oct 28 01:27:56 2009 (r14470)
@@ -3,8 +3,12 @@
[ Ben Hutchings ]
* Fix false soft lockup reports for the nohz idle loop
* nohz: Fix two bugs that can keep a processor idle and lead to a
- system hang (may fix #538158 and others)
+ system hang (may fix #496917, #538158 and others)
* usbmidi: Fix crash when device is disconnected (Closes: #513050)
+ * r8169: Apply various upstream bug fixes
+ * r8169: Add support for RTL8101e (v2), RTL8102e (v1,v2,v3),
+ RTL8168c/8111c (v3,v4), RTL8168cp/8111cp (v2,v3), RTL8168d (v1)
+ (Closes: #552465; may fix #516187)
-- Ben Hutchings <ben at decadent.org.uk> Sat, 24 Oct 2009 23:45:45 +0100
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-01-add-hw-start-helpers-for-the-8168-and-the-8101.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-01-add-hw-start-helpers-for-the-8168-and-the-8101.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,122 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sat, 2 Aug 2008 20:44:13 +0200
+Subject: [PATCH] r8169: add hw start helpers for the 8168 and the 8101
+
+This commit triggers three 'defined but not used' warnings but
+I prefer avoiding to tie these helpers to a specific change in
+the hw start sequences of the 8168 or of the 8101.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -526,6 +526,77 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
+ return value;
+ }
+
++static void mdio_patch(void __iomem *ioaddr, int reg_addr, int value)
++{
++ mdio_write(ioaddr, reg_addr, mdio_read(ioaddr, reg_addr) | value);
++}
++
++static void rtl_ephy_write(void __iomem *ioaddr, int reg_addr, int value)
++{
++ unsigned int i;
++
++ RTL_W32(EPHYAR, EPHYAR_WRITE_CMD | (value & EPHYAR_DATA_MASK) |
++ (reg_addr & EPHYAR_REG_MASK) << EPHYAR_REG_SHIFT);
++
++ for (i = 0; i < 100; i++) {
++ if (!(RTL_R32(EPHYAR) & EPHYAR_FLAG))
++ break;
++ udelay(10);
++ }
++}
++
++static u16 rtl_ephy_read(void __iomem *ioaddr, int reg_addr)
++{
++ u16 value = 0xffff;
++ unsigned int i;
++
++ RTL_W32(EPHYAR, (reg_addr & EPHYAR_REG_MASK) << EPHYAR_REG_SHIFT);
++
++ for (i = 0; i < 100; i++) {
++ if (RTL_R32(EPHYAR) & EPHYAR_FLAG) {
++ value = RTL_R32(EPHYAR) & EPHYAR_DATA_MASK;
++ break;
++ }
++ udelay(10);
++ }
++
++ return value;
++}
++
++static void rtl_csi_write(void __iomem *ioaddr, int addr, int value)
++{
++ unsigned int i;
++
++ RTL_W32(CSIDR, value);
++ RTL_W32(CSIAR, CSIAR_WRITE_CMD | (addr & CSIAR_ADDR_MASK) |
++ CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT);
++
++ for (i = 0; i < 100; i++) {
++ if (!(RTL_R32(CSIAR) & CSIAR_FLAG))
++ break;
++ udelay(10);
++ }
++}
++
++static u32 rtl_csi_read(void __iomem *ioaddr, int addr)
++{
++ u32 value = ~0x00;
++ unsigned int i;
++
++ RTL_W32(CSIAR, (addr & CSIAR_ADDR_MASK) |
++ CSIAR_BYTE_ENABLE << CSIAR_BYTE_ENABLE_SHIFT);
++
++ for (i = 0; i < 100; i++) {
++ if (RTL_R32(CSIAR) & CSIAR_FLAG) {
++ value = RTL_R32(CSIDR);
++ break;
++ }
++ udelay(10);
++ }
++
++ return value;
++}
++
+ static void rtl8169_irq_mask_and_ack(void __iomem *ioaddr)
+ {
+ RTL_W16(IntrMask, 0x0000);
+@@ -2114,6 +2185,31 @@ static void rtl_tx_performance_tweak(struct pci_dev *pdev, u16 force)
+ RTL_W16(IntrMask, tp->intr_event);
+ }
+
++static void rtl_csi_access_enable(void __iomem *ioaddr)
++{
++ u32 csi;
++
++ csi = rtl_csi_read(ioaddr, 0x070c) & 0x00ffffff;
++ rtl_csi_write(ioaddr, 0x070c, csi | 0x27000000);
++}
++
++struct ephy_info {
++ unsigned int offset;
++ u16 mask;
++ u16 bits;
++};
++
++static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len)
++{
++ u16 w;
++
++ while (len-- > 0) {
++ w = (rtl_ephy_read(ioaddr, e->offset) & ~e->mask) | e->bits;
++ rtl_ephy_write(ioaddr, e->offset, w);
++ e++;
++ }
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-02-wake-up-the-PHY-of-the-8168.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-02-wake-up-the-PHY-of-the-8168.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,41 @@
+From a2de6b89b74b28052e293fdb39975a5a03c432e0 Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Thu, 4 Sep 2008 00:17:12 +0200
+Subject: [PATCH] r8169: wake up the PHY of the 8168
+
+This is typically needed when some other OS puts the PHY
+to sleep due to the disabling of WOL options in the BIOS
+of the system.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Tested-by: Chiaki Ishikawa <chiaki.ishikawa at ubin.jp>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+Cc: RyanKao <ryankao at realtek.com.tw>
+---
+ drivers/net/r8169.c | 10 +++++++---
+ 1 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 59fbc64..9881563 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -865,9 +865,13 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+
+ auto_nego |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
+
+- if ((tp->mac_version == RTL_GIGA_MAC_VER_12) ||
+- (tp->mac_version == RTL_GIGA_MAC_VER_17)) {
+- /* Vendor specific (0x1f) and reserved (0x0e) MII registers. */
++ if ((tp->mac_version == RTL_GIGA_MAC_VER_11) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_12) ||
++ (tp->mac_version >= RTL_GIGA_MAC_VER_17)) {
++ /*
++ * Wake up the PHY.
++ * Vendor specific (0x1f) and reserved (0x0e) MII registers.
++ */
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ mdio_write(ioaddr, 0x0e, 0x0000);
+ }
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-03-update-phy-init-parameters.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-03-update-phy-init-parameters.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,74 @@
+From f50d4275422415cfb2a5b94bad3b2b229d0ec1aa Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Fri, 30 May 2008 16:07:07 +0200
+Subject: [PATCH] r8169: update phy init parameters
+
+The modified parameters are synced with Realtek's driver
+version 8.006.00.
+
+The change should only be noticeable with some 8168c.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+---
+ drivers/net/r8169.c | 29 ++++++++++++++++++++++++-----
+ 1 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 9881563..62e1115 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1379,26 +1379,45 @@ static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
+ { 0x1f, 0x0003 },
+ { 0x12, 0xc096 },
+ { 0x16, 0x000a },
+- { 0x1f, 0x0000 }
++ { 0x1f, 0x0000 },
++ { 0x1f, 0x0000 },
++ { 0x09, 0x2000 },
++ { 0x09, 0x0000 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++
++ mdio_patch(ioaddr, 0x14, 1 << 5);
++ mdio_patch(ioaddr, 0x0d, 1 << 5);
++ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
+ static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+- { 0x1f, 0x0000 },
++ { 0x1f, 0x0001 },
+ { 0x12, 0x2300 },
+- { 0x1f, 0x0003 },
+- { 0x16, 0x0f0a },
+- { 0x1f, 0x0000 },
++ { 0x03, 0x802f },
++ { 0x02, 0x4f02 },
++ { 0x01, 0x0409 },
++ { 0x00, 0xf099 },
++ { 0x04, 0x9800 },
++ { 0x04, 0x9000 },
++ { 0x1d, 0x3d98 },
+ { 0x1f, 0x0002 },
+ { 0x0c, 0x7eb8 },
++ { 0x06, 0x0761 },
++ { 0x1f, 0x0003 },
++ { 0x16, 0x0f0a },
+ { 0x1f, 0x0000 }
+ };
+
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++
++ mdio_patch(ioaddr, 0x16, 1 << 0);
++ mdio_patch(ioaddr, 0x14, 1 << 5);
++ mdio_patch(ioaddr, 0x0d, 1 << 5);
++ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
+ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-04-new-phy-init-parameters-for-the-8168b.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-04-new-phy-init-parameters-for-the-8168b.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,58 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Fri, 30 May 2008 16:11:48 +0200
+Subject: [PATCH] r8169: new phy init parameters for the 8168b
+
+The new parameters are synced with Realtek's driver
+version 8.006.00.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1350,6 +1350,30 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x10, 0xf41b },
++ { 0x1f, 0x0000 }
++ };
++
++ mdio_write(ioaddr, 0x1f, 0x0001);
++ mdio_patch(ioaddr, 0x16, 1 << 0);
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++}
++
++static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x10, 0xf41b },
++ { 0x1f, 0x0000 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++}
++
+ static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1458,6 +1482,15 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_04:
+ rtl8169sb_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_11:
++ rtl8168bb_hw_phy_config(ioaddr);
++ break;
++ case RTL_GIGA_MAC_VER_12:
++ rtl8168bef_hw_phy_config(ioaddr);
++ break;
++ case RTL_GIGA_MAC_VER_17:
++ rtl8168bef_hw_phy_config(ioaddr);
++ break;
+ case RTL_GIGA_MAC_VER_18:
+ rtl8168cp_hw_phy_config(ioaddr);
+ break;
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-05-shuffle-some-registers-handling-around-8168-op.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-05-shuffle-some-registers-handling-around-8168-op.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,53 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 1 Jun 2008 12:31:57 +0200
+Subject: [PATCH] r8169: shuffle some registers handling around (8168 operation only)
+
+I can not argue strongly for (or against) a specific ordering
+on a purely technical ground but the patch avoids to swallow
+Realtek's changes in one big, hard-to-read gulp.
+
+Let aside the way the RxConfig register is written (see
+rtl_set_rx_tx_config_registers / RxConfig / rtl_set_rx_mode),
+this change brings the registers write ordering closer with
+Realtek's driver one (version 8.006.00) for the 8168 chipsets.
+
+More 8168 specific code which touches the Configx registers will
+be added in the section covered by Cfg9346_UnLock / Cfg9346_Lock.
+
+This code should not be the cause of regression for 810x and
+8110 users.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2396,8 +2396,6 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
+
+- rtl_set_rx_tx_config_registers(tp);
+-
+ tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1;
+
+ RTL_W16(CPlusCmd, tp->cp_cmd);
+@@ -2414,14 +2410,17 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ rtl_set_rx_tx_desc_registers(tp, ioaddr);
+
+- RTL_W8(Cfg9346, Cfg9346_Lock);
++ rtl_set_rx_mode(dev);
++
++ RTL_W32(TxConfig, (TX_DMA_BURST << TxDMAShift) |
++ (InterFrameGap << TxInterFrameGapShift));
+
+ RTL_R8(IntrMask);
+
+- rtl_set_rx_mode(dev);
+-
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+
++ RTL_W8(Cfg9346, Cfg9346_Lock);
++
+ RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000);
+
+ RTL_W16(IntrMask, tp->intr_event);
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-06-make-room-for-more-specific-8168-hardware-star.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-06-make-room-for-more-specific-8168-hardware-star.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,117 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sat, 28 Jun 2008 11:58:39 +0200
+Subject: [PATCH] r8169: make room for more specific 8168 hardware start procedure
+
+Broadly speaking the 8168c* share some common code which will
+be factored in __rtl_hw_start_8168cp. The 8168b* share some
+code too but it will be a bit different.
+
+Any change of behavior should be confined to the currently
+unidentified 8168 chipsets. They will not be applied the Tx
+performance tweak and will emit a warning instead.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1387,7 +1387,7 @@ static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1416,7 +1416,7 @@ static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
+-static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0001 },
+@@ -1495,10 +1495,10 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ rtl8168cp_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_19:
+- rtl8168c_hw_phy_config(ioaddr);
++ rtl8168c_1_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_20:
+- rtl8168cx_hw_phy_config(ioaddr);
++ rtl8168c_2_hw_phy_config(ioaddr);
+ break;
+ default:
+ break;
+@@ -2384,6 +2384,34 @@ static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len)
+ }
+ }
+
++static void rtl_hw_start_8168bb(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++}
++
++static void rtl_hw_start_8168bef(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_hw_start_8168bb(ioaddr, pdev);
++}
++
++static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++}
++
++static void rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ __rtl_hw_start_8168cp(ioaddr, pdev);
++}
++
++static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ __rtl_hw_start_8168cp(ioaddr, pdev);
++}
++
++static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ __rtl_hw_start_8168cp(ioaddr, pdev);
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2417,6 +2447,34 @@ static void rtl_hw_start_8168(struct net_device *dev)
+
+ RTL_R8(IntrMask);
+
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_11:
++ rtl_hw_start_8168bb(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_12:
++ case RTL_GIGA_MAC_VER_17:
++ rtl_hw_start_8168bef(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_18:
++ rtl_hw_start_8168cp(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_19:
++ rtl_hw_start_8168c_1(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_20:
++ rtl_hw_start_8168c_2(ioaddr, pdev);
++ break;
++
++ default:
++ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
++ dev->name, tp->mac_version);
++ break;
++ }
++
+ RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
+
+ RTL_W8(Cfg9346, Cfg9346_Lock);
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-07-sync-existing-8168-device-hardware-start-seque.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-07-sync-existing-8168-device-hardware-start-seque.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,117 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sat, 28 Jun 2008 12:22:59 +0200
+Subject: [PATCH] r8169: sync existing 8168 device hardware start sequences with vendor driver
+
+This part of the driver should be reasonably in line with Realtek's
+8.006.00 driver.
+
+I have left some bits related to jumbo frame and optional features
+aside for now.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2384,31 +2384,102 @@ static void rtl_ephy_init(void __iomem *ioaddr, struct ephy_info *e, int len)
+ }
+ }
+
++static void rtl_disable_clock_request(struct pci_dev *pdev)
++{
++ int cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
++
++ if (cap) {
++ u16 ctl;
++
++ pci_read_config_word(pdev, cap + PCI_EXP_LNKCTL, &ctl);
++ ctl &= ~PCI_EXP_LNKCTL_CLKREQ_EN;
++ pci_write_config_word(pdev, cap + PCI_EXP_LNKCTL, ctl);
++ }
++}
++
++#define R8168_CPCMD_QUIRK_MASK (\
++ EnableBist | \
++ Mac_dbgo_oe | \
++ Force_half_dup | \
++ Force_rxflow_en | \
++ Force_txflow_en | \
++ Cxpl_dbg_sel | \
++ ASF | \
++ PktCntrDisable | \
++ Mac_dbgo_sel)
++
+ static void rtl_hw_start_8168bb(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
++ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
++
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
+ }
+
+ static void rtl_hw_start_8168bef(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+ rtl_hw_start_8168bb(ioaddr, pdev);
++
++ RTL_W8(EarlyTxThres, EarlyTxThld);
++
++ RTL_W8(Config4, RTL_R8(Config4) & ~(1 << 0));
+ }
+
+ static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
++ RTL_W8(Config1, RTL_R8(Config1) | Speed_down);
++
++ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
++
++ rtl_disable_clock_request(pdev);
++
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
+ }
+
+ static void rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
++ static struct ephy_info e_info_8168cp[] = {
++ { 0x01, 0, 0x0001 },
++ { 0x02, 0x0800, 0x1000 },
++ { 0x03, 0, 0x0042 },
++ { 0x06, 0x0080, 0x0000 },
++ { 0x07, 0, 0x2000 }
++ };
++
++ rtl_csi_access_enable(ioaddr);
++
++ rtl_ephy_init(ioaddr, e_info_8168cp, ARRAY_SIZE(e_info_8168cp));
++
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
+ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
++ static struct ephy_info e_info_8168c_1[] = {
++ { 0x02, 0x0800, 0x1000 },
++ { 0x03, 0, 0x0002 },
++ { 0x06, 0x0080, 0x0000 }
++ };
++
++ rtl_csi_access_enable(ioaddr);
++
++ RTL_W8(DBG_REG, 0x06 | FIX_NAK_1 | FIX_NAK_2);
++
++ rtl_ephy_init(ioaddr, e_info_8168c_1, ARRAY_SIZE(e_info_8168c_1));
++
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
+ static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
++ static struct ephy_info e_info_8168c_2[] = {
++ { 0x01, 0, 0x0001 },
++ { 0x03, 0x0400, 0x0220 }
++ };
++
++ rtl_csi_access_enable(ioaddr);
++
++ rtl_ephy_init(ioaddr, e_info_8168c_2, ARRAY_SIZE(e_info_8168c_2));
++
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-08-Don-t-update-statistics-counters-when-interfac.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-08-Don-t-update-statistics-counters-when-interfac.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,169 @@
+Based on:
+
+From: Ivan Vecera <ivecera at redhat.com>
+Date: Fri, 6 Feb 2009 21:49:57 -0800
+Subject: [PATCH] r8169: Don't update statistics counters when interface is down
+
+Some Realtek chips (RTL8169sb/8110sb in my case) are unable to retrieve
+ethtool statistics when the interface is down. The process stays in
+endless loop in rtl8169_get_ethtool_stats. This is because these chips
+need to have receiver enabled (CmdRxEnb bit in ChipCmd register) that is
+cleared when the interface is going down. It's better to update statistics
+only when the interface is up and otherwise return copy of statistics
+grabbed when the interface was up (in rtl8169_close).
+
+It is interesting that PCI-E NICs (like 8168b/8111b...) are not affected.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -437,6 +437,22 @@ enum features {
+ RTL_FEATURE_MSI = (1 << 1),
+ };
+
++struct rtl8169_counters {
++ __le64 tx_packets;
++ __le64 rx_packets;
++ __le64 tx_errors;
++ __le32 rx_errors;
++ __le16 rx_missed;
++ __le16 align_errors;
++ __le32 tx_one_collision;
++ __le32 tx_multi_collision;
++ __le64 rx_unicast;
++ __le64 rx_broadcast;
++ __le32 rx_multicast;
++ __le16 tx_aborted;
++ __le16 tx_underun;
++};
++
+ struct rtl8169_private {
+ void __iomem *mmio_addr; /* memory map physical address */
+ struct pci_dev *pci_dev; /* Index of PCI device */
+@@ -480,6 +496,7 @@ struct rtl8169_private {
+ unsigned int (*link_ok)(void __iomem *);
+ struct delayed_work task;
+ unsigned features;
++ struct rtl8169_counters counters;
+ };
+
+ MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev at vger.kernel.org>");
+@@ -1100,22 +1117,6 @@ static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
+ "tx_underrun",
+ };
+
+-struct rtl8169_counters {
+- __le64 tx_packets;
+- __le64 rx_packets;
+- __le64 tx_errors;
+- __le32 rx_errors;
+- __le16 rx_missed;
+- __le16 align_errors;
+- __le32 tx_one_collision;
+- __le32 tx_multi_collision;
+- __le64 rx_unicast;
+- __le64 rx_broadcast;
+- __le32 rx_multicast;
+- __le16 tx_aborted;
+- __le16 tx_underun;
+-};
+-
+ static int rtl8169_get_sset_count(struct net_device *dev, int sset)
+ {
+ switch (sset) {
+@@ -1126,16 +1127,21 @@ static int rtl8169_get_sset_count(struct net_device *dev, int sset)
+ }
+ }
+
+-static void rtl8169_get_ethtool_stats(struct net_device *dev,
+- struct ethtool_stats *stats, u64 *data)
++static void rtl8169_update_counters(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+ void __iomem *ioaddr = tp->mmio_addr;
+ struct rtl8169_counters *counters;
+ dma_addr_t paddr;
+ u32 cmd;
++ int wait = 1000;
+
+- ASSERT_RTNL();
++ /*
++ * Some chips are unable to dump tally counters when the receiver
++ * is disabled.
++ */
++ if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
++ return;
+
+ counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr);
+ if (!counters)
+@@ -1146,31 +1152,45 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
+ RTL_W32(CounterAddrLow, cmd);
+ RTL_W32(CounterAddrLow, cmd | CounterDump);
+
+- while (RTL_R32(CounterAddrLow) & CounterDump) {
+- if (msleep_interruptible(1))
++ while (wait--) {
++ if ((RTL_R32(CounterAddrLow) & CounterDump) == 0) {
++ /* copy updated counters */
++ memcpy(&tp->counters, counters, sizeof(*counters));
+ break;
++ }
++ udelay(10);
+ }
+
+ RTL_W32(CounterAddrLow, 0);
+ RTL_W32(CounterAddrHigh, 0);
+
+- data[0] = le64_to_cpu(counters->tx_packets);
+- data[1] = le64_to_cpu(counters->rx_packets);
+- data[2] = le64_to_cpu(counters->tx_errors);
+- data[3] = le32_to_cpu(counters->rx_errors);
+- data[4] = le16_to_cpu(counters->rx_missed);
+- data[5] = le16_to_cpu(counters->align_errors);
+- data[6] = le32_to_cpu(counters->tx_one_collision);
+- data[7] = le32_to_cpu(counters->tx_multi_collision);
+- data[8] = le64_to_cpu(counters->rx_unicast);
+- data[9] = le64_to_cpu(counters->rx_broadcast);
+- data[10] = le32_to_cpu(counters->rx_multicast);
+- data[11] = le16_to_cpu(counters->tx_aborted);
+- data[12] = le16_to_cpu(counters->tx_underun);
+-
+ pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
+ }
+
++static void rtl8169_get_ethtool_stats(struct net_device *dev,
++ struct ethtool_stats *stats, u64 *data)
++{
++ struct rtl8169_private *tp = netdev_priv(dev);
++
++ ASSERT_RTNL();
++
++ rtl8169_update_counters(dev);
++
++ data[0] = le64_to_cpu(tp->counters.tx_packets);
++ data[1] = le64_to_cpu(tp->counters.rx_packets);
++ data[2] = le64_to_cpu(tp->counters.tx_errors);
++ data[3] = le32_to_cpu(tp->counters.rx_errors);
++ data[4] = le16_to_cpu(tp->counters.rx_missed);
++ data[5] = le16_to_cpu(tp->counters.align_errors);
++ data[6] = le32_to_cpu(tp->counters.tx_one_collision);
++ data[7] = le32_to_cpu(tp->counters.tx_multi_collision);
++ data[8] = le64_to_cpu(tp->counters.rx_unicast);
++ data[9] = le64_to_cpu(tp->counters.rx_broadcast);
++ data[10] = le32_to_cpu(tp->counters.rx_multicast);
++ data[11] = le16_to_cpu(tp->counters.tx_aborted);
++ data[12] = le16_to_cpu(tp->counters.tx_underun);
++}
++
+ static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
+ {
+ switch(stringset) {
+@@ -3682,6 +3702,9 @@ static int rtl8169_close(struct net_device *dev)
+ struct rtl8169_private *tp = netdev_priv(dev);
+ struct pci_dev *pdev = tp->pci_dev;
+
++ /* update counters before going down */
++ rtl8169_update_counters(dev);
++
+ rtl8169_down(dev);
+
+ free_irq(dev->irq, dev);
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-09-reset-IntrStatus-after-chip-reset.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-09-reset-IntrStatus-after-chip-reset.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,41 @@
+Based on:
+
+From: Karsten Wiese <fzu at wemgehoertderstaat.de>
+Date: Thu, 2 Apr 2009 01:06:01 -0700
+Subject: [PATCH] r8169: reset IntrStatus after chip reset
+
+Original comment (Karsten):
+On a MSI MS-6702E mainboard, when in rtl8169_init_one() for the first time
+after BIOS has run, IntrStatus reads 5 after chip has been reset.
+IntrStatus should equal 0 there, so patch changes IntrStatus reset to happen
+after chip reset instead of before.
+
+Remark (Francois):
+Assuming that the loglevel of the driver is increased above NETIF_MSG_INTR,
+the bug reveals itself with a typical "interrupt 0025 in poll" message
+at startup. In retrospect, the message should had been read as an hint of
+an unexpected hardware state several months ago :o(
+
+Fixes (at least part of) https://bugzilla.redhat.com/show_bug.cgi?id=460747
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -2075,8 +2075,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ goto err_out_free_res_4;
+ }
+
+- /* Unneeded ? Don't mess with Mrs. Murphy. */
+- rtl8169_irq_mask_and_ack(ioaddr);
++ RTL_W16(IntrMask, 0x0000);
+
+ /* Soft reset the chip. */
+ RTL_W8(ChipCmd, CmdReset);
+@@ -2088,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ msleep_interruptible(1);
+ }
+
++ RTL_W16(IntrStatus, 0xffff);
++
+ /* Identify chip attached to board */
+ rtl8169_get_mac_version(tp, ioaddr);
+
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-10-Use-a-different-default-for-each-family.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-10-Use-a-different-default-for-each-family.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,116 @@
+Based on:
+
+From: Jean Delvare <jdelvare at suse.de>
+Date: Tue, 26 May 2009 20:54:48 -0700
+Subject: [PATCH] r8169: Use a different default for each family
+
+The r8169 driver supports 3 different families of network chips
+(RTL8169, RTL8168 and RTL8101). When an unknown version is found, the
+driver currently always defaults to the RTL8169 variant. This has very
+little chance to ever work for chips of the other families. So better
+define a per-family default.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -94,6 +94,7 @@ static const int multicast_filter_limit = 32;
+ #define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg)))
+
+ enum mac_version {
++ RTL_GIGA_MAC_NONE = 0x00,
+ RTL_GIGA_MAC_VER_01 = 0x01, // 8169
+ RTL_GIGA_MAC_VER_02 = 0x02, // 8169S
+ RTL_GIGA_MAC_VER_03 = 0x03, // 8110S
+@@ -1300,7 +1301,8 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ { 0xfc800000, 0x00800000, RTL_GIGA_MAC_VER_02 },
+ { 0xfc800000, 0x00000000, RTL_GIGA_MAC_VER_01 },
+
+- { 0x00000000, 0x00000000, RTL_GIGA_MAC_VER_01 } /* Catch-all */
++ /* Catch-all */
++ { 0x00000000, 0x00000000, RTL_GIGA_MAC_NONE }
+ }, *p = mac_info;
+ u32 reg;
+
+@@ -1308,12 +1310,6 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ while ((reg & p->mask) != p->val)
+ p++;
+ tp->mac_version = p->mac_version;
+-
+- if (p->mask == 0x00000000) {
+- struct pci_dev *pdev = tp->pci_dev;
+-
+- dev_info(&pdev->dev, "unknown MAC (%08x)\n", reg);
+- }
+ }
+
+ static void rtl8169_print_mac_version(struct rtl8169_private *tp)
+@@ -1889,6 +1885,7 @@ static const struct rtl_cfg_info {
+ u16 intr_event;
+ u16 napi_event;
+ unsigned msi;
++ u8 default_ver;
+ } rtl_cfg_infos [] = {
+ [RTL_CFG_0] = {
+ .hw_start = rtl_hw_start_8169,
+@@ -1897,7 +1894,8 @@ static const struct rtl_cfg_info {
+ .intr_event = SYSErr | LinkChg | RxOverflow |
+ RxFIFOOver | TxErr | TxOK | RxOK | RxErr,
+ .napi_event = RxFIFOOver | TxErr | TxOK | RxOK | RxOverflow,
+- .msi = 0
++ .msi = 0,
++ .default_ver = RTL_GIGA_MAC_VER_01,
+ },
+ [RTL_CFG_1] = {
+ .hw_start = rtl_hw_start_8168,
+@@ -1906,7 +1904,8 @@ static const struct rtl_cfg_info {
+ .intr_event = SYSErr | LinkChg | RxOverflow |
+ TxErr | TxOK | RxOK | RxErr,
+ .napi_event = TxErr | TxOK | RxOK | RxOverflow,
+- .msi = RTL_FEATURE_MSI
++ .msi = RTL_FEATURE_MSI,
++ .default_ver = RTL_GIGA_MAC_VER_11,
+ },
+ [RTL_CFG_2] = {
+ .hw_start = rtl_hw_start_8101,
+@@ -1915,7 +1914,8 @@ static const struct rtl_cfg_info {
+ .intr_event = SYSErr | LinkChg | RxOverflow | PCSTimeout |
+ RxFIFOOver | TxErr | TxOK | RxOK | RxErr,
+ .napi_event = RxFIFOOver | TxErr | TxOK | RxOK | RxOverflow,
+- .msi = RTL_FEATURE_MSI
++ .msi = RTL_FEATURE_MSI,
++ .default_ver = RTL_GIGA_MAC_VER_13,
+ }
+ };
+
+@@ -2096,6 +2096,15 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ /* Identify chip attached to board */
+ rtl8169_get_mac_version(tp, ioaddr);
+
++ /* Use appropriate default if unknown */
++ if (tp->mac_version == RTL_GIGA_MAC_NONE) {
++ if (netif_msg_probe(tp)) {
++ dev_notice(&pdev->dev,
++ "unknown MAC, using family default\n");
++ }
++ tp->mac_version = cfg->default_ver;
++ }
++
+ rtl8169_print_mac_version(tp);
+
+ for (i = 0; i < ARRAY_SIZE(rtl_chip_info); i++) {
+@@ -2103,13 +2112,9 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ break;
+ }
+ if (i == ARRAY_SIZE(rtl_chip_info)) {
+- /* Unknown chip: assume array element #0, original RTL-8169 */
+- if (netif_msg_probe(tp)) {
+- dev_printk(KERN_DEBUG, &pdev->dev,
+- "unknown chip version, assuming %s\n",
+- rtl_chip_info[0].name);
+- }
+- i = 0;
++ dev_err(&pdev->dev,
++ "driver bug, MAC version not found in rtl_chip_info\n");
++ goto err_out_msi_5;
+ }
+ tp->chipset = i;
+
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-11-phy-init-for-the-8169sce.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-11-phy-init-for-the-8169sce.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,80 @@
+Based on:
+
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 10 Aug 2009 19:43:29 +0000
+Subject: [PATCH] r8169: phy init for the 8169sce
+
+Synced with Realtek's 6.011.00 r8169 driver.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1389,6 +1389,59 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x04, 0x0000 },
++ { 0x03, 0x00a1 },
++ { 0x02, 0x0008 },
++ { 0x01, 0x0120 },
++ { 0x00, 0x1000 },
++ { 0x04, 0x0800 },
++ { 0x04, 0x9000 },
++ { 0x03, 0x802f },
++ { 0x02, 0x4f02 },
++ { 0x01, 0x0409 },
++ { 0x00, 0xf099 },
++ { 0x04, 0x9800 },
++ { 0x04, 0xa000 },
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0xff95 },
++ { 0x00, 0xba00 },
++ { 0x04, 0xa800 },
++ { 0x04, 0xf000 },
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0x101a },
++ { 0x00, 0xa0ff },
++ { 0x04, 0xf800 },
++ { 0x04, 0x0000 },
++ { 0x1f, 0x0000 },
++
++ { 0x1f, 0x0001 },
++ { 0x0b, 0x8480 },
++ { 0x1f, 0x0000 },
++
++ { 0x1f, 0x0001 },
++ { 0x18, 0x67c7 },
++ { 0x04, 0x2000 },
++ { 0x03, 0x002f },
++ { 0x02, 0x4360 },
++ { 0x01, 0x0109 },
++ { 0x00, 0x3022 },
++ { 0x04, 0x2800 },
++ { 0x1f, 0x0000 },
++
++ { 0x1f, 0x0001 },
++ { 0x17, 0x0cc0 },
++ { 0x1f, 0x0000 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++}
++
+ static void rtl8168bb_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1628,6 +1681,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_04:
+ rtl8169sb_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_06:
++ rtl8169sce_hw_phy_config(ioaddr);
++ break;
+ case RTL_GIGA_MAC_VER_11:
+ rtl8168bb_hw_phy_config(ioaddr);
+ break;
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-12-phy-init-for-the-8169scd.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-12-phy-init-for-the-8169scd.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,92 @@
+Based on:
+
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 10 Aug 2009 19:44:19 +0000
+Subject: [PATCH] r8169: phy init for the 8169scd
+
+Synced with Realtek's 6.011.00 r8169 driver.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1389,6 +1389,71 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp,
++ void __iomem *ioaddr)
++{
++ struct pci_dev *pdev = tp->pci_dev;
++ u16 vendor_id, device_id;
++
++ pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor_id);
++ pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &device_id);
++
++ if ((vendor_id != 0x1458) || (device_id != 0xe000))
++ return;
++
++ mdio_write(ioaddr, 0x1f, 0x0001);
++ mdio_write(ioaddr, 0x10, 0xf01b);
++ mdio_write(ioaddr, 0x1f, 0x0000);
++}
++
++static void rtl8169scd_hw_phy_config(struct rtl8169_private *tp,
++ void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x04, 0x0000 },
++ { 0x03, 0x00a1 },
++ { 0x02, 0x0008 },
++ { 0x01, 0x0120 },
++ { 0x00, 0x1000 },
++ { 0x04, 0x0800 },
++ { 0x04, 0x9000 },
++ { 0x03, 0x802f },
++ { 0x02, 0x4f02 },
++ { 0x01, 0x0409 },
++ { 0x00, 0xf099 },
++ { 0x04, 0x9800 },
++ { 0x04, 0xa000 },
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0xff95 },
++ { 0x00, 0xba00 },
++ { 0x04, 0xa800 },
++ { 0x04, 0xf000 },
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0x101a },
++ { 0x00, 0xa0ff },
++ { 0x04, 0xf800 },
++ { 0x04, 0x0000 },
++ { 0x1f, 0x0000 },
++
++ { 0x1f, 0x0001 },
++ { 0x10, 0xf41b },
++ { 0x14, 0xfb54 },
++ { 0x18, 0xf5c7 },
++ { 0x1f, 0x0000 },
++
++ { 0x1f, 0x0001 },
++ { 0x17, 0x0cc0 },
++ { 0x1f, 0x0000 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++
++ rtl8169scd_hw_phy_config_quirk(tp, ioaddr);
++}
++
+ static void rtl8169sce_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1681,6 +1746,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_04:
+ rtl8169sb_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_05:
++ rtl8169scd_hw_phy_config(tp, ioaddr);
++ break;
+ case RTL_GIGA_MAC_VER_06:
+ rtl8169sce_hw_phy_config(ioaddr);
+ break;
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-13-phy-init-for-the-8169s.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/r8169/r8169-13-phy-init-for-the-8169s.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,154 @@
+From 0b9b571d246d1c2621a5e4e5a0fa5cb95e18365d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 10 Aug 2009 19:44:56 +0000
+Subject: [PATCH] r8169: phy init for the 8169s
+
+Synced with Realtek's 6.011.00 r8169 driver.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/r8169.c | 116 ++++++++++++++++++++++++++------------------------
+ 1 files changed, 60 insertions(+), 56 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 4470fef..93a87aa 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1222,17 +1222,6 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
+ .get_ethtool_stats = rtl8169_get_ethtool_stats,
+ };
+
+-static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg,
+- int bitnum, int bitval)
+-{
+- int val;
+-
+- val = mdio_read(ioaddr, reg);
+- val = (bitval == 1) ?
+- val | (bitval << bitnum) : val & ~(0x0001 << bitnum);
+- mdio_write(ioaddr, reg, val & 0xffff);
+-}
+-
+ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ void __iomem *ioaddr)
+ {
+@@ -1328,54 +1317,69 @@ static void rtl_phy_write(void __iomem *ioaddr, struct phy_reg *regs, int len)
+
+ static void rtl8169s_hw_phy_config(void __iomem *ioaddr)
+ {
+- struct {
+- u16 regs[5]; /* Beware of bit-sign propagation */
+- } phy_magic[5] = { {
+- { 0x0000, //w 4 15 12 0
+- 0x00a1, //w 3 15 0 00a1
+- 0x0008, //w 2 15 0 0008
+- 0x1020, //w 1 15 0 1020
+- 0x1000 } },{ //w 0 15 0 1000
+- { 0x7000, //w 4 15 12 7
+- 0xff41, //w 3 15 0 ff41
+- 0xde60, //w 2 15 0 de60
+- 0x0140, //w 1 15 0 0140
+- 0x0077 } },{ //w 0 15 0 0077
+- { 0xa000, //w 4 15 12 a
+- 0xdf01, //w 3 15 0 df01
+- 0xdf20, //w 2 15 0 df20
+- 0xff95, //w 1 15 0 ff95
+- 0xfa00 } },{ //w 0 15 0 fa00
+- { 0xb000, //w 4 15 12 b
+- 0xff41, //w 3 15 0 ff41
+- 0xde20, //w 2 15 0 de20
+- 0x0140, //w 1 15 0 0140
+- 0x00bb } },{ //w 0 15 0 00bb
+- { 0xf000, //w 4 15 12 f
+- 0xdf01, //w 3 15 0 df01
+- 0xdf20, //w 2 15 0 df20
+- 0xff95, //w 1 15 0 ff95
+- 0xbf00 } //w 0 15 0 bf00
+- }
+- }, *p = phy_magic;
+- unsigned int i;
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x06, 0x006e },
++ { 0x08, 0x0708 },
++ { 0x15, 0x4000 },
++ { 0x18, 0x65c7 },
+
+- mdio_write(ioaddr, 0x1f, 0x0001); //w 31 2 0 1
+- mdio_write(ioaddr, 0x15, 0x1000); //w 21 15 0 1000
+- mdio_write(ioaddr, 0x18, 0x65c7); //w 24 15 0 65c7
+- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
++ { 0x1f, 0x0001 },
++ { 0x03, 0x00a1 },
++ { 0x02, 0x0008 },
++ { 0x01, 0x0120 },
++ { 0x00, 0x1000 },
++ { 0x04, 0x0800 },
++ { 0x04, 0x0000 },
+
+- for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) {
+- int val, pos = 4;
++ { 0x03, 0xff41 },
++ { 0x02, 0xdf60 },
++ { 0x01, 0x0140 },
++ { 0x00, 0x0077 },
++ { 0x04, 0x7800 },
++ { 0x04, 0x7000 },
+
+- val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff);
+- mdio_write(ioaddr, pos, val);
+- while (--pos >= 0)
+- mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff);
+- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1
+- rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0
+- }
+- mdio_write(ioaddr, 0x1f, 0x0000); //w 31 2 0 0
++ { 0x03, 0x802f },
++ { 0x02, 0x4f02 },
++ { 0x01, 0x0409 },
++ { 0x00, 0xf0f9 },
++ { 0x04, 0x9800 },
++ { 0x04, 0x9000 },
++
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0xff95 },
++ { 0x00, 0xba00 },
++ { 0x04, 0xa800 },
++ { 0x04, 0xa000 },
++
++ { 0x03, 0xff41 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0x0140 },
++ { 0x00, 0x00bb },
++ { 0x04, 0xb800 },
++ { 0x04, 0xb000 },
++
++ { 0x03, 0xdf41 },
++ { 0x02, 0xdc60 },
++ { 0x01, 0x6340 },
++ { 0x00, 0x007d },
++ { 0x04, 0xd800 },
++ { 0x04, 0xd000 },
++
++ { 0x03, 0xdf01 },
++ { 0x02, 0xdf20 },
++ { 0x01, 0x100a },
++ { 0x00, 0xa0ff },
++ { 0x04, 0xf800 },
++ { 0x04, 0xf000 },
++
++ { 0x1f, 0x0000 },
++ { 0x0b, 0x0000 },
++ { 0x00, 0x9200 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-01-add-8168-8101-registers-description.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-01-add-8168-8101-registers-description.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,101 @@
+From f162a5d1b326d54b0be7e3100f69763d8a707721 Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 1 Jun 2008 22:37:49 +0200
+Subject: [PATCH] r8169: add 8168/8101 registers description
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+---
+ drivers/net/r8169.c | 47 +++++++++++++++++++++++++++++++++++++++++++----
+ 1 files changed, 43 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index ae149a9..600540e 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -197,9 +197,6 @@ enum rtl_registers {
+ Config5 = 0x56,
+ MultiIntr = 0x5c,
+ PHYAR = 0x60,
+- TBICSR = 0x64,
+- TBI_ANAR = 0x68,
+- TBI_LPAR = 0x6a,
+ PHYstatus = 0x6c,
+ RxMaxSize = 0xda,
+ CPlusCmd = 0xe0,
+@@ -213,6 +210,32 @@ enum rtl_registers {
+ FuncForceEvent = 0xfc,
+ };
+
++enum rtl8110_registers {
++ TBICSR = 0x64,
++ TBI_ANAR = 0x68,
++ TBI_LPAR = 0x6a,
++};
++
++enum rtl8168_8101_registers {
++ CSIDR = 0x64,
++ CSIAR = 0x68,
++#define CSIAR_FLAG 0x80000000
++#define CSIAR_WRITE_CMD 0x80000000
++#define CSIAR_BYTE_ENABLE 0x0f
++#define CSIAR_BYTE_ENABLE_SHIFT 12
++#define CSIAR_ADDR_MASK 0x0fff
++
++ EPHYAR = 0x80,
++#define EPHYAR_FLAG 0x80000000
++#define EPHYAR_WRITE_CMD 0x80000000
++#define EPHYAR_REG_MASK 0x1f
++#define EPHYAR_REG_SHIFT 16
++#define EPHYAR_DATA_MASK 0xffff
++ DBG_REG = 0xd1,
++#define FIX_NAK_1 (1 << 4)
++#define FIX_NAK_2 (1 << 3)
++};
++
+ enum rtl_register_content {
+ /* InterruptStatusBits */
+ SYSErr = 0x8000,
+@@ -266,7 +289,13 @@ enum rtl_register_content {
+ TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */
+
+ /* Config1 register p.24 */
++ LEDS1 = (1 << 7),
++ LEDS0 = (1 << 6),
+ MSIEnable = (1 << 5), /* Enable Message Signaled Interrupt */
++ Speed_down = (1 << 4),
++ MEMMAP = (1 << 3),
++ IOMAP = (1 << 2),
++ VPD = (1 << 1),
+ PMEnable = (1 << 0), /* Power Management Enable */
+
+ /* Config2 register p. 25 */
+@@ -276,6 +305,7 @@ enum rtl_register_content {
+ /* Config3 register p.25 */
+ MagicPacket = (1 << 5), /* Wake up when receives a Magic Packet */
+ LinkUp = (1 << 4), /* Wake up when the cable connection is re-established */
++ Beacon_en = (1 << 0), /* 8168 only. Reserved in the 8168b */
+
+ /* Config5 register p.27 */
+ BWF = (1 << 6), /* Accept Broadcast wakeup frame */
+@@ -293,7 +323,16 @@ enum rtl_register_content {
+ TBINwComplete = 0x01000000,
+
+ /* CPlusCmd p.31 */
+- PktCntrDisable = (1 << 7), // 8168
++ EnableBist = (1 << 15), // 8168 8101
++ Mac_dbgo_oe = (1 << 14), // 8168 8101
++ Normal_mode = (1 << 13), // unused
++ Force_half_dup = (1 << 12), // 8168 8101
++ Force_rxflow_en = (1 << 11), // 8168 8101
++ Force_txflow_en = (1 << 10), // 8168 8101
++ Cxpl_dbg_sel = (1 << 9), // 8168 8101
++ ASF = (1 << 8), // 8168 8101
++ PktCntrDisable = (1 << 7), // 8168 8101
++ Mac_dbgo_sel = 0x001c, // 8168
+ RxVlan = (1 << 6),
+ RxChkSum = (1 << 5),
+ PCIDAC = (1 << 4),
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-02-additional-8101-and-8102-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-02-additional-8101-and-8102-support.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,203 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sat, 2 Aug 2008 21:08:49 +0200
+Subject: [PATCH] r8169: additional 8101 and 8102 support
+
+and:
+
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 10 Aug 2009 19:41:52 +0000
+Subject: [PATCH] r8169: fix r8101 quirk dupe
+
+Noticed by Vincent Pelletier <plr.vincent at gmail.com>.
+
+and:
+
+From: =?UTF-8?q?fran=C3=A7ois=20romieu?= <romieu at fr.zoreil.com>
+Date: Mon, 10 Aug 2009 19:45:48 +0000
+Subject: [PATCH] r8169: phy init for the 8102e
+
+Synced with Realtek's 1.013.00 r8101 driver.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -96,6 +96,10 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_04 = 0x04, // 8169SB
+ RTL_GIGA_MAC_VER_05 = 0x05, // 8110SCd
+ RTL_GIGA_MAC_VER_06 = 0x06, // 8110SCe
++ RTL_GIGA_MAC_VER_07 = 0x07, // 8102e
++ RTL_GIGA_MAC_VER_08 = 0x08, // 8102e
++ RTL_GIGA_MAC_VER_09 = 0x09, // 8102e
++ RTL_GIGA_MAC_VER_10 = 0x0a, // 8101e
+ RTL_GIGA_MAC_VER_11 = 0x0b, // 8168Bb
+ RTL_GIGA_MAC_VER_12 = 0x0c, // 8168Be
+ RTL_GIGA_MAC_VER_13 = 0x0d, // 8101Eb
+@@ -122,6 +126,10 @@ static const struct {
+ _R("RTL8169sb/8110sb", RTL_GIGA_MAC_VER_04, 0xff7e1880), // 8169SB
+ _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_05, 0xff7e1880), // 8110SCd
+ _R("RTL8169sc/8110sc", RTL_GIGA_MAC_VER_06, 0xff7e1880), // 8110SCe
++ _R("RTL8102e", RTL_GIGA_MAC_VER_07, 0xff7e1880), // PCI-E
++ _R("RTL8102e", RTL_GIGA_MAC_VER_08, 0xff7e1880), // PCI-E
++ _R("RTL8102e", RTL_GIGA_MAC_VER_09, 0xff7e1880), // PCI-E
++ _R("RTL8101e", RTL_GIGA_MAC_VER_10, 0xff7e1880), // PCI-E
+ _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_11, 0xff7e1880), // PCI-E
+ _R("RTL8168b/8111b", RTL_GIGA_MAC_VER_12, 0xff7e1880), // PCI-E
+ _R("RTL8101e", RTL_GIGA_MAC_VER_13, 0xff7e1880), // PCI-E 8139
+@@ -837,8 +845,12 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
+ }
+ }
+
+- /* The 8100e/8101e do Fast Ethernet only. */
+- if ((tp->mac_version == RTL_GIGA_MAC_VER_13) ||
++ /* The 8100e/8101e/8102e do Fast Ethernet only. */
++ if ((tp->mac_version == RTL_GIGA_MAC_VER_07) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_08) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_09) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_10) ||
++ (tp->mac_version == RTL_GIGA_MAC_VER_13) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_14) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_15) ||
+ (tp->mac_version == RTL_GIGA_MAC_VER_16)) {
+@@ -1212,8 +1224,17 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ { 0x7c800000, 0x30000000, RTL_GIGA_MAC_VER_11 },
+
+ /* 8101 family. */
++ { 0x7cf00000, 0x34a00000, RTL_GIGA_MAC_VER_09 },
++ { 0x7cf00000, 0x24a00000, RTL_GIGA_MAC_VER_09 },
++ { 0x7cf00000, 0x34900000, RTL_GIGA_MAC_VER_08 },
++ { 0x7cf00000, 0x24900000, RTL_GIGA_MAC_VER_08 },
++ { 0x7cf00000, 0x34800000, RTL_GIGA_MAC_VER_07 },
++ { 0x7cf00000, 0x24800000, RTL_GIGA_MAC_VER_07 },
+ { 0x7cf00000, 0x34000000, RTL_GIGA_MAC_VER_13 },
++ { 0x7cf00000, 0x34300000, RTL_GIGA_MAC_VER_10 },
+ { 0x7cf00000, 0x34200000, RTL_GIGA_MAC_VER_16 },
++ { 0x7c800000, 0x34800000, RTL_GIGA_MAC_VER_09 },
++ { 0x7c800000, 0x24800000, RTL_GIGA_MAC_VER_09 },
+ { 0x7c800000, 0x34000000, RTL_GIGA_MAC_VER_16 },
+ /* FIXME: where did these entries come from ? -- FR */
+ { 0xfc800000, 0x38800000, RTL_GIGA_MAC_VER_15 },
+@@ -1375,6 +1396,23 @@ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
++static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0003 },
++ { 0x08, 0x441d },
++ { 0x01, 0x9100 },
++ { 0x1f, 0x0000 }
++ };
++
++ mdio_write(ioaddr, 0x1f, 0x0000);
++ mdio_patch(ioaddr, 0x11, 1 << 12);
++ mdio_patch(ioaddr, 0x19, 1 << 13);
++ mdio_patch(ioaddr, 0x10, 1 << 15);
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++}
++
+ static void rtl_hw_phy_config(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -1392,6 +1429,11 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_06:
+ rtl8169sce_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_07:
++ case RTL_GIGA_MAC_VER_08:
++ case RTL_GIGA_MAC_VER_09:
++ rtl8102e_hw_phy_config(ioaddr);
++ break;
+ case RTL_GIGA_MAC_VER_11:
+ rtl8168bb_hw_phy_config(ioaddr);
+ break;
+@@ -2255,6 +2297,66 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ RTL_W16(IntrMask, tp->intr_event);
+ }
+
++#define R810X_CPCMD_QUIRK_MASK (\
++ EnableBist | \
++ Mac_dbgo_oe | \
++ Force_half_dup | \
++ Force_rxflow_en | \
++ Force_txflow_en | \
++ Cxpl_dbg_sel | \
++ ASF | \
++ PktCntrDisable | \
++ PCIDAC | \
++ PCIMulRW)
++
++static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ static struct ephy_info e_info_8102e_1[] = {
++ { 0x01, 0, 0x6e65 },
++ { 0x02, 0, 0x091f },
++ { 0x03, 0, 0xc2f9 },
++ { 0x06, 0, 0xafb5 },
++ { 0x07, 0, 0x0e00 },
++ { 0x19, 0, 0xec80 },
++ { 0x01, 0, 0x2e65 },
++ { 0x01, 0, 0x6e65 }
++ };
++ u8 cfg1;
++
++ rtl_csi_access_enable(ioaddr);
++
++ RTL_W8(DBG_REG, FIX_NAK_1);
++
++ RTL_W8(Config1,
++ LEDS1 | LEDS0 | Speed_down | MEMMAP | IOMAP | VPD | PMEnable);
++ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
++
++ cfg1 = RTL_R8(Config1);
++ 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));
++}
++
++static void rtl_hw_start_8102e_2(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_csi_access_enable(ioaddr);
++
++ 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)
++{
++ rtl_hw_start_8102e_2(ioaddr, pdev);
++
++ rtl_ephy_write(ioaddr, 0x03, 0xc2f9);
++}
++
+ static void rtl_hw_start_8101(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2271,6 +2377,20 @@ static void rtl_hw_start_8101(struct net_device *dev)
+ pci_write_config_word(pdev, 0x69, 0x08);
+ }
+
++ switch (tp->mac_version) {
++ case RTL_GIGA_MAC_VER_07:
++ rtl_hw_start_8102e_1(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_08:
++ rtl_hw_start_8102e_3(ioaddr, pdev);
++ break;
++
++ case RTL_GIGA_MAC_VER_09:
++ rtl_hw_start_8102e_2(ioaddr, pdev);
++ break;
++ }
++
+ RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+ RTL_W8(EarlyTxThres, EarlyTxThld);
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-03-add-a-new-8168c-flavor.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-03-add-a-new-8168c-flavor.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,110 @@
+From 197ff761dbf9fa5de9a4684a51ee5cb534cbb852 Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sat, 28 Jun 2008 13:16:02 +0200
+Subject: [PATCH] r8169: add a new 8168c flavor
+
+Taken from Realtek's 8.006.00 r8168 driver.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+---
+ drivers/net/r8169.c | 41 +++++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 39 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index f0f842d..9681aca 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -109,7 +109,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_17 = 0x10, // 8168Bf
+ RTL_GIGA_MAC_VER_18 = 0x12, // 8168CP
+ RTL_GIGA_MAC_VER_19 = 0x13, // 8168C
+- RTL_GIGA_MAC_VER_20 = 0x14 // 8168C
++ RTL_GIGA_MAC_VER_20 = 0x14, // 8168C
++ RTL_GIGA_MAC_VER_21 = 0x15 // 8168C
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -139,7 +140,8 @@ static const struct {
+ _R("RTL8101e", RTL_GIGA_MAC_VER_16, 0xff7e1880), // PCI-E
+ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_18, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_19, 0xff7e1880), // PCI-E
+- _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880) // PCI-E
++ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E
++ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -1220,6 +1222,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
+ { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
+ { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
++ { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 },
+ { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_20 },
+
+ /* 8168B family. */
+@@ -1444,6 +1447,28 @@ static void rtl8168c_2_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
++static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x12, 0x2300 },
++ { 0x1d, 0x3d98 },
++ { 0x1f, 0x0002 },
++ { 0x0c, 0x7eb8 },
++ { 0x06, 0x5461 },
++ { 0x1f, 0x0003 },
++ { 0x16, 0x0f0a },
++ { 0x1f, 0x0000 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++
++ mdio_patch(ioaddr, 0x16, 1 << 0);
++ mdio_patch(ioaddr, 0x14, 1 << 5);
++ mdio_patch(ioaddr, 0x0d, 1 << 5);
++ mdio_write(ioaddr, 0x1f, 0x0000);
++}
++
+ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1500,6 +1525,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_20:
+ rtl8168c_2_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_21:
++ rtl8168c_3_hw_phy_config(ioaddr);
++ break;
+ default:
+ break;
+ }
+@@ -2490,6 +2518,11 @@ static void rtl_hw_start_8168c_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
++static void rtl_hw_start_8168c_3(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_hw_start_8168c_2(ioaddr, pdev);
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2545,6 +2578,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168c_2(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_21:
++ rtl_hw_start_8168c_3(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-04-add-a-new-8168c-flavor-bis.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-04-add-a-new-8168c-flavor-bis.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,97 @@
+From 6fb07058d2b6c748c308e4ee453035433d34ca93 Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 29 Jun 2008 11:54:28 +0200
+Subject: [PATCH] r8169: add a new 8168c flavor (bis)
+
+Taken from Realtek's 8.006.00 r8168 driver.
+
+I have left some bits related to jumbo frame aside for now.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+---
+ drivers/net/r8169.c | 26 ++++++++++++++++++++++++--
+ 1 files changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 9681aca..9a0d4e6 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -110,7 +110,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_18 = 0x12, // 8168CP
+ RTL_GIGA_MAC_VER_19 = 0x13, // 8168C
+ RTL_GIGA_MAC_VER_20 = 0x14, // 8168C
+- RTL_GIGA_MAC_VER_21 = 0x15 // 8168C
++ RTL_GIGA_MAC_VER_21 = 0x15, // 8168C
++ RTL_GIGA_MAC_VER_22 = 0x16 // 8168C
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -141,7 +142,8 @@ static const struct {
+ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_18, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_19, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E
+- _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880) // PCI-E
++ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880), // PCI-E
++ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -1223,6 +1225,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
+ { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
+ { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 },
++ { 0x7cf00000, 0x3c400000, RTL_GIGA_MAC_VER_22 },
+ { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_20 },
+
+ /* 8168B family. */
+@@ -1469,6 +1472,11 @@ static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
+ mdio_write(ioaddr, 0x1f, 0x0000);
+ }
+
++static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
++{
++ rtl8168c_3_hw_phy_config(ioaddr);
++}
++
+ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1528,6 +1536,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_21:
+ rtl8168c_3_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_22:
++ rtl8168c_4_hw_phy_config(ioaddr);
++ break;
+ default:
+ break;
+ }
+@@ -2523,6 +2534,13 @@ static void rtl_hw_start_8168c_3(void __iomem *ioaddr, struct pci_dev *pdev)
+ rtl_hw_start_8168c_2(ioaddr, pdev);
+ }
+
++static void rtl_hw_start_8168c_4(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_csi_access_enable(ioaddr);
++
++ __rtl_hw_start_8168cp(ioaddr, pdev);
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2582,6 +2600,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168c_3(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_22:
++ rtl_hw_start_8168c_4(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-05-add-a-new-8168cp-flavor.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-05-add-a-new-8168cp-flavor.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,136 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 29 Jun 2008 12:24:30 +0200
+Subject: [PATCH] r8169: add a new 8168cp flavor
+
+Taken from Realtek's 8.006.00 r8168 driver.
+
+I have left some bits related to jumbo frame aside for now.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -111,7 +111,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_19 = 0x13, // 8168C
+ RTL_GIGA_MAC_VER_20 = 0x14, // 8168C
+ RTL_GIGA_MAC_VER_21 = 0x15, // 8168C
+- RTL_GIGA_MAC_VER_22 = 0x16 // 8168C
++ RTL_GIGA_MAC_VER_22 = 0x16, // 8168C
++ RTL_GIGA_MAC_VER_23 = 0x17 // 8168CP
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -143,7 +144,8 @@ static const struct {
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_19, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880), // PCI-E
+- _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880) // PCI-E
++ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880), // PCI-E
++ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_23, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -1221,6 +1223,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ int mac_version;
+ } mac_info[] = {
+ /* 8168B family. */
++ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+ { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
+ { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
+ { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
+@@ -1380,7 +1383,7 @@ static void rtl8168bef_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
+-static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
++static void rtl8168cp_1_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+ { 0x1f, 0x0000 },
+@@ -1393,6 +1396,21 @@ static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
+ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+ }
+
++static void rtl8168cp_2_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init[] = {
++ { 0x1f, 0x0001 },
++ { 0x1d, 0x3d98 },
++ { 0x1f, 0x0000 }
++ };
++
++ mdio_write(ioaddr, 0x1f, 0x0000);
++ mdio_patch(ioaddr, 0x14, 1 << 5);
++ mdio_patch(ioaddr, 0x0d, 1 << 5);
++
++ rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
++}
++
+ static void rtl8168c_1_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1525,7 +1543,7 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ rtl8168bef_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_18:
+- rtl8168cp_hw_phy_config(ioaddr);
++ rtl8168cp_1_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_19:
+ rtl8168c_1_hw_phy_config(ioaddr);
+@@ -1539,6 +1557,10 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_22:
+ rtl8168c_4_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_23:
++ rtl8168cp_2_hw_phy_config(ioaddr);
++ break;
++
+ default:
+ break;
+ }
+@@ -2481,7 +2503,7 @@ static void __rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
+ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
+ }
+
+-static void rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
++static void rtl_hw_start_8168cp_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+ static struct ephy_info e_info_8168cp[] = {
+ { 0x01, 0, 0x0001 },
+@@ -2498,6 +2520,15 @@ static void rtl_hw_start_8168cp(void __iomem *ioaddr, struct pci_dev *pdev)
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
++static void rtl_hw_start_8168cp_2(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_csi_access_enable(ioaddr);
++
++ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
++
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
++}
++
+ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+ static struct ephy_info e_info_8168c_1[] = {
+@@ -2585,7 +2618,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ break;
+
+ case RTL_GIGA_MAC_VER_18:
+- rtl_hw_start_8168cp(ioaddr, pdev);
++ rtl_hw_start_8168cp_1(ioaddr, pdev);
+ break;
+
+ case RTL_GIGA_MAC_VER_19:
+@@ -2604,6 +2637,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168c_4(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_23:
++ rtl_hw_start_8168cp_2(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-06-change-default-behavior-for-mildly-identified-.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-06-change-default-behavior-for-mildly-identified-.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,44 @@
+From ef808d502cc3b18b2d823bbe8c03c0b8ea0df1b5 Mon Sep 17 00:00:00 2001
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 29 Jun 2008 13:10:54 +0200
+Subject: [PATCH] r8169: change default behavior for mildly identified 8168c chipsets
+
+The addition of a new device has so far implied a specialization of
+these masks. While they identify 8168c devices, they can be expected
+to be further refined as they have been by Realtek so far.
+
+The change should bring the driver closer to the version 8.006.00 of
+Realtek's 8168 driver.
+
+Signed-off-by: Francois Romieu <romieu at fr.zoreil.com>
+Cc: Edward Hsu <edward_hsu at realtek.com.tw>
+---
+ drivers/net/r8169.c | 7 ++++---
+ 1 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
+index 775dc84..4edc6b0 100644
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -1222,14 +1222,15 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ u32 val;
+ int mac_version;
+ } mac_info[] = {
+- /* 8168B family. */
++ /* 8168C family. */
+ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+- { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
++ { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
++ { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_23 },
+ { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
+ { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
+ { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 },
+ { 0x7cf00000, 0x3c400000, RTL_GIGA_MAC_VER_22 },
+- { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_20 },
++ { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_22 },
+
+ /* 8168B family. */
+ { 0x7cf00000, 0x38000000, RTL_GIGA_MAC_VER_12 },
+--
+1.6.4.3
+
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-07-support-additional-8168cp-chipset.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-07-support-additional-8168cp-chipset.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,82 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 20 Jul 2008 18:53:20 +0200
+Subject: [PATCH] r8169: support additional 8168cp chipset
+
+Taken from Realtek's 8.007.00 r8168 driver.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -112,7 +112,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_20 = 0x14, // 8168C
+ RTL_GIGA_MAC_VER_21 = 0x15, // 8168C
+ RTL_GIGA_MAC_VER_22 = 0x16, // 8168C
+- RTL_GIGA_MAC_VER_23 = 0x17 // 8168CP
++ RTL_GIGA_MAC_VER_23 = 0x17, // 8168CP
++ RTL_GIGA_MAC_VER_24 = 0x18 // 8168CP
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -145,7 +146,8 @@ static const struct {
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880), // PCI-E
+- _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_23, 0xff7e1880) // PCI-E
++ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_23, 0xff7e1880), // PCI-E
++ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_24, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -1223,9 +1225,10 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ int mac_version;
+ } mac_info[] = {
+ /* 8168C family. */
++ { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 },
+ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+ { 0x7cf00000, 0x3c800000, RTL_GIGA_MAC_VER_18 },
+- { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_23 },
++ { 0x7c800000, 0x3c800000, RTL_GIGA_MAC_VER_24 },
+ { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
+ { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
+ { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 },
+@@ -1559,6 +1562,7 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ rtl8168c_4_hw_phy_config(ioaddr);
+ break;
+ case RTL_GIGA_MAC_VER_23:
++ case RTL_GIGA_MAC_VER_24:
+ rtl8168cp_2_hw_phy_config(ioaddr);
+ break;
+
+@@ -2532,6 +2536,20 @@ static void rtl_hw_start_8168cp_2(void __iomem *ioaddr, struct pci_dev *pdev)
+ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
+ }
+
++static void rtl_hw_start_8168cp_3(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_csi_access_enable(ioaddr);
++
++ RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
++
++ /* Magic. */
++ RTL_W8(DBG_REG, 0x20);
++
++ RTL_W8(EarlyTxThres, EarlyTxThld);
++
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
++}
++
+ static void rtl_hw_start_8168c_1(void __iomem *ioaddr, struct pci_dev *pdev)
+ {
+ static struct ephy_info e_info_8168c_1[] = {
+@@ -2642,6 +2662,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168cp_2(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_24:
++ rtl_hw_start_8168cp_3(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
Added: dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-08-preliminary-8168d-support.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/features/all/r8169/r8169-08-preliminary-8168d-support.patch Wed Oct 28 01:27:56 2009 (r14470)
@@ -0,0 +1,156 @@
+Based on:
+
+From: Francois Romieu <romieu at fr.zoreil.com>
+Date: Sun, 20 Jul 2008 16:22:45 +0200
+Subject: [PATCH] r8169: preliminary 8168d support
+
+Taken from Realtek's 8.007.00 r8168 driver.
+
+--- a/drivers/net/r8169.c
++++ b/drivers/net/r8169.c
+@@ -113,7 +113,8 @@ enum mac_version {
+ RTL_GIGA_MAC_VER_21 = 0x15, // 8168C
+ RTL_GIGA_MAC_VER_22 = 0x16, // 8168C
+ RTL_GIGA_MAC_VER_23 = 0x17, // 8168CP
+- RTL_GIGA_MAC_VER_24 = 0x18 // 8168CP
++ RTL_GIGA_MAC_VER_24 = 0x18, // 8168CP
++ RTL_GIGA_MAC_VER_25 = 0x19 // 8168D
+ };
+
+ #define _R(NAME,MAC,MASK) \
+@@ -147,7 +148,8 @@ static const struct {
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880), // PCI-E
+ _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880), // PCI-E
+ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_23, 0xff7e1880), // PCI-E
+- _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_24, 0xff7e1880) // PCI-E
++ _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_24, 0xff7e1880), // PCI-E
++ _R("RTL8168d/8111d", RTL_GIGA_MAC_VER_25, 0xff7e1880) // PCI-E
+ };
+ #undef _R
+
+@@ -1224,6 +1226,9 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+ u32 val;
+ int mac_version;
+ } mac_info[] = {
++ /* 8168D family. */
++ { 0x7c800000, 0x28000000, RTL_GIGA_MAC_VER_25 },
++
+ /* 8168C family. */
+ { 0x7cf00000, 0x3ca00000, RTL_GIGA_MAC_VER_24 },
+ { 0x7cf00000, 0x3c900000, RTL_GIGA_MAC_VER_23 },
+@@ -1499,6 +1504,76 @@ static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
+ rtl8168c_3_hw_phy_config(ioaddr);
+ }
+
++static void rtl8168d_hw_phy_config(void __iomem *ioaddr)
++{
++ struct phy_reg phy_reg_init_0[] = {
++ { 0x1f, 0x0001 },
++ { 0x09, 0x2770 },
++ { 0x08, 0x04d0 },
++ { 0x0b, 0xad15 },
++ { 0x0c, 0x5bf0 },
++ { 0x1c, 0xf101 },
++ { 0x1f, 0x0003 },
++ { 0x14, 0x94d7 },
++ { 0x12, 0xf4d6 },
++ { 0x09, 0xca0f },
++ { 0x1f, 0x0002 },
++ { 0x0b, 0x0b10 },
++ { 0x0c, 0xd1f7 },
++ { 0x1f, 0x0002 },
++ { 0x06, 0x5461 },
++ { 0x1f, 0x0002 },
++ { 0x05, 0x6662 },
++ { 0x1f, 0x0000 },
++ { 0x14, 0x0060 },
++ { 0x1f, 0x0000 },
++ { 0x0d, 0xf8a0 },
++ { 0x1f, 0x0005 },
++ { 0x05, 0xffc2 }
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init_0, ARRAY_SIZE(phy_reg_init_0));
++
++ if (mdio_read(ioaddr, 0x06) == 0xc400) {
++ struct phy_reg phy_reg_init_1[] = {
++ { 0x1f, 0x0005 },
++ { 0x01, 0x0300 },
++ { 0x1f, 0x0000 },
++ { 0x11, 0x401c },
++ { 0x16, 0x4100 },
++ { 0x1f, 0x0005 },
++ { 0x07, 0x0010 },
++ { 0x05, 0x83dc },
++ { 0x06, 0x087d },
++ { 0x05, 0x8300 },
++ { 0x06, 0x0101 },
++ { 0x06, 0x05f8 },
++ { 0x06, 0xf9fa },
++ { 0x06, 0xfbef },
++ { 0x06, 0x79e2 },
++ { 0x06, 0x835f },
++ { 0x06, 0xe0f8 },
++ { 0x06, 0x9ae1 },
++ { 0x06, 0xf89b },
++ { 0x06, 0xef31 },
++ { 0x06, 0x3b65 },
++ { 0x06, 0xaa07 },
++ { 0x06, 0x81e4 },
++ { 0x06, 0xf89a },
++ { 0x06, 0xe5f8 },
++ { 0x06, 0x9baf },
++ { 0x06, 0x06ae },
++ { 0x05, 0x83dc },
++ { 0x06, 0x8300 },
++ };
++
++ rtl_phy_write(ioaddr, phy_reg_init_1,
++ ARRAY_SIZE(phy_reg_init_1));
++ }
++
++ mdio_write(ioaddr, 0x1f, 0x0000);
++}
++
+ static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
+ {
+ struct phy_reg phy_reg_init[] = {
+@@ -1565,6 +1640,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
+ case RTL_GIGA_MAC_VER_24:
+ rtl8168cp_2_hw_phy_config(ioaddr);
+ break;
++ case RTL_GIGA_MAC_VER_25:
++ rtl8168d_hw_phy_config(ioaddr);
++ break;
+
+ default:
+ break;
+@@ -2595,6 +2673,17 @@ static void rtl_hw_start_8168c_4(void __iomem *ioaddr, struct pci_dev *pdev)
+ __rtl_hw_start_8168cp(ioaddr, pdev);
+ }
+
++static void rtl_hw_start_8168d(void __iomem *ioaddr, struct pci_dev *pdev)
++{
++ rtl_csi_access_enable(ioaddr);
++
++ rtl_disable_clock_request(pdev);
++
++ RTL_W8(EarlyTxThres, EarlyTxThld);
++
++ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
++}
++
+ static void rtl_hw_start_8168(struct net_device *dev)
+ {
+ struct rtl8169_private *tp = netdev_priv(dev);
+@@ -2666,6 +2757,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
+ rtl_hw_start_8168cp_3(ioaddr, pdev);
+ break;
+
++ case RTL_GIGA_MAC_VER_25:
++ rtl_hw_start_8168d(ioaddr, pdev);
++ break;
++
+ default:
+ printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
+ dev->name, tp->mac_version);
Modified: dists/lenny/linux-2.6/debian/patches/series/21
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/21 Tue Oct 27 16:35:16 2009 (r14469)
+++ dists/lenny/linux-2.6/debian/patches/series/21 Wed Oct 28 01:27:56 2009 (r14470)
@@ -3,3 +3,24 @@
+ bugfix/all/nohz-dont-stop-outside-idle-loop.patch
+ bugfix/s390/nohz-dont-stop-outside-idle-loop-s390.patch
+ bugfix/all/usbmidi-fix-oops-at-disconnection.patch
++ bugfix/all/r8169/r8169-01-add-hw-start-helpers-for-the-8168-and-the-8101.patch
++ bugfix/all/r8169/r8169-02-wake-up-the-PHY-of-the-8168.patch
++ bugfix/all/r8169/r8169-03-update-phy-init-parameters.patch
++ bugfix/all/r8169/r8169-04-new-phy-init-parameters-for-the-8168b.patch
++ bugfix/all/r8169/r8169-05-shuffle-some-registers-handling-around-8168-op.patch
++ bugfix/all/r8169/r8169-06-make-room-for-more-specific-8168-hardware-star.patch
++ bugfix/all/r8169/r8169-07-sync-existing-8168-device-hardware-start-seque.patch
++ bugfix/all/r8169/r8169-08-Don-t-update-statistics-counters-when-interfac.patch
++ bugfix/all/r8169/r8169-09-reset-IntrStatus-after-chip-reset.patch
++ bugfix/all/r8169/r8169-10-Use-a-different-default-for-each-family.patch
++ bugfix/all/r8169/r8169-11-phy-init-for-the-8169sce.patch
++ bugfix/all/r8169/r8169-12-phy-init-for-the-8169scd.patch
++ bugfix/all/r8169/r8169-13-phy-init-for-the-8169s.patch
++ features/all/r8169/r8169-01-add-8168-8101-registers-description.patch
++ features/all/r8169/r8169-02-additional-8101-and-8102-support.patch
++ features/all/r8169/r8169-03-add-a-new-8168c-flavor.patch
++ features/all/r8169/r8169-04-add-a-new-8168c-flavor-bis.patch
++ features/all/r8169/r8169-05-add-a-new-8168cp-flavor.patch
++ features/all/r8169/r8169-06-change-default-behavior-for-mildly-identified-.patch
++ features/all/r8169/r8169-07-support-additional-8168cp-chipset.patch
++ features/all/r8169/r8169-08-preliminary-8168d-support.patch
More information about the Kernel-svn-changes
mailing list