Drivers/Net/MarvellYukon: Don't re-use DMA buffers
Drivers/Net/MarvellYukon: Don't re-use DMA buffers

Change the receive buffers to be single-use only. This involves a few
changes that work together:
1. Change msk_newbuf() to not attempt to re-use or free a buffer,
2. Change msk_rxeof() free the buffer when it is done with it,
3. Store a temporary copy of the received data for passing to
   the Receive Queue,
4. Call the required Flush() and Unmap() on the DMA buffer.

In addition this means failure to allocate a new buffer is a failure
of msk_rxeof().

Note that this change makes the driver work the way the FreeBSD driver
(from which this driver was derived) works, and this simply removes an
optimization (the code in msk_newbuf() which re-uses the buffers. This
removal of the optimization is done for two reasons:
1. The optimization failed to work for 64-bit DMA transfers;
2. The UEFI specification, version 2.6, section 13.4 requires calls to
   Flush() and Unmap() before reading a DMA write buffer from the CPU,
   which doesn't fit with the optimization as it existed.

Reverting back to the behavior as it was in the FreeBSD driver solves
number 1 and 2 above, and makes this driver more consistent with
something we know to be working. There is slightly more overhead, but
it is more consistent with the UEFI standard.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alan Ott <91e38e63b890fbb214c8914809fde03c73e7f24d@softiron.co.uk>
[ardb: replaced struct assignment with gBS->CopyMem()]
Reviewed-by: Ard Biesheuvel <66d3c5fdaeea7ff1f996ad04f2c45e08ab38e2f5@linaro.org>

hisilicon/OpenPlatformPkg,hisilicon/OpenPlatformPkg,jlinton/OpenPlatformPkg,jlinton/OpenPlatformPkg