From patchwork Fri Feb 17 03:42:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 13144289 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7307C636D4 for ; Fri, 17 Feb 2023 03:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230397AbjBQDnU (ORCPT ); Thu, 16 Feb 2023 22:43:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230314AbjBQDm7 (ORCPT ); Thu, 16 Feb 2023 22:42:59 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69A2310AA4 for ; Thu, 16 Feb 2023 19:42:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=v0MEiMWS+uXrX6lIdQ1G6bplK2FfCnGNtr94G+uxu9E=; b=IZBYPtmm6yMRzi/ciD4yx7w6h/ a/Xbk5imBWRxy0SrbF4458CSG1yXc/whD60MWZ/Bt4IFwayt91VbDqMbkd6Yjo19PoC1exO92xKDS lgNUFnI3Oms8AjbDym4fL+C9UcpP9m9hRBlXvyyAWbZDYslrKtF3lLTeNRRvPHIQCbyk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pSre0-005F6t-E8; Fri, 17 Feb 2023 04:42:44 +0100 From: Andrew Lunn To: netdev Cc: Florian Fainelli , Vladimir Oltean , Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , AngeloGioacchino Del Regno , Doug Berger , Broadcom internal kernel review list , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , UNGLinuxDriver@microchip.com, Byungho An , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Heiner Kallweit , Russell King , Woojung Huh , Oleksij Rempel , Andrew Lunn Subject: [PATCH RFC 14/18] net: dsa: b53: Call phylib for set_eee and get_eee Date: Fri, 17 Feb 2023 04:42:26 +0100 Message-Id: <20230217034230.1249661-15-andrew@lunn.ch> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230217034230.1249661-1-andrew@lunn.ch> References: <20230217034230.1249661-1-andrew@lunn.ch> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC phylib should be called in order to manage the EEE settings in the PHY, and to return EEE status such are supported link modes, and what the link peer supports. Signed-off-by: Andrew Lunn --- drivers/net/dsa/b53/b53_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 1e8eaf143b65..f782a08a9bc9 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2179,6 +2179,7 @@ EXPORT_SYMBOL(b53_eee_init); int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) { + struct dsa_port *dp = dsa_to_port(ds, port); struct b53_device *dev = ds->priv; struct ethtool_eee *p = &dev->ports[port].eee; u16 reg; @@ -2190,12 +2191,15 @@ int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) e->eee_enabled = p->eee_enabled; e->eee_active = !!(reg & BIT(port)); + if (dp->slave->phydev) + return phy_ethtool_get_eee(dp->slave->phydev, e); return 0; } EXPORT_SYMBOL(b53_get_mac_eee); int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) { + struct dsa_port *dp = dsa_to_port(ds, port); struct b53_device *dev = ds->priv; struct ethtool_eee *p = &dev->ports[port].eee; @@ -2205,6 +2209,8 @@ int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e) p->eee_enabled = e->eee_enabled; b53_eee_enable_set(ds, port, e->eee_enabled); + if (dp->slave->phydev) + return phy_ethtool_set_eee(dp->slave->phydev, e); return 0; } EXPORT_SYMBOL(b53_set_mac_eee);