From owner-freebsd-net@freebsd.org Fri Mar 25 00:44:40 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9A23ADC04C for ; Fri, 25 Mar 2016 00:44:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id A4E7E15B5 for ; Fri, 25 Mar 2016 00:44:40 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 0E100564CE; Thu, 24 Mar 2016 19:44:40 -0500 (CDT) Subject: Re: Intel I219 V2 (if_em) Wake on LAN not working To: Guido Falsi , freebsd-net@freebsd.org References: <56F284A0.4050900@madpilot.net> From: Eric van Gyzen Message-ID: <56F489F3.7010208@FreeBSD.org> Date: Thu, 24 Mar 2016 19:44:35 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <56F284A0.4050900@madpilot.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2016 00:44:40 -0000 On 03/23/16 06:57 AM, Guido Falsi wrote: > Hi, > > I have a new machine with the I219 ethernet adapter. (PCI deviceID: 0x15b8). > > It works fine on the OS, but I cannot enable wake on lan on it in any way: > > # ifconfig em0 > em0: flags=8843 metric 0 mtu 1500 > > options=4019b > ether XXX > inet XXX netmask 0xffffff00 broadcast XXX > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active > # ifconfig em0 wol > # ifconfig em0 > em0: flags=8843 metric 0 mtu 1500 > > options=4019b > ether XXX > inet XXX netmask 0xffffff00 broadcast XXX > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active > # sysctl dev.em.0.wake=1 > dev.em.0.wake: 0 -> 1 > # ifconfig em0 > em0: flags=8843 metric 0 mtu 1500 > > options=4019b > ether XXX > inet XXX netmask 0xffffff00 broadcast XXX > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active > # ifconfig em0 wol > # ifconfig em0 > em0: flags=8843 metric 0 mtu 1500 > > options=4019b > ether XXX > inet XXX netmask 0xffffff00 broadcast XXX > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active > # > > > > Sending the WOL packet does not work after shutdown, while it works if > turning off the machine from the BIOS (obviously appropriate flags in > the BIOS are turned on) with the power button. I have a new Dell XPS 8900 with the same NIC and the same problem. I'm running head (r297219). I made the following two changes: diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 6f7458c..16c7495 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -5275,7 +5275,8 @@ em_get_wakeup(device_t dev) NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); break; } - if (eeprom_data & apme_mask) + device_printf(dev, "em_get_wakeup: eeprom_data %hu\n", eeprom_data); + //if (eeprom_data & apme_mask) adapter->wol = (E1000_WUFC_MAG | E1000_WUFC_MC); /* * We have the eeprom settings, now apply the special cases >From that, I see that eeprom_data is 0, so adapter->wol stays zero, so ifconfig doesn't show any WOL capabilities. When I ignore the eeprom_data by commenting out the "if" condition, WOL capabilities appear in ifconfig. However, even when I enable WOL with ifconfig, WOL still doesn't work after a "shutdown -p now". WOL only works after I power off using the power button before the kernel boots. Eric