From patchwork Thu Oct 4 18:14:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 189229 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 915AD2C03A0 for ; Fri, 5 Oct 2012 04:15:13 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754884Ab2JDSPL (ORCPT ); Thu, 4 Oct 2012 14:15:11 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35439 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754274Ab2JDSPF (ORCPT ); Thu, 4 Oct 2012 14:15:05 -0400 Received: by mail-wi0-f172.google.com with SMTP id hq12so4700923wib.1 for ; Thu, 04 Oct 2012 11:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=P2uvDHr3g+Ijjd5R2n2nYBjxGN8CnemrqqQdUoKAdWQ=; b=DM+N6H+zNY6HBnAdleb5p8AO9MxXUQI9H/ysSgstJJkoDixRGP9HWqvJo1fwt+6rXU CCpsRP8fdUtm0991gpW2nc8a2yTrOSAH0axJ+/yW3dFcgt0TfYBm/AP6ckJYPXZRzT6n aLyIwdI6fu8nIsBJ1Xc33UxyoRWF5QJqJU94Eky0kzMZiQ6x1PE9RVEWu1g2qstXMARJ 2gPMlOIvHZgoVFog+1WODR3kc+IOHa8UuYiE4L2oewe3F21REvd6nxzYnLFXUA8gdWK9 K+LctVrF6p5jh5W+SXKB2+5/TOsCdMX24Zwxmo4P2Us4faLvKRF4+XZKAf5K60vFvJDY vC6Q== Received: by 10.180.102.164 with SMTP id fp4mr39797048wib.13.1349374503970; Thu, 04 Oct 2012 11:15:03 -0700 (PDT) Received: from localhost (nat-2.starnet.cz. [92.62.224.2]) by mx.google.com with ESMTPS id gg4sm16001870wib.6.2012.10.04.11.15.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Oct 2012 11:15:03 -0700 (PDT) From: Michal Simek To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Michal Simek , Anirudha Sarangi , John Linn , Grant Likely , Rob Herring , "David S. Miller" Subject: [PATCH 02/11] net: axienet: Add ioctl support Date: Thu, 4 Oct 2012 20:14:48 +0200 Message-Id: <1349374497-9540-2-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1349374497-9540-1-git-send-email-monstr@monstr.eu> References: <1349374497-9540-1-git-send-email-monstr@monstr.eu> X-Gm-Message-State: ALoCoQmxdWnBSa/01At9XwIveuYMkIdS8b513qDzApvHGAgXg3bS5Yx9cMqtqypHyxjW1BBgufor Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Allow user to access the MDIO from userspace. Signed-off-by: Michal Simek CC: Anirudha Sarangi CC: John Linn CC: Grant Likely CC: Rob Herring CC: David S. Miller --- 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; + + if (!priv->phy_dev) + return -ENODEV; + + return phy_mii_ioctl(priv->phy_dev, rq, cmd); +} + static const struct net_device_ops axienet_netdev_ops = { .ndo_open = axienet_open, .ndo_stop = axienet_stop, @@ -1061,6 +1075,7 @@ static const struct net_device_ops axienet_netdev_ops = { .ndo_set_mac_address = netdev_set_mac_address, .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = axienet_set_multicast_list, + .ndo_do_ioctl = axienet_ioctl, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = axienet_poll_controller, #endif