qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 8/9] usb: fix interface initialization
Date: Mon,  9 Jul 2012 12:20:32 +0200	[thread overview]
Message-ID: <1341829233-24381-10-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1341829233-24381-1-git-send-email-kraxel@redhat.com>

zero is a valid interface number, so don't use it when resetting the
endpoints.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb.h      |    2 ++
 hw/usb/core.c |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/usb.h b/hw/usb.h
index 9cd2f89..7ed8fb8 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -145,6 +145,8 @@
 #define USB_ENDPOINT_XFER_INT		3
 #define USB_ENDPOINT_XFER_INVALID     255
 
+#define USB_INTERFACE_INVALID         255
+
 typedef struct USBBus USBBus;
 typedef struct USBBusOps USBBusOps;
 typedef struct USBPort USBPort;
diff --git a/hw/usb/core.c b/hw/usb/core.c
index fe15be0..0614f76 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -566,8 +566,8 @@ void usb_ep_reset(USBDevice *dev)
         dev->ep_out[ep].pid = USB_TOKEN_OUT;
         dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
         dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
-        dev->ep_in[ep].ifnum = 0;
-        dev->ep_out[ep].ifnum = 0;
+        dev->ep_in[ep].ifnum = USB_INTERFACE_INVALID;
+        dev->ep_out[ep].ifnum = USB_INTERFACE_INVALID;
         dev->ep_in[ep].dev = dev;
         dev->ep_out[ep].dev = dev;
         dev->ep_in[ep].pipeline = false;
-- 
1.7.1

  parent reply	other threads:[~2012-07-09 10:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 10:20 [Qemu-devel] [PULL 0/9] usb patch queue Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 1/9] ehci: fix ehci_qh_do_overlay Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH] usb: split endpoint init and reset Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 2/9] ehci: fix td writeback Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 3/9] ehci: don't flush cache on doorbell rings Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 4/9] usb-ehci: Fix an assert whenever isoc transfers are used Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 5/9] ehci: Kick async schedule on wakeup in the non companion case Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 6/9] usb-redir: Correctly handle the usb_redir_babble usbredir status Gerd Hoffmann
2012-07-09 10:20 ` [Qemu-devel] [PATCH 7/9] usb: split endpoint init and reset Gerd Hoffmann
2012-07-09 10:20 ` Gerd Hoffmann [this message]
2012-07-09 10:20 ` [Qemu-devel] [PATCH 9/9] usb-host: add trace events for iso xfers Gerd Hoffmann
2012-07-09 16:48 ` [Qemu-devel] [PULL 0/9] usb patch queue Anthony Liguori

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=1341829233-24381-10-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --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).