From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 11 04:25:00 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A44561065670 for ; Tue, 11 Aug 2009 04:25:00 +0000 (UTC) (envelope-from matthew@digitalstratum.com) Received: from mail-yx0-f181.google.com (mail-yx0-f181.google.com [209.85.210.181]) by mx1.freebsd.org (Postfix) with ESMTP id 694998FC2B for ; Tue, 11 Aug 2009 04:25:00 +0000 (UTC) Received: by yxe11 with SMTP id 11so4725007yxe.3 for ; Mon, 10 Aug 2009 21:24:59 -0700 (PDT) Received: by 10.100.240.15 with SMTP id n15mr4580931anh.63.1249962924905; Mon, 10 Aug 2009 20:55:24 -0700 (PDT) Received: from ?10.0.81.13? (adsl-76-236-176-45.dsl.klmzmi.sbcglobal.net [76.236.176.45]) by mx.google.com with ESMTPS id d29sm1516907and.18.2009.08.10.20.55.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 20:55:24 -0700 (PDT) Message-ID: <4A80EBA6.40908@digitalstratum.com> Date: Mon, 10 Aug 2009 23:55:18 -0400 From: Matthew Hagerty Organization: Digital Stratum User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Tracing Wake on Lan problem? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: matthew@digitalstratum.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 04:25:00 -0000 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: 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 metric 0 mtu 1500 options=9b capabilities=19b ether 00:1b:21:3a:32:ed inet 10.0.81.6 netmask 0xffffff00 broadcast 10.0.81.255 media: Ethernet autoselect (1000baseTX ) 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