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] [day] [month] [year] [list]
Message-Id: <1257186579.2847.24.camel@achroite.uk.solarflarecom.com>
Date:	Mon, 02 Nov 2009 18:29:39 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	David Miller <davem@...emloft.net>, mchan@...adcom.com,
	netdev@...r.kernel.org
Subject: Re: RFC: netdev: allow ethtool physical id to drop rtnl_lock

On Mon, 2009-11-02 at 08:51 -0800, Stephen Hemminger wrote:
[...]
> For compatibility, I was thinking of adding a new ethtool hook that
> moves the blinking loop into ethtool.
>
> static int ethtool_phys_blink(struct net_device *dev, u32 secs)
> {
> 	while (secs > 0) {
> 		dev->ethtool_ps->phys_led(dev, ETH_LED_ON);
> ...
> 		dev->ethtool_ps->phys_led(dev, ETH_LED_OFF);
> 	}
> 	dev->ethtool_ops->phys_led(dev, ETH_LED_NORMAL);
> }
[...]

We could even force this on unconverted drivers, but using a longer
loop period to allow for slow blinking:

static int ethtool_phys_id_loop(struct net_device *dev, u32 secs)
{
	u32 timeout;
	int rc;

	for (;;) {
		timeout = min_t(u32, secs, 5);
		secs -= timeout;
		rc = dev->ethtool_ops->phys_id(dev, timeout);
		if (rc || secs == 0)
			return rc;
		...
	}
}

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists