Re: [PATCH 02/11] net: axienet: Add ioctl support
flat view
From: Michal Simek <monstr@monstr.eu>
Date: 2012-10-05 07:00:12
Also in:
lkml
On 10/04/2012 09:17 PM, Ben Hutchings wrote:
On Thu, 2012-10-04 at 20:14 +0200, Michal Simek wrote:quoted
Allow user to access the MDIO from userspace. Signed-off-by: Michal Simek <monstr@monstr.eu> CC: Anirudha Sarangi <redacted> CC: John Linn <redacted> CC: Grant Likely <redacted> CC: Rob Herring <redacted> CC: David S. Miller <davem@davemloft.net> --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-)diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 50167ab..a5b41cd 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c@@ -1053,6 +1053,20 @@ static void axienet_poll_controller(struct net_device *ndev) } #endif +/* Ioctl MII Interface */ +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + struct axienet_local *priv = netdev_priv(dev); + + if (!netif_running(dev)) + return -EINVAL;Not sure this is the appropriate error code.quoted
+ if (!priv->phy_dev) + return -ENODEV;Error code should be EOPNOTSUPP - the device is present but just doesn't support MDIO.
ok. Thanks will fix it. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian