summaryrefslogtreecommitdiffstats
path: root/hw/ne2000.c
diff options
context:
space:
mode:
authorbellard2004-05-22 18:52:29 +0200
committerbellard2004-05-22 18:52:29 +0200
commit8d6c7eb896fddb4d4361fc97ec90dda41e825df8 (patch)
treede97c63cc276854da6affcd734c063c40cb20a82 /hw/ne2000.c
parentpci memory mapping fix (diff)
downloadqemu-8d6c7eb896fddb4d4361fc97ec90dda41e825df8.tar.gz
qemu-8d6c7eb896fddb4d4361fc97ec90dda41e825df8.tar.xz
qemu-8d6c7eb896fddb4d4361fc97ec90dda41e825df8.zip
receive status register support (aka GRUB netboot fix)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@845 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ne2000.c')
-rw-r--r--hw/ne2000.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/ne2000.c b/hw/ne2000.c
index 6897bafd4f..9a04c921da 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -118,6 +118,7 @@ typedef struct NE2000State {
uint16_t tcnt;
uint16_t rcnt;
uint32_t rsar;
+ uint8_t rsr;
uint8_t isr;
uint8_t dcfg;
uint8_t imr;
@@ -212,7 +213,11 @@ static void ne2000_receive(void *opaque, const uint8_t *buf, int size)
next -= (s->stop - s->start);
/* prepare packet header */
p = s->mem + index;
- p[0] = ENRSR_RXOK; /* receive status */
+ s->rsr = ENRSR_RXOK; /* receive status */
+ /* XXX: check this */
+ if (buf[0] & 0x01)
+ s->rsr |= ENRSR_PHY;
+ p[0] = s->rsr;
p[1] = next >> 8;
p[2] = total_len;
p[3] = total_len >> 8;
@@ -232,7 +237,7 @@ static void ne2000_receive(void *opaque, const uint8_t *buf, int size)
size -= len;
}
s->curpag = next >> 8;
-
+
/* now we can signal we have receive something */
s->isr |= ENISR_RX;
ne2000_update_irq(s);
@@ -360,6 +365,9 @@ static uint32_t ne2000_ioport_read(void *opaque, uint32_t addr)
case EN1_MULT ... EN1_MULT + 7:
ret = s->mult[offset - EN1_MULT];
break;
+ case EN0_RSR:
+ ret = s->rsr;
+ break;
default:
ret = 0x00;
break;