linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ppopov@linux-mips.org
Date: Mon, 10 Jan 2005 10:26:31 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ppopov@ftp.linux-mips.org       05/01/10 10:26:25

Modified files:
        drivers/net    : au1000_eth.c 

Log message:
        mii-tool support.

diff -urN linux/drivers/net/au1000_eth.c linux/drivers/net/au1000_eth.c
--- linux/drivers/net/au1000_eth.c      2005/01/10 08:29:29     1.40
+++ linux/drivers/net/au1000_eth.c      2005/01/10 10:26:25     1.41
@@ -6,6 +6,9 @@
  * Copyright 2002 TimeSys Corp.
  * Added ethtool/mii-tool support,
  * Copyright 2004 Matt Porter <mporter@kernel.crashing.org>
+ * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de 
+ * or riemer@riemer-nt.de: fixed the link beat detection with 
+ * ioctls (SIOCGMIIPHY)
  * Author: MontaVista Software, Inc.
  *             ppopov@mvista.com or source@mvista.com
  *
@@ -64,7 +67,7 @@
 #endif
 
 #define DRV_NAME       "au1000eth"
-#define DRV_VERSION    "1.4"
+#define DRV_VERSION    "1.5"
 #define DRV_AUTHOR     "Pete Popov <ppopov@embeddedalley.com>"
 #define DRV_DESC       "Au1xxx on-chip Ethernet driver"
 
@@ -1677,6 +1680,11 @@
        if (link && (dev->if_port == IF_PORT_100BASEFX)) {
                control |= MAC_FULL_DUPLEX;
        }
+
+       /* fix for startup without cable */
+       if (!link) 
+               dev->flags &= ~IFF_RUNNING;
+
        aup->mac->control = control;
        aup->mac->vlan1_tag = 0x8100; /* activate vlan support */
        au_sync();
@@ -2133,20 +2141,24 @@
        u16 *data = (u16 *)&rq->ifr_ifru;
 
        switch(cmd) { 
-       case SIOCGMIIPHY:
-               data[0] = aup->phy_addr;
-               /* Fall through */
-       case SIOCGMIIREG:
-               data[3] = mdio_read(dev, aup->phy_addr, data[1]);
-               return 0;
-       case SIOCSMIIREG:
-               if (!capable(CAP_NET_ADMIN))
-                       return -EPERM;
-               mdio_write(dev, aup->phy_addr, data[1], data[2]);
-               return 0;
-       default:
-               return -EOPNOTSUPP;
+               case SIOCDEVPRIVATE:    /* Get the address of the PHY in use. */
+               case SIOCGMIIPHY:
+                       if (!netif_running(dev)) return -EINVAL;
+                       data[0] = aup->phy_addr;
+               case SIOCDEVPRIVATE+1:  /* Read the specified MII register. */
+               case SIOCGMIIREG:
+                       data[3] =  mdio_read(dev, data[0], data[1]); 
+                       return 0;
+               case SIOCDEVPRIVATE+2:  /* Write the specified MII register */
+               case SIOCSMIIREG: 
+                       if (!capable(CAP_NET_ADMIN))
+                               return -EPERM;
+                       mdio_write(dev, data[0], data[1],data[2]);
+                       return 0;
+               default:
+                       return -EOPNOTSUPP;
        }
+
 }
 
 

<Prev in Thread] Current Thread [Next in Thread>