Dear DaVince developer,

I'm currently working with a TI AM35xx on our embedded SOM.

Due the fact that I need to use mii-tool on our platform I've done a
little patch to your driver to add mii ioctl support.

It has been tested on our Lizard board (SMSC LAN8700 as Ethernet phy)
with the following version of mii-tool:

root@lizard:/mnt/ubifs# mii-tool -V
mii-tool.c 1.9 2000/04/28 00:56:08 (David Hinds)
eth0: 100 Mbit, full duplex, link ok

Feel free to add this to patch to the next release of your driver, I
think it will be useful to many developers.

Best Regards,

--

Andrea SCIAN
DAVE
www.dave.eu

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 45e6188..f63827e 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -2355,14 +2355,15 @@ static void emac_adjust_link(struct net_device *ndev)
  */
 static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
 {
-       dev_warn(&ndev->dev, "DaVinci EMAC: ioctl not supported\n");
-
+       struct emac_priv *priv = netdev_priv(ndev);
+       
        if (!(netif_running(ndev)))
                return -EINVAL;
 
-       /* TODO: Add phy read and write and private statistics get feature */
+       if (!priv->phydev)
+               return -ENOTSUPP;
 
-       return -EOPNOTSUPP;
+       return phy_mii_ioctl(priv->phydev, if_mii(ifrq), cmd);
 }
 
 /**
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to