lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97df39dc-daae-4334-bb80-d690851e5269@gmail.com>
Date: Mon, 16 Oct 2023 08:37:50 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>,
 "David S. Miller" <davem@...emloft.net>, Andrew Lunn <andrew@...n.ch>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Vladimir Oltean <olteanv@...il.com>,
 Woojung Huh <woojung.huh@...rochip.com>,
 Arun Ramadoss <arun.ramadoss@...rochip.com>,
 Conor Dooley <conor+dt@...nel.org>,
 Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
 Rob Herring <robh+dt@...nel.org>
Cc: kernel@...gutronix.de, linux-kernel@...r.kernel.org,
 netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com,
 "Russell King (Oracle)" <linux@...linux.org.uk>, devicetree@...r.kernel.org
Subject: Re: [PATCH net-next v4 4/9] net: dsa: microchip: ksz9477: add Wake on
 LAN support



On 10/16/2023 7:12 AM, Oleksij Rempel wrote:
> Add WoL support for KSZ9477 family of switches. This code was tested on
> KSZ8563 chip.
> 
> KSZ9477 family of switches supports multiple PHY events:
> - wake on Link Up
> - wake on Energy Detect.
> Since current UAPI can't differentiate between this PHY events, map all of them
> to WAKE_PHY.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> ---
[snip]
> +void ksz9477_get_wol(struct ksz_device *dev, int port,
> +		     struct ethtool_wolinfo *wol)
> +{
> +	u8 pme_ctrl, pme_conf;
> +	int ret;
> +
> +	ret = ksz_read8(dev, REG_SW_PME_CTRL, &pme_conf);
> +	if (ret)
> +		return;
> +
> +	if (!(pme_conf & PME_ENABLE))
> +		return;

I suppose this works beause you have separate enable bits for 
WOL_LINKUP, WOL_ENERGY and WOL_MAGICPKT, you could have also left the 
setting of the PME_ENABLE bit to the set_wol() routine provided that 
wol->wolopts is non-zero.

Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ