* [Qemu-devel] patch to make ne2000 usable in Minix 2.0.4
@ 2004-05-25 5:05 Jim C. Brown
0 siblings, 0 replies; only message in thread
From: Jim C. Brown @ 2004-05-25 5:05 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
I've managed to apply this patch to the current CVS.
I'm not sure what the exact problem with the Minix NE2000 driver is. I do know
that it has something to do with the Bochs PANIC message: "tx start, dev in reset".
As far as I can see, it appears that Minix is trying to send packets over
the ne2k w/o initializing it properly. This prevents Minix from actually using
the NIC, although it is able to detect it w/o any problems. My patch basicly
forces qemu to allow Minix to work with the NIC. I should emphasize that this
is a Minix bug, and my patch is a workaround for it. (However, from what I've
heard real NICs work fine with the Minix driver in spite of its bug.)
Before you yell at me for trying to fix Minix's bugs in qemu, I should add that
the NE2000 in Bochs works just perfectly with Minix.
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.
[-- Attachment #2: ne2000.c.diff --]
[-- Type: text/plain, Size: 1098 bytes --]
--- ne2000.c.old Tue May 25 00:38:03 2004
+++ ne2000.c Tue May 25 00:51:37 2004
@@ -271,6 +271,25 @@
ne2000_update_irq(s);
}
}
+ /* this is a workaround for a bug in Minix 2.0.4net */
+ else if (val & E8390_TRANS) {
+ printf("NE2000: I quote thy Bochs: tx start, dev in reset\n");
+ /* this printf above is just to annoy the user endlessly. **
+ ** feel free to remove it if you must. */
+ s->isr &= ~ENISR_RESET;
+ /* test specific case: zero length transfert **
+ ** not sure if it is needed */
+ if ((val & (E8390_RREAD | E8390_RWRITE)) &&
+ s->rcnt == 0) {
+ s->isr |= ENISR_RDC;
+ ne2000_update_irq(s);
+ }
+ qemu_send_packet(s->nd, s->mem + (s->tpsr << 8), s->tcnt);
+ /* signal end of transfert */
+ s->tsr = ENTSR_PTX;
+ s->isr |= ENISR_TX;
+ ne2000_update_irq(s);
+ }
} else {
page = s->cmd >> 6;
offset = addr | (page << 4);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-25 5:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-25 5:05 [Qemu-devel] patch to make ne2000 usable in Minix 2.0.4 Jim C. Brown
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).