qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hans Petter Selasky <hselasky@freebsd.org>
To: Juergen Lock <nox@jelal.kn-bremen.de>
Cc: "freebsd-emulation@FreeBSD.org" <freebsd-emulation@freebsd.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org>
Subject: Re: [Qemu-devel] qemu 0.15.0 testing, usb redirection, and libusb_get_device_speed()
Date: Tue, 16 Aug 2011 09:37:27 +0200	[thread overview]
Message-ID: <201108160937.27850.hselasky@freebsd.org> (raw)
In-Reply-To: <20110815202656.GA94934@triton8.kn-bremen.de>

[-- Attachment #1: Type: Text/Plain, Size: 945 bytes --]

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.

--HPS

[-- Attachment #2: libusb_speed.txt --]
[-- Type: text/plain, Size: 1659 bytes --]

=== libusb.h
==================================================================
--- libusb.h	(revision 224768)
+++ libusb.h	(local)
@@ -151,6 +151,14 @@
 	LIBUSB_ERROR_OTHER = -99,
 };
 
+enum libusb_speed {
+	LIBUSB_SPEED_UNKNOWN = 0,
+	LIBUSB_SPEED_LOW = 1,
+	LIBUSB_SPEED_FULL = 2,
+	LIBUSB_SPEED_HIGH = 3,
+	LIBUSB_SPEED_SUPER = 4,
+};
+
 enum libusb_transfer_status {
 	LIBUSB_TRANSFER_COMPLETED,
 	LIBUSB_TRANSFER_ERROR,
@@ -304,6 +312,7 @@
 void	libusb_free_device_list(libusb_device ** list, int unref_devices);
 uint8_t	libusb_get_bus_number(libusb_device * dev);
 uint8_t	libusb_get_device_address(libusb_device * dev);
+enum libusb_speed libusb_get_device_speed(libusb_device * dev);
 int	libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint);
 int	libusb_get_max_packet_size(libusb_device * dev, uint8_t endpoint);
 libusb_device *libusb_ref_device(libusb_device * dev);
=== libusb10.c
==================================================================
--- libusb10.c	(revision 224768)
+++ libusb10.c	(local)
@@ -272,6 +272,27 @@
 	return (libusb20_dev_get_address(dev->os_priv));
 }
 
+enum libusb_speed
+libusb_get_device_speed(libusb_device *dev)
+{
+	if (dev == NULL)
+		return (0);		/* should not happen */
+
+	switch (libusb20_dev_get_speed(dev->os_priv)) {
+	case LIBUSB20_SPEED_LOW:
+		return (LIBUSB_SPEED_LOW);
+	case LIBUSB20_SPEED_FULL:
+		return (LIBUSB_SPEED_FULL);
+	case LIBUSB20_SPEED_HIGH:
+		return (LIBUSB_SPEED_HIGH);
+	case LIBUSB20_SPEED_SUPER:
+		return (LIBUSB_SPEED_SUPER);
+	default:
+		break;
+	}
+	return (LIBUSB_SPEED_UNKNOWN);
+}
+
 int
 libusb_get_max_packet_size(libusb_device *dev, uint8_t endpoint)
 {

  reply	other threads:[~2011-08-16  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15 20:26 [Qemu-devel] qemu 0.15.0 testing, usb redirection, and libusb_get_device_speed() Juergen Lock
2011-08-16  7:37 ` Hans Petter Selasky [this message]
2011-08-16 17:27 ` Hans Petter Selasky
2011-08-26 10:42 ` Gerd Hoffmann
2011-08-26 11:52   ` Gerd Hoffmann
  -- strict thread matches above, loose matches on Subject: below --
2011-08-16  7:37 Hans Petter Selasky
2011-08-16 19:54 ` Juergen Lock
2011-08-16 20:22   ` Juergen Lock
2011-08-17 21:14   ` 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=201108160937.27850.hselasky@freebsd.org \
    --to=hselasky@freebsd.org \
    --cc=freebsd-emulation@freebsd.org \
    --cc=freebsd-usb@freebsd.org \
    --cc=nox@jelal.kn-bremen.de \
    --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).