[patch] WOL support for nfe(4)

Pyun YongHyeon pyunyh at gmail.com
Tue Nov 9 01:15:11 UTC 2010

On Fri, Nov 05, 2010 at 11:10:37AM +0100, Yamagi Burmeister wrote:
> Hi,
> some time ago we migrated a lot of boxes from Linux to FreeBSD. Those
> machines have a "NVIDIA nForce4 CK804 MCP4" network adapter, supported
> by nfe(4). Even if nfe(4) at least tries to enable the WOL capability of
> the NIC it doesn't work and nfe(4) doesn't integrate with FreeBSDs (new)
> WOL framework. Since we are in need of WOL I spend some minutes to
> implement it the correct way.
> Attached are two patches:
> - if_nfe_wol_8.1.diff against FreeBSD 8.1-RELEASE-p1, this one is used
>   on our servers.
> - if_nfe_wol_current.diff against -CURRENT r214831. This one is
>   _untested_! But it should work...
> In case that the patches a stripped by mailman they can be found here:
> http://deponie.yamagi.org/freebsd/nfe/
> This patch works reliable on our machines and nfe(4) runs without any
> problems with it. But nevertheless my skills in writting network drivers
> are somewhat limited therefor a review by somewhat with better knowledge
> of the WOL framework and maybe nfe(4) itself is highly anticipated.

Thanks for the patch. I attached slightly modified the code to
better match other WOL capable drivers in tree. Because data sheet
is not available I blindly made a patch based on your code. I have
a couple of questions which I can't verify it on real hardware(I
have no more access to the hardware).

o If you established a gigabit link with link partner and shutdown
  your box, does the established link automatically change to 10 or
  100Mbps? You can check it on your link partner. If your link
  partner still reports it established 1000Mbps link, we have to
  do other necessary work in driver(i.e. manually switching to
o When you put your box into suspend mode, can you wake up your box
  with WOL magic packet?
o When your system boots up with/without WOL magic packet, sending
  WOL magic packets from other hosts can hang your box?
o If you disabled WOL with ifconfig before system shutdown, can you
  still wakeup your box with WOL magic packet?
o If you reprogram your station address with ifconfig(i.e. ifconfig
  nfe0 ether xx:xx:xx:xx:xx:xx), can you still wakeup your box with
  WOL magic packet?

The patch I made didn't take into account management firmware so
if you use the patch with IMPI, IMPI wouldn't work. But I think
that's not an issue since all other parts of nfe(4) also ignores
management firmware at this moment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nfe.wol.patch
Type: text/x-diff
Size: 3486 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20101109/edbc15d2/nfe.wol.bin

More information about the freebsd-net mailing list