Francois Romieu <[EMAIL PROTECTED]> :
[...]
> - try http://www.fr.zoreil.com/people/francois/backport/r8169/20070604-00
> It is a backport against 2.6.18 which should bring you quite close to
> 2.6.23-git wrt r8169.
Regarding the backport option, it was initially more a compiled-ok-untested-
use-at-your-own-risk thing than anything else. I have given it a try with
2.6.18 and it does not blow up immediately. I suggest adding the attached
patch at the end of the serie to fix a locking bug though.
--
Ueimor
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index eaf5373..982a901 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -135,8 +135,8 @@ static const struct {
u32 RxConfigMask; /* Clears the bits supported by this chip */
} rtl_chip_info[] = {
_R("RTL8169", RTL_GIGA_MAC_VER_01, 0xff7e1880), // 8169
- _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_02, 0xff7e1880), // 8169S
- _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_03, 0xff7e1880), // 8110S
+ _R("RTL8169s", RTL_GIGA_MAC_VER_02, 0xff7e1880), // 8169S
+ _R("RTL8110s", RTL_GIGA_MAC_VER_03, 0xff7e1880), // 8110S
_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
@@ -1391,22 +1380,26 @@ static void rtl8169_init_phy(struct net_device *dev,
struct rtl8169_private *tp)
printk(KERN_INFO PFX "%s: TBI auto-negotiating\n", dev->name);
}
-static void rtl8169_rar_set(struct rtl8169_private *tp, u8 *addr)
+static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
{
void __iomem *ioaddr = tp->mmio_addr;
- u32 low;
u32 high;
+ u32 low;
low = addr[0] | (addr[1] << 8) | (addr[2] << 16) | (addr[3] << 24);
high = addr[4] | (addr[5] << 8);
+ spin_lock_irq(&tp->lock);
+
RTL_W8(Cfg9346, Cfg9346_Unlock);
RTL_W32(MAC0, low);
RTL_W32(MAC4, high);
RTL_W8(Cfg9346, Cfg9346_Lock);
+
+ spin_unlock_irq(&tp->lock);
}
-static int rtl8169_set_mac_address(struct net_device *dev, void *p)
+static int rtl_set_mac_address(struct net_device *dev, void *p)
{
struct rtl8169_private *tp = netdev_priv(dev);
struct sockaddr *addr = p;
@@ -1416,7 +1409,7 @@ static int rtl8169_set_mac_address(struct net_device
*dev, void *p)
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- rtl8169_rar_set(tp, dev->dev_addr);
+ rtl_rar_set(tp, dev->dev_addr);
return 0;
}
@@ -1650,7 +1645,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct
pci_device_id *ent)
dev->irq = pdev->irq;
dev->base_addr = (unsigned long) ioaddr;
dev->change_mtu = rtl8169_change_mtu;
- dev->set_mac_address = rtl8169_set_mac_address;
+ dev->set_mac_address = rtl_set_mac_address;
#ifdef CONFIG_R8169_NAPI
dev->poll = rtl8169_poll;