All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Zelem <marek@terminus.sk>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] USB support
Date: Sat, 09 Feb 2008 16:34:26 +0100	[thread overview]
Message-ID: <47ADC802.7040209@terminus.sk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]


    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


[-- Attachment #2: qemu-0.9.0-usb-clrhalt.patch --]
[-- Type: text/x-patch, Size: 524 bytes --]

--- 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 {

             reply	other threads:[~2008-02-09 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 15:34 Marek Zelem [this message]
2008-02-10 13:06 ` [Qemu-devel] USB support Arnon Gilboa
  -- strict thread matches above, loose matches on Subject: below --
2005-11-05 14:45 Fabrice Bellard
2005-11-05 16:31 ` Volker Ruppert
2005-11-05 17:10   ` Fabrice Bellard
2005-11-05 17:24     ` Lonnie Mendez
2005-11-06 14:11       ` Fabrice Bellard
2005-11-06  2:04 ` Mark Williamson
2005-11-06  2:10   ` Paul Brook

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=47ADC802.7040209@terminus.sk \
    --to=marek@terminus.sk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.