From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS3px-0000mt-NO for qemu-devel@nongnu.org; Wed, 09 May 2012 06:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SS3ps-000589-VD for qemu-devel@nongnu.org; Wed, 09 May 2012 06:09:37 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:64808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SS3ps-00057d-LC for qemu-devel@nongnu.org; Wed, 09 May 2012 06:09:32 -0400 Date: Wed, 9 May 2012 12:09:26 +0200 (CEST) From: Erik Rull Message-ID: <1636824573.927677.1336558166437.JavaMail.open-xchange@email.1und1.de> In-Reply-To: <1336478816-32522-1-git-send-email-kraxel@redhat.com> References: <1336478816-32522-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] usb-host: handle guest-issued clear halt Reply-To: Erik Rull List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Gerd Hoffmann Looks VERY good, ACK! The DVD drive works now! On May 8, 2012 at 2:06 PM Gerd Hoffmann 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 > --- > 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 > >