Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp606541ybl; Fri, 10 Jan 2020 03:56:42 -0800 (PST) X-Google-Smtp-Source: APXvYqyh/hqIl5yYDb7z+sDGpj3E0eM8kLqGzqup/hQOlqXAJ7YQ6KBpKVucrXWcLzjaJ6lBgYaZ X-Received: by 2002:aca:55cc:: with SMTP id j195mr1954201oib.22.1578657402802; Fri, 10 Jan 2020 03:56:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578657402; cv=none; d=google.com; s=arc-20160816; b=g4ETP+aiAyZvhi9KRZmaSjsQRGjB69RdYglK0rH5Uu+LNeoqazlgAWgU+XUh+WpWsz gBZOEnKqVV4ljMoSU5LgvjJUvNN1+8X4db6otsxwpVqAp8u7dxjXCts3MlOObh/qeaNF 2UgSjJimV4zUJBk77cP6H8DaZJIHrwe9uMgb1EUKSnBBjOZUk2dvkFKT8TCihBYv8IDo 6JFpdTkwGZHpVFOf1osSdQigYkI2RrkhHI5O0HQ5A/NlGJYDNxEpQpL920Z/AA2lv0Rq 79xvHXH6MZqEQpse/y4LoYsCInnWmSY2oAEPQy0/6WK0evl78mFdC9kkUPvSYaABQxb2 gRuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=OgbeyuhGykGw2aCdzoxtItoC9+m+THUp98I3/FkuM0M=; b=LUNoWldbmQW5nY7mPTTQieVgNVZIyQsizxvSFq3pIi6MV8pbJsNFU9mbVbijqIxizX xXvpGuQnwOLVMxtyA1Sce3r0Bw3uE1p0r6EEZsYj+VT8WBnYym2itMtEdk6zIZeI+D/8 zDL+z0N6yfNzEwhOdw18BdDzapuo5Was/ifPt8UI380IEsakOhwX7mJdHlQ3Hiu7d/1X k7NuGaMPjvmwfl9C2nE0Xlz0jVmaLlDR2T0Wfw83ZMMXJa3pSm30jtFYsnX8dgwDPKKI T8qhQo/KGiUDfCs0c0tSKYlzgGMab+oCPRAkmEn8345mDe1HfVYSBCL/pi1Cs67CgfZ9 mQIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si1036235oth.267.2020.01.10.03.56.31; Fri, 10 Jan 2020 03:56:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728278AbgAJLzG (ORCPT + 99 others); Fri, 10 Jan 2020 06:55:06 -0500 Received: from foss.arm.com ([217.140.110.172]:43170 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728128AbgAJLyf (ORCPT ); Fri, 10 Jan 2020 06:54:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5E5281063; Fri, 10 Jan 2020 03:54:35 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 453313F534; Fri, 10 Jan 2020 03:54:34 -0800 (PST) From: Andre Przywara To: "David S . Miller" , Radhey Shyam Pandey Cc: Michal Simek , Robert Hancock , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/14] net: axienet: Add mii-tool support Date: Fri, 10 Jan 2020 11:54:10 +0000 Message-Id: <20200110115415.75683-10-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200110115415.75683-1-andre.przywara@arm.com> References: <20200110115415.75683-1-andre.przywara@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mii-tool is useful for debugging, and all it requires to work is to wire up the ioctl ops function pointer. Add this to the axienet driver to enable mii-tool. Signed-off-by: Andre Przywara --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 7a747345e98e..64f799f3d248 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1152,6 +1152,16 @@ static void axienet_poll_controller(struct net_device *ndev) } #endif +static int axienet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) +{ + struct axienet_local *lp = netdev_priv(dev); + + if (!netif_running(dev)) + return -EINVAL; + + return phylink_mii_ioctl(lp->phylink, rq, cmd); +} + static const struct net_device_ops axienet_netdev_ops = { .ndo_open = axienet_open, .ndo_stop = axienet_stop, @@ -1159,6 +1169,7 @@ static const struct net_device_ops axienet_netdev_ops = { .ndo_change_mtu = axienet_change_mtu, .ndo_set_mac_address = netdev_set_mac_address, .ndo_validate_addr = eth_validate_addr, + .ndo_do_ioctl = axienet_ioctl, .ndo_set_rx_mode = axienet_set_multicast_list, #ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = axienet_poll_controller, -- 2.17.1