e1000: set E1000_ICR_INT_ASSERTED only for 8257x
authorJason Wang <jasowang@redhat.com>
Thu, 22 Mar 2012 10:02:34 +0000 (18:02 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Apr 2012 07:53:48 +0000 (10:53 +0300)
E1000_ICR_INT_ASSERTED were introduced only for 8257x, so we need to
check the E1000_DEVID before setting this bit in ICS.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/e1000.c

index b5c26e0dd8648b97ced4d8871115d9e944a37560..4573f1301e79b835d5a35cf0ee89485dc184d061 100644 (file)
@@ -223,8 +223,10 @@ static const uint32_t mac_reg_init[] = {
 static void
 set_interrupt_cause(E1000State *s, int index, uint32_t val)
 {
-    if (val)
+    if (val && (E1000_DEVID >= E1000_DEV_ID_82547EI_MOBILE)) {
+        /* Only for 8257x */
         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);