qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Brown <mcb30@ipxe.org>
To: qemu-devel@nongnu.org
Cc: Michael Brown <mcb30@ipxe.org>
Subject: [Qemu-devel] [PATCH 1/4] usbnet: Add missing usb_wakeup() call in usbnet_receive()
Date: Mon,  8 Feb 2016 14:19:31 +0000	[thread overview]
Message-ID: <1454941174-25050-2-git-send-email-mcb30@ipxe.org> (raw)
In-Reply-To: <1454941174-25050-1-git-send-email-mcb30@ipxe.org>

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 <mcb30@ipxe.org>
---
 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

  reply	other threads:[~2016-02-08 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 14:19 [Qemu-devel] [PATCH 0/4] usbnet: various CDC-ECM and xHCI fixes Michael Brown
2016-02-08 14:19 ` Michael Brown [this message]
2016-02-08 14:19 ` [Qemu-devel] [PATCH 2/4] usbnet: Accept mandatory USB_CDC_SET_ETHERNET_PACKET_FILTER request Michael Brown
2016-02-08 14:19 ` [Qemu-devel] [PATCH 3/4] usbnet: Detect short packets as sent by the xHCI controller Michael Brown
2016-02-08 14:19 ` [Qemu-devel] [PATCH 4/4] usbnet: Report link-up via interrupt endpoint in CDC-ECM mode Michael Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454941174-25050-2-git-send-email-mcb30@ipxe.org \
    --to=mcb30@ipxe.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).