From: Erik Rull <erik.rull@rdsoftware.de>
To: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] usb-host: handle guest-issued clear halt
Date: Wed, 9 May 2012 12:09:26 +0200 (CEST) [thread overview]
Message-ID: <1636824573.927677.1336558166437.JavaMail.open-xchange@email.1und1.de> (raw)
In-Reply-To: <1336478816-32522-1-git-send-email-kraxel@redhat.com>
Looks VERY good, ACK!
The DVD drive works now!
On May 8, 2012 at 2:06 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> Most important here is to update our internal endpoint state so we know
> the endpoint isn't in halted state any more. Without this usb-host
> tries to clear halt again with the next data transfer submitted. Doing
> this twice is (a) not correct and (b) confuses some usb devices,
> rendering them non-functional in the guest.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/usb/host-linux.c | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
> index bb08542..9094120 100644
> --- a/hw/usb/host-linux.c
> +++ b/hw/usb/host-linux.c
> @@ -1101,6 +1101,15 @@ static int usb_host_handle_control(USBDevice *dev,
USBPacket *p,
> ret = usb_host_set_interface(s, index, value);
> trace_usb_host_req_emulated(s->bus_num, s->addr, p, ret);
> return ret;
> +
> + case EndpointOutRequest | USB_REQ_CLEAR_FEATURE:
> + if (value == 0) { /* clear halt */
> + int pid = (index & USB_DIR_IN) ? USB_TOKEN_IN :
USB_TOKEN_OUT;
> + ioctl(s->fd, USBDEVFS_CLEAR_HALT, &index);
> + clear_halt(s, pid, index & 0x0f);
> + trace_usb_host_req_emulated(s->bus_num, s->addr, p, 0);
> + return 0;
> + }
> }
>
> /* The rest are asynchronous */
> --
> 1.7.1
>
>
next prev parent reply other threads:[~2012-05-09 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 12:06 [Qemu-devel] [PATCH] usb-host: handle guest-issued clear halt Gerd Hoffmann
2012-05-08 12:12 ` Hans de Goede
2012-05-09 10:09 ` Erik Rull [this message]
2012-05-11 14:59 ` Gerd Hoffmann
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=1636824573.927677.1336558166437.JavaMail.open-xchange@email.1und1.de \
--to=erik.rull@rdsoftware.de \
--cc=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).