Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RTL8111/8168B wake on lan (WOL) working randomly

296 views
Skip to first unread message

Juan Sierra Pons

unread,
Jan 1, 2012, 3:10:02 PM1/1/12
to
Dear all,

I have been spending many days trying to make my computer start using
the with wake on lan (WOL) feature.

My PC has a "Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)"
integrated NIC

lspci -v

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)
Subsystem: ASUSTeK Computer Inc. P5B
Flags: bus master, fast devsel, latency 0, IRQ 41
I/O ports at dc00 [size=256]
Memory at fdfff000 (64-bit, non-prefetchable) [size=4K]
[virtual] Expansion ROM at fdd00000 [disabled] [size=128K]
Capabilities: [40] Power Management version 2
Capabilities: [48] Vital Product Data
Capabilities: [50] MSI: Enable+ Count=1/2 Maskable- 64bit+
Capabilities: [60] Express Endpoint, MSI 00
Capabilities: [84] Vendor Specific Information: Len=4c <?>
Capabilities: [100] Advanced Error Reporting
Capabilities: [12c] Virtual Channel
Capabilities: [148] Device Serial Number 1a-00-00-00-10-ec-81-68
Capabilities: [154] Power Budgeting <?>
Kernel driver in use: r8168

I have found on many mailing lists, forums that it is necessary the
r8168 module to make it works as by default Debian wheezy uses the
r8169 so I have installed the newest r8168 module from
http://code.google.com/p/r8168/

For example:
http://djlab.com/2010/10/fixing-rtl8111-8168b-driver-debian-ubuntu/comment-page-1/

The problem is that when I shutdown the computer the NIC is switched
off too. I can see it as the port in my home ADSL router is switched
off. BUT randomly I can see that the NIC is not switched off after a
shutdown and if I send the WOL packet from another computer it works
like a charm.

I have already checked the following:

* My computer uses the right module as i have blacklisted the r8169:

more /etc/modprobe.d/blacklist-network.conf
blacklist r8169

* I am using the last module version:

ethtool -i eth0
driver: r8168
version: 8.027.00-NAPI
firmware-version:
bus-info: 0000:02:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: yes
supports-register-dump: yes

* NIC has the WOL feature enabled (Wake-on: g)

root@mediacenter:/etc# ethtool eth0

Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes

* I have already modified the /etc/init.d/halt script with NETDOWN=no
to do not switch off the NIC
[....]
NETDOWN=no
[....]
# Make it possible to not shut down network interfaces,
# needed to use wake-on-lan
netdown="-i"
if [ "$NETDOWN" = "no" ]; then
netdown=""
fi
[....]

I can not see any pattern as it works around 10-20% of the times I
shutdown the computer locally, remotely or from the poweroff button.

Thanks a log for your time.

Best regards

Juan Sierra Pons

--------------------------------------------------------------------------------------
Juan Sierra Pons                                 ju...@elsotanillo.net
Linux User Registered: #257202       http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00  6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CABSy9sAGc4MWWtoZg+YWJ2WZ...@mail.gmail.com

Scott Ferguson

unread,
Jan 1, 2012, 6:50:01 PM1/1/12
to
You might try the tip suggested in:-
http://lists.debian.org/debian-user/2011/12/msg01704.html


Thank you for supplying all that info - I'm only familiar with one WOL
tool (wakeonlan). I don't know if it's the one you use but... some NICs
will always work with:-
wakeonlan xx:xx:xx:xx:xx:xx

others require:-
wakeonlan -i bro.adc.ast.msk xx:xx:xx:xx:xx:xx

eg. wakeonlan -i 192.168.0.255 66:66:b0:a4:22:f6



Cheers

--
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/4F00F042...@gmail.com

Janek Lapka

unread,
Jan 2, 2012, 9:50:02 PM1/2/12
to
Juan Sierra Pons <ju...@elsotanillo.net> writes:

>lspci -v
>
>02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
^^ The 2 digit at the beginning of the line means the pci bus



More info:
http://www.thinkwiki.org/wiki/WakeOnLAN
or google: pci-config wol

> The problem is that when I shutdown the computer the NIC is switched
> off too. I can see it as the port in my home ADSL router is switched
> off. BUT randomly I can see that the NIC is not switched off after a
> shutdown and if I send the WOL packet from another computer it works
> like a charm.

Use pci-config (apt-get install nictools-pci) to put the nic into
sleep mode

(part of my /etc/network/interfaces)
# pci-config -B 4 -#1
# gigabyte p35c-ds3r pci bus ^ ^ device number
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
# wol gigabyte p35c-ds3r (on asus p5b I don't need this)
#pre-up pci-config -W -B 4 -#1 # I don't use
#pre-up pci-config -B 4 -#1 # I don't use
pre-down pci-config -S -B 4 -#1 # Put device to sleep (ACPI D3)
pre-down pci-config -B 4 -#1 # Show the current status



Also, if you share the drive with MS-Windows it may change the status of
the driver.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/87wr99p...@ibmx60t.lan

Camaleón

unread,
Jan 3, 2012, 11:10:02 AM1/3/12
to
On Sun, 01 Jan 2012 21:01:33 +0100, Juan Sierra Pons wrote:

> I have been spending many days trying to make my computer start using
> the with wake on lan (WOL) feature.

(...)

> The problem is that when I shutdown the computer the NIC is switched off
> too. I can see it as the port in my home ADSL router is switched off.
> BUT randomly I can see that the NIC is not switched off after a shutdown
> and if I send the WOL packet from another computer it works like a
> charm.

(...)

Okay, so the fact your system powers off the ethernet adapter "randomly"
is the key of the problem. This should not happen.

As the network interface comes integrated within the motherboard, I would
look for a BIOS update and check if it solves someting related to power
management or WOL (hint: most of the manufacturers do not write down the
full BIOS release changelogs unless you directly contact them, so it's a
good idea to ask the motherboard's manufacturer directly and query about
this).

A bad PSU, "too smart" UPS unit (or a power surge strip) can be also
making noise here...

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/pan.2012.01...@gmail.com

Juan Sierra Pons

unread,
Jan 3, 2012, 3:50:01 PM1/3/12
to
2012/1/3 Janek Lapka <jan...@gmail.com>:
Hi all,

Finally Janek pointed me in the right direction: nictools-pci package
and the pci-config command

I tried the pre-down directive in the /etc/network/interfaces and it
worked ok but the second or third time I rebooted my PC it got frozen
so I started to search the internet and I found a web [1] explaining
how to use the pci-config

I've make it work using the following procedure:

lspci -nn |grep -i Ether

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd.
RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev
01)
^^ The 2 digit at the beginning of the line means the pci bus (As
explained by Janek)
^ ^ this is the vendor:model number


Then:

pci-config -B 2
pci-config.c:v2.05 2/23/2005 Donald Becker (bec...@scyld.com)
http://www.scyld.com/diag/index.html
Device #1 at bus 2 device/function 0/0, 816810ec.
^-----^ this
is tne model:vendor number the same as before BUT in different order

Now I know the BUS number (2) and device number (#1)

So I can use the pci-config to put the NIC in the proper state for WOL:

pci-config -B 2 -# 1 -S

Instead of using the pre-down directive in the /etc/network/interfaces
I choose the /etc/init.d/halt script as written in [1] and added the
following lines just before "halt -d -f $netdown $poweroff $hddown"

[...]
### http://lists.debian.org/debian-user/2012/01/msg00182.html
### http://ubuntuforums.org/archive/index.php/t-951563.html
rmmod r8168
sleep 0.5
modprobe r8168
sleep 0.5
pci-config -B 2 -# 1 -S
sleep 0.5

log_action_msg "Will now halt"
halt -d -f $netdown $poweroff $hddown
[...]

I have restarted my PC at least 10 times and it works without problem.

[1] http://ubuntuforums.org/archive/index.php/t-951563.html


Thank you guys for your time!!

Best regards

--------------------------------------------------------------------------------------
Juan Sierra Pons ju...@elsotanillo.net
Linux User Registered: #257202 http://www.elsotanillo.net
GPG key = 0xA110F4FE
Key Fingerprint = DF53 7415 0936 244E 9B00 6E66 E934 3406 A110 F4FE
--------------------------------------------------------------------------------------


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CABSy9v7U21xQ6mE4asoNARe...@mail.gmail.com
0 new messages