From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNsFz-0001DU-GR for qemu-devel@nongnu.org; Sat, 09 Feb 2008 11:08:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNsFx-0001Bo-On for qemu-devel@nongnu.org; Sat, 09 Feb 2008 11:08:46 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNsFx-0001Bl-L2 for qemu-devel@nongnu.org; Sat, 09 Feb 2008 11:08:45 -0500 Received: from seldon.terminus.sk ([85.248.119.70] helo=s-mail.terminus.sk) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JNsFx-00088e-14 for qemu-devel@nongnu.org; Sat, 09 Feb 2008 11:08:45 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by s-mail.terminus.sk (Postfix) with ESMTP id 6DC1C3406B for ; Sat, 9 Feb 2008 16:35:03 +0100 (CET) Received: from s-mail.terminus.sk ([127.0.0.1]) by localhost (s-mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22542-10 for ; Sat, 9 Feb 2008 16:34:47 +0100 (CET) Received: from [10.9.9.34] (unknown [10.9.9.129]) by s-mail.terminus.sk (Postfix) with ESMTP id 0EB2934063 for ; Sat, 9 Feb 2008 16:34:46 +0100 (CET) Message-ID: <47ADC802.7040209@terminus.sk> Date: Sat, 09 Feb 2008 16:34:26 +0100 From: Marek Zelem MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070701000109070005070002" Subject: [Qemu-devel] USB support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------070701000109070005070002 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Hi I want to inform you that I successfully attached my Canon MP830 (printer, scanner, fax) to Qemu via USB. It was not easy, I had to pass though two stoppages. 1. There is no support for multi port/config (do not know proper term for that) USB devices in Qemu. Meaning that if single USB device provides multiple functionalities (like printer, scanner, fax) it will be rejected by Qemu. Fortunately there is patch for that available on internet page http://www.wina.at/uni/html/linux-qemu.html (qemu-0.9.0-usb-multi-configs.patch). 2. When I applied the patch I hit another issue. When the USB device is not ready it is automatically switched to HALT state (if I understood it correctly) and additional ioctl USBDEVFS_CLEAR_HALT is required to give device another chance. Thus, I have written patch for that issue. The patch I am sending as attachment. When I applied both patches, everything worked fine. I suggest to include those two patches in Qemu. Best regards Marek Zelem -- e-mail: marek@terminus.sk web: http://marek.terminus.sk/ pgp key: http://marek.terminus.sk/gpg.txt --------------070701000109070005070002 Content-Type: text/x-patch; name="qemu-0.9.0-usb-clrhalt.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-0.9.0-usb-clrhalt.patch" --- usb-linux.c.orig 2008-01-12 12:56:09.000000000 +0100 +++ usb-linux.c 2008-01-12 14:02:47.000000000 +0100 @@ -229,12 +229,14 @@ if (ret < 0) { switch(errno) { case ETIMEDOUT: + ret = ioctl(s->fd, USBDEVFS_CLEAR_HALT, &(bt.ep)); return USB_RET_NAK; case EPIPE: default: #ifdef DEBUG printf("handle_data: errno=%d\n", errno); #endif + ret = ioctl(s->fd, USBDEVFS_CLEAR_HALT, &(bt.ep)); return USB_RET_STALL; } } else { --------------070701000109070005070002--