Wake on LAN working in Windows, but not in Ubuntu 16.04

CNR

I have a 16.04 server running and have set up Wake On Lan through

{ethtool - s <NIC> wol g}

and

{auto <NIC>
iface <NIC> inet dhcp
up ethtool -s <NIC> wol g}

in /etc/network/interfaces.

I use rtcwake -m mem to test, but cannot get the server to start up. I have used ngrep to control that the server receives the magic packet, and I have tried to install Windows on the server to confirm that the hardware supports WOL.

Others have reported that they can bypass this problem by shutting off with the power button, but that does not have any effect here.

What am I missing?

CNR

I found the solution

The problem arises because of an error in the sky2 NIC driver that apparently has been around some years.

It can be solved using the setpci method described in a comment on this article:

I have a Shuttle device with Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12). I have been running Ubuntu 10.04 LTS and XBMC, with the Sky2 driver v1.25. WOL running just fine in this setup.

I recently had to upgrade to 12.04 LTS as part of another story, and run into the WOL problem not working anymore with Sky2 v1.30

The Sky2 driver fails because of parameter handling of Y2_HW_WOL_ON and Y2_HW_WOL_OFF and the register writes, during the sky2_wol_init function.

I am by no means a Linux developer, but using a combination of lspci and setpci commands, I sniffed out the registers in the Marvell device that were set by the driver v1.25 and the driver v1.30, and now set the register manually with setpci when running the v1.30 driver. Wakeonlan works again with 12.04 LTS and v1.30 driver without any recompiling!

The register (in my system) is at 0x41, and needs its value setting to 0x80. My Marvell chip is on the PCI bus at 02:00.0, found using lspci.

I added this command in the same startup script used to run the ethtool sequence:

setpci -s 02:00 41.b=80

So, a nasty hack, but works fine. I would fix the sky2.c driver if I knew how to build a kernel driver on my system…

It worked even though I do not have the same controller as the poster.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related