From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz8lY-00015c-Pi for qemu-devel@nongnu.org; Fri, 03 Jan 2014 12:42:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz8lQ-0002gL-C3 for qemu-devel@nongnu.org; Fri, 03 Jan 2014 12:42:36 -0500 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:49241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz8lQ-0002gE-6A for qemu-devel@nongnu.org; Fri, 03 Jan 2014 12:42:28 -0500 Received: by mail-ea0-f174.google.com with SMTP id b10so6715223eae.5 for ; Fri, 03 Jan 2014 09:42:27 -0800 (PST) Date: Fri, 3 Jan 2014 18:42:18 +0100 From: Beniamino Galvani Message-ID: <20140103174217.GA4600@gmail.com> References: <1388654332-10303-1-git-send-email-b.galvani@gmail.com> <1388654332-10303-2-git-send-email-b.galvani@gmail.com> <20140102145836.GB23307@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 1/2] hw/net: add support for Allwinner EMAC Fast Ethernet controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , Li Guang , "qemu-devel@nongnu.org Developers" , Stefan Hajnoczi , "Edgar E. Iglesias" On Fri, Jan 03, 2014 at 11:26:01AM +1000, Peter Crosthwaite wrote: > >> > +static const VMStateDescription vmstate_tx_fifo = { > >> > + .name = "allwinner_emac_tx_fifo", > >> > + .version_id = 1, > >> > + .minimum_version_id = 1, > >> > + .fields = (VMStateField[]) { > >> > + VMSTATE_UINT32_ARRAY(data, AwEmacTxFifo, FIFO_SIZE >> 2), > >> > + VMSTATE_INT32(length, AwEmacTxFifo), > >> > + VMSTATE_INT32(offset, AwEmacTxFifo), > >> > + VMSTATE_END_OF_LIST() > >> > + } > >> > +}; > >> > >> This might warrant a dup of fifo8 as fifo32 if you want to clean this > >> up. I think I have a patch handy that might help, will send tmrw. > >> Check util/fifo8.c for fifo8 example. > > > > Yes, probably AwEmacTxFifo can be replaced with Fifo32. > > I need to obtain a pointer to the fifo backing buffer after the frame has been copied completely in order to pass it to qemu_send_packet(). The generic fifo implementation doesn't allow that (unless I access directly the structure member, but I suppose that the intent is to treat the fifo object as opaque). Maybe a function fifo_get_data() could be added to the generic implementation? Otherwise I can go on using my custom implementation. Beniamino