From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DJtSX-0003DB-F2 for qemu-devel@nongnu.org; Fri, 08 Apr 2005 09:23:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DJtSS-0003AT-0x for qemu-devel@nongnu.org; Fri, 08 Apr 2005 09:23:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DJtSR-0003AB-LT for qemu-devel@nongnu.org; Fri, 08 Apr 2005 09:23:35 -0400 Received: from [195.238.3.3] (helo=outmx011.isp.belgacom.be) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DJtvJ-0008Rz-7m for qemu-devel@nongnu.org; Fri, 08 Apr 2005 09:53:25 -0400 Received: from outmx011.isp.belgacom.be (localhost [127.0.0.1]) by outmx011.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j38DqSFS031296 for ; Fri, 8 Apr 2005 15:52:29 +0200 (envelope-from ) Received: from easynet.be (199.52-201-80.adsl.skynet.be [80.201.52.199]) by outmx011.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with ESMTP id j38DqPQC031282 for ; Fri, 8 Apr 2005 15:52:25 +0200 (envelope-from ) Message-ID: <42568D7B.8070806@easynet.be> Date: Fri, 08 Apr 2005 15:56:11 +0200 From: Mark Jonckheere MIME-Version: 1.0 References: <42415A89.9000903@easynet.be> <425594EF.5090801@bellard.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] ne2000 and Netware 3.11 (Revised patch) 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 Fabrice Bellard wrote: > > This patch is not correct: it limits the memory to 16K, not 32K because > the memory starts at a 16K offset. A possible solution could be to wrap > to 16K only if (tpsr << 8) >= 48K. Moreover, it should be done in the > packet transmit code. The patch worked because standard drivers know that an original ne2000 card only has 16K RAM. I wonder if Netware works with a 32K ne2000-clone. I include two possible revised patches: The first one is just a more consistent rewrite of the previous patch: ++8<++cut+here++>8++ --- ne2000.c Sun Oct 3 15:56:00 2004 +++ ne2000-p1.c Fri Apr 8 15:05:52 2005 @@ -103,7 +103,7 @@ #define ENTSR_CDH 0x40 /* The collision detect "heartbeat" signal was lost. */ #define ENTSR_OWC 0x80 /* There was an out-of-window collision. */ -#define NE2000_PMEM_SIZE (32*1024) +#define NE2000_PMEM_SIZE (16*1024) #define NE2000_PMEM_START (16*1024) #define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START) #define NE2000_MEM_SIZE NE2000_PMEM_END @@ -268,6 +268,7 @@ /* signal end of transfert */ s->tsr = ENTSR_PTX; s->isr |= ENISR_TX; + s->cmd &= ~E8390_TRANS; ne2000_update_irq(s); } } @@ -289,7 +290,8 @@ ne2000_update_irq(s); break; case EN0_TPSR: - s->tpsr = val; + /* XXX: only 16K memory available, ignore bit 8 */ + s->tpsr = val & 0x7f; break; case EN0_TCNTLO: s->tcnt = (s->tcnt & 0xff00) | val; ++8<++cut+here++>8++ in the second one the correction is in the packet transmit code as you asked ++8<++cut+here++>8++ --- ne2000.c Sun Oct 3 15:56:00 2004 +++ ne2000-p2.c Fri Apr 8 15:06:01 2005 @@ -247,6 +247,7 @@ { NE2000State *s = opaque; int offset, page; + int index; addr &= 0xf; #ifdef DEBUG_NE2000 @@ -264,10 +265,15 @@ ne2000_update_irq(s); } if (val & E8390_TRANS) { - qemu_send_packet(s->nd, s->mem + (s->tpsr << 8), s->tcnt); + /* XXX: next 3 lines are a hack to make netware 3.11 work */ + index = s->tpsr << 8; + if (index >= NE2000_PMEM_END) + index -= NE2000_PMEM_SIZE; + qemu_send_packet(s->nd, s->mem + index, s->tcnt); /* signal end of transfert */ s->tsr = ENTSR_PTX; s->isr |= ENISR_TX; + s->cmd &= ~E8390_TRANS; ne2000_update_irq(s); } } ++8<++cut+here++>8++ greetings Mark. -- :wq