Received: from eggs.gnu.org ([2001:4830:134:3::10]:44540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnrD1-0002MC-M3 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:44:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnrCs-0006fS-9N for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:44:19 -0500 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:48861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnrCs-0006fG-2h for qemu-devel@nongnu.org; Tue, 03 Dec 2013 09:44:10 -0500 Received: by mail-wg0-f48.google.com with SMTP id z12so13672639wgg.27 for ; Tue, 03 Dec 2013 06:44:09 -0800 (PST) Date: Tue, 3 Dec 2013 15:44:05 +0100 From: Stefan Hajnoczi Message-ID: <20131203144405.GG24604@stefanha-thinkpad.muc.redhat.com> References: <1385131669-16845-1-git-send-email-dmitry.s.smagin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385131669-16845-1-git-send-email-dmitry.s.smagin@gmail.com> Subject: Re: [Qemu-devel] [RFC] hw/net: add DEC Tulip NIC emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Smagin Cc: Dmitry Smagin , qemu-devel@nongnu.org, Antony Pavlov On Fri, Nov 22, 2013 at 06:47:49PM +0400, Dmitry Smagin wrote: > From: Antony Pavlov > > This patch adds emulation of DEC/Intel Tulip 21143 with some external chips: > * Intel LXT971A 10/100 Mbps PHY MII Tranceiver; > * Microchip 93LC46B 1K Microwire Compatible Serial EEPROM. > > Restrictions and TODOs: > - Tulip always work in promisc-mode with no packet filtering > (TODO: check qemu packet filtering interfaces) > > - Address errors in packet descriptors are not checked > > - Tulip is bound to PCI, no other bus is possible for now > (TODO: Rewrite code to permit Tulip to live on buses other than PCI) > > - Internal transceiver is not emulated > The reason: internal transceiver works with 10 Mbps but we need 100Mbps > which only external transceivers can give. > > - Link status is not emulated, it's always ON > (TODO: use standard qemu interface) > > - Incorrect behavior of the Tulip driver is not checked and there's no error > signaling via register CSR5 > > - Only transfer/receive (TI/RI) interrupts are emulated > > - Subsystem IDs in EEPROM image are not good > (TODO: find proper IDs) The NIC needs to tell QEMU when it transitions from a rx descriptors exhausted state to a rx refilled state. For example, the e1000 NIC calls qemu_flush_queued_packets(qemu_get_queue(s->nic)) when the RDT hardware register is written to by the guest. This is necessary since the netdev (e.g. tap) disables receive when the NIC runs out of rx descriptors. > +static const VMStateDescription vmstate_tulip = { > + .name = "tulip", > + .version_id = 2, > + .minimum_version_id = 1, > + .minimum_version_id_old = 1, > + .fields = (VMStateField[]) { > + VMSTATE_PCI_DEVICE(dev, TulipState), > + VMSTATE_MACADDR(conf.macaddr, TulipState), This looks a little sparse :). Other hardware registers probably need to be saved/loaded too.