Discussion:
IFCAP_WOL
(too old to reply)
SAITOH Masanobu
2010-03-07 09:29:20 UTC
Permalink
Hello.

As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.

The function is disabled by default because it may wastes a battery's
capacity in a notebook. So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.

Any objections?

----------------------------------------------------------
SAITOH Masanobu (***@iij.ad.jp
***@netbsd.org)


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Bernd Ernesti
2010-03-07 09:40:09 UTC
Permalink
Post by SAITOH Masanobu
Hello.
As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.
The function is disabled by default because it may wastes a battery's
capacity in a notebook.
I agree that turning it off for a notebook is a good idea.

With a desktop adapter and netbsd-5 it seems that shutdown -p does not turn
the power off because I still see the active led on the adapater and the switch.
Post by SAITOH Masanobu
So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.
What is that?
Post by SAITOH Masanobu
Any objections?
Too which proposal?

Bernd


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2010-03-07 09:57:03 UTC
Permalink
From: Bernd Ernesti <***@lists.veego.de>
Subject: Re: IFCAP_WOL
Date: Sun, 7 Mar 2010 10:40:09 +0100
Post by Bernd Ernesti
Post by SAITOH Masanobu
Hello.
As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.
The function is disabled by default because it may wastes a battery's
capacity in a notebook.
I agree that turning it off for a notebook is a good idea.
With a desktop adapter and netbsd-5 it seems that shutdown -p does not turn
the power off because I still see the active led on the adapater and the switch.
Perhaps, the behavior depends on a system and the setting of the BIOS.
My Thinkpad X61 drops the link when I suspend with zzz command without my
change.
Post by Bernd Ernesti
Post by SAITOH Masanobu
So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.
What is that?
Post by SAITOH Masanobu
Any objections?
Too which proposal?
Bernd
I'm sorry. My proposal is:

0) Add the following definitions into net/if.h for the capability and
enabled flag.

#define IFCAP_WOL_UCAST 0x080000 /* wake on any unicast frame */
#define IFCAP_WOL_MCAST 0x100000 /* wake on any multicast frame */
#define IFCAP_WOL_MAGIC 0x200000 /* wake on any Magic Packet */

#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)

1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).

----------------------------------------------------------
SAITOH Masanobu (***@iij.ad.jp
***@netbsd.org)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Bernd Ernesti
2010-03-07 10:09:05 UTC
Permalink
Post by SAITOH Masanobu
Subject: Re: IFCAP_WOL
Date: Sun, 7 Mar 2010 10:40:09 +0100
Post by Bernd Ernesti
Post by SAITOH Masanobu
Hello.
As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.
The function is disabled by default because it may wastes a battery's
capacity in a notebook.
I agree that turning it off for a notebook is a good idea.
With a desktop adapter and netbsd-5 it seems that shutdown -p does not turn
the power off because I still see the active led on the adapater and the switch.
Perhaps, the behavior depends on a system and the setting of the BIOS.
That is not an onboard device. It is a pcie card.
I also see that with a pci card in another machine.
Post by SAITOH Masanobu
My Thinkpad X61 drops the link when I suspend with zzz command without my
change.
Post by Bernd Ernesti
Post by SAITOH Masanobu
So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.
What is that?
Post by SAITOH Masanobu
Any objections?
Too which proposal?
Bernd
0) Add the following definitions into net/if.h for the capability and
enabled flag.
#define IFCAP_WOL_UCAST 0x080000 /* wake on any unicast frame */
#define IFCAP_WOL_MCAST 0x100000 /* wake on any multicast frame */
#define IFCAP_WOL_MAGIC 0x200000 /* wake on any Magic Packet */
#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).
I see.
Defaulting to leave it turned off? So it is up to the admin to enable it.

Bernd


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2010-03-07 11:50:43 UTC
Permalink
Post by Bernd Ernesti
Post by SAITOH Masanobu
0) Add the following definitions into net/if.h for the capability and
enabled flag.
#define IFCAP_WOL_UCAST 0x080000 /* wake on any unicast frame */
#define IFCAP_WOL_MCAST 0x100000 /* wake on any multicast frame */
#define IFCAP_WOL_MAGIC 0x200000 /* wake on any Magic Packet */
#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).
I see.
Defaulting to leave it turned off?
Yes, ofcourse.
Post by Bernd Ernesti
So it is up to the admin to enable it.
Bernd
----------------------------------------------------------
SAITOH Masanobu (***@iij.ad.jp
***@netbsd.org)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Joerg Sonnenberger
2010-03-07 11:13:38 UTC
Permalink
Post by SAITOH Masanobu
0) Add the following definitions into net/if.h for the capability and
enabled flag.
#define IFCAP_WOL_UCAST 0x080000 /* wake on any unicast frame */
#define IFCAP_WOL_MCAST 0x100000 /* wake on any multicast frame */
#define IFCAP_WOL_MAGIC 0x200000 /* wake on any Magic Packet */
#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).
Are those the only three options supported by hardware?

Joerg

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2010-03-07 12:08:01 UTC
Permalink
Hi, Joerg.

From: Joerg Sonnenberger <***@britannica.bec.de>
Subject: Re: IFCAP_WOL
Date: Sun, 7 Mar 2010 12:13:38 +0100
Post by Joerg Sonnenberger
Post by SAITOH Masanobu
0) Add the following definitions into net/if.h for the capability and
enabled flag.
#define IFCAP_WOL_UCAST 0x080000 /* wake on any unicast frame */
#define IFCAP_WOL_MCAST 0x100000 /* wake on any multicast frame */
#define IFCAP_WOL_MAGIC 0x200000 /* wake on any Magic Packet */
#define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC)
1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).
Are those the only three options supported by hardware?
No. The wm has many wakeup functions other than above:

Wake on Link status change.
Wake on ARP request.
Some other special functions (I don't know the detail yet...)

The FreeBSD's code says that age, ale, gsip, ste, stge, txp, re and vge
have some capabilities of IFCAP_WOL_MCAST, IFCAP_UCAST and IFCAP_WOL_MAGIC.
Post by Joerg Sonnenberger
Joerg
----------------------------------------------------------
SAITOH Masanobu (***@iij.ad.jp
***@netbsd.org)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Joerg Sonnenberger
2010-03-07 16:50:06 UTC
Permalink
Post by SAITOH Masanobu
Post by Joerg Sonnenberger
Post by SAITOH Masanobu
1) Add [-]wol, [-]wol_ucast, [-]wol_mcast and [-]wol_magic flags into
ifconfig(8).
Are those the only three options supported by hardware?
Wake on Link status change.
Wake on ARP request.
Some other special functions (I don't know the detail yet...)
The FreeBSD's code says that age, ale, gsip, ste, stge, txp, re and vge
have some capabilities of IFCAP_WOL_MCAST, IFCAP_UCAST and IFCAP_WOL_MAGIC.
OK, the question is whether we want to have a capability for each
possible wake up event. I think it is a better idea to have one
capability IFCAP_WOL and a separate ioctl to set the specific mechanism.

Joerg

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2010-03-08 19:43:41 UTC
Permalink
Post by SAITOH Masanobu
Hello.
As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.
How will this interact with pmf(9)?

How will this work on a machine without an ACPI BIOS?
Post by SAITOH Masanobu
The function is disabled by default because it may wastes a battery's
capacity in a notebook. So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.
It will only waste battery capacity on a notebook if the operator
activated wake-on-LAN, correct?

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2010-03-09 12:41:16 UTC
Permalink
From: David Young <***@pobox.com>
Subject: Re: IFCAP_WOL
Date: Mon, 8 Mar 2010 13:43:41 -0600
Post by David Young
Post by SAITOH Masanobu
Hello.
As I wrote in the commit message for if_wm.c rev. 1.203. I've succeeded
waking up from suspend(S3) by the Magic Packet. I tested on my ThinkPad X61.
How will this interact with pmf(9)?
wm_attach():
pmf_device_register(self, wm_suspend, wm_resume);

and,

static bool
wm_suspend(device_t self, const pmf_qual_t *qual)
{
struct wm_softc *sc = device_private(self);

wm_release_manageability(sc); /*
* Tell the firmware to take over
* the manageability from the OS.
*/
wm_release_hw_control(sc); /*
* Tell the firmware that the driver
* is unloaded.
*/
wm_enable_wakeup(sc); /*
* 1) Tell the wakeup capability to the
* system, 2) set the APM wakeup, 3) set
* the power management function in the
* Ethernet controller, it will keep
* the power of the PHY on, 4) set PME
* function in PCI spec.
*/
return true;
}

static bool
wm_resume(device_t self, const pmf_qual_t *qual)
{
struct wm_softc *sc = device_private(self);

wm_init_manageability(sc); /* get back the control */

return true;
}
Post by David Young
How will this work on a machine without an ACPI BIOS?
Post by SAITOH Masanobu
The function is disabled by default because it may wastes a battery's
capacity in a notebook. So I think it's a good solution to introduce FreeBSD's
IFCAP_WOL to NetBSD.
It will only waste battery capacity on a notebook if the operator
activated wake-on-LAN, correct?
Yes, it will. But some systems (e.g. my own Intel DQ45CB (though it's not
a notebook)) don't obey my code, so it keeps the power of the PHY on when
the WOL is disabled and it's suspended. Perhaps, the behavior is depend on
the BIOS.

For wm(4), if The Intel AMT is enabled, it seems that the power of the PHY
may be on regardless of the WOL setting of the OS. The behavior is depend
on the setting of the Intel AMT, too.
Post by David Young
Dave
--
David Young OJC Technologies
----------------------------------------------------------
SAITOH Masanobu (***@iij.ad.jp
***@netbsd.org)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2010-03-09 18:15:17 UTC
Permalink
Post by SAITOH Masanobu
Post by David Young
How will this interact with pmf(9)?
static bool
wm_suspend(device_t self, const pmf_qual_t *qual)
{
struct wm_softc *sc = device_private(self);
wm_release_manageability(sc); /*
* Tell the firmware to take over
* the manageability from the OS.
*/
Is that the host firmware or the NIC firmware?
Post by SAITOH Masanobu
wm_enable_wakeup(sc); /*
* 1) Tell the wakeup capability to the
* system, 2) set the APM wakeup, 3) set
* the power management function in the
* Ethernet controller, it will keep
* the power of the PHY on, 4) set PME
* function in PCI spec.
*/
In this step, I think that wm(4) needs to cooperate with PMF:

1 When wm_suspend() is called, PMF has already suspended all of the wm's
children (PHYs). PMF needs information that it should not suspend the
wm's children. Resetting the PHYs

2 A driver should probably not enable PME# itself. Instead, it should
let pci_child_suspend() enable PME#.

3 PMF needs to enable a PME# input to wake the system. In a system with
ACPI BIOS, you call some method on some ACPI node to do that. (See
the hw.wake.* sysctl nodes.) BTW, I have a Dell desktop with two
nodes for PCI, hw.wake.PCI0 and hw.wake.PCI1. I think that PME# on my
wm(4) add-on card is wired to one or the other, but not both.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jukka Ruohonen
2010-03-10 04:30:15 UTC
Permalink
Post by SAITOH Masanobu
wm_enable_wakeup(sc); /*
* 1) Tell the wakeup capability to the
* system, 2) set the APM wakeup, 3) set
* the power management function in the
* Ethernet controller, it will keep
* the power of the PHY on, 4) set PME
* function in PCI spec.
If you look at the big picture, wouldn't it be better to abstract this into
generic PCI or pmf(9) code?

- Jukka.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...