Re: Power off ethernet device

From: Stephen Hemminger
Date: Tue Jun 03 2008 - 13:24:54 EST


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.
--
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