mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
net: introduce qemu_get_nic()
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
b356f76de3
commit
cc1f0f4542
28 changed files with 92 additions and 78 deletions
|
@ -1261,7 +1261,7 @@ static void usb_net_handle_data(USBDevice *dev, USBPacket *p)
|
|||
|
||||
static ssize_t usbnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
|
||||
{
|
||||
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
USBNetState *s = qemu_get_nic_opaque(nc);
|
||||
uint8_t *in_buf = s->in_buf;
|
||||
size_t total_size = size;
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ static ssize_t usbnet_receive(NetClientState *nc, const uint8_t *buf, size_t siz
|
|||
|
||||
static int usbnet_can_receive(NetClientState *nc)
|
||||
{
|
||||
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
USBNetState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
if (is_rndis(s) && s->rndis_state != RNDIS_DATA_INITIALIZED) {
|
||||
return 1;
|
||||
|
@ -1319,7 +1319,7 @@ static int usbnet_can_receive(NetClientState *nc)
|
|||
|
||||
static void usbnet_cleanup(NetClientState *nc)
|
||||
{
|
||||
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
|
||||
USBNetState *s = qemu_get_nic_opaque(nc);
|
||||
|
||||
s->nic = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue