From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA1536AB79 for ; Tue, 24 Feb 2026 09:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.13.80.246 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771924748; cv=none; b=J4S1u3CEb088qysD16Yhdhmtosr8ORrrEXDeVUN2GXOGWehFRUO0LpF9WwRNKOSACaPbCLEHnswjF9KsYPsnKz205WFI5Z5X02tk4eKp5Qzht/7Yf2Cx8ioPDq1yJFlzEHIcLf/UqOgEQPa+MZmRbj4iAudGqCmFdI4ZCJuF0HY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771924748; c=relaxed/simple; bh=E/zH2WQ17wjMh0almr5V54CPHmNhvlsIpcn6vhAI++k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N1JV27badcn+N4MsSa9lgsufD47UYi8yj14lzbgguRDLvkPXDzBOu7s6dzZzx/nl3uleOziX1J3kWI7n+snCfZ5FwrQYpBHFESohB/d5Jvg+VHSA9BBw25nFs3MloHowVMirKnubUnac4bAv/04rJQqFMYnsuPMgaUMV8brzmFQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b=rYuptmUY; arc=none smtp.client-ip=194.13.80.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.b="rYuptmUY" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5A559A3F86; Tue, 24 Feb 2026 10:18:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1771924739; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=1zfs1ZzSYNuUvKO52oJZfqu2Qk1U5evCGx95Yfix0iQ=; b=rYuptmUYsQg+7LpJCkvAInYJtry5fZ69vTbBXsiD4KO8J+g9b/yJi2z2keMCoJT6VBqMdG lvDkodGBiO4cR4VjMneANatGWSAjgQXMfgkOlzDFaP4ar0nV4BIZhmGpQ4UcgvmGCzK3TC Ko8t6I7G9pl13FHTenbS64kVq1ACcl6BVACFAgeoICShNN6/AbLh4yXbrSxFujKWhxWAwI 5JHuLoWlbNsz/G4KBb77rmo+Wt/T0bDkc3ifY9UwRuJC2E91Q3xEU/Px/DPLLYEFMSpYUL Fb8OgtHF5iPc4V+lcrEgxPpSiMNdRSbfsSuragWeP9cD7T+Nw0MMDCo29fGV5Q== From: Nicolai Buchwitz To: netdev@vger.kernel.org Cc: andrew+netdev@lunn.ch, claudiu.beznea@tuxon.dev, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, nicolas.ferre@microchip.com, pabeni@redhat.com, linux@armlinux.org.uk, phil@raspberrypi.com, Nicolai Buchwitz Subject: [PATCH net-next v2 4/5] net: cadence: macb: add ethtool EEE support Date: Tue, 24 Feb 2026 10:18:20 +0100 Message-Id: <20260224091821.47671-5-nb@tipi-net.de> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260224091821.47671-1-nb@tipi-net.de> References: <20260224091821.47671-1-nb@tipi-net.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 Implement ethtool get_eee and set_eee operations for the Cadence GEM MAC, delegating to phylink for PHY-level EEE negotiation state. The MAC-level LPI control (TXLPIEN) is not manipulated directly in the ethtool ops - phylink manages the full EEE lifecycle through the mac_enable_tx_lpi / mac_disable_tx_lpi callbacks. Both ops are gated on MACB_CAPS_EEE; platforms without the capability flag return -EOPNOTSUPP. Signed-off-by: Nicolai Buchwitz --- drivers/net/ethernet/cadence/macb_main.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index fb64a97725b1..87097100b88c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4032,6 +4032,26 @@ static const struct ethtool_ops macb_ethtool_ops = { .set_ringparam = macb_set_ringparam, }; +static int macb_get_eee(struct net_device *dev, struct ethtool_keee *eee) +{ + struct macb *bp = netdev_priv(dev); + + if (!(bp->caps & MACB_CAPS_EEE)) + return -EOPNOTSUPP; + + return phylink_ethtool_get_eee(bp->phylink, eee); +} + +static int macb_set_eee(struct net_device *dev, struct ethtool_keee *eee) +{ + struct macb *bp = netdev_priv(dev); + + if (!(bp->caps & MACB_CAPS_EEE)) + return -EOPNOTSUPP; + + return phylink_ethtool_set_eee(bp->phylink, eee); +} + static const struct ethtool_ops gem_ethtool_ops = { .get_regs_len = macb_get_regs_len, .get_regs = macb_get_regs, @@ -4053,6 +4073,8 @@ static const struct ethtool_ops gem_ethtool_ops = { .get_rxnfc = gem_get_rxnfc, .set_rxnfc = gem_set_rxnfc, .get_rx_ring_count = gem_get_rx_ring_count, + .get_eee = macb_get_eee, + .set_eee = macb_set_eee, }; static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -- 2.51.0