From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BSUAp-0006vt-4D for qemu-devel@nongnu.org; Tue, 25 May 2004 01:08:23 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BSUAI-0006pX-3y for qemu-devel@nongnu.org; Tue, 25 May 2004 01:08:22 -0400 Received: from [38.113.3.61] (helo=babyruth.hotpop.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BSUAH-0006pN-Ph for qemu-devel@nongnu.org; Tue, 25 May 2004 01:07:49 -0400 Received: from phreaker.net (kubrick.hotpop.com [38.113.3.103]) by babyruth.hotpop.com (Postfix) with SMTP id 836445105EA for ; Tue, 25 May 2004 04:36:21 +0000 (UTC) Received: from jbrown.mylinuxbox.org (pcp02555028pcs.batlfl01.tn.comcast.net [68.60.22.179]) by smtp-3.hotpop.com (Postfix) with ESMTP id C1D02F88B04 for ; Tue, 25 May 2004 04:47:07 +0000 (UTC) Date: Tue, 25 May 2004 01:05:37 -0400 From: "Jim C. Brown" Message-ID: <20040525050537.GA28890@jbrown.mylinuxbox.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline Subject: [Qemu-devel] patch to make ne2000 usable in Minix 2.0.4 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ne2000.c.diff" --- 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); --ZGiS0Q5IWpPtfppv--