Tracing Wake on Lan problem?

Matthew Hagerty matthew at digitalstratum.com
Tue Aug 11 04:25:00 UTC 2009


Greetings,

I'm trying to get the Wake on Lan feature working on a 7.2-release box.  
I have two Intel NIC's, a Pro/100 and Pro/1000 (82541PI).  The Pro/100 
worked great right from the start using the generic kernel and was 
detected by the fxp driver.  Using the wol (from ports) on another box 
fired the WoL box right up.  However, I would like to use the gigabit 
card in the WoL box, which is detected by the em driver, and according 
to the WoL wiki and some posts to hackers a few months ago, the em 
driver does not have WoL support yet.

I went digging and actually found FreeBSD specific drivers (in source 
code form) on Intel's site (would never have guessed that in a million 
years) and the code provided builds an if_em kernel load module.  So I 
built a custom kernel removing all network card drivers.  Then I built 
and installed the Intel provided if_em module.  The system starts fine 
and configures the NIC, but I still do not have WoL ability.  What can I 
do to track down where the problem might be?  Here are some details:

# dmesg
. . .
em0: <Intel(R) PRO/1000 Network Connection 6.9.12> port 0x14c0-0x14ff 
mem 0x40200000-0x4021ffff,0x40300000-0x4031ffff irq 18 at device 9.0 on pci2
. . .

6.9.12 is the version in the source code provided by Intel.  The em 
driver that comes with 7.2R is 6.9.6 I believe.  Device 0x107c matches 
my NIC in the e1000_hw.h file:

#define E1000_DEV_ID_82541GI_LF               0x107C

# sysctl -a | grep em.0
dev.em.0.%desc: Intel(R) PRO/1000 Network Connection 6.9.12
dev.em.0.%driver: em
dev.em.0.%location: slot=9 function=0
dev.em.0.%pnpinfo: vendor=0x8086 device=0x107c subvendor=0x8086 
subdevice=0x1376 class=0x020000
dev.em.0.%parent: pci2
dev.em.0.debug: -1
dev.em.0.stats: -1
dev.em.0.rx_int_delay: 0
dev.em.0.tx_int_delay: 66
dev.em.0.rx_abs_int_delay: 66
dev.em.0.tx_abs_int_delay: 66
dev.em.0.rx_processing_limit: 100

# ifconfig -m em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        
capabilities=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
        ether 00:1b:21:3a:32:ed
        inet 10.0.81.6 netmask 0xffffff00 broadcast 10.0.81.255
        media: Ethernet autoselect (1000baseTX <full-duplex>)
        status: active
        supported media:
                media autoselect
                media 1000baseTX
                media 1000baseTX mediaopt full-duplex
                media 100baseTX mediaopt full-duplex
                media 100baseTX
                media 10baseT/UTP mediaopt full-duplex
                media 10baseT/UTP

The card does not report WoL in its capabilities, however the datasheet 
(http://download.intel.com/design/network/datashts/318138.pdf) indicates 
WoL support.

# kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 536ef8   kernel
 2    1 0xc0937000 31eec    if_em.ko
 3    1 0xc0969000 6a45c    acpi.ko
 4    1 0xc238b000 3000     daemon_saver.ko

# kldstat -v
. . .
2    1 0xc0937000 31eec    if_em.ko
        Contains modules:
                Id Name
                 1 pci/em
. . .

The if_em.c code from Intel also have functions for dealing with WoL:

/* Management and WOL Support */
static void     em_init_manageability(struct adapter *);
static void     em_release_manageability(struct adapter *);
static void     em_get_hw_control(struct adapter *);
static void     em_release_hw_control(struct adapter *);
static void     em_enable_wakeup(device_t);

I've been reading through the code to see if there is any reason why my 
specific chipset would be ignored or have special #ifdefs, etc., but I 
don't see anything.  Only the multi-port fiber cards seem to have 
special code (only port A supports the WoL it seems).  I'm pretty good 
with C but have no device driver programming experience (but I would 
like to learn some).  Any tips or pointers on how I can proceeded to 
solving this would be greatly appreciated.  Also, is there any reason 
Intel's source is not provided with FreeBSD, since it seems they have 
taken the time to write the driver?  Probably a copyright thing right?  
Either way, I'd like to get this working if possible.

Thanks,
Matthew



More information about the freebsd-hackers mailing list