virtio: net: Support non-legacy device
authorBin Meng <bmeng.cn@gmail.com>
Mon, 15 Oct 2018 09:21:24 +0000 (02:21 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 14 Nov 2018 17:16:28 +0000 (09:16 -0800)
commit699aae0800983b0230bffe999d149e7323537cb3
tree396f468d38f6e2cf1e9675ec58523d3875758929
parent550435edf810ad0a96a50e6a94d4ebf693fc5913
virtio: net: Support non-legacy device

For v1.0 compliant device, it always assumes the member 'num_buffers'
exists in the struct virtio_net_hdr while the legacy driver only
presented 'num_buffers' when VIRTIO_NET_F_MRG_RXBUF was negotiated.
Without that feature the structure was 2 bytes shorter.

Update the driver to support the non-legacy device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/virtio/virtio_net.c