From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HVtcI-0001ZH-Sy for qemu-devel@nongnu.org; Mon, 26 Mar 2007 14:08:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HVtcG-0001Ym-Ts for qemu-devel@nongnu.org; Mon, 26 Mar 2007 14:08:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVtcG-0001Y6-LW for qemu-devel@nongnu.org; Mon, 26 Mar 2007 13:08:24 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HVtZy-0004dI-Q7 for qemu-devel@nongnu.org; Mon, 26 Mar 2007 14:06:03 -0400 Received: by ug-out-1314.google.com with SMTP id j40so1882014ugd for ; Mon, 26 Mar 2007 11:05:58 -0700 (PDT) Message-ID: <46080B80.6030908@gmail.com> Date: Mon, 26 Mar 2007 20:05:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Marcel Block Subject: [Qemu-devel] Ne2000 bug?, buffer full/empty 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 Hi qemu-devers, this is my first post here, so please be kind :-) i believe i found a bug in qemu's ne2000 code. i'm currently working on a ne2000 driver for my little hobby-os and i'm having some troubles getting it to receive any packets when running on qemu. but it works fine on bochs and on _real_ ne2000-hardware (rtl8029-pci in my case). i believe the case "current page register == boundary register" should be interpreted as 'buffer empty' instead of 'buffer full'. this was changed last year or so by dr. han zhu, i tried to send him a email but it looks like the email-address he used back then is no longer available. the current code looks like this: (hw/ne2000.c): static int ne2000_buffer_full(NE2000State *s) { int avail, index, boundary; index = s->curpag << 8; boundary = s->boundary << 8; if (index <= boundary) avail = boundary - index; else avail = (s->stop - s->start) - (index - boundary); if (avail < (MAX_ETH_FRAME_SIZE + 4)) return 1; return 0; } that way qemu thinks the buffer is full if index==boundary. if i change the "if(index <= boundary)" back to "if(index < boundary)" my driver appears to work fine. all the specs i read so far tend to initialize those two registers to the same value. so it appears logical that index==boundary should be interpreted as 'buffer empty'. i'm waiting for your feedback :-) best regards, marcel block