Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp426760ybh; Thu, 12 Mar 2020 04:42:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtnNtt8oejeVx5lceQ9hbtudacQGkTY7QUjfX8gV5dON/0UGs0FhOKxtA0IEqZAySGZsjLX X-Received: by 2002:aca:c70f:: with SMTP id x15mr2201874oif.80.1584013369491; Thu, 12 Mar 2020 04:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584013369; cv=none; d=google.com; s=arc-20160816; b=IC7H4ei012MaCcHGS3tFnTSMr8UvPoOtTL7YwUd6voYMrIJt+7XXtL70wQYR+FzyF9 RFnYFjJ6iFEeZbgshMKKBpXOfJStjLDRuE4oZa6wNjRIbevQxiMblGQkvbT9EnwCZ8Ls eEL6nCK/GELxAjCzjMsHrIyW3t+pskMEjYC0OAcjxYbki+v0Zq3+/NUpJQ0R/foerF2w tThoNaVYsiK/4j6UOJqItBnS8tuM1pA5GNeu8L+uIi7nTIUQNI0nygnDHfvT2xhIifYe +U8/bXLNi/7R4VB+vqEOFWdCvYl3a9wDp007f8j12O6FOHkH+KKa7npaNUPkD5e67PaV uZIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=jScrN07Zji2Zhmw6FJBzmsOBnTdnMHYJDk0KzmuiCqA=; b=ezv48VK8WlUOPnedbW39ZMiMSrYlyX2S6TaGGflo7+uJe2vQneOIGyrJYHvdJSL9a5 8l0XlId3aGikxEcENAoOx6+Hn2jucCaZFluyoJ5tSErOR+xNNLR90xCx0iKXvs4yt8nz vGE/QaEhRcP4pD0C/bqdqKGOuwj8mgUQmh/GErKImNPBwwalyLijcoLn+DvSPCFEnpck r+ptqQEBU+YxCKy2kj2+8SKLVE5YgMWZNoby1NxVN69U5zp3GEbKxt8t3kj454Ny/NDM SPNX03EOH9Cv0EsV4s04J/WusCOejWSbezl12Itvo4XBdsl0Qi4oHxpiuVKqEzY97rsV V7Ow== 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 d24si2350129oij.121.2020.03.12.04.42.36; Thu, 12 Mar 2020 04:42:49 -0700 (PDT) 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 S1726817AbgCLLlg (ORCPT + 99 others); Thu, 12 Mar 2020 07:41:36 -0400 Received: from foss.arm.com ([217.140.110.172]:60960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725268AbgCLLlg (ORCPT ); Thu, 12 Mar 2020 07:41:36 -0400 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 1ACA331B; Thu, 12 Mar 2020 04:41:35 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11AB33F67D; Thu, 12 Mar 2020 04:41:33 -0700 (PDT) Date: Thu, 12 Mar 2020 11:41:31 +0000 From: Andre Przywara To: Radhey Shyam Pandey Cc: "David S . Miller" , Michal Simek , Robert Hancock , "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 09/14] net: axienet: Add mii-tool support Message-ID: <20200312114131.070d9a1c@donnerap.cambridge.arm.com> In-Reply-To: References: <20200110115415.75683-1-andre.przywara@arm.com> <20200110115415.75683-10-andre.przywara@arm.com> Organization: ARM X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jan 2020 06:12:10 +0000 Radhey Shyam Pandey wrote: Hi, (sorry, forgot to send this out before posting v2) > > -----Original Message----- > > From: Andre Przywara > > Sent: Friday, January 10, 2020 5:24 PM > > 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 > > > > 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; > > I think phy ioctl should be allowed even if the device is not up. > Or is there any specific reason for keeping it? I found that some of the drivers check this (macb, stmmac), while others (dpaa2, mvneta, mvpp2, mtk_eth) don't. I don't know the reasons for that, so I play safe here. Happy to change this if someone provides some rationale. Cheers, Andre. > > > + > > + 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 >