e1000: conditionally raise irq at the end of MDI cycle
authorJason Wang <jasowang@redhat.com>
Thu, 22 Mar 2012 10:01:50 +0000 (18:01 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Apr 2012 07:53:48 +0000 (10:53 +0300)
According to the spec:

"When set to 1b by software, it causes an Interrupt to be
asserted to indicate the end of an MDI cycle."

We need check the Interrupt Enable bit and raise irq only when it is
set.

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

index dd067680c980e593a72802ba0539d0a1bf269de6..4e787bc2cf2a1480e9c898088867ba65218ec31c 100644 (file)
@@ -274,7 +274,10 @@ set_mdic(E1000State *s, int index, uint32_t val)
             s->phy_reg[addr] = data;
     }
     s->mac_reg[MDIC] = val | E1000_MDIC_READY;
-    set_ics(s, 0, E1000_ICR_MDAC);
+
+    if (val & E1000_MDIC_INT_EN) {
+        set_ics(s, 0, E1000_ICR_MDAC);
+    }
 }
 
 static uint32_t