From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6158C43331 for ; Wed, 25 Mar 2020 13:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6EC420658 for ; Wed, 25 Mar 2020 13:43:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="3Xxdvt6/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727673AbgCYNne (ORCPT ); Wed, 25 Mar 2020 09:43:34 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:56740 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727383AbgCYNnd (ORCPT ); Wed, 25 Mar 2020 09:43:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1/8mTWJrenAg7O/YlpnDgMgE1IImRPDkK2qH5LisLrQ=; b=3Xxdvt6/CQ+RcOocwfyz8+R8d1 z82iZDmhcvBBUIoCVVaWs07AM+pg2nz2ctHbld02U7pSdvgvnBHWu7t5O1t3b6o4pN9sZ3uiwhngQ ESVcnLsMtqN1cvJirrm4oxe9XNEVX+t2mTS1qn0JtIPWTLXcr51Qd9a1oXh2NV9winTM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jH6Je-0004PP-C2; Wed, 25 Mar 2020 14:43:30 +0100 Date: Wed, 25 Mar 2020 14:43:30 +0100 From: Andrew Lunn To: Marek Vasut Cc: netdev@vger.kernel.org, o.rempel@pengutronix.de, Florian Fainelli , Guenter Roeck , Heiner Kallweit , Jean Delvare Subject: Re: [RFC][PATCH 1/2] ethtool: Add BroadRReach Master/Slave PHY tunable Message-ID: <20200325134330.GD3819@lunn.ch> References: <20200325101736.2100-1-marex@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200325101736.2100-1-marex@denx.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 25, 2020 at 11:17:35AM +0100, Marek Vasut wrote: > Add a PHY tunable to select BroadRReach PHY Master/Slave mode. > > Signed-off-by: Marek Vasut > Cc: Andrew Lunn > Cc: Florian Fainelli > Cc: Guenter Roeck > Cc: Heiner Kallweit > Cc: Jean Delvare > Cc: netdev@vger.kernel.org > --- > include/uapi/linux/ethtool.h | 1 + > net/core/ethtool.c | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h > index dc69391d2bba..ebe658804ef1 100644 > --- a/include/uapi/linux/ethtool.h > +++ b/include/uapi/linux/ethtool.h > @@ -259,6 +259,7 @@ struct ethtool_tunable { > enum phy_tunable_id { > ETHTOOL_PHY_ID_UNSPEC, > ETHTOOL_PHY_DOWNSHIFT, > + ETHTOOL_PHY_BRR_MODE, > /* > * Add your fresh new phy tunable attribute above and remember to update > * phy_tunable_strings[] in net/core/ethtool.c > diff --git a/net/core/ethtool.c b/net/core/ethtool.c > index 09d828a6a173..553f3d0e2624 100644 > --- a/net/core/ethtool.c > +++ b/net/core/ethtool.c > @@ -133,6 +133,7 @@ static const char > phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = { > [ETHTOOL_ID_UNSPEC] = "Unspec", > [ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift", > + [ETHTOOL_PHY_BRR_MODE] = "phy-broadrreach-mode", > }; > > static int ethtool_get_features(struct net_device *dev, void __user *useraddr) > @@ -2524,6 +2525,7 @@ static int ethtool_phy_tunable_valid(const struct ethtool_tunable *tuna) > { > switch (tuna->id) { > case ETHTOOL_PHY_DOWNSHIFT: > + case ETHTOOL_PHY_BRR_MODE: > if (tuna->len != sizeof(u8) || > tuna->type_id != ETHTOOL_TUNABLE_U8) > return -EINVAL; Hi Marek As far as i understand, there are only two settings. Master and Slave. So you can make the validation here more specific. I would also add some #defines for this in include/uapi/linux/ethtool.h so it is clear what value represents master and what is slave. Andrew