[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] usbnet: Add missing usb_wakeup() call in usbnet
From: |
Michael Brown |
Subject: |
[Qemu-devel] [PATCH 1/4] usbnet: Add missing usb_wakeup() call in usbnet_receive() |
Date: |
Mon, 8 Feb 2016 14:19:31 +0000 |
usbnet_receive() does not currently wake up the USB endpoint, leading
to a dead RX datapath when used with a host controller such as xHCI
that relies on being woken up.
Fix by adding a call to usb_wakeup() at the end of usbnet_receive().
Signed-off-by: Michael Brown <address@hidden>
---
hw/usb/dev-network.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 985a629..cf2c641 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -642,6 +642,7 @@ typedef struct USBNetState {
uint8_t in_buf[2048];
USBEndpoint *intr;
+ USBEndpoint *bulk_in;
char usbstring_mac[13];
NICState *nic;
@@ -1311,6 +1312,7 @@ static ssize_t usbnet_receive(NetClientState *nc, const
uint8_t *buf, size_t siz
memcpy(in_buf, buf, size);
s->in_len = total_size;
s->in_ptr = 0;
+ usb_wakeup(s->bulk_in, 0);
return size;
}
@@ -1353,6 +1355,7 @@ static void usb_net_realize(USBDevice *dev, Error **errrp)
s->filter = 0;
s->vendorid = 0x1234;
s->intr = usb_ep_get(dev, USB_TOKEN_IN, 1);
+ s->bulk_in = usb_ep_get(dev, USB_TOKEN_IN, 2);
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,
--
2.3.8