qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current
Date: Sat, 13 Jun 2009 17:21:42 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

Juergen Lock wrote:
FreeBSD 8.0-current svn rev >= 190872 changed the way initial
MAC addresses are read in the em(4) driver, it now reads them from
E1000_RA instead of from the EEPROM.  See e1000_read_mac_addr_generic()
in sys/dev/e1000/if_em.c:
        
http://svn.freebsd.org/viewvc/base/head/sys/dev/e1000/e1000_nvm.c?view=markup&pathrev=190872
        http://svn.freebsd.org/viewvc/base?view=revision&revision=190872

Needs a Signed-off-by.

diff --git a/hw/e1000.c b/hw/e1000.c
index 2665792..5d614bd 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1102,6 +1102,16 @@ static void pci_e1000_init(PCIDevice *pci_dev)
     memmove(d->phy_reg, phy_reg_init, sizeof phy_reg_init);
     memset(d->mac_reg, 0, sizeof d->mac_reg);
     memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init);
+    /*
+     * FreeBSD 8.0-current svn rev >= 190872 expects the mac address here,
+     * see e1000_read_mac_addr_generic() in sys/dev/e1000/if_em.c:
+     * 
http://svn.freebsd.org/viewvc/base/head/sys/dev/e1000/e1000_nvm.c?view=markup&pathrev=190872
+     * http://svn.freebsd.org/viewvc/base?view=revision&revision=190872
+     */
+    d->mac_reg[RA] = (macaddr[3]<<24) | (macaddr[2]<<16) |
+ (macaddr[1]<<8) | macaddr[0]; + d->mac_reg[RA+1] = (macaddr[5]<<8) | macaddr[4]; +
     d->rxbuf_min_shift = 1;
     memset(&d->tx, 0, sizeof d->tx);




--
Regards,

Anthony Liguori





reply via email to

[Prev in Thread] Current Thread [Next in Thread]