Re: Wake-on-LAN from suspended state

2018-04-26 Thread Paul de Weerd
Hi Erling,

On Thu, Apr 26, 2018 at 12:31:27AM +0200, Erling Westenvik wrote:
| In this context, em(4) refers to the OpenBSD driver (man em), not the
| actual physical device. Many em-devices support WoL at BIOS-level and
| machines with such setup will cold boot successfully. Resuming from
| suspend/hibernate is an altogheter different affair. It works partly on
| an em-machine I have. At least for the first zzz/arp cycle.

Hmm?  So you're saying you *can* resume a suspended machine through
WoL to its em(4) interface?

| I'm wondering: are there any OpenBSD drivers that support WoL at all? 

re(4) has this bit:

> The re driver additionally supports Wake on LAN (WoL).  See arp(8)
> and ifconfig(8) for more details.

Maybe other NIC drivers support it too, I didn't check them all.  Just
remembered that Stefan Sperling (stsp@) added it there a looong long
time ago.  Just checked: 7 years ago!

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/share/man/man4/re.4?rev=1.45=text/x-cvsweb-markup

Cheers,

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: Wake-on-LAN from suspended state

2018-04-26 Thread Paul de Weerd
Hi George,

On Wed, Apr 25, 2018 at 05:33:15PM +0100, geo...@t-t-l.co.uk wrote:
| I see the same apparent lack of support but I've been using wol happily with
| em on both 6.2 and 6.3 i386 ...  I use it to wake up a box shutdown with
| "halt -p".

Yes, as I mentioned in my original mail, that works fine for me too:
when the machine is powered off (as in your case with `halt -p`), I
can wake up the machine just fine with WoL.

| I don't remember doing anything clever and I can't see anything related in
| any config files.

My challenge is waking the machine with WoL after suspending it
through `zzz`.  To that end, as has been pointed out by a few people
on the list, you'd have to put 'wol' in the relevant hostname.if(5)
file (see the ifconfig manpage for details).  But, since the driver
for Intel gigabit network cards (em(4)) doesn't support this option,
it doesn't work.

Cheers,

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: Wake-on-LAN from suspended state

2018-04-25 Thread Erling Westenvik
On Wed, Apr 25, 2018 at 05:33:15PM +0100, geo...@t-t-l.co.uk wrote:
> On 25/04/18 07:55, Paul de Weerd wrote:
> > On Wed, Apr 25, 2018 at 02:27:44AM -0400, Jiri B wrote:
> > | On Tue, Apr 24, 2018 at 10:11:44PM +0200, Paul de Weerd wrote:
> > | > [...]
> > | > em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x04: msi, address 
> > b8:ca:3a:93:03:e8
> > |
> > | IIUC em does not support WOL. Am I right?
> >
> > Thanks Jiri, Daniel and one person who responded off-list.  I had
> > missed the ifconfig wol option, this does exactly what I want:
> >
> >  wol Enable Wake on LAN (WoL).  When enabled, reception of a
> >  WoL frame will cause the network card to power up the
> >  system from standby or suspend mode.  WoL frames are sent
> >  using arp(8).
> >
> >
> > But indeed, as Jiri suggests, it seems that em(4) doesn't support WOL:
> >
> > [weerd@pom] $ doas ifconfig em0 wol
> > ifconfig: SIOCSIFXFLAGS: Not supported
> >
> > Thanks for all the replies!
> >
> > Paul 'WEiRD' de Weerd
> >
> Hi Paul,
>
> I see the same apparent lack of support but I've been using wol happily with
> em on both 6.2 and 6.3 i386 ...  I use it to wake up a box shutdown with
> "halt -p".
>
> I don't remember doing anything clever and I can't see anything related in
> any config files.

In this context, em(4) refers to the OpenBSD driver (man em), not the
actual physical device. Many em-devices support WoL at BIOS-level and
machines with such setup will cold boot successfully. Resuming from
suspend/hibernate is an altogheter different affair. It works partly on
an em-machine I have. At least for the first zzz/arp cycle.

I'm wondering: are there any OpenBSD drivers that support WoL at all? 

Regards,
Erling



Re: Wake-on-LAN from suspended state

2018-04-25 Thread george



On 25/04/18 07:55, Paul de Weerd wrote:

On Wed, Apr 25, 2018 at 02:27:44AM -0400, Jiri B wrote:
| On Tue, Apr 24, 2018 at 10:11:44PM +0200, Paul de Weerd wrote:
| > [...]
| > em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x04: msi, address 
b8:ca:3a:93:03:e8
|
| IIUC em does not support WOL. Am I right?

Thanks Jiri, Daniel and one person who responded off-list.  I had
missed the ifconfig wol option, this does exactly what I want:

 wol Enable Wake on LAN (WoL).  When enabled, reception of a
 WoL frame will cause the network card to power up the
 system from standby or suspend mode.  WoL frames are sent
 using arp(8).


But indeed, as Jiri suggests, it seems that em(4) doesn't support WOL:

[weerd@pom] $ doas ifconfig em0 wol
ifconfig: SIOCSIFXFLAGS: Not supported

Thanks for all the replies!

Paul 'WEiRD' de Weerd


Hi Paul,

I see the same apparent lack of support but I've been using wol happily 
with em on both 6.2 and 6.3 i386 ...  I use it to wake up a box shutdown 
with "halt -p".


I don't remember doing anything clever and I can't see anything related 
in any config files.


Regards,
George.



Re: Wake-on-LAN from suspended state

2018-04-25 Thread Paul de Weerd
On Wed, Apr 25, 2018 at 02:27:44AM -0400, Jiri B wrote:
| On Tue, Apr 24, 2018 at 10:11:44PM +0200, Paul de Weerd wrote:
| > [...]
| > em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x04: msi, address 
b8:ca:3a:93:03:e8
| 
| IIUC em does not support WOL. Am I right?

Thanks Jiri, Daniel and one person who responded off-list.  I had
missed the ifconfig wol option, this does exactly what I want:

wol Enable Wake on LAN (WoL).  When enabled, reception of a
WoL frame will cause the network card to power up the
system from standby or suspend mode.  WoL frames are sent
using arp(8).


But indeed, as Jiri suggests, it seems that em(4) doesn't support WOL:

[weerd@pom] $ doas ifconfig em0 wol
ifconfig: SIOCSIFXFLAGS: Not supported

Thanks for all the replies!

Paul 'WEiRD' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: Wake-on-LAN from suspended state

2018-04-25 Thread Jiri B
On Tue, Apr 24, 2018 at 10:11:44PM +0200, Paul de Weerd wrote:
> [...]
> em0 at pci0 dev 25 function 0 "Intel I217-LM" rev 0x04: msi, address 
> b8:ca:3a:93:03:e8

IIUC em does not support WOL. Am I right?

Jiri



Re: Wake-on-LAN from suspended state

2018-04-24 Thread Daniel Melameth
On Tue, Apr 24, 2018 at 2:11 PM, Paul de Weerd  wrote:
> I've been playing with WoL recently and found that my desktop machine
> (a Dell Optiplex 9020) can be woken up from another OpenBSD machine on
> the same network with `doas arp -W ${MAC} em1` (where ${MAC} is the
> mac address of my desktop machine).  As I'm using softraid full disk
> encryption, this doesn't help too much - I still need to be present to
> unlock the crypto volume manually.
>
> Figured I try waking the machine up from sleep mode.  This machine
> suspends fine with zzz, and also wakes perfectly from sleep by pushing
> the power button (included dmesg contains one suspend / resume cycle).
> However, in suspended state, I can't wake up the machine with the
> magic packet.
>
> Reading up on the topic of WoL shows a field full of rabbit holes.
> Does anyone know if it is possible at all to do this with OpenBSD?
> I'm guessing the NIC should be left in a state that allows it to wake
> the rest of the machine when entering suspend - perhaps that's not
> done on purpose because it's not wanted.  Can anyone shed some light
> on this matter?

If I understand you correctly, have you tried enabling WoL via ifconfig?