From owner-freebsd-net@FreeBSD.ORG Wed Aug 19 02:55:23 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9337106568B for ; Wed, 19 Aug 2009 02:55:23 +0000 (UTC) (envelope-from sfourman@gmail.com) Received: from mail-gx0-f227.google.com (mail-gx0-f227.google.com [209.85.217.227]) by mx1.freebsd.org (Postfix) with ESMTP id 8FC868FC16 for ; Wed, 19 Aug 2009 02:55:23 +0000 (UTC) Received: by gxk27 with SMTP id 27so5331410gxk.12 for ; Tue, 18 Aug 2009 19:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Nqm2WqL82KaHD5yi9V+Lm0oTeLd/gzVjHLyoovmn+9s=; b=kHCQkJS1w/RLzCnCey8zhU86SDgQ0Bm+vCbtyoZ/XTvAWaaf41gnLxKXRpzGNIOnQl wuErnsVmRAKjY71jfDhrpMK7UKWmrxgDq/dEdRJ4srS9rVvmxgXmxPYEEB6EyVKf34Fn m+dNwAALQnzlAWxuK2S8anxhY2s+6eLU8i+XA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oQ0YoCTlMAkJMk09wfUlCiqg+8veaGS/14haBgso8he/NOR+tu+WJ6VcEhMBSwy20c aRhLC0Q6KwzgiWGuikpgAsU5OOb7D/5QlUVZBsT55EMIZZM66W7+dLvJq9Vm5Ch/O9Kq sdfFdouCuvDpBBQMrd2fdHCxdDBstARBvPg3s= MIME-Version: 1.0 Received: by 10.150.235.17 with SMTP id i17mr9403995ybh.200.1250650522830; Tue, 18 Aug 2009 19:55:22 -0700 (PDT) In-Reply-To: References: <2a41acea0905020803s63b69b1awb39538f000f5bd5a@mail.gmail.com> <2a41acea0906261725x57e6903br9f3f42b55f3a3d30@mail.gmail.com> <688430.20427.qm@web37906.mail.mud.yahoo.com> <2a41acea0906280952s23d6553ep42fcfd4671561c3a@mail.gmail.com> <2a41acea0907071722p7992bea0s281399cb0baecd90@mail.gmail.com> Date: Tue, 18 Aug 2009 21:55:22 -0500 Message-ID: <11167f520908181955x3cc90a26k3ca37fd45cfaabf3@mail.gmail.com> From: "Sam Fourman Jr." To: Mark Atkinson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Regression: em driver in -CURRENT, "Invalid MAC address" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2009 02:55:24 -0000 On Mon, Jul 13, 2009 at 12:25 PM, Mark Atkinson wrote: > Jack Vogel wrote: >> In case you hadn't seen it, the code that fixes this is now checked into >> the tip, so the latest em driver should work for you. > > I upgraded the machine in question this morning and it appears to be > working, thanks! Jack Would you be able to commit this patch to em(4) I have several machines that do not work on FreeBSD 8 BETA2 With the 82543 em(4) based card. I copied the same approach you took on e1000_82542.c Thank you Sam Fourman Jr. pciconf -v -l |grep -A4 -e "^em" em0@pci0:14:13:0: class=0x020000 card=0x10038086 chip=0x10018086 rev=0x02 hdr=0x00 vendor = 'Intel Corporation' device = '82543GC Gigabit Ethernet Adapter (Fiber)' class = network subclass = ethernet I tested this patch and it works on today's source tree **** e1000_82543.c Wed Nov 26 17:57:23 2008 --- /root/e1000_82543.c Tue Aug 18 21:23:00 2009 *************** *** 75,80 **** --- 75,81 ---- u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); + static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); /** * e1000_init_phy_params_82543 - Init PHY func ptrs. *************** *** 246,251 **** --- 247,254 ---- mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_82543; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82543; /* turn on/off LED */ mac->ops.led_on = e1000_led_on_82543; mac->ops.led_off = e1000_led_off_82543; *************** *** 1600,1602 **** --- 1603,1638 ---- E1000_READ_REG(hw, E1000_TSCTC); E1000_READ_REG(hw, E1000_TSCTFC); } + + /** + * e1000_read_mac_addr_82543 - Read device MAC address + * @hw: pointer to the HW structure + * Same approach was taken for the 82542 + * + * Reads the device MAC address from the EEPROM and stores the value. + **/ + static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) + { + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) {