qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current
@ 2009-06-07 19:29 Juergen Lock
  2009-06-07 20:07 ` Juergen Lock
  2009-06-13 22:21 ` Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Lock @ 2009-06-07 19:29 UTC (permalink / raw)
  To: qemu-devel

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

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);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current
  2009-06-07 19:29 [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current Juergen Lock
@ 2009-06-07 20:07 ` Juergen Lock
  2009-06-13 22:21 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Lock @ 2009-06-07 20:07 UTC (permalink / raw)
  To: nox; +Cc: qemu-devel

>[...]

The Subject should probably have been...
Subject: [PATCH] Fix e1000 emulation for FreeBSD 8.0-current _guests_

 Sorry,
	Juergen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current
  2009-06-07 19:29 [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current Juergen Lock
  2009-06-07 20:07 ` Juergen Lock
@ 2009-06-13 22:21 ` Anthony Liguori
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2009-06-13 22:21 UTC (permalink / raw)
  To: Juergen Lock; +Cc: qemu-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-13 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-07 19:29 [Qemu-devel] [PATCH] Fix e1000 emulation for FreeBSD 8.0-current Juergen Lock
2009-06-07 20:07 ` Juergen Lock
2009-06-13 22:21 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).