qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] bug report + fix: e1000.c in 0.10.5 does not properly e


From: Bill Paul
Subject: Re: [Qemu-devel] bug report + fix: e1000.c in 0.10.5 does not properly emulate real hardware
Date: Tue, 9 Jun 2009 12:42:56 -0700
User-agent: KMail/1.5.3

Of all the gin joints in all the towns in all the world, Richard W.M. Jones 
had to walk into mine and say:

> On Mon, Jun 08, 2009 at 08:39:26PM -0700, Bill Paul wrote:
> > I can generate a unified diff, but I'm not sure I understand what is
> > meant by "Signed-off-by." Can you elaborate? (Sorry, I'm not familiar
> > with the QEMU development process. I just wanted to send a bug report. :)
>
> It's just a convention started on the Linux kernel mailing lists a
> few years back.  Just put this in your email with the patch:
>
>   Signed-off-by: Your Name <address@hidden>
>
> See also: http://kerneltrap.org/node/3929
>
> Rich.

Ah, ok. Will do.

Note: this diff is against the 0.10.5 released sources. not the latest code in 
the repository (though the same bugs are still there, I'm sure).

-Bill

-- 
=============================================================================
-Bill Paul            (510) 749-2329 | Senior Engineer, Master of Unix-Fu
                 address@hidden | Wind River Systems
=============================================================================
   "I put a dollar in a change machine. Nothing changed." - George Carlin
=============================================================================


Signed-off-by: Bill Paul <address@hidden>
---

--- e1000.c.orig        2009-05-20 13:46:59.000000000 -0700
+++ e1000.c     2009-06-08 14:23:24.000000000 -0700
@@ -155,6 +155,7 @@
     if (val)
         val |= E1000_ICR_INT_ASSERTED;
     s->mac_reg[ICR] = val;
+    s->mac_reg[ICS] = val;
     qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0);
 }
 
@@ -275,10 +276,14 @@
 {
     unsigned int index, r = s->mac_reg[EERD] & ~E1000_EEPROM_RW_REG_START;
 
+    if ((s->mac_reg[EERD] & E1000_EEPROM_RW_REG_START) == 0)
+        return (s->mac_reg[EERD]);
+
     if ((index = r >> E1000_EEPROM_RW_ADDR_SHIFT) > EEPROM_CHECKSUM_REG)
-        return 0;
-    return (s->eeprom_data[index] << E1000_EEPROM_RW_REG_DATA) |
-           E1000_EEPROM_RW_REG_DONE | r;
+        return (E1000_EEPROM_RW_REG_DONE | r);
+
+    return ((s->eeprom_data[index] << E1000_EEPROM_RW_REG_DATA) |
+           E1000_EEPROM_RW_REG_DONE | r);
 }
 
 static void
@@ -767,7 +772,7 @@
     getreg(WUFC),      getreg(TDT),    getreg(CTRL),   getreg(LEDCTL),
     getreg(MANC),      getreg(MDIC),   getreg(SWSM),   getreg(STATUS),
     getreg(TORL),      getreg(TOTL),   getreg(IMS),    getreg(TCTL),
-    getreg(RDH),       getreg(RDT),    getreg(VET),
+    getreg(RDH),       getreg(RDT),    getreg(VET),    getreg(ICS),
 
     [TOTH] = mac_read_clr8,    [TORH] = mac_read_clr8, [GPRC] = mac_read_clr4,
     [GPTC] = mac_read_clr4,    [TPR] = mac_read_clr4,  [TPT] = mac_read_clr4,





reply via email to

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