Re: Power off ethernet device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Hemminger wrote:
On Tue, 3 Jun 2008 08:48:30 +0000 (GMT)
Nicola Salvemini <nicolasalvemini@xxxxxxxx> wrote:

Thanks to all to help me!
Now I’m testing the possibility to use ioctl to command the PHY device. I’m studying how mii-tools works and about the possibility to reuse the Giuseppe’s patch, but I’m not an expert and I need many time!
When I’ll achieve something good, I’ll post a message.
Thank you very much for your help. Nicola.

----- Messaggio originale -----
Da: Giuseppe Cavallaro <peppe.cavallaro@xxxxxxxxx>
A: Nicola Salvemini <nicolasalvemini@xxxxxxxx>
Cc: Glenn Henshaw <thraxisp@xxxxxxxxxxxxxxxxx>; linux-net@xxxxxxxxxxxxxxx
Inviato: Lunedì 2 giugno 2008, 19:54:58
Oggetto: Re: Power off ethernet device

Glenn Henshaw wrote:
On 28-May-08, at 6:43 AM, Nicola Salvemini wrote:

Hello,

I'm developing some
software on a development board based on AT91SAM9260 processor. I
need to power off the ethernet device, but I need a “low level”
command. I mean that an “ifconfig eth0 down” command is not
suffice to my purpose, I need a command to emulate a cable
disconnection, something to power off the yellow LED on the ethernet
port.

I'd like to implement an "application layer" function that uses some kernel functions (maybe some physical abstract layer function), but I'm not very sure on how to proceed.
What PHY device are you using? Many of them allow the link to be controlled using ioctl commands. Look at mii-tool for examples of how this is done,

If your Ethernet driver uses a PHY device driver trough the PAL (physical abstract layer), there is no specific command to put in power save the PHY device (no entry in proc or sys FS, no user application).Note that, PHY Power save operation is usually performed by setting the Reg0 bit 11. Maybe, you could use the suspend/resume functions. There is a patch I posted some weeks ago to do that. Indeed, I'm continuing to work on it for the stlinux but I use the Linux PM framework to test the PHY power mode. So you ought to hack your code, as Glenn, suggested, adding a specific ioctl.
mii-tool is a good example to start.

An ethernet device should just power off PHY if possible when the
interface is marked down (ifconfig eth0 down). There are cases such
as wake-on-lan, and ASF where this is not possible because there are
features that are expected to work when device is offline.

Don't introduce additional device specific complexity to handle something
that existing device's do with existing API's.
I agree with you.
At any rate, we could also put in power-down a physical device when the suspend function is invoked (standby mode or hibernation on media).
These kind of operations are today required for an embedded Linux system.
Moreover, the suspend/resume functions, within the physical abstraction layer, do not fully perform this job. I mean, if an Ethernet driver attaches a physical device (e.g. the Generic PHY) as soon as the MAC suspend is called from the PM framework the phy device is not in power save mode. I also agree with you concerning the wake-on LAN. In this case, we cannot turn-off the phy device. I've just proposed a patch to fix that.

In the end, Nicola, I suppose working on an embedded Linux platform, could add a new ioctl, within his Ethernet device driver, just to put in power-down the PHY device, e.g. calling the genphy_suspend, (without modifying any API etc).

Regards,
Giuseppe


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

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux