mlx4_en: using stop/start_all_queues
[pandora-kernel.git] / drivers / net / r6040.c
index 5e8540b..ed63d23 100644 (file)
@@ -49,8 +49,8 @@
 #include <asm/processor.h>
 
 #define DRV_NAME       "r6040"
-#define DRV_VERSION    "0.22"
-#define DRV_RELDATE    "25Mar2009"
+#define DRV_VERSION    "0.23"
+#define DRV_RELDATE    "05May2009"
 
 /* PHY CHIP Address */
 #define PHY1_ADDR      1       /* For MAC1 */
@@ -160,6 +160,7 @@ MODULE_AUTHOR("Sten Wang <sten.wang@rdc.com.tw>,"
        "Florian Fainelli <florian@openwrt.org>");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver");
+MODULE_VERSION(DRV_VERSION " " DRV_RELDATE);
 
 /* RX and TX interrupts that we handle */
 #define RX_INTS                        (RX_FIFO_FULL | RX_NO_DESC | RX_FINISH)
@@ -400,6 +401,9 @@ static void r6040_init_mac_regs(struct net_device *dev)
         * 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)
@@ -527,6 +531,8 @@ static int r6040_phy_mode_chk(struct net_device *dev)
                        phy_dat = 0x0000;
        }
 
+       mii_check_media(&lp->mii_if, 0, 1);
+
        return phy_dat;
 };
 
@@ -741,6 +747,14 @@ static int r6040_up(struct net_device *dev)
        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);
@@ -801,7 +815,6 @@ static void r6040_timer(unsigned long data)
                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 */