From owner-freebsd-usb@FreeBSD.ORG Tue Aug 16 20:23:58 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22035106566C; Tue, 16 Aug 2011 20:23:58 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id CFCC18FC0C; Tue, 16 Aug 2011 20:23:57 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id D7A231E00259; Tue, 16 Aug 2011 22:23:56 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id p7GJsNcY084701; Tue, 16 Aug 2011 21:54:23 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id p7GJsNvi084700; Tue, 16 Aug 2011 21:54:23 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Tue, 16 Aug 2011 21:54:23 +0200 To: Hans Petter Selasky Message-ID: <20110816195422.GB84056@triton8.kn-bremen.de> References: <201108160937.39168.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201108160937.39168.hselasky@c2i.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Hans de Goede , "freebsd-emulation@FreeBSD.org" , Juergen Lock , "freebsd-usb@FreeBSD.org" , "qemu-devel@nongnu.org" Subject: Re: qemu 0.15.0 testing, usb redirection, and libusb_get_device_speed() X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2011 20:23:58 -0000 On Tue, Aug 16, 2011 at 09:37:39AM +0200, Hans Petter Selasky wrote: > On Monday 15 August 2011 22:26:56 Juergen Lock wrote: > > Hi! > > > > I just prepared a preliminary update of the emulators/qemu-devel > > port to 0.15.0 [1], and among other things it now also has a > > usb network redirection feature using usbredir [2], which uses > > libusb 1.0 and a function that is missing in our version, > > libusb_get_device_speed(). I added a stub to the code that > > always returns LIBUSB_SPEED_UNKNOWN > > (files/patch-usbredirhost-usbredirhost.c in the usbredir port [2]), > > question for Hans (I guess), would there be an easy way to make a > > `proper' implementation? > > > > If anyone wants to help me test qemu 0.15.0, thanx! > > Please try the attached patch to libusb in /usr/src/lib/libusb . > > You only need to rebuild libusb: make all install clean > > > FETCHENTRY: entry at 22C5484 is of type 2 which is not supported > > yet processing error - resetting ehci HC > > Try my patch first. EHCI needs to know device speed. Thanx, tho it turns out: a) the FETCHENTRY:.. crash also happens without any device redirection with FreeBSD 8.2 (at least) guests and ehci enabled (-readconfig docs/ich9-ehci-uhci.cfg), and b) if I test this with your patch (working libusb_get_device_speed() that doesn't just always return LIBUSB_SPEED_UNKNOWN) and redirecting an usb 2.0 device with ehci enabled using usbredir then qemu complains like: qemu: Warning: speed mismatch trying to attach usb device USB Redirectio n Device to bus usb.0 and ignores the redirected device. So for now I have added a #define IGNORE_LIBUSB_GET_DEVICE_SPEED to the (updated) preliminary usbredir FreeBSD port, http://people.freebsd.org/~nox/qemu/usbredir.shar so that usbredirhost_open() now always works with: device_connect.speed = usb_redir_speed_unknown; Question: do people also see this problem on Linux? This post has an usage example: http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183 Or is the problem just that with the example usage, sudo usbredirserver 045e:0772 ... qemu ... \ -readconfig docs/ich9-ehci-uhci.cfg \ -chardev socket,id=usbredirchardev,host=localhost,port=4000 \ -device usb-redir,chardev=usbredirchardev,id=usbredirdev qemu 0.15.0 tries to attach the redirected usb 2.0 device to the uhci bus instead of to the ehci one and if yes, how can I fix that? Thanx! :) Juergen