From patchwork Wed Apr 6 14:24:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "r&d4@dave-tech.it" X-Patchwork-Id: 689901 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p36EQCM4014674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Apr 2011 14:26:33 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p36EOnnG008083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Apr 2011 09:24:49 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id p36EOmod002061; Wed, 6 Apr 2011 09:24:49 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id AF66280627; Wed, 6 Apr 2011 09:24:48 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 8774580626 for ; Wed, 6 Apr 2011 09:24:46 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p36EOk4u025180 for ; Wed, 6 Apr 2011 09:24:46 -0500 (CDT) Received: from psmtp.com (na3sys009amx206.postini.com [74.125.149.46]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id p36EOiAs018472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 6 Apr 2011 09:24:45 -0500 Received: from mx.dave-tech.it ([2.116.177.210]) (using TLSv1) by na3sys009amx206.postini.com ([74.125.148.10]) with SMTP; Wed, 06 Apr 2011 14:24:45 GMT Received: (qmail 18486 invoked by uid 89); 6 Apr 2011 14:24:41 -0000 Received: by simscan 1.2.0 ppid: 18481, pid: 18484, t: 0.0480s scanners: attach: 1.2.0 Received: from unknown (HELO ?127.0.0.1?) (andrea.scian%dave-tech.it@192.168.0.7) by mx.dave-tech.it with ESMTPA; 6 Apr 2011 14:24:41 -0000 Message-ID: <4D9C77A8.3040209@dave-tech.it> Date: Wed, 06 Apr 2011 16:24:40 +0200 From: "r&d4@dave-tech.it" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: davinci-linux-open-source@linux.davincidsp.com Subject: PATCH: DaVinci EMAC MII ioctl support X-Antivirus: avast! (VPS 110406-0, 06/04/2011), Outbound message X-Antivirus-Status: Clean X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:55.53451/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Apr 2011 14:26:34 +0000 (UTC) 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); } /**