aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 6f97b47d74a6..ed63d23a6452 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -49,8 +49,8 @@
49#include <asm/processor.h> 49#include <asm/processor.h>
50 50
51#define DRV_NAME "r6040" 51#define DRV_NAME "r6040"
52#define DRV_VERSION "0.22" 52#define DRV_VERSION "0.23"
53#define DRV_RELDATE "25Mar2009" 53#define DRV_RELDATE "05May2009"
54 54
55/* PHY CHIP Address */ 55/* PHY CHIP Address */
56#define PHY1_ADDR 1 /* For MAC1 */ 56#define PHY1_ADDR 1 /* For MAC1 */
@@ -401,6 +401,9 @@ static void r6040_init_mac_regs(struct net_device *dev)
401 * we may got called by r6040_tx_timeout which has left 401 * we may got called by r6040_tx_timeout which has left
402 * some unsent tx buffers */ 402 * some unsent tx buffers */
403 iowrite16(0x01, ioaddr + MTPR); 403 iowrite16(0x01, ioaddr + MTPR);
404
405 /* Check media */
406 mii_check_media(&lp->mii_if, 1, 1);
404} 407}
405 408
406static void r6040_tx_timeout(struct net_device *dev) 409static void r6040_tx_timeout(struct net_device *dev)
@@ -528,6 +531,8 @@ static int r6040_phy_mode_chk(struct net_device *dev)
528 phy_dat = 0x0000; 531 phy_dat = 0x0000;
529 } 532 }
530 533
534 mii_check_media(&lp->mii_if, 0, 1);
535
531 return phy_dat; 536 return phy_dat;
532}; 537};
533 538
@@ -742,6 +747,14 @@ static int r6040_up(struct net_device *dev)
742 struct r6040_private *lp = netdev_priv(dev); 747 struct r6040_private *lp = netdev_priv(dev);
743 void __iomem *ioaddr = lp->base; 748 void __iomem *ioaddr = lp->base;
744 int ret; 749 int ret;
750 u16 val;
751
752 /* Check presence of a second PHY */
753 val = r6040_phy_read(ioaddr, lp->phy_addr, 2);
754 if (val == 0xFFFF) {
755 printk(KERN_ERR DRV_NAME " no second PHY attached\n");
756 return -EIO;
757 }
745 758
746 /* Initialise and alloc RX/TX buffers */ 759 /* Initialise and alloc RX/TX buffers */
747 r6040_init_txbufs(dev); 760 r6040_init_txbufs(dev);
@@ -802,7 +815,6 @@ static void r6040_timer(unsigned long data)
802 lp->phy_mode = phy_mode; 815 lp->phy_mode = phy_mode;
803 lp->mcr0 = (lp->mcr0 & 0x7fff) | phy_mode; 816 lp->mcr0 = (lp->mcr0 & 0x7fff) | phy_mode;
804 iowrite16(lp->mcr0, ioaddr); 817 iowrite16(lp->mcr0, ioaddr);
805 printk(KERN_INFO "Link Change %x \n", ioread16(ioaddr));
806 } 818 }
807 819
808 /* Timer active again */ 820 /* Timer active again */