View Single Post
Old 12-11-03, 03:31 AM   #8
sphere
Registered User
 
Join Date: Jul 2003
Posts: 20
Default

Wake-on-LAN:
NOTE: This will not work flawlessly with the nvnet driver, use forcedeth instead if you value WOL.
This works with Debian on an Abit NF7-S, but it's probably easy enough to adapt it for your setup.
http://www.scyld.com/diag/index.html
Download ftp://ftp.scyld.com/pub/diag/pci-config.c

NOTE: You have to figure out yourself what device number your nic has:
Example:
#! /bin/shsphere@barton:~/media$ lspci
[SNIP]
00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1)
[SNIP]

sphere@barton:~/media$ ./pci-config
pci-config.c:v2.03 4/15/2002 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/index.html
[SNIP]
Device #12 at bus 0 device/function 4/0, 006610de.
[SNIP]

sphere@barton:~/media$ cat /proc/pci
PCI devices found:
[SNIP]
Bus 0, device 4, function 0:
Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev 161).
IRQ 20.
Master Capable. No bursts. Min Gnt=1.Max Lat=20.
Non-prefetchable 32 bit memory at 0xe0087000 [0xe0087fff].
[SNIP]

sphere@barton:~/media$ ./pci-config -a -#12
pci-config.c:v2.03 4/15/2002 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/index.html
Device #12 at bus 0 device/function 4/0.
006610de 00b00007 020000a1 00000000 e0087000 0000b001 00000000 00000000
00000000 00000000 00000000 1c00147b 00000000 00000044 00000000 1401010b
1c00147b fe020001 00000100 00000004 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Base Address 0: Memory at e0087000.
Base Address 1: I/O at 0000b000.
Address 0 memory at e0087000, decoded bits are 00000fff.
Address 1 is I/O at 0000b000, decoded bits are 00000006.
No BIOS extension (boot ROM).
Extended capabilities, first structure at offset 0x44.
Extended PCI capability type 1 at 0x44, next 0.
Power management entry ver. 2: Capabilities fe02, Ctrl 0100, Event 0000.
Power state D0.

Now that you know the device number, you can force it to power state D3 at shutdown. The forcedeth driver will complain about the transceiver. After power down you are able to wake your box up by sending it a magic packet, with ether-wake for Linux for instance.

Add script for init 0:
sphere@barton:/usr/src$ more /etc/rc0.d/S21D3NIC
echo "Putting NIC to D3 state -- FIXME!!!"
/home/sphere/media/pci-config -S -#12 | grep Power
/home/sphere/media/pci-config -a -#12 | grep Power
sphere is offline   Reply With Quote