diff options
author | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-06-16 22:01:24 +0000 |
---|---|---|
committer | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-06-16 22:01:24 +0000 |
commit | 830eb974f69838d31e26cf304cdd08e7603566f8 (patch) | |
tree | 558bcdee44245091b1bda4b5173b9426a69ce9b6 /target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch | |
parent | 9e3e51970364de3a4e39d9b880656efe7e747bed (diff) |
[rdc] backport some mainline fixes, refresh mtd driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16485 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch')
-rw-r--r-- | target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch b/target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch index 6447be43b6..704786ae76 100644 --- a/target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch +++ b/target/linux/rdc/patches-2.6.28/007-r6040_git_updates.patch @@ -193,3 +193,49 @@ /* Link new device into r6040_root_dev */ lp->pdev = pdev; lp->dev = dev; +--- a/drivers/net/r6040.c ++++ b/drivers/net/r6040.c +@@ -742,6 +742,14 @@ static int r6040_up(struct net_device *d + struct r6040_private *lp = netdev_priv(dev); + void __iomem *ioaddr = lp->base; + int ret; ++ u16 val; ++ ++ /* Check presence of a second PHY */ ++ val = r6040_phy_read(ioaddr, lp->phy_addr, 2); ++ if (val == 0xFFFF) { ++ printk(KERN_ERR DRV_NAME " no second PHY attached\n"); ++ return -EIO; ++ } + + /* Initialise and alloc RX/TX buffers */ + r6040_init_txbufs(dev); +--- a/drivers/net/r6040.c ++++ b/drivers/net/r6040.c +@@ -401,6 +401,9 @@ static void r6040_init_mac_regs(struct n + * we may got called by r6040_tx_timeout which has left + * some unsent tx buffers */ + iowrite16(0x01, ioaddr + MTPR); ++ ++ /* Check media */ ++ mii_check_media(&lp->mii_if, 1, 1); + } + + static void r6040_tx_timeout(struct net_device *dev) +@@ -528,6 +531,8 @@ static int r6040_phy_mode_chk(struct net + phy_dat = 0x0000; + } + ++ mii_check_media(&lp->mii_if, 0, 1); ++ + return phy_dat; + }; + +@@ -810,7 +815,6 @@ static void r6040_timer(unsigned long da + lp->phy_mode = phy_mode; + lp->mcr0 = (lp->mcr0 & 0x7fff) | phy_mode; + iowrite16(lp->mcr0, ioaddr); +- printk(KERN_INFO "Link Change %x \n", ioread16(ioaddr)); + } + + /* Timer active again */ |