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