From: Andrew Lunn <andrew@lunn.ch>
To: daniel.braunwarth@kuka.com
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: phy: realtek: Add support for WOL magic packet on RTL8211F
Date: Mon, 28 Apr 2025 14:53:55 +0200 [thread overview]
Message-ID: <39f9fa02-7fa9-4246-aaa5-2f14d6319f90@lunn.ch> (raw)
In-Reply-To: <20250428-realtek_wol-v1-1-15de3139d488@kuka.com>
> +static void rtl8211f_get_wol(struct phy_device *dev, struct ethtool_wolinfo *wol)
> +{
> + struct rtl821x_priv *priv = dev->priv;
> +
> + wol->supported = WAKE_MAGIC;
> + wol->wolopts = priv->saved_wolopts;
Can the current configuration be read from the hardware, rather than
using a cached value. The BIOS could for example enable magic packet,
and Linux inherits it.
> +static int rtl8211f_set_wol(struct phy_device *dev, struct ethtool_wolinfo *wol)
> +{
> + struct rtl821x_priv *priv = dev->priv;
> + const u8 *mac_addr = dev->attached_dev->dev_addr;
> + int oldpage;
> +
> + oldpage = phy_save_page(dev);
> + if (oldpage < 0)
> + goto err;
> +
> + if (wol->wolopts & WAKE_MAGIC) {
> + /* Store the device address for the magic packet */
> + rtl821x_write_page(dev, 0xd8c);
Does the datasheet have names for these magic values? Please add
#defines.
Andrew
prev parent reply other threads:[~2025-04-28 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 7:09 Daniel Braunwarth via B4 Relay
2025-04-28 12:53 ` Andrew Lunn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39f9fa02-7fa9-4246-aaa5-2f14d6319f90@lunn.ch \
--to=andrew@lunn.ch \
--cc=daniel.braunwarth@kuka.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®