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]
Date: Mon, 19 Jun 2023 16:18:29 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev <netdev@...r.kernel.org>, ansuelsmth@...il.com,
	Russell King <rmk+kernel@...linux.org.uk>,
	Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH net-next v0 2/3] net: phy: phy_device: Call into the PHY
 driver to set LED offload

On Sun, Jun 18, 2023 at 07:39:36PM +0200, Andrew Lunn wrote:
> Linux LEDs can be requested to perform hardware accelerated blinking
> to indicate link, RX, TX etc. Pass the rules for blinking to the PHY
> driver, if it implements the ops needed to determine if a given
> pattern can be offloaded, to offload it, and what the current offload
> is. Additionally implement the op needed to get what device the LED is
> for.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>

...

> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 11c1e91563d4..1db63fb905c5 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -1104,6 +1104,20 @@ struct phy_driver {
>  	int (*led_blink_set)(struct phy_device *dev, u8 index,
>  			     unsigned long *delay_on,
>  			     unsigned long *delay_off);
> +	/* Can the HW support the given rules. Return 0 if yes,
> +	 * -EOPNOTSUPP if not, or an error code.
> +	 */
> +	int (*led_hw_is_supported)(struct phy_device *dev, u8 index,
> +				   unsigned long rules);
> +	/* Set the HW to control the LED as described by rules. */
> +	int (*led_hw_control_set)(struct phy_device *dev, u8 index,
> +				  unsigned long rules);
> +	/* Get the rules used to describe how the HW is currently
> +	 * configure.
> +	 */
> +	int (*led_hw_control_get)(struct phy_device *dev, u8 index,
> +				  unsigned long *rules);
> +

Hi Andrew,

for consistency it would be nice if the comments for
the new members above was in kernel doc format.

>  };
>  #define to_phy_driver(d) container_of(to_mdio_common_driver(d),		\
>  				      struct phy_driver, mdiodrv)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ