* [Qemu-devel] [PULL] usb patch queue
@ 2011-05-04 15:41 Gerd Hoffmann
2011-05-05 18:28 ` Anthony Liguori
0 siblings, 1 reply; 47+ messages in thread
From: Gerd Hoffmann @ 2011-05-04 15:41 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
The USB patch queue is back! I'm still busy catching up with the
backlog, I know I didn't pick up everything from the list yet. If in
doubt it doesn't hurt to resend usb related patches, with me being
Cc'ed.
This pull brings old stuff, most of the patches are several months old
already. Finally the usb-host fixes from Hans are queued up for merge.
Some async packet handling cleanups are in there to. Oh, and one more
bugfix for the usb mass storage device.
please pull,
Gerd
The following changes since commit d2d979c628e4b2c4a3cb71a31841875795c79043:
NBD: Avoid leaking a couple of strings when the NBD device is closed (2011-05-03 11:29:21 +0200)
are available in the git repository at:
git://git.kraxel.org/qemu usb.7.pull
Gerd Hoffmann (6):
uhci: switch to QTAILQ
uhci: keep uhci state pointer in async packet struct.
ohci: get ohci state via container_of()
musb: get musb state via container_of()
usb: move complete callback to port ops
usb: mass storage fix
Hans de Goede (8):
usb-linux: introduce a usb_linux_alt_setting function
usb-linux: Get the alt. setting from sysfs rather then asking the dev
usb-linux: Add support for buffering iso usb packets
usb-linux: Refuse packets for endpoints which are not in the usb descriptor
usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)
usb-linux: We only need to keep track of 15 endpoints
usb-linux: Add support for buffering iso out usb packets
usb: control buffer fixes
hw/usb-hub.c | 14 ++
hw/usb-msd.c | 5 +-
hw/usb-musb.c | 75 ++++++-----
hw/usb-ohci.c | 9 +-
hw/usb-uhci.c | 82 ++++--------
hw/usb.c | 6 +
hw/usb.h | 9 +-
usb-linux.c | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
8 files changed, 445 insertions(+), 149 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-05-04 15:41 Gerd Hoffmann
@ 2011-05-05 18:28 ` Anthony Liguori
0 siblings, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-05-05 18:28 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 05/04/2011 10:41 AM, Gerd Hoffmann wrote:
> Hi,
>
> The USB patch queue is back! I'm still busy catching up with the
> backlog, I know I didn't pick up everything from the list yet. If in
> doubt it doesn't hurt to resend usb related patches, with me being
> Cc'ed.
>
> This pull brings old stuff, most of the patches are several months old
> already. Finally the usb-host fixes from Hans are queued up for merge.
> Some async packet handling cleanups are in there to. Oh, and one more
> bugfix for the usb mass storage device.
>
> please pull,
> Gerd
Pulled. Thanks.
Regards,
Anthony Liguori
>
> The following changes since commit d2d979c628e4b2c4a3cb71a31841875795c79043:
>
> NBD: Avoid leaking a couple of strings when the NBD device is closed (2011-05-03 11:29:21 +0200)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.7.pull
>
> Gerd Hoffmann (6):
> uhci: switch to QTAILQ
> uhci: keep uhci state pointer in async packet struct.
> ohci: get ohci state via container_of()
> musb: get musb state via container_of()
> usb: move complete callback to port ops
> usb: mass storage fix
>
> Hans de Goede (8):
> usb-linux: introduce a usb_linux_alt_setting function
> usb-linux: Get the alt. setting from sysfs rather then asking the dev
> usb-linux: Add support for buffering iso usb packets
> usb-linux: Refuse packets for endpoints which are not in the usb descriptor
> usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)
> usb-linux: We only need to keep track of 15 endpoints
> usb-linux: Add support for buffering iso out usb packets
> usb: control buffer fixes
>
> hw/usb-hub.c | 14 ++
> hw/usb-msd.c | 5 +-
> hw/usb-musb.c | 75 ++++++-----
> hw/usb-ohci.c | 9 +-
> hw/usb-uhci.c | 82 ++++--------
> hw/usb.c | 6 +
> hw/usb.h | 9 +-
> usb-linux.c | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
> 8 files changed, 445 insertions(+), 149 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-06-14 11:05 Gerd Hoffmann
2011-06-15 14:17 ` Anthony Liguori
0 siblings, 1 reply; 47+ messages in thread
From: Gerd Hoffmann @ 2011-06-14 11:05 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
The USB patch queue has been rebased, got a minor fix (wrong comment in
patch #8, spotted by David Ahern) and three new patches. I'm just
posting the three new patches to avoid spamming the list with 30
identical patches ...
please pull,
Gerd
The following changes since commit 0b862cedf36d927818c50584ddd611b0370673df:
configure: Detect and don't try to use older libcurl (2011-06-13 21:16:27 +0200)
are available in the git repository at:
git://git.kraxel.org/qemu usb.16
Brad Hards (3):
usb: Add defines for USB Serial Bus Release Number register
usb: Use defines for serial bus release number register for UHCI
usb: Use defines for serial bus release number register for EHCI
Gerd Hoffmann (18):
usb-linux: catch ENODEV in more places.
usb-ehci: trace mmio and usbsts
usb-ehci: trace state machine changes
usb-ehci: trace port state
usb-ehci: improve mmio tracing
usb-ehci: trace buffer copy
usb-ehci: add queue data struct
usb-ehci: multiqueue support
usb-ehci: fix offset writeback in ehci_buffer_rw
usb-ehci: fix error handling.
usb: cancel async packets on unplug
usb-ehci: drop EXECUTING checks.
usb-ehci: itd handling fixes.
usb-ehci: split trace calls to handle arg count limits
usb: documentation update
usb-linux: only cleanup in host_close when host_open was successful.
usb: don't call usb_host_device_open from vl.c
usb-uhci: fix expire time initialization.
Hans de Goede (9):
ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)
usb-linux: Get speed from sysfs rather then from the connectinfo ioctl
usb-linux: Teach about super speed
usb-linux: Don't do perror when errno is not set
usb-linux: Ensure devep != 0
usb-linux: Don't try to open the same device twice
usb-linux: Enlarge buffer for descriptors to 8192 bytes
usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper
usb-bus: Don't detach non attached devices on device exit
Kevin O'Connor (2):
Fix USB mouse Set_Protocol behavior
The USB tablet should not claim boot protocol support.
Peter Maydell (2):
hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
hw/usb-ohci.c: Implement remote wakeup
docs/usb2.txt | 85 ++++
hw/milkymist-softusb.c | 10 +-
hw/usb-bus.c | 10 +-
hw/usb-ehci.c | 1198 ++++++++++++++++++++++++++++--------------------
hw/usb-hid.c | 5 +-
hw/usb-musb.c | 23 +-
hw/usb-ohci.c | 37 ++-
hw/usb-uhci.c | 32 ++-
hw/usb.h | 14 +-
trace-events | 20 +
usb-linux.c | 96 +++--
vl.c | 6 +-
12 files changed, 990 insertions(+), 546 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-06-14 11:05 Gerd Hoffmann
@ 2011-06-15 14:17 ` Anthony Liguori
0 siblings, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-06-15 14:17 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 06/14/2011 06:05 AM, Gerd Hoffmann wrote:
> Hi,
>
> The USB patch queue has been rebased, got a minor fix (wrong comment in
> patch #8, spotted by David Ahern) and three new patches. I'm just
> posting the three new patches to avoid spamming the list with 30
> identical patches ...
>
> please pull,
> Gerd
Pulled. Thanks.
Regards,
Anthony Liguori
>
> The following changes since commit 0b862cedf36d927818c50584ddd611b0370673df:
>
> configure: Detect and don't try to use older libcurl (2011-06-13 21:16:27 +0200)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.16
>
> Brad Hards (3):
> usb: Add defines for USB Serial Bus Release Number register
> usb: Use defines for serial bus release number register for UHCI
> usb: Use defines for serial bus release number register for EHCI
>
> Gerd Hoffmann (18):
> usb-linux: catch ENODEV in more places.
> usb-ehci: trace mmio and usbsts
> usb-ehci: trace state machine changes
> usb-ehci: trace port state
> usb-ehci: improve mmio tracing
> usb-ehci: trace buffer copy
> usb-ehci: add queue data struct
> usb-ehci: multiqueue support
> usb-ehci: fix offset writeback in ehci_buffer_rw
> usb-ehci: fix error handling.
> usb: cancel async packets on unplug
> usb-ehci: drop EXECUTING checks.
> usb-ehci: itd handling fixes.
> usb-ehci: split trace calls to handle arg count limits
> usb: documentation update
> usb-linux: only cleanup in host_close when host_open was successful.
> usb: don't call usb_host_device_open from vl.c
> usb-uhci: fix expire time initialization.
>
> Hans de Goede (9):
> ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)
> usb-linux: Get speed from sysfs rather then from the connectinfo ioctl
> usb-linux: Teach about super speed
> usb-linux: Don't do perror when errno is not set
> usb-linux: Ensure devep != 0
> usb-linux: Don't try to open the same device twice
> usb-linux: Enlarge buffer for descriptors to 8192 bytes
> usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper
> usb-bus: Don't detach non attached devices on device exit
>
> Kevin O'Connor (2):
> Fix USB mouse Set_Protocol behavior
> The USB tablet should not claim boot protocol support.
>
> Peter Maydell (2):
> hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
> hw/usb-ohci.c: Implement remote wakeup
>
> docs/usb2.txt | 85 ++++
> hw/milkymist-softusb.c | 10 +-
> hw/usb-bus.c | 10 +-
> hw/usb-ehci.c | 1198 ++++++++++++++++++++++++++++--------------------
> hw/usb-hid.c | 5 +-
> hw/usb-musb.c | 23 +-
> hw/usb-ohci.c | 37 ++-
> hw/usb-uhci.c | 32 ++-
> hw/usb.h | 14 +-
> trace-events | 20 +
> usb-linux.c | 96 +++--
> vl.c | 6 +-
> 12 files changed, 990 insertions(+), 546 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-06-24 10:59 Gerd Hoffmann
2011-06-24 13:30 ` Hans de Goede
2011-06-27 20:19 ` Anthony Liguori
0 siblings, 2 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-06-24 10:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Here comes the USB patch queue. Nothing major, just a bunch of little
fixes and improvements.
please pull,
Gerd
The following changes since commit 48e2faf222cbf4abab7c8e4b3f44229ec98eae7f:
net: Warn about "-net nic" options which were ignored (2011-06-22 07:18:39 -0500)
are available in the git repository at:
git://git.kraxel.org/qemu usb.17
Gerd Hoffmann (6):
usb-linux: add get_endp()
usb-linux: make iso urb count contigurable
usb-linux: track inflight iso urb count
ehci: add freq + maxframes properties
ehci: switch to nanoseconds
usb: ignore USB_DT_DEBUG
Hans de Goede (5):
usb-bus: Don't allow attaching a device to a bus with no free ports
usb: Proper error propagation for usb_device_attach errors
usb: Add a speedmask to devices
usb-linux: allow "compatible" high speed devices to connect at fullspeed
usb-bus: Don't allow speed mismatch while attaching devices
Markus Armbruster (1):
usb-storage: Turn drive serial into a qdev property usb-storage.serial
Peter Maydell (1):
hw/usb-ohci.c: Fix handling of remote wakeup corner cases
hw/usb-bus.c | 31 ++++++++++-----
hw/usb-ccid.c | 1 +
hw/usb-desc.c | 14 ++++++
hw/usb-ehci.c | 43 +++++++++++---------
hw/usb-msd.c | 19 ++++++--
hw/usb-ohci.c | 17 ++++++-
hw/usb.h | 4 ++
usb-bsd.c | 2 +
usb-linux.c | 124 +++++++++++++++++++++++++++++++++++++++++++++------------
9 files changed, 191 insertions(+), 64 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-06-24 10:59 Gerd Hoffmann
@ 2011-06-24 13:30 ` Hans de Goede
2011-06-27 20:19 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Hans de Goede @ 2011-06-24 13:30 UTC (permalink / raw)
To: qemu-devel
Hi,
Entire series looks good to me, including my own patches ;)
Ack series.
Regards,
Hans
On 06/24/2011 12:59 PM, Gerd Hoffmann wrote:
> Hi,
>
> Here comes the USB patch queue. Nothing major, just a bunch of little
> fixes and improvements.
>
> please pull,
> Gerd
>
> The following changes since commit 48e2faf222cbf4abab7c8e4b3f44229ec98eae7f:
>
> net: Warn about "-net nic" options which were ignored (2011-06-22 07:18:39 -0500)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.17
>
> Gerd Hoffmann (6):
> usb-linux: add get_endp()
> usb-linux: make iso urb count contigurable
> usb-linux: track inflight iso urb count
> ehci: add freq + maxframes properties
> ehci: switch to nanoseconds
> usb: ignore USB_DT_DEBUG
>
> Hans de Goede (5):
> usb-bus: Don't allow attaching a device to a bus with no free ports
> usb: Proper error propagation for usb_device_attach errors
> usb: Add a speedmask to devices
> usb-linux: allow "compatible" high speed devices to connect at fullspeed
> usb-bus: Don't allow speed mismatch while attaching devices
>
> Markus Armbruster (1):
> usb-storage: Turn drive serial into a qdev property usb-storage.serial
>
> Peter Maydell (1):
> hw/usb-ohci.c: Fix handling of remote wakeup corner cases
>
> hw/usb-bus.c | 31 ++++++++++-----
> hw/usb-ccid.c | 1 +
> hw/usb-desc.c | 14 ++++++
> hw/usb-ehci.c | 43 +++++++++++---------
> hw/usb-msd.c | 19 ++++++--
> hw/usb-ohci.c | 17 ++++++-
> hw/usb.h | 4 ++
> usb-bsd.c | 2 +
> usb-linux.c | 124 +++++++++++++++++++++++++++++++++++++++++++++------------
> 9 files changed, 191 insertions(+), 64 deletions(-)
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-06-24 10:59 Gerd Hoffmann
2011-06-24 13:30 ` Hans de Goede
@ 2011-06-27 20:19 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-06-27 20:19 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 06/24/2011 05:59 AM, Gerd Hoffmann wrote:
> Hi,
>
> Here comes the USB patch queue. Nothing major, just a bunch of little
> fixes and improvements.
>
> please pull,
Pulled. Thanks.
Regards,
Anthony Liguori
> Gerd
>
> The following changes since commit 48e2faf222cbf4abab7c8e4b3f44229ec98eae7f:
>
> net: Warn about "-net nic" options which were ignored (2011-06-22 07:18:39 -0500)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.17
>
> Gerd Hoffmann (6):
> usb-linux: add get_endp()
> usb-linux: make iso urb count contigurable
> usb-linux: track inflight iso urb count
> ehci: add freq + maxframes properties
> ehci: switch to nanoseconds
> usb: ignore USB_DT_DEBUG
>
> Hans de Goede (5):
> usb-bus: Don't allow attaching a device to a bus with no free ports
> usb: Proper error propagation for usb_device_attach errors
> usb: Add a speedmask to devices
> usb-linux: allow "compatible" high speed devices to connect at fullspeed
> usb-bus: Don't allow speed mismatch while attaching devices
>
> Markus Armbruster (1):
> usb-storage: Turn drive serial into a qdev property usb-storage.serial
>
> Peter Maydell (1):
> hw/usb-ohci.c: Fix handling of remote wakeup corner cases
>
> hw/usb-bus.c | 31 ++++++++++-----
> hw/usb-ccid.c | 1 +
> hw/usb-desc.c | 14 ++++++
> hw/usb-ehci.c | 43 +++++++++++---------
> hw/usb-msd.c | 19 ++++++--
> hw/usb-ohci.c | 17 ++++++-
> hw/usb.h | 4 ++
> usb-bsd.c | 2 +
> usb-linux.c | 124 +++++++++++++++++++++++++++++++++++++++++++++------------
> 9 files changed, 191 insertions(+), 64 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-07-08 9:50 Gerd Hoffmann
2011-07-12 14:52 ` Gerd Hoffmann
2011-07-19 15:59 ` Anthony Liguori
0 siblings, 2 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-07-08 9:50 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Here is the current usb patch queue. Most noteworthy is the usb
companion controller support added. There are also a bunch of bug
fixes, some from Hans which he found while doing the companion
controller work and some have been found in patch review.
please pull,
Gerd
The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:
pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)
are available in the git repository at:
git://git.kraxel.org/qemu usb.19
Gerd Hoffmann (8):
pci: add ich9 usb controller ids
uhci: add ich9 controllers
ehci: fix port count.
ehci: add ich9 controller.
usb: update documentation
usb: fixup bluetooth descriptors
usb-hub: remove unused descriptor arrays
usb-ohci: raise interrupt on attach
Hans de Goede (13):
usb: Add a usb_fill_port helper function
usb: Move (initial) call of usb_port_location to usb_fill_port
usb: Add a register_companion USB bus op.
usb: Make port wakeup and complete ops take a USBPort instead of a Device
usb: Replace device_destroy bus op with a child_detach port op
usb-ehci: drop unused num-ports state member
usb-ehci: Connect Status bit is read only, don't allow changing it by the guest
usb-ehci: cleanup port reset handling
usb: assert on calling usb_attach(port, NULL) on a port without a dev
usb-ehci: Fix handling of PED and PEDC port status bits
usb-ehci: Add support for registering companion controllers
usb-uhci: Add support for being a companion controller
usb-ohci: Add support for being a companion controller
Jes Sorensen (1):
usb_register_port(): do not set port->opaque and port->index twice
Peter Maydell (1):
hw/usb-musb.c: Don't misuse usb_packet_complete()
docs/ich9-ehci-uhci.cfg | 37 +++++++
docs/usb2.txt | 33 +++++-
hw/milkymist-softusb.c | 9 ++-
hw/pci_ids.h | 8 ++
hw/usb-bt.c | 24 ++--
hw/usb-bus.c | 46 +++++++-
hw/usb-ehci.c | 270 ++++++++++++++++++++++++++++++++++-------------
hw/usb-hub.c | 90 +++-------------
hw/usb-musb.c | 24 +++--
hw/usb-ohci.c | 89 +++++++++++-----
hw/usb-uhci.c | 95 +++++++++++++----
hw/usb.c | 13 +--
hw/usb.h | 20 +++-
13 files changed, 523 insertions(+), 235 deletions(-)
create mode 100644 docs/ich9-ehci-uhci.cfg
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-07-08 9:50 Gerd Hoffmann
@ 2011-07-12 14:52 ` Gerd Hoffmann
2011-07-19 15:59 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-07-12 14:52 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 07/08/11 11:50, Gerd Hoffmann wrote:
> Hi,
>
> Here is the current usb patch queue. Most noteworthy is the usb
> companion controller support added. There are also a bunch of bug
> fixes, some from Hans which he found while doing the companion
> controller work and some have been found in patch review.
>
> please pull,
> Gerd
>
> The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:
>
> pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.19
ping?
cheers,
Gerd
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-07-08 9:50 Gerd Hoffmann
2011-07-12 14:52 ` Gerd Hoffmann
@ 2011-07-19 15:59 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-07-19 15:59 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 07/08/2011 04:50 AM, Gerd Hoffmann wrote:
> Hi,
>
> Here is the current usb patch queue. Most noteworthy is the usb
> companion controller support added. There are also a bunch of bug
> fixes, some from Hans which he found while doing the companion
> controller work and some have been found in patch review.
Pulled. Thanks.
Regards,
Anthony Liguori
>
> please pull,
> Gerd
>
> The following changes since commit 9312805d33e8b106bae356d13a8071fb37d75554:
>
> pxa2xx_lcd: add proper rotation support (2011-07-04 22:12:21 +0200)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.19
>
> Gerd Hoffmann (8):
> pci: add ich9 usb controller ids
> uhci: add ich9 controllers
> ehci: fix port count.
> ehci: add ich9 controller.
> usb: update documentation
> usb: fixup bluetooth descriptors
> usb-hub: remove unused descriptor arrays
> usb-ohci: raise interrupt on attach
>
> Hans de Goede (13):
> usb: Add a usb_fill_port helper function
> usb: Move (initial) call of usb_port_location to usb_fill_port
> usb: Add a register_companion USB bus op.
> usb: Make port wakeup and complete ops take a USBPort instead of a Device
> usb: Replace device_destroy bus op with a child_detach port op
> usb-ehci: drop unused num-ports state member
> usb-ehci: Connect Status bit is read only, don't allow changing it by the guest
> usb-ehci: cleanup port reset handling
> usb: assert on calling usb_attach(port, NULL) on a port without a dev
> usb-ehci: Fix handling of PED and PEDC port status bits
> usb-ehci: Add support for registering companion controllers
> usb-uhci: Add support for being a companion controller
> usb-ohci: Add support for being a companion controller
>
> Jes Sorensen (1):
> usb_register_port(): do not set port->opaque and port->index twice
>
> Peter Maydell (1):
> hw/usb-musb.c: Don't misuse usb_packet_complete()
>
> docs/ich9-ehci-uhci.cfg | 37 +++++++
> docs/usb2.txt | 33 +++++-
> hw/milkymist-softusb.c | 9 ++-
> hw/pci_ids.h | 8 ++
> hw/usb-bt.c | 24 ++--
> hw/usb-bus.c | 46 +++++++-
> hw/usb-ehci.c | 270 ++++++++++++++++++++++++++++++++++-------------
> hw/usb-hub.c | 90 +++-------------
> hw/usb-musb.c | 24 +++--
> hw/usb-ohci.c | 89 +++++++++++-----
> hw/usb-uhci.c | 95 +++++++++++++----
> hw/usb.c | 13 +--
> hw/usb.h | 20 +++-
> 13 files changed, 523 insertions(+), 235 deletions(-)
> create mode 100644 docs/ich9-ehci-uhci.cfg
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-07-20 10:23 Gerd Hoffmann
0 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-07-20 10:23 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Tiny usb patch queue with two small fixes.
please pull for 0.15,
Gerd
The following changes since commit 03ff09580ef6cbc4a893b6e3e6bbff33180ec70a:
Merge remote-tracking branch 'agraf/xen-next' into staging (2011-07-19 08:04:35 -0500)
are available in the git repository at:
git://git.kraxel.org/qemu usb.20
Gerd Hoffmann (2):
usb-hid: fixup changed tracking.
usb-uhci: fix irq handling on error.
hw/usb-hid.c | 9 ++++-----
hw/usb-uhci.c | 6 ++++++
2 files changed, 10 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-08-11 7:03 Gerd Hoffmann
2011-08-12 7:02 ` Michael Tokarev
2011-08-12 13:04 ` Anthony Liguori
0 siblings, 2 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-08-11 7:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
More usb and hid bits. Fixes a usb tablet regression with windows xp.
milkymist goes use the new, splitted hid code directly instead of
(ab-)using the usb-kbd device, which in turn allows to kill the
usb_hid_datain_cb callback as no users are left.
please pull,
Gerd
The following changes since commit b9c6cbff76061537b722d55f0e321dde2a612a23:
Merge remote-tracking branch 'pm-arm/for-upstream' into pm (2011-08-09 19:16:43 +0200)
are available in the git repository at:
git://git.kraxel.org/qemu usb.23
Gerd Hoffmann (2):
usb/hid: add hid_pointer_activate, use it
usb-hid: remove usb_hid_datain_cb
Michael Walle (4):
hid: register kbd hander in init()
hid: introduce hid vmstate macros
usb-hid: use hid vmstate macro
milkymist-softusb: use hid code directly
hw/hid.c | 76 +++++++++++++++++++++++++++--
hw/hid.h | 1 +
hw/hw.h | 20 ++++++++
hw/milkymist-softusb.c | 122 +++++++++++++++---------------------------------
hw/usb-hid.c | 58 ++---------------------
hw/usb.h | 3 -
6 files changed, 134 insertions(+), 146 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-08-11 7:03 Gerd Hoffmann
@ 2011-08-12 7:02 ` Michael Tokarev
2011-08-12 7:57 ` Gerd Hoffmann
2011-08-12 13:04 ` Anthony Liguori
1 sibling, 1 reply; 47+ messages in thread
From: Michael Tokarev @ 2011-08-12 7:02 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
11.08.2011 11:03, Gerd Hoffmann wrote:
> Hi,
>
> More usb and hid bits. Fixes a usb tablet regression with windows xp.
> milkymist goes use the new, splitted hid code directly instead of
> (ab-)using the usb-kbd device, which in turn allows to kill the
> usb_hid_datain_cb callback as no users are left.
The same question as about spice queue: should
at least the regression fix go to stable?
Thanks,
/mjt
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-08-12 7:02 ` Michael Tokarev
@ 2011-08-12 7:57 ` Gerd Hoffmann
0 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-08-12 7:57 UTC (permalink / raw)
To: Michael Tokarev; +Cc: qemu-devel
On 08/12/11 09:02, Michael Tokarev wrote:
> 11.08.2011 11:03, Gerd Hoffmann wrote:
>> Hi,
>>
>> More usb and hid bits. Fixes a usb tablet regression with windows xp.
>> milkymist goes use the new, splitted hid code directly instead of
>> (ab-)using the usb-kbd device, which in turn allows to kill the
>> usb_hid_datain_cb callback as no users are left.
>
> The same question as about spice queue: should
> at least the regression fix go to stable?
Same answer ;)
The regression is present in master only, so no.
cheers,
Gerd
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-08-11 7:03 Gerd Hoffmann
2011-08-12 7:02 ` Michael Tokarev
@ 2011-08-12 13:04 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-08-12 13:04 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 08/11/2011 02:03 AM, Gerd Hoffmann wrote:
> Hi,
>
> More usb and hid bits. Fixes a usb tablet regression with windows xp.
> milkymist goes use the new, splitted hid code directly instead of
> (ab-)using the usb-kbd device, which in turn allows to kill the
> usb_hid_datain_cb callback as no users are left.
>
> please pull,
> Gerd
>
> The following changes since commit b9c6cbff76061537b722d55f0e321dde2a612a23:
>
> Merge remote-tracking branch 'pm-arm/for-upstream' into pm (2011-08-09 19:16:43 +0200)
Pulled. Thanks.
Regards,
Anthony Liguori
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu usb.23
>
> Gerd Hoffmann (2):
> usb/hid: add hid_pointer_activate, use it
> usb-hid: remove usb_hid_datain_cb
>
> Michael Walle (4):
> hid: register kbd hander in init()
> hid: introduce hid vmstate macros
> usb-hid: use hid vmstate macro
> milkymist-softusb: use hid code directly
>
> hw/hid.c | 76 +++++++++++++++++++++++++++--
> hw/hid.h | 1 +
> hw/hw.h | 20 ++++++++
> hw/milkymist-softusb.c | 122 +++++++++++++++---------------------------------
> hw/usb-hid.c | 58 ++---------------------
> hw/usb.h | 3 -
> 6 files changed, 134 insertions(+), 146 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-09-02 9:56 Gerd Hoffmann
2011-09-07 8:41 ` Gerd Hoffmann
2011-09-08 14:23 ` Anthony Liguori
0 siblings, 2 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-09-02 9:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
This is the current use patch queue with the following changes:
* musb improvements (qdev windup)
* fix ehci emulation for FreeBSD guests.
* a bunch if usb-host fixes.
* misc minir tweaks.
please pull,
Gerd
Gerd Hoffmann (15):
usb-host: start tracing support
usb-host: reapurb error report fix
usb-host: fix halted endpoints
usb-host: limit open retries
usb-host: fix configuration tracking.
usb-host: claim port
usb-host: endpoint table fixup
usb-ehci: handle siTDs
usb-host: constify port
usb-host: parse port in /proc/bus/usb/devices scan
usb: fix use after free
usb-ccid: switch to USBDesc*
usb-ccid: remote wakeup support
usb: claim port at device initialization time.
usb-host: tag as unmigratable
Juha Riihimäki (1):
usb-musb: Add reset function
Peter Maydell (2):
usb: Remove leading underscores from __musb_irq_max
usb-musb: Take a DeviceState* in init function
hw/tusb6010.c | 11 +-
hw/usb-bus.c | 110 ++++++++------
hw/usb-ccid.c | 248 +++++++++++---------------------
hw/usb-desc.h | 2 +-
hw/usb-ehci.c | 65 +++++++--
hw/usb-hub.c | 12 +--
hw/usb-musb.c | 26 +++-
hw/usb-ohci.c | 4 +-
hw/usb-uhci.c | 11 +-
hw/usb.c | 37 +++---
hw/usb.h | 11 +-
trace-events | 32 ++++
usb-linux.c | 448 ++++++++++++++++++++++++++++++++++-----------------------
13 files changed, 561 insertions(+), 456 deletions(-)
The following changes since commit 625f9e1f54cd78ee98ac22030da527c9a1cc9d2b:
Merge remote-tracking branch 'stefanha/trivial-patches' into staging (2011-09-01 13:57:19 -0500)
are available in the git repository at:
git://git.kraxel.org/qemu usb.25
Gerd Hoffmann (15):
usb-host: start tracing support
usb-host: reapurb error report fix
usb-host: fix halted endpoints
usb-host: limit open retries
usb-host: fix configuration tracking.
usb-host: claim port
usb-host: endpoint table fixup
usb-ehci: handle siTDs
usb-host: constify port
usb-host: parse port in /proc/bus/usb/devices scan
usb: fix use after free
usb-ccid: switch to USBDesc*
usb-ccid: remote wakeup support
usb: claim port at device initialization time.
usb-host: tag as unmigratable
Juha Riihimäki (1):
usb-musb: Add reset function
Peter Maydell (2):
usb: Remove leading underscores from __musb_irq_max
usb-musb: Take a DeviceState* in init function
hw/tusb6010.c | 11 +-
hw/usb-bus.c | 110 ++++++++------
hw/usb-ccid.c | 248 +++++++++++---------------------
hw/usb-desc.h | 2 +-
hw/usb-ehci.c | 65 +++++++--
hw/usb-hub.c | 12 +--
hw/usb-musb.c | 26 +++-
hw/usb-ohci.c | 4 +-
hw/usb-uhci.c | 11 +-
hw/usb.c | 37 +++---
hw/usb.h | 11 +-
trace-events | 32 ++++
usb-linux.c | 448 ++++++++++++++++++++++++++++++++++-----------------------
13 files changed, 561 insertions(+), 456 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-09-02 9:56 Gerd Hoffmann
@ 2011-09-07 8:41 ` Gerd Hoffmann
2011-09-08 14:23 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2011-09-07 8:41 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
Hi,
> are available in the git repository at:
>
> git://git.kraxel.org/qemu usb.25
Pushed new branch usb.26.
Rebased to latest master, solved conflicts due to tracing merge, adapted
to tracing changes ("disabled" not needed any more in trace-events).
Squashed in a warning fix (init port variable) here:
> usb-host: parse port in /proc/bus/usb/devices scan
Don't feel like spamming the list with these minor changes. But can do
a full repost if prefered.
please pull,
Gerd
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-09-02 9:56 Gerd Hoffmann
2011-09-07 8:41 ` Gerd Hoffmann
@ 2011-09-08 14:23 ` Anthony Liguori
1 sibling, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-09-08 14:23 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 09/02/2011 04:56 AM, Gerd Hoffmann wrote:
> Hi,
>
> This is the current use patch queue with the following changes:
>
> * musb improvements (qdev windup)
> * fix ehci emulation for FreeBSD guests.
> * a bunch if usb-host fixes.
> * misc minir tweaks.
>
> please pull,
> Gerd
Pulled. Thanks.
Regards,
Anthony Liguori
>
> Gerd Hoffmann (15):
> usb-host: start tracing support
> usb-host: reapurb error report fix
> usb-host: fix halted endpoints
> usb-host: limit open retries
> usb-host: fix configuration tracking.
> usb-host: claim port
> usb-host: endpoint table fixup
> usb-ehci: handle siTDs
> usb-host: constify port
> usb-host: parse port in /proc/bus/usb/devices scan
> usb: fix use after free
> usb-ccid: switch to USBDesc*
> usb-ccid: remote wakeup support
> usb: claim port at device initialization time.
> usb-host: tag as unmigratable
>
> Juha Riihimäki (1):
> usb-musb: Add reset function
>
> Peter Maydell (2):
> usb: Remove leading underscores from __musb_irq_max
> usb-musb: Take a DeviceState* in init function
>
> hw/tusb6010.c | 11 +-
> hw/usb-bus.c | 110 ++++++++------
> hw/usb-ccid.c | 248 +++++++++++---------------------
> hw/usb-desc.h | 2 +-
> hw/usb-ehci.c | 65 +++++++--
> hw/usb-hub.c | 12 +--
> hw/usb-musb.c | 26 +++-
> hw/usb-ohci.c | 4 +-
> hw/usb-uhci.c | 11 +-
> hw/usb.c | 37 +++---
> hw/usb.h | 11 +-
> trace-events | 32 ++++
> usb-linux.c | 448 ++++++++++++++++++++++++++++++++++-----------------------
> 13 files changed, 561 insertions(+), 456 deletions(-)
>
> The following changes since commit 625f9e1f54cd78ee98ac22030da527c9a1cc9d2b:
>
> Merge remote-tracking branch 'stefanha/trivial-patches' into staging (2011-09-01 13:57:19 -0500)
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu usb.25
>
> Gerd Hoffmann (15):
> usb-host: start tracing support
> usb-host: reapurb error report fix
> usb-host: fix halted endpoints
> usb-host: limit open retries
> usb-host: fix configuration tracking.
> usb-host: claim port
> usb-host: endpoint table fixup
> usb-ehci: handle siTDs
> usb-host: constify port
> usb-host: parse port in /proc/bus/usb/devices scan
> usb: fix use after free
> usb-ccid: switch to USBDesc*
> usb-ccid: remote wakeup support
> usb: claim port at device initialization time.
> usb-host: tag as unmigratable
>
> Juha Riihimäki (1):
> usb-musb: Add reset function
>
> Peter Maydell (2):
> usb: Remove leading underscores from __musb_irq_max
> usb-musb: Take a DeviceState* in init function
>
> hw/tusb6010.c | 11 +-
> hw/usb-bus.c | 110 ++++++++------
> hw/usb-ccid.c | 248 +++++++++++---------------------
> hw/usb-desc.h | 2 +-
> hw/usb-ehci.c | 65 +++++++--
> hw/usb-hub.c | 12 +--
> hw/usb-musb.c | 26 +++-
> hw/usb-ohci.c | 4 +-
> hw/usb-uhci.c | 11 +-
> hw/usb.c | 37 +++---
> hw/usb.h | 11 +-
> trace-events | 32 ++++
> usb-linux.c | 448 ++++++++++++++++++++++++++++++++++-----------------------
> 13 files changed, 561 insertions(+), 456 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-10-13 11:08 Gerd Hoffmann
2011-10-14 16:25 ` Anthony Liguori
0 siblings, 1 reply; 47+ messages in thread
From: Gerd Hoffmann @ 2011-10-13 11:08 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Here comes the usb patch queue with a bunch of bug fixes.
Check the individual patches for details.
please pull,
Gerd
The following changes since commit ebffe2afceb1a17b5d134b5debf553955fe5ea1a:
Merge remote-tracking branch 'qmp/queue/qmp' into staging (2011-10-10 08:21:46 -0500)
are available in the git repository at:
git://git.kraxel.org/qemu usb.28
Gerd Hoffmann (7):
usb-storage: fix NULL pointer dereference.
usb-hub: need to check dev->attached
usb: fix port reset
usb-host: factor out code
usb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY
usb-hid: activate usb tablet / mouse after migration.
usb-hub: don't trigger assert on packet completion.
Peter Maydell (2):
hw/usb-ohci: Fix OHCI_TD_T1 bit position definition
hw/usb-ohci: Honour endpoint maximum packet size
hw/usb-ehci.c | 4 +-
hw/usb-hid.c | 11 ++++
hw/usb-hub.c | 12 +++-
hw/usb-msd.c | 5 +-
hw/usb-ohci.c | 41 +++++++++----
hw/usb-uhci.c | 2 +-
hw/usb.c | 12 ++++
hw/usb.h | 1 +
usb-linux.c | 176 ++++++++++++++++++++++++++++++++++++---------------------
9 files changed, 180 insertions(+), 84 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-10-13 11:08 Gerd Hoffmann
@ 2011-10-14 16:25 ` Anthony Liguori
0 siblings, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-10-14 16:25 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 10/13/2011 06:08 AM, Gerd Hoffmann wrote:
> Hi,
>
> Here comes the usb patch queue with a bunch of bug fixes.
> Check the individual patches for details.
>
> please pull,
> Gerd
Pulled. Thanks.
Regards,
Anthony Liguori
>
> The following changes since commit ebffe2afceb1a17b5d134b5debf553955fe5ea1a:
>
> Merge remote-tracking branch 'qmp/queue/qmp' into staging (2011-10-10 08:21:46 -0500)
>
> are available in the git repository at:
>
> git://git.kraxel.org/qemu usb.28
>
> Gerd Hoffmann (7):
> usb-storage: fix NULL pointer dereference.
> usb-hub: need to check dev->attached
> usb: fix port reset
> usb-host: factor out code
> usb-host: handle USBDEVFS_SETCONFIGURATION returning EBUSY
> usb-hid: activate usb tablet / mouse after migration.
> usb-hub: don't trigger assert on packet completion.
>
> Peter Maydell (2):
> hw/usb-ohci: Fix OHCI_TD_T1 bit position definition
> hw/usb-ohci: Honour endpoint maximum packet size
>
> hw/usb-ehci.c | 4 +-
> hw/usb-hid.c | 11 ++++
> hw/usb-hub.c | 12 +++-
> hw/usb-msd.c | 5 +-
> hw/usb-ohci.c | 41 +++++++++----
> hw/usb-uhci.c | 2 +-
> hw/usb.c | 12 ++++
> hw/usb.h | 1 +
> usb-linux.c | 176 ++++++++++++++++++++++++++++++++++++---------------------
> 9 files changed, 180 insertions(+), 84 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2011-11-01 14:56 Gerd Hoffmann
2011-11-01 18:13 ` Anthony Liguori
0 siblings, 1 reply; 47+ messages in thread
From: Gerd Hoffmann @ 2011-11-01 14:56 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Three little usb patches for 1.0.
please pull,
Gerd
The following changes since commit ff74c5a9a91c6dbf1017195462aa4176f7381240:
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging (2011-10-31 15:05:40 -0500)
are available in the git repository at:
git://git.kraxel.org/qemu usb.29
Gerd Hoffmann (2):
usb-hub: wakeup on attach
usb-host: fix host close
Roy Tam (1):
usb: change VID/PID for usb-hub and usb-msd to prevent conflict
hw/usb-hub.c | 5 +++--
hw/usb-msd.c | 4 ++--
usb-linux.c | 6 ++++--
3 files changed, 9 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2011-11-01 14:56 Gerd Hoffmann
@ 2011-11-01 18:13 ` Anthony Liguori
0 siblings, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2011-11-01 18:13 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 11/01/2011 09:56 AM, Gerd Hoffmann wrote:
> Hi,
>
> Three little usb patches for 1.0.
>
> please pull,
> Gerd
>
> The following changes since commit ff74c5a9a91c6dbf1017195462aa4176f7381240:
>
> Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging (2011-10-31 15:05:40 -0500)
Pulled. Thanks.
Regards,
Anthony Liguori
> are available in the git repository at:
>
> git://git.kraxel.org/qemu usb.29
>
> Gerd Hoffmann (2):
> usb-hub: wakeup on attach
> usb-host: fix host close
>
> Roy Tam (1):
> usb: change VID/PID for usb-hub and usb-msd to prevent conflict
>
> hw/usb-hub.c | 5 +++--
> hw/usb-msd.c | 4 ++--
> usb-linux.c | 6 ++++--
> 3 files changed, 9 insertions(+), 6 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PULL] usb patch queue
@ 2012-02-28 10:20 Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 01/21] usb-hid: fix tablet activation Gerd Hoffmann
` (21 more replies)
0 siblings, 22 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Hi,
Next batch of usb updates. This one brings packet queuing for uhci and
xhci, so we have per-endpoint queues at usb-bus level now. Need to
bring those to the usb drivers as next step, so they (especially
usb-host) can pipeline requests.
Also a bunch of bugfixes in ehci, smartcard emulation and usb redirect.
cheers,
Gerd
The following changes since commit b4bd0b168e9f4898b98308f4a8a089f647a86d16:
audio: Add some fall through comments (2012-02-25 18:16:11 +0400)
are available in the git repository at:
git://git.kraxel.org/qemu usb.39
Alon Levy (4):
usb-desc: fix user trigerrable segfaults (!config)
libcacard: link with glib for g_strndup
usb-ccid: advertise SELF_POWERED
libcacard: fix reported ATR length
Gerd Hoffmann (10):
usb-hid: fix tablet activation
usb-ehci: fix reset
usb-uhci: cleanup UHCIAsync allocation & initialization.
usb-uhci: add UHCIQueue
usb-uhci: process uhci_handle_td return code via switch.
usb-uhci: implement packet queuing
usb-xhci: enable packet queuing
usb: add tracepoint for usb packet state changes.
usb-ehci: sanity-check iso xfers
ehci: drop old stuff
Hans de Goede (6):
usb-ehci: Handle ISO packets failing with an error other then NAK
usb-redir: Fix printing of device version
usb-redir: Always clear device state on filter reject
usb-redir: Let the usb-host know about our device filtering
usb-redir: Limit return values returned by iso packets
usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
Jan Kiszka (1):
usb: Resolve warnings about unassigned bus on usb device creation
configure | 6 +-
hw/usb-bt.c | 4 +-
hw/usb-bus.c | 18 +---
hw/usb-ccid.c | 2 +-
hw/usb-desc.c | 20 +++-
hw/usb-ehci.c | 71 ++++++-------
hw/usb-hid.c | 3 +
hw/usb-msd.c | 4 +-
hw/usb-net.c | 4 +-
hw/usb-serial.c | 8 +-
hw/usb-uhci.c | 314 +++++++++++++++++++++++++++++++---------------------
hw/usb-xhci.c | 6 -
hw/usb.c | 27 +----
hw/usb.h | 7 +-
libcacard/vcardt.h | 4 +-
trace-events | 3 +
usb-bsd.c | 4 +-
usb-linux.c | 4 +-
usb-redir.c | 46 ++++++--
vl.c | 7 +-
20 files changed, 317 insertions(+), 245 deletions(-)
^ permalink raw reply [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 01/21] usb-hid: fix tablet activation
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 02/21] usb-ehci: fix reset Gerd Hoffmann
` (20 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Activate usb hid pointer devices (mouse+tablet) unconditionally
on polls, even if we NAK the poll due to lack of new events.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-hid.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/hw/usb-hid.c b/hw/usb-hid.c
index 7fc0bd8..37bca78 100644
--- a/hw/usb-hid.c
+++ b/hw/usb-hid.c
@@ -466,6 +466,9 @@ static int usb_hid_handle_data(USBDevice *dev, USBPacket *p)
case USB_TOKEN_IN:
if (p->ep->nr == 1) {
int64_t curtime = qemu_get_clock_ns(vm_clock);
+ if (hs->kind == HID_MOUSE || hs->kind == HID_TABLET) {
+ hid_pointer_activate(hs);
+ }
if (!hid_has_events(hs) &&
(!hs->idle || hs->next_idle_clock - curtime > 0)) {
return USB_RET_NAK;
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 02/21] usb-ehci: fix reset
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 01/21] usb-hid: fix tablet activation Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 03/21] usb-uhci: cleanup UHCIAsync allocation & initialization Gerd Hoffmann
` (19 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Two reset fixes:
* pick up s->usbcmd value after ehci_reset call to make sure it
keeps the reset value and doesn't get rubbish filled in when
val is written back to the mmio register array later on.
* make sure the frame timer is zapped on reset.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ehci.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index e699814..b9da26a 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -912,6 +912,7 @@ static void ehci_reset(void *opaque)
}
}
ehci_queues_rip_all(s);
+ qemu_del_timer(s->frame_timer);
}
static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr)
@@ -1070,7 +1071,7 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val)
if (val & USBCMD_HCRESET) {
ehci_reset(s);
- val &= ~USBCMD_HCRESET;
+ val = s->usbcmd;
}
/* not supporting dynamic frame list size at the moment */
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 03/21] usb-uhci: cleanup UHCIAsync allocation & initialization.
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 01/21] usb-hid: fix tablet activation Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 02/21] usb-ehci: fix reset Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 04/21] usb-uhci: add UHCIQueue Gerd Hoffmann
` (18 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-uhci.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 2280dc7..ca87290 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -159,15 +159,9 @@ typedef struct UHCI_QH {
static UHCIAsync *uhci_async_alloc(UHCIState *s)
{
- UHCIAsync *async = g_malloc(sizeof(UHCIAsync));
+ UHCIAsync *async = g_new0(UHCIAsync, 1);
- memset(&async->packet, 0, sizeof(async->packet));
async->uhci = s;
- async->valid = 0;
- async->td = 0;
- async->token = 0;
- async->done = 0;
- async->isoc = 0;
usb_packet_init(&async->packet);
pci_dma_sglist_init(&async->sgl, &s->dev, 1);
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 04/21] usb-uhci: add UHCIQueue
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (2 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 03/21] usb-uhci: cleanup UHCIAsync allocation & initialization Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 05/21] usb-uhci: process uhci_handle_td return code via switch Gerd Hoffmann
` (17 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
UHCIAsync structs (in-flight requests) grouped in UHCIQueue now.
Each (active) usb endpoint gets its own UHCIQueue.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-uhci.c | 209 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 118 insertions(+), 91 deletions(-)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index ca87290..b8b336f 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -95,23 +95,32 @@ static const char *pid2str(int pid)
#endif
typedef struct UHCIState UHCIState;
+typedef struct UHCIAsync UHCIAsync;
+typedef struct UHCIQueue UHCIQueue;
/*
* Pending async transaction.
* 'packet' must be the first field because completion
* handler does "(UHCIAsync *) pkt" cast.
*/
-typedef struct UHCIAsync {
+
+struct UHCIAsync {
USBPacket packet;
QEMUSGList sgl;
- UHCIState *uhci;
+ UHCIQueue *queue;
QTAILQ_ENTRY(UHCIAsync) next;
uint32_t td;
- uint32_t token;
- int8_t valid;
uint8_t isoc;
uint8_t done;
-} UHCIAsync;
+};
+
+struct UHCIQueue {
+ uint32_t token;
+ UHCIState *uhci;
+ QTAILQ_ENTRY(UHCIQueue) next;
+ QTAILQ_HEAD(, UHCIAsync) asyncs;
+ int8_t valid;
+};
typedef struct UHCIPort {
USBPort port;
@@ -137,7 +146,7 @@ struct UHCIState {
uint32_t pending_int_mask;
/* Active packets */
- QTAILQ_HEAD(,UHCIAsync) async_pending;
+ QTAILQ_HEAD(, UHCIQueue) queues;
uint8_t num_ports_vmstate;
/* Properties */
@@ -157,56 +166,90 @@ typedef struct UHCI_QH {
uint32_t el_link;
} UHCI_QH;
-static UHCIAsync *uhci_async_alloc(UHCIState *s)
+static inline int32_t uhci_queue_token(UHCI_TD *td)
+{
+ /* covers ep, dev, pid -> identifies the endpoint */
+ return td->token & 0x7ffff;
+}
+
+static UHCIQueue *uhci_queue_get(UHCIState *s, UHCI_TD *td)
+{
+ uint32_t token = uhci_queue_token(td);
+ UHCIQueue *queue;
+
+ QTAILQ_FOREACH(queue, &s->queues, next) {
+ if (queue->token == token) {
+ return queue;
+ }
+ }
+
+ queue = g_new0(UHCIQueue, 1);
+ queue->uhci = s;
+ queue->token = token;
+ QTAILQ_INIT(&queue->asyncs);
+ QTAILQ_INSERT_HEAD(&s->queues, queue, next);
+ return queue;
+}
+
+static void uhci_queue_free(UHCIQueue *queue)
+{
+ UHCIState *s = queue->uhci;
+
+ QTAILQ_REMOVE(&s->queues, queue, next);
+ g_free(queue);
+}
+
+static UHCIAsync *uhci_async_alloc(UHCIQueue *queue)
{
UHCIAsync *async = g_new0(UHCIAsync, 1);
- async->uhci = s;
+ async->queue = queue;
usb_packet_init(&async->packet);
- pci_dma_sglist_init(&async->sgl, &s->dev, 1);
+ pci_dma_sglist_init(&async->sgl, &queue->uhci->dev, 1);
return async;
}
-static void uhci_async_free(UHCIState *s, UHCIAsync *async)
+static void uhci_async_free(UHCIAsync *async)
{
usb_packet_cleanup(&async->packet);
qemu_sglist_destroy(&async->sgl);
g_free(async);
}
-static void uhci_async_link(UHCIState *s, UHCIAsync *async)
+static void uhci_async_link(UHCIAsync *async)
{
- QTAILQ_INSERT_HEAD(&s->async_pending, async, next);
+ UHCIQueue *queue = async->queue;
+ QTAILQ_INSERT_TAIL(&queue->asyncs, async, next);
}
-static void uhci_async_unlink(UHCIState *s, UHCIAsync *async)
+static void uhci_async_unlink(UHCIAsync *async)
{
- QTAILQ_REMOVE(&s->async_pending, async, next);
+ UHCIQueue *queue = async->queue;
+ QTAILQ_REMOVE(&queue->asyncs, async, next);
}
-static void uhci_async_cancel(UHCIState *s, UHCIAsync *async)
+static void uhci_async_cancel(UHCIAsync *async)
{
DPRINTF("uhci: cancel td 0x%x token 0x%x done %u\n",
async->td, async->token, async->done);
if (!async->done)
usb_cancel_packet(&async->packet);
- uhci_async_free(s, async);
+ uhci_async_free(async);
}
/*
* Mark all outstanding async packets as invalid.
* This is used for canceling them when TDs are removed by the HCD.
*/
-static UHCIAsync *uhci_async_validate_begin(UHCIState *s)
+static void uhci_async_validate_begin(UHCIState *s)
{
- UHCIAsync *async;
+ UHCIQueue *queue;
- QTAILQ_FOREACH(async, &s->async_pending, next) {
- async->valid--;
+ QTAILQ_FOREACH(queue, &s->queues, next) {
+ queue->valid--;
}
- return NULL;
}
/*
@@ -214,77 +257,74 @@ static UHCIAsync *uhci_async_validate_begin(UHCIState *s)
*/
static void uhci_async_validate_end(UHCIState *s)
{
- UHCIAsync *curr, *n;
+ UHCIQueue *queue, *n;
+ UHCIAsync *async;
- QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) {
- if (curr->valid > 0) {
+ QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) {
+ if (queue->valid > 0) {
continue;
}
- uhci_async_unlink(s, curr);
- uhci_async_cancel(s, curr);
+ while (!QTAILQ_EMPTY(&queue->asyncs)) {
+ async = QTAILQ_FIRST(&queue->asyncs);
+ uhci_async_unlink(async);
+ uhci_async_cancel(async);
+ }
+ uhci_queue_free(queue);
}
}
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
{
+ UHCIQueue *queue;
UHCIAsync *curr, *n;
- QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) {
- if (!usb_packet_is_inflight(&curr->packet) ||
- curr->packet.ep->dev != dev) {
- continue;
+ QTAILQ_FOREACH(queue, &s->queues, next) {
+ QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
+ if (!usb_packet_is_inflight(&curr->packet) ||
+ curr->packet.ep->dev != dev) {
+ continue;
+ }
+ uhci_async_unlink(curr);
+ uhci_async_cancel(curr);
}
- uhci_async_unlink(s, curr);
- uhci_async_cancel(s, curr);
}
}
static void uhci_async_cancel_all(UHCIState *s)
{
+ UHCIQueue *queue;
UHCIAsync *curr, *n;
- QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) {
- uhci_async_unlink(s, curr);
- uhci_async_cancel(s, curr);
+ QTAILQ_FOREACH(queue, &s->queues, next) {
+ QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
+ uhci_async_unlink(curr);
+ uhci_async_cancel(curr);
+ }
}
}
-static UHCIAsync *uhci_async_find_td(UHCIState *s, uint32_t addr, uint32_t token)
+static UHCIAsync *uhci_async_find_td(UHCIState *s, uint32_t addr, UHCI_TD *td)
{
+ uint32_t token = uhci_queue_token(td);
+ UHCIQueue *queue;
UHCIAsync *async;
- UHCIAsync *match = NULL;
- int count = 0;
-
- /*
- * We're looking for the best match here. ie both td addr and token.
- * Otherwise we return last good match. ie just token.
- * It's ok to match just token because it identifies the transaction
- * rather well, token includes: device addr, endpoint, size, etc.
- *
- * Also since we queue async transactions in reverse order by returning
- * last good match we restores the order.
- *
- * It's expected that we wont have a ton of outstanding transactions.
- * If we ever do we'd want to optimize this algorithm.
- */
-
- QTAILQ_FOREACH(async, &s->async_pending, next) {
- if (async->token == token) {
- /* Good match */
- match = async;
- if (async->td == addr) {
- /* Best match */
- break;
- }
+ QTAILQ_FOREACH(queue, &s->queues, next) {
+ if (queue->token == token) {
+ break;
}
- count++;
+ }
+ if (queue == NULL) {
+ return NULL;
}
- if (count > 64)
- fprintf(stderr, "uhci: warning lots of async transactions\n");
+ QTAILQ_FOREACH(async, &queue->asyncs, next) {
+ if (async->td == addr) {
+ return async;
+ }
+ }
- return match;
+ return NULL;
}
static void uhci_update_irq(UHCIState *s)
@@ -753,8 +793,7 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, uint32_t *in
{
UHCIAsync *async;
int len = 0, max_len;
- uint8_t pid, isoc;
- uint32_t token;
+ uint8_t pid;
USBDevice *dev;
USBEndpoint *ep;
@@ -762,41 +801,29 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, uint32_t *in
if (!(td->ctrl & TD_CTRL_ACTIVE))
return 1;
- /* token field is not unique for isochronous requests,
- * so use the destination buffer
- */
- if (td->ctrl & TD_CTRL_IOS) {
- token = td->buffer;
- isoc = 1;
- } else {
- token = td->token;
- isoc = 0;
- }
-
- async = uhci_async_find_td(s, addr, token);
+ async = uhci_async_find_td(s, addr, td);
if (async) {
/* Already submitted */
- async->valid = 32;
+ async->queue->valid = 32;
if (!async->done)
return 1;
- uhci_async_unlink(s, async);
+ uhci_async_unlink(async);
goto done;
}
/* Allocate new packet */
- async = uhci_async_alloc(s);
+ async = uhci_async_alloc(uhci_queue_get(s, td));
if (!async)
return 1;
/* valid needs to be large enough to handle 10 frame delay
* for initial isochronous requests
*/
- async->valid = 32;
+ async->queue->valid = 32;
async->td = addr;
- async->token = token;
- async->isoc = isoc;
+ async->isoc = td->ctrl & TD_CTRL_IOS;
max_len = ((td->token >> 21) + 1) & 0x7ff;
pid = td->token & 0xff;
@@ -821,14 +848,14 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, uint32_t *in
default:
/* invalid pid : frame interrupted */
- uhci_async_free(s, async);
+ uhci_async_free(async);
s->status |= UHCI_STS_HCPERR;
uhci_update_irq(s);
return -1;
}
if (len == USB_RET_ASYNC) {
- uhci_async_link(s, async);
+ uhci_async_link(async);
return 2;
}
@@ -837,14 +864,14 @@ static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td, uint32_t *in
done:
len = uhci_complete_td(s, td, async, int_mask);
usb_packet_unmap(&async->packet);
- uhci_async_free(s, async);
+ uhci_async_free(async);
return len;
}
static void uhci_async_complete(USBPort *port, USBPacket *packet)
{
UHCIAsync *async = container_of(packet, UHCIAsync, packet);
- UHCIState *s = async->uhci;
+ UHCIState *s = async->queue->uhci;
DPRINTF("uhci: async complete. td 0x%x token 0x%x\n", async->td, async->token);
@@ -859,14 +886,14 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
le32_to_cpus(&td.token);
le32_to_cpus(&td.buffer);
- uhci_async_unlink(s, async);
+ uhci_async_unlink(async);
uhci_complete_td(s, &td, async, &int_mask);
s->pending_int_mask |= int_mask;
/* update the status bits of the TD */
val = cpu_to_le32(td.ctrl);
pci_dma_write(&s->dev, (link & ~0xf) + 4, &val, sizeof(val));
- uhci_async_free(s, async);
+ uhci_async_free(async);
} else {
async->done = 1;
uhci_process_frame(s);
@@ -1142,7 +1169,7 @@ static int usb_uhci_common_initfn(PCIDevice *dev)
}
s->frame_timer = qemu_new_timer_ns(vm_clock, uhci_frame_timer, s);
s->num_ports_vmstate = NB_PORTS;
- QTAILQ_INIT(&s->async_pending);
+ QTAILQ_INIT(&s->queues);
qemu_register_reset(uhci_reset, s);
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 05/21] usb-uhci: process uhci_handle_td return code via switch.
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (3 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 04/21] usb-uhci: add UHCIQueue Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 06/21] usb-uhci: implement packet queuing Gerd Hoffmann
` (16 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Restruct the uhci_handle_td return code processing to make the
control flow more clear and the code more readable.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-uhci.c | 66 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 39 insertions(+), 27 deletions(-)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index b8b336f..13298aa 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -1029,49 +1029,61 @@ static void uhci_process_frame(UHCIState *s)
pci_dma_write(&s->dev, (link & ~0xf) + 4, &val, sizeof(val));
}
- if (ret < 0) {
- /* interrupted frame */
- break;
- }
-
- if (ret == 2 || ret == 1) {
- DPRINTF("uhci: TD 0x%x %s. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
- link, ret == 2 ? "pend" : "skip",
- td.link, td.ctrl, td.token, curr_qh);
+ switch (ret) {
+ case -1: /* interrupted frame */
+ goto out;
+ case 1: /* goto next queue */
+ DPRINTF("uhci: TD 0x%x skip. "
+ "link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
+ link, td.link, td.ctrl, td.token, curr_qh);
link = curr_qh ? qh.link : td.link;
continue;
- }
- /* completed TD */
+ case 2: /* got USB_RET_ASYNC */
+ DPRINTF("uhci: TD 0x%x async. "
+ "link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
+ link, td.link, td.ctrl, td.token, curr_qh);
+ fprintf(stderr, "async td: link %x%s\n",
+ td.link, is_valid(td.link) ? " valid" : "");
+ link = curr_qh ? qh.link : td.link;
+ continue;
- DPRINTF("uhci: TD 0x%x done. link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
- link, td.link, td.ctrl, td.token, curr_qh);
+ case 0: /* completed TD */
+ DPRINTF("uhci: TD 0x%x done. "
+ "link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
+ link, td.link, td.ctrl, td.token, curr_qh);
- link = td.link;
- td_count++;
- bytes_count += (td.ctrl & 0x7ff) + 1;
+ link = td.link;
+ td_count++;
+ bytes_count += (td.ctrl & 0x7ff) + 1;
- if (curr_qh) {
- /* update QH element link */
- qh.el_link = link;
- val = cpu_to_le32(qh.el_link);
- pci_dma_write(&s->dev, (curr_qh & ~0xf) + 4, &val, sizeof(val));
+ if (curr_qh) {
+ /* update QH element link */
+ qh.el_link = link;
+ val = cpu_to_le32(qh.el_link);
+ pci_dma_write(&s->dev, (curr_qh & ~0xf) + 4, &val, sizeof(val));
- if (!depth_first(link)) {
- /* done with this QH */
+ if (!depth_first(link)) {
+ /* done with this QH */
- DPRINTF("uhci: QH 0x%x done. link 0x%x elink 0x%x\n",
- curr_qh, qh.link, qh.el_link);
+ DPRINTF("uhci: QH 0x%x done. link 0x%x elink 0x%x\n",
+ curr_qh, qh.link, qh.el_link);
- curr_qh = 0;
- link = qh.link;
+ curr_qh = 0;
+ link = qh.link;
+ }
}
+ break;
+
+ default:
+ assert(!"unknown return code");
}
/* go to the next entry */
}
+out:
s->pending_int_mask |= int_mask;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 06/21] usb-uhci: implement packet queuing
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (4 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 05/21] usb-uhci: process uhci_handle_td return code via switch Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 07/21] usb-xhci: enable " Gerd Hoffmann
` (15 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
When a usb device is busy processing a packet (and returns
USB_RET_ASYNC), continue walking the transfer descriptor list
and process them to fill the request queue.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-uhci.c | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 13298aa..70e3881 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -942,6 +942,34 @@ static int qhdb_insert(QhDb *db, uint32_t addr)
return 0;
}
+static void uhci_fill_queue(UHCIState *s, UHCI_TD *td)
+{
+ uint32_t int_mask = 0;
+ uint32_t plink = td->link;
+ uint32_t token = uhci_queue_token(td);
+ UHCI_TD ptd;
+ int ret;
+
+ fprintf(stderr, "%s: -- %x\n", __func__, token);
+ while (is_valid(plink)) {
+ pci_dma_read(&s->dev, plink & ~0xf, &ptd, sizeof(ptd));
+ le32_to_cpus(&ptd.link);
+ le32_to_cpus(&ptd.ctrl);
+ le32_to_cpus(&ptd.token);
+ le32_to_cpus(&ptd.buffer);
+ if (!(ptd.ctrl & TD_CTRL_ACTIVE)) {
+ break;
+ }
+ if (uhci_queue_token(&ptd) != token) {
+ break;
+ }
+ ret = uhci_handle_td(s, plink, &ptd, &int_mask);
+ assert(ret == 2); /* got USB_RET_ASYNC */
+ assert(int_mask == 0);
+ plink = ptd.link;
+ }
+}
+
static void uhci_process_frame(UHCIState *s)
{
uint32_t frame_addr, link, old_td_ctrl, val, int_mask;
@@ -1044,8 +1072,9 @@ static void uhci_process_frame(UHCIState *s)
DPRINTF("uhci: TD 0x%x async. "
"link 0x%x ctrl 0x%x token 0x%x qh 0x%x\n",
link, td.link, td.ctrl, td.token, curr_qh);
- fprintf(stderr, "async td: link %x%s\n",
- td.link, is_valid(td.link) ? " valid" : "");
+ if (is_valid(td.link)) {
+ uhci_fill_queue(s, &td);
+ }
link = curr_qh ? qh.link : td.link;
continue;
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 07/21] usb-xhci: enable packet queuing
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (5 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 06/21] usb-uhci: implement packet queuing Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 08/21] usb: add tracepoint for usb packet state changes Gerd Hoffmann
` (14 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
qemu usb core has packet queues now, so flip lets the switch.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-xhci.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c
index 008b0b5..fc5b542 100644
--- a/hw/usb-xhci.c
+++ b/hw/usb-xhci.c
@@ -1769,12 +1769,6 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, unsigned int epid
epctx->retry = xfer;
break;
}
-
- /*
- * Qemu usb can't handle multiple in-flight xfers.
- * Stop here for now.
- */
- break;
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 08/21] usb: add tracepoint for usb packet state changes.
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (6 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 07/21] usb-xhci: enable " Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 09/21] usb-ehci: sanity-check iso xfers Gerd Hoffmann
` (13 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb.c | 27 +++++----------------------
trace-events | 3 +++
2 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/hw/usb.c b/hw/usb.c
index e5b8f33..57fc5e3 100644
--- a/hw/usb.c
+++ b/hw/usb.c
@@ -26,6 +26,7 @@
#include "qemu-common.h"
#include "usb.h"
#include "iov.h"
+#include "trace.h"
void usb_attach(USBPort *port)
{
@@ -390,7 +391,6 @@ void usb_packet_init(USBPacket *p)
void usb_packet_set_state(USBPacket *p, USBPacketState state)
{
-#ifdef DEBUG
static const char *name[] = {
[USB_PACKET_UNDEFINED] = "undef",
[USB_PACKET_SETUP] = "setup",
@@ -399,28 +399,11 @@ void usb_packet_set_state(USBPacket *p, USBPacketState state)
[USB_PACKET_COMPLETE] = "complete",
[USB_PACKET_CANCELED] = "canceled",
};
- static const char *rets[] = {
- [-USB_RET_NODEV] = "NODEV",
- [-USB_RET_NAK] = "NAK",
- [-USB_RET_STALL] = "STALL",
- [-USB_RET_BABBLE] = "BABBLE",
- [-USB_RET_ASYNC] = "ASYNC",
- };
- char add[16] = "";
+ USBDevice *dev = p->ep->dev;
+ USBBus *bus = usb_bus_from_device(dev);
- if (state == USB_PACKET_COMPLETE) {
- if (p->result < 0) {
- snprintf(add, sizeof(add), " - %s", rets[-p->result]);
- } else {
- snprintf(add, sizeof(add), " - %d", p->result);
- }
- }
- fprintf(stderr, "bus %s, port %s, dev %d, ep %d: packet %p: %s -> %s%s\n",
- p->ep->dev->qdev.parent_bus->name,
- p->ep->dev->port->path,
- p->ep->dev->addr, p->ep->nr,
- p, name[p->state], name[state], add);
-#endif
+ trace_usb_packet_state_change(bus->busnr, dev->port->path, p->ep->nr,
+ p, name[p->state], name[state]);
p->state = state;
}
diff --git a/trace-events b/trace-events
index e918ff6..c5d0f0f 100644
--- a/trace-events
+++ b/trace-events
@@ -227,6 +227,9 @@ sun4m_iommu_page_get_flags(uint64_t pa, uint64_t iopte, uint32_t ret) "get flags
sun4m_iommu_translate_pa(uint64_t addr, uint64_t pa, uint32_t iopte) "xlate dva %"PRIx64" => pa %"PRIx64" iopte = %x"
sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64
+# hw/usb.c
+usb_packet_state_change(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, port %s, ep %d, packet %p, state %s -> %s"
+
# hw/usb-bus.c
usb_port_claim(int bus, const char *port) "bus %d, port %s"
usb_port_attach(int bus, const char *port) "bus %d, port %s"
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 09/21] usb-ehci: sanity-check iso xfers
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (7 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 08/21] usb: add tracepoint for usb packet state changes Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 10/21] usb-desc: fix user trigerrable segfaults (!config) Gerd Hoffmann
` (12 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
This patch adds a sanity check to itd processing to make sure the
endpoint addressed by the guest is actually an iso endpoint. Also
verify that usb drivers don't return USB_RET_ASYNC which is illegal for
iso xfers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ehci.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index b9da26a..048eb76 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1459,12 +1459,16 @@ static int ehci_process_itd(EHCIState *ehci,
dev = ehci_find_device(ehci, devaddr);
ep = usb_ep_get(dev, pid, endp);
- usb_packet_setup(&ehci->ipacket, pid, ep);
- usb_packet_map(&ehci->ipacket, &ehci->isgl);
-
- ret = usb_handle_packet(dev, &ehci->ipacket);
-
- usb_packet_unmap(&ehci->ipacket);
+ if (ep->type == USB_ENDPOINT_XFER_ISOC) {
+ usb_packet_setup(&ehci->ipacket, pid, ep);
+ usb_packet_map(&ehci->ipacket, &ehci->isgl);
+ ret = usb_handle_packet(dev, &ehci->ipacket);
+ assert(ret != USB_RET_ASYNC);
+ usb_packet_unmap(&ehci->ipacket);
+ } else {
+ DPRINTF("ISOCH: attempt to addess non-iso endpoint\n");
+ ret = USB_RET_NAK;
+ }
qemu_sglist_destroy(&ehci->isgl);
#if 0
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 10/21] usb-desc: fix user trigerrable segfaults (!config)
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (8 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 09/21] usb-ehci: sanity-check iso xfers Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 11/21] libcacard: link with glib for g_strndup Gerd Hoffmann
` (11 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann
From: Alon Levy <alevy@redhat.com>
Check for dev->config being NULL in two places:
USB_REQ_GET_CONFIGURATION and USB_REQ_GET_STATUS.
The behavior of USB_REQ_GET_STATUS is unspecified in the Default state,
that corresponds to dev->config being NULL (it defaults to NULL and is
reset whenever a SET_CONFIGURATION with value 0, or attachment). I
implemented it to correspond with the state before
ed5a83ddd8c1d8ec7b1015315530cf29949e7c48, the commit moving SET_STATUS
to usb-desc; if dev->config is not set we return whatever is in the
first configuration.
The behavior of USB_REQ_GET_CONFIGURATION is also undefined before any
SET_CONFIGURATION, but here we just return 0 (same as specified for the
Address state).
A win7 guest failed to initialize the device before this patch,
segfaulting when GET_STATUS was called with dev->config == NULL. With
this patch the passthrough device still doesn't work but the failure is
unrelated.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-desc.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/hw/usb-desc.c b/hw/usb-desc.c
index 3c3ed6a..ccf85ad 100644
--- a/hw/usb-desc.c
+++ b/hw/usb-desc.c
@@ -536,7 +536,11 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
break;
case DeviceRequest | USB_REQ_GET_CONFIGURATION:
- data[0] = dev->config->bConfigurationValue;
+ /*
+ * 9.4.2: 0 should be returned if the device is unconfigured, otherwise
+ * the non zero value of bConfigurationValue.
+ */
+ data[0] = dev->config ? dev->config->bConfigurationValue : 0;
ret = 1;
break;
case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
@@ -544,9 +548,18 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
trace_usb_set_config(dev->addr, value, ret);
break;
- case DeviceRequest | USB_REQ_GET_STATUS:
+ case DeviceRequest | USB_REQ_GET_STATUS: {
+ const USBDescConfig *config = dev->config ?
+ dev->config : &dev->device->confs[0];
+
data[0] = 0;
- if (dev->config->bmAttributes & 0x40) {
+ /*
+ * Default state: Device behavior when this request is received while
+ * the device is in the Default state is not specified.
+ * We return the same value that a configured device would return if
+ * it used the first configuration.
+ */
+ if (config->bmAttributes & 0x40) {
data[0] |= 1 << USB_DEVICE_SELF_POWERED;
}
if (dev->remote_wakeup) {
@@ -555,6 +568,7 @@ int usb_desc_handle_control(USBDevice *dev, USBPacket *p,
data[1] = 0x00;
ret = 2;
break;
+ }
case DeviceOutRequest | USB_REQ_CLEAR_FEATURE:
if (value == USB_DEVICE_REMOTE_WAKEUP) {
dev->remote_wakeup = 0;
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 11/21] libcacard: link with glib for g_strndup
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (9 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 10/21] usb-desc: fix user trigerrable segfaults (!config) Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 12/21] usb-ccid: advertise SELF_POWERED Gerd Hoffmann
` (10 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann
From: Alon Levy <alevy@redhat.com>
Without it the produced library for make libcacard.la has an unresolved
symbol.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index f9d5330..87474e9 100755
--- a/configure
+++ b/configure
@@ -2571,8 +2571,8 @@ if test "$smartcard" != "no" ; then
int main(void) { PK11_FreeSlot(0); return 0; }
EOF
smartcard_cflags="-I\$(SRC_PATH)/libcacard"
- libcacard_libs=$($pkg_config --libs nss 2>/dev/null)
- libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null)
+ libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
+ libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then
smartcard_nss="yes"
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 12/21] usb-ccid: advertise SELF_POWERED
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (10 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 11/21] libcacard: link with glib for g_strndup Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length Gerd Hoffmann
` (9 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann
From: Alon Levy <alevy@redhat.com>
Before commit ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 each device
provided it's own response to USB_REQ_GET_STATUS, but after it that
response was based on bmAttributes, which was errounously set for
usb-ccid as 0xa0 and not 0xe0.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ccid.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/usb-ccid.c b/hw/usb-ccid.c
index 0b2ac80..ce01e34 100644
--- a/hw/usb-ccid.c
+++ b/hw/usb-ccid.c
@@ -447,7 +447,7 @@ static const USBDescDevice desc_device = {
{
.bNumInterfaces = 1,
.bConfigurationValue = 1,
- .bmAttributes = 0xa0,
+ .bmAttributes = 0xe0,
.bMaxPower = 50,
.nif = 1,
.ifs = &desc_iface0,
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (11 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 12/21] usb-ccid: advertise SELF_POWERED Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-03-08 7:12 ` Wen Congyang
2012-02-28 10:20 ` [Qemu-devel] [PATCH 14/21] usb-ehci: Handle ISO packets failing with an error other then NAK Gerd Hoffmann
` (8 subsequent siblings)
21 siblings, 1 reply; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann
From: Alon Levy <alevy@redhat.com>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
libcacard/vcardt.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
index 538bdde..d4d8e2e 100644
--- a/libcacard/vcardt.h
+++ b/libcacard/vcardt.h
@@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
#define MAX_CHANNEL 4
/* create an ATR with appropriate historical bytes */
-#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
- 'V', 'C', 'A', 'R', 'D', '_'
+#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
+ 'V', 'C', 'A', 'R', 'D', '_')
typedef enum {
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 14/21] usb-ehci: Handle ISO packets failing with an error other then NAK
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (12 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 15/21] ehci: drop old stuff Gerd Hoffmann
` (7 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
Before this patch the ehci code was not checking for any other errors other
then USB_RET_NAK. This causes 2 problems:
1) Other errors are not reported to the guest.
2) When transactions with the ITD_XACT_IOC bit set completing with another
error would not result in USBSTS_INT getting set.
I hit this problem when unplugging devices while iso data was streaming from
the device to the guest. When this happens it takes a while for the guest to
process the unplugging and remove ISO transactions from the ehci schedule, in
the mean time these transactions would complete with a result of USB_RET_NODEV,
which was not handled. This lead to the Linux guest's usb subsystem "hanging",
that is it would no longer see new usb devices getting plugged in and running
for example lsusb would lead to a stuck (D state) lsusb process. This patch
fixes this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ehci.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index 048eb76..b95773f 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1510,11 +1510,27 @@ static int ehci_process_itd(EHCIState *ehci,
/* IN */
set_field(&itd->transact[i], ret, ITD_XACT_LENGTH);
}
-
- if (itd->transact[i] & ITD_XACT_IOC) {
- ehci_record_interrupt(ehci, USBSTS_INT);
+ } else {
+ switch (ret) {
+ default:
+ fprintf(stderr, "Unexpected iso usb result: %d\n", ret);
+ /* Fall through */
+ case USB_RET_NODEV:
+ /* 3.3.2: XACTERR is only allowed on IN transactions */
+ if (dir) {
+ itd->transact[i] |= ITD_XACT_XACTERR;
+ ehci_record_interrupt(ehci, USBSTS_ERRINT);
+ }
+ break;
+ case USB_RET_BABBLE:
+ itd->transact[i] |= ITD_XACT_BABBLE;
+ ehci_record_interrupt(ehci, USBSTS_ERRINT);
+ break;
}
}
+ if (itd->transact[i] & ITD_XACT_IOC) {
+ ehci_record_interrupt(ehci, USBSTS_INT);
+ }
itd->transact[i] &= ~ITD_XACT_ACTIVE;
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 15/21] ehci: drop old stuff
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (13 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 14/21] usb-ehci: Handle ISO packets failing with an error other then NAK Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 16/21] usb-redir: Fix printing of device version Gerd Hoffmann
` (6 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Drop the "ehci under development" banner.
Drop unused & inactive (#if 0) code.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ehci.c | 30 +-----------------------------
1 files changed, 1 insertions(+), 29 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index b95773f..afc8ccf 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1471,36 +1471,10 @@ static int ehci_process_itd(EHCIState *ehci,
}
qemu_sglist_destroy(&ehci->isgl);
-#if 0
- /* In isoch, there is no facility to indicate a NAK so let's
- * instead just complete a zero-byte transaction. Setting
- * DBERR seems too draconian.
- */
-
- if (ret == USB_RET_NAK) {
- if (ehci->isoch_pause > 0) {
- DPRINTF("ISOCH: received a NAK but paused so returning\n");
- ehci->isoch_pause--;
- return 0;
- } else if (ehci->isoch_pause == -1) {
- DPRINTF("ISOCH: recv NAK & isoch pause inactive, setting\n");
- // Pause frindex for up to 50 msec waiting for data from
- // remote
- ehci->isoch_pause = 50;
- return 0;
- } else {
- DPRINTF("ISOCH: isoch pause timeout! return 0\n");
- ret = 0;
- }
- } else {
- DPRINTF("ISOCH: received ACK, clearing pause\n");
- ehci->isoch_pause = -1;
- }
-#else
if (ret == USB_RET_NAK) {
+ /* no data for us, so do a zero-length transfer */
ret = 0;
}
-#endif
if (ret >= 0) {
if (!dir) {
@@ -2389,8 +2363,6 @@ static int usb_ehci_initfn(PCIDevice *dev)
memory_region_init_io(&s->mem, &ehci_mem_ops, s, "ehci", MMIO_SIZE);
pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mem);
- fprintf(stderr, "*** EHCI support is under development ***\n");
-
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 16/21] usb-redir: Fix printing of device version
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (14 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 15/21] ehci: drop old stuff Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 17/21] usb-redir: Always clear device state on filter reject Gerd Hoffmann
` (5 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
The device version is in bcd format, which requires some special handling to
print.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
usb-redir.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index a59b347..18204be 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1049,8 +1049,10 @@ static void usbredir_device_connect(void *priv,
usb_redir_cap_connect_device_version)) {
INFO("attaching %s device %04x:%04x version %d.%d class %02x\n",
speed, device_connect->vendor_id, device_connect->product_id,
- device_connect->device_version_bcd >> 8,
- device_connect->device_version_bcd & 0xff,
+ ((device_connect->device_version_bcd & 0xf000) >> 12) * 10 +
+ ((device_connect->device_version_bcd & 0x0f00) >> 8),
+ ((device_connect->device_version_bcd & 0x00f0) >> 4) * 10 +
+ ((device_connect->device_version_bcd & 0x000f) >> 0),
device_connect->device_class);
} else {
INFO("attaching %s device %04x:%04x class %02x\n", speed,
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 17/21] usb-redir: Always clear device state on filter reject
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (15 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 16/21] usb-redir: Fix printing of device version Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 18/21] usb-redir: Let the usb-host know about our device filtering Gerd Hoffmann
` (4 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
Always call usbredir_device_disconnect() when usbredir_check_filter() fails
to clean up all the device state (ie received endpoint info).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
usb-redir.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 18204be..c98b14e 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -958,7 +958,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
{
if (dev->interface_info.interface_count == 0) {
ERROR("No interface info for device\n");
- return -1;
+ goto error;
}
if (dev->filter_rules) {
@@ -966,7 +966,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
usb_redir_cap_connect_device_version)) {
ERROR("Device filter specified and peer does not have the "
"connect_device_version capability\n");
- return -1;
+ goto error;
}
if (usbredirfilter_check(
@@ -983,11 +983,15 @@ static int usbredir_check_filter(USBRedirDevice *dev)
dev->device_info.product_id,
dev->device_info.device_version_bcd,
0) != 0) {
- return -1;
+ goto error;
}
}
return 0;
+
+error:
+ usbredir_device_disconnect(dev);
+ return -1;
}
/*
@@ -1113,7 +1117,6 @@ static void usbredir_interface_info(void *priv,
if (usbredir_check_filter(dev)) {
ERROR("Device no longer matches filter after interface info "
"change, disconnecting!\n");
- usbredir_device_disconnect(dev);
}
}
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 18/21] usb-redir: Let the usb-host know about our device filtering
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (16 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 17/21] usb-redir: Always clear device state on filter reject Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 19/21] usb-redir: Limit return values returned by iso packets Gerd Hoffmann
` (3 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
libusbredirparser-0.3.4 adds 2 new packets which allows us to notify
the usb-host:
-about the usb device filter we have (if any), so that it knows not the even
try to redirect certain devices
-when we reject a device based on filtering (in case it tries anyways)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 2 +-
usb-redir.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index 87474e9..d64b2de 100755
--- a/configure
+++ b/configure
@@ -2592,7 +2592,7 @@ fi
# check for usbredirparser for usb network redirection support
if test "$usb_redir" != "no" ; then
- if $pkg_config --atleast-version=0.3.3 libusbredirparser >/dev/null 2>&1 ; then
+ if $pkg_config --atleast-version=0.3.4 libusbredirparser >/dev/null 2>&1 ; then
usb_redir="yes"
usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
diff --git a/usb-redir.c b/usb-redir.c
index c98b14e..6c92fd9 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -106,6 +106,7 @@ struct AsyncURB {
QTAILQ_ENTRY(AsyncURB)next;
};
+static void usbredir_hello(void *priv, struct usb_redir_hello_header *h);
static void usbredir_device_connect(void *priv,
struct usb_redir_device_connect_header *device_connect);
static void usbredir_device_disconnect(void *priv);
@@ -802,6 +803,7 @@ static void usbredir_open_close_bh(void *opaque)
dev->parser->log_func = usbredir_log;
dev->parser->read_func = usbredir_read;
dev->parser->write_func = usbredir_write;
+ dev->parser->hello_func = usbredir_hello;
dev->parser->device_connect_func = usbredir_device_connect;
dev->parser->device_disconnect_func = usbredir_device_disconnect;
dev->parser->interface_info_func = usbredir_interface_info;
@@ -820,6 +822,7 @@ static void usbredir_open_close_bh(void *opaque)
dev->read_buf_size = 0;
usbredirparser_caps_set_cap(caps, usb_redir_cap_connect_device_version);
+ usbredirparser_caps_set_cap(caps, usb_redir_cap_filter);
usbredirparser_init(dev->parser, VERSION, caps, USB_REDIR_CAPS_SIZE, 0);
usbredirparser_do_write(dev->parser);
}
@@ -991,6 +994,10 @@ static int usbredir_check_filter(USBRedirDevice *dev)
error:
usbredir_device_disconnect(dev);
+ if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter)) {
+ usbredirparser_send_filter_reject(dev->parser);
+ usbredirparser_do_write(dev->parser);
+ }
return -1;
}
@@ -1016,6 +1023,19 @@ static int usbredir_handle_status(USBRedirDevice *dev,
}
}
+static void usbredir_hello(void *priv, struct usb_redir_hello_header *h)
+{
+ USBRedirDevice *dev = priv;
+
+ /* Try to send the filter info now that we've the usb-host's caps */
+ if (usbredirparser_peer_has_cap(dev->parser, usb_redir_cap_filter) &&
+ dev->filter_rules) {
+ usbredirparser_send_filter_filter(dev->parser, dev->filter_rules,
+ dev->filter_rules_count);
+ usbredirparser_do_write(dev->parser);
+ }
+}
+
static void usbredir_device_connect(void *priv,
struct usb_redir_device_connect_header *device_connect)
{
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 19/21] usb-redir: Limit return values returned by iso packets
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (17 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 18/21] usb-redir: Let the usb-host know about our device filtering Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 20/21] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint Gerd Hoffmann
` (2 subsequent siblings)
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
The usbredir protocol uses a status of usb_redir_stall to indicate that
an iso data stream has stopped (ie because the urbs failed on resubmit),
but iso packets should never return a result of USB_RET_STALL, since iso
endpoints cannot stall. So instead simply always return USB_RET_NAK on
iso stream errors.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
usb-redir.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 6c92fd9..d905463 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -431,7 +431,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
/* Check iso_error for stream errors, otherwise its an underrun */
status = dev->endpoint[EP2I(ep)].iso_error;
dev->endpoint[EP2I(ep)].iso_error = 0;
- return usbredir_handle_status(dev, status, 0);
+ return status ? USB_RET_NAK : 0;
}
DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep,
isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size);
@@ -439,7 +439,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
status = isop->status;
if (status != usb_redir_success) {
bufp_free(dev, isop, ep);
- return usbredir_handle_status(dev, status, 0);
+ return USB_RET_NAK;
}
len = isop->len;
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 20/21] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (18 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 19/21] usb-redir: Limit return values returned by iso packets Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 21/21] usb: Resolve warnings about unassigned bus on usb device creation Gerd Hoffmann
2012-02-29 21:07 ` [Qemu-devel] [PULL] usb patch queue Anthony Liguori
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Hans de Goede, Gerd Hoffmann
From: Hans de Goede <hdegoede@redhat.com>
We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data
for an interrupt IN endpoint.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
usb-redir.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index d905463..755492f 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -548,7 +548,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
/* Check interrupt_error for stream errors */
status = dev->endpoint[EP2I(ep)].interrupt_error;
dev->endpoint[EP2I(ep)].interrupt_error = 0;
- return usbredir_handle_status(dev, status, 0);
+ if (status) {
+ return usbredir_handle_status(dev, status, 0);
+ }
+ return USB_RET_NAK;
}
DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
intp->status, intp->len);
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* [Qemu-devel] [PATCH 21/21] usb: Resolve warnings about unassigned bus on usb device creation
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (19 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 20/21] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint Gerd Hoffmann
@ 2012-02-28 10:20 ` Gerd Hoffmann
2012-02-29 21:07 ` [Qemu-devel] [PULL] usb patch queue Anthony Liguori
21 siblings, 0 replies; 47+ messages in thread
From: Gerd Hoffmann @ 2012-02-28 10:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Jan Kiszka, Gerd Hoffmann
From: Jan Kiszka <jan.kiszka@siemens.com>
When creating an USB device the old way, there is no way to specify the
target bus. Thus the warning issued by usb_create makes no sense and
rather confuses our users.
Resolve this by passing a bus reference to the usbdevice_init handler
and letting those handlers forward it to usb_create.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-bt.c | 4 ++--
hw/usb-bus.c | 18 ++++--------------
hw/usb-msd.c | 4 ++--
hw/usb-net.c | 4 ++--
hw/usb-serial.c | 8 ++++----
hw/usb.h | 7 ++++---
usb-bsd.c | 4 ++--
usb-linux.c | 4 ++--
vl.c | 7 ++++---
9 files changed, 26 insertions(+), 34 deletions(-)
diff --git a/hw/usb-bt.c b/hw/usb-bt.c
index 649bdcf..23c39ec 100644
--- a/hw/usb-bt.c
+++ b/hw/usb-bt.c
@@ -498,14 +498,14 @@ static int usb_bt_initfn(USBDevice *dev)
return 0;
}
-USBDevice *usb_bt_init(HCIInfo *hci)
+USBDevice *usb_bt_init(USBBus *bus, HCIInfo *hci)
{
USBDevice *dev;
struct USBBtState *s;
if (!hci)
return NULL;
- dev = usb_create_simple(NULL /* FIXME */, "usb-bt-dongle");
+ dev = usb_create_simple(bus, "usb-bt-dongle");
if (!dev) {
return NULL;
}
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index ae79a45..70b7ebc 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -203,13 +203,14 @@ typedef struct LegacyUSBFactory
{
const char *name;
const char *usbdevice_name;
- USBDevice *(*usbdevice_init)(const char *params);
+ USBDevice *(*usbdevice_init)(USBBus *bus, const char *params);
} LegacyUSBFactory;
static GSList *legacy_usb_factory;
void usb_legacy_register(const char *typename, const char *usbdevice_name,
- USBDevice *(*usbdevice_init)(const char *params))
+ USBDevice *(*usbdevice_init)(USBBus *bus,
+ const char *params))
{
if (usbdevice_name) {
LegacyUSBFactory *f = g_malloc0(sizeof(*f));
@@ -224,17 +225,6 @@ USBDevice *usb_create(USBBus *bus, const char *name)
{
DeviceState *dev;
-#if 1
- /* temporary stopgap until all usb is properly qdev-ified */
- if (!bus) {
- bus = usb_bus_find(-1);
- if (!bus)
- return NULL;
- error_report("%s: no bus specified, using \"%s\" for \"%s\"",
- __FUNCTION__, bus->qbus.name, name);
- }
-#endif
-
dev = qdev_create(&bus->qbus, name);
return USB_DEVICE(dev);
}
@@ -565,7 +555,7 @@ USBDevice *usbdevice_create(const char *cmdline)
}
return usb_create_simple(bus, f->name);
}
- return f->usbdevice_init(params);
+ return f->usbdevice_init(bus, params);
}
static void usb_device_class_init(ObjectClass *klass, void *data)
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 5fbd2d0..c6f08a0 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -568,7 +568,7 @@ static int usb_msd_initfn(USBDevice *dev)
return 0;
}
-static USBDevice *usb_msd_init(const char *filename)
+static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
{
static int nr=0;
char id[8];
@@ -611,7 +611,7 @@ static USBDevice *usb_msd_init(const char *filename)
}
/* create guest device */
- dev = usb_create(NULL /* FIXME */, "usb-storage");
+ dev = usb_create(bus, "usb-storage");
if (!dev) {
return NULL;
}
diff --git a/hw/usb-net.c b/hw/usb-net.c
index 49d5d4d..22b8201 100644
--- a/hw/usb-net.c
+++ b/hw/usb-net.c
@@ -1353,7 +1353,7 @@ static int usb_net_initfn(USBDevice *dev)
return 0;
}
-static USBDevice *usb_net_init(const char *cmdline)
+static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
{
USBDevice *dev;
QemuOpts *opts;
@@ -1371,7 +1371,7 @@ static USBDevice *usb_net_init(const char *cmdline)
return NULL;
}
- dev = usb_create(NULL /* FIXME */, "usb-net");
+ dev = usb_create(bus, "usb-net");
if (!dev) {
return NULL;
}
diff --git a/hw/usb-serial.c b/hw/usb-serial.c
index 52676e8..0aae379 100644
--- a/hw/usb-serial.c
+++ b/hw/usb-serial.c
@@ -492,7 +492,7 @@ static int usb_serial_initfn(USBDevice *dev)
return 0;
}
-static USBDevice *usb_serial_init(const char *filename)
+static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
{
USBDevice *dev;
CharDriverState *cdrv;
@@ -535,7 +535,7 @@ static USBDevice *usb_serial_init(const char *filename)
if (!cdrv)
return NULL;
- dev = usb_create(NULL /* FIXME */, "usb-serial");
+ dev = usb_create(bus, "usb-serial");
if (!dev) {
return NULL;
}
@@ -549,7 +549,7 @@ static USBDevice *usb_serial_init(const char *filename)
return dev;
}
-static USBDevice *usb_braille_init(const char *unused)
+static USBDevice *usb_braille_init(USBBus *bus, const char *unused)
{
USBDevice *dev;
CharDriverState *cdrv;
@@ -558,7 +558,7 @@ static USBDevice *usb_braille_init(const char *unused)
if (!cdrv)
return NULL;
- dev = usb_create(NULL /* FIXME */, "usb-braille");
+ dev = usb_create(bus, "usb-braille");
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
qdev_init_nofail(&dev->qdev);
diff --git a/hw/usb.h b/hw/usb.h
index 4470ea8..8e83697 100644
--- a/hw/usb.h
+++ b/hw/usb.h
@@ -373,12 +373,12 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
int set_usb_string(uint8_t *buf, const char *str);
/* usb-linux.c */
-USBDevice *usb_host_device_open(const char *devname);
+USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
int usb_host_device_close(const char *devname);
void usb_host_info(Monitor *mon);
/* usb-bt.c */
-USBDevice *usb_bt_init(HCIInfo *hci);
+USBDevice *usb_bt_init(USBBus *bus, HCIInfo *hci);
/* usb ports of the VM */
@@ -431,7 +431,8 @@ struct USBBusOps {
void usb_bus_new(USBBus *bus, USBBusOps *ops, DeviceState *host);
USBBus *usb_bus_find(int busnr);
void usb_legacy_register(const char *typename, const char *usbdevice_name,
- USBDevice *(*usbdevice_init)(const char *params));
+ USBDevice *(*usbdevice_init)(USBBus *bus,
+ const char *params));
USBDevice *usb_create(USBBus *bus, const char *name);
USBDevice *usb_create_simple(USBBus *bus, const char *name);
USBDevice *usbdevice_create(const char *cmdline);
diff --git a/usb-bsd.c b/usb-bsd.c
index 4fa4b42..ec26266 100644
--- a/usb-bsd.c
+++ b/usb-bsd.c
@@ -298,7 +298,7 @@ static int usb_host_initfn(USBDevice *dev)
return 0;
}
-USBDevice *usb_host_device_open(const char *devname)
+USBDevice *usb_host_device_open(USBBus *guest_bus, const char *devname)
{
struct usb_device_info bus_info, dev_info;
USBDevice *d = NULL, *ret = NULL;
@@ -358,7 +358,7 @@ USBDevice *usb_host_device_open(const char *devname)
goto fail_dfd;
}
- d = usb_create(NULL /* FIXME */, "usb-host");
+ d = usb_create(guest_bus, "usb-host");
dev = DO_UPCAST(USBHostDevice, dev, d);
if (dev_info.udi_speed == 1) {
diff --git a/usb-linux.c b/usb-linux.c
index 24700fc..47994f3 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -1443,13 +1443,13 @@ static void usb_host_register_types(void)
type_init(usb_host_register_types)
-USBDevice *usb_host_device_open(const char *devname)
+USBDevice *usb_host_device_open(USBBus *bus, const char *devname)
{
struct USBAutoFilter filter;
USBDevice *dev;
char *p;
- dev = usb_create(NULL /* FIXME */, "usb-host");
+ dev = usb_create(bus, "usb-host");
if (strstr(devname, "auto:")) {
if (parse_filter(devname, &filter) < 0) {
diff --git a/vl.c b/vl.c
index 1d4c350..4a77696 100644
--- a/vl.c
+++ b/vl.c
@@ -1052,12 +1052,13 @@ static int usb_device_add(const char *devname)
#ifndef CONFIG_LINUX
/* only the linux version is qdev-ified, usb-bsd still needs this */
if (strstart(devname, "host:", &p)) {
- dev = usb_host_device_open(p);
+ dev = usb_host_device_open(usb_bus_find(-1), p);
} else
#endif
if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) {
- dev = usb_bt_init(devname[2] ? hci_init(p) :
- bt_new_hci(qemu_find_bt_vlan(0)));
+ dev = usb_bt_init(usb_bus_find(-1),
+ devname[2] ? hci_init(p)
+ : bt_new_hci(qemu_find_bt_vlan(0)));
} else {
return -1;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PULL] usb patch queue
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
` (20 preceding siblings ...)
2012-02-28 10:20 ` [Qemu-devel] [PATCH 21/21] usb: Resolve warnings about unassigned bus on usb device creation Gerd Hoffmann
@ 2012-02-29 21:07 ` Anthony Liguori
21 siblings, 0 replies; 47+ messages in thread
From: Anthony Liguori @ 2012-02-29 21:07 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 02/28/2012 04:20 AM, Gerd Hoffmann wrote:
> Hi,
>
> Next batch of usb updates. This one brings packet queuing for uhci and
> xhci, so we have per-endpoint queues at usb-bus level now. Need to
> bring those to the usb drivers as next step, so they (especially
> usb-host) can pipeline requests.
>
> Also a bunch of bugfixes in ehci, smartcard emulation and usb redirect.
Regards,
Anthony Liguori
>
> cheers,
> Gerd
>
> The following changes since commit b4bd0b168e9f4898b98308f4a8a089f647a86d16:
>
> audio: Add some fall through comments (2012-02-25 18:16:11 +0400)
>
> are available in the git repository at:
> git://git.kraxel.org/qemu usb.39
>
> Alon Levy (4):
> usb-desc: fix user trigerrable segfaults (!config)
> libcacard: link with glib for g_strndup
> usb-ccid: advertise SELF_POWERED
> libcacard: fix reported ATR length
>
> Gerd Hoffmann (10):
> usb-hid: fix tablet activation
> usb-ehci: fix reset
> usb-uhci: cleanup UHCIAsync allocation& initialization.
> usb-uhci: add UHCIQueue
> usb-uhci: process uhci_handle_td return code via switch.
> usb-uhci: implement packet queuing
> usb-xhci: enable packet queuing
> usb: add tracepoint for usb packet state changes.
> usb-ehci: sanity-check iso xfers
> ehci: drop old stuff
>
> Hans de Goede (6):
> usb-ehci: Handle ISO packets failing with an error other then NAK
> usb-redir: Fix printing of device version
> usb-redir: Always clear device state on filter reject
> usb-redir: Let the usb-host know about our device filtering
> usb-redir: Limit return values returned by iso packets
> usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint
>
> Jan Kiszka (1):
> usb: Resolve warnings about unassigned bus on usb device creation
>
> configure | 6 +-
> hw/usb-bt.c | 4 +-
> hw/usb-bus.c | 18 +---
> hw/usb-ccid.c | 2 +-
> hw/usb-desc.c | 20 +++-
> hw/usb-ehci.c | 71 ++++++-------
> hw/usb-hid.c | 3 +
> hw/usb-msd.c | 4 +-
> hw/usb-net.c | 4 +-
> hw/usb-serial.c | 8 +-
> hw/usb-uhci.c | 314 +++++++++++++++++++++++++++++++---------------------
> hw/usb-xhci.c | 6 -
> hw/usb.c | 27 +----
> hw/usb.h | 7 +-
> libcacard/vcardt.h | 4 +-
> trace-events | 3 +
> usb-bsd.c | 4 +-
> usb-linux.c | 4 +-
> usb-redir.c | 46 ++++++--
> vl.c | 7 +-
> 20 files changed, 317 insertions(+), 245 deletions(-)
>
>
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length
2012-02-28 10:20 ` [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length Gerd Hoffmann
@ 2012-03-08 7:12 ` Wen Congyang
2012-03-08 8:15 ` Alon Levy
0 siblings, 1 reply; 47+ messages in thread
From: Wen Congyang @ 2012-03-08 7:12 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: Alon Levy, qemu-devel
At 02/28/2012 06:20 PM, Gerd Hoffmann Wrote:
> From: Alon Levy <alevy@redhat.com>
>
> Signed-off-by: Alon Levy <alevy@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> libcacard/vcardt.h | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> index 538bdde..d4d8e2e 100644
> --- a/libcacard/vcardt.h
> +++ b/libcacard/vcardt.h
> @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
> #define MAX_CHANNEL 4
>
> /* create an ATR with appropriate historical bytes */
> -#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
> - 'V', 'C', 'A', 'R', 'D', '_'
> +#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> + 'V', 'C', 'A', 'R', 'D', '_')
>
>
> typedef enum {
qemu build faile with this patch:
CC libcacard/vcard_emul_nss.o
cc1: warnings being treated as errors
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
vcard_emul_nss.c:528: error: initializer element is not constant
vcard_emul_nss.c:528: error: (near initialization for ‘nss_atr[0]’)
make[1]: *** [vcard_emul_nss.o] Error 1
make: *** [subdir-libcacard] Error 2
I donot know this patch's purpose, so I donot know how to fix it. I guess this
patch is unnecessary.
Thanks
Wen Congyang
^ permalink raw reply [flat|nested] 47+ messages in thread
* Re: [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length
2012-03-08 7:12 ` Wen Congyang
@ 2012-03-08 8:15 ` Alon Levy
0 siblings, 0 replies; 47+ messages in thread
From: Alon Levy @ 2012-03-08 8:15 UTC (permalink / raw)
To: Wen Congyang, Anthony Liguori; +Cc: Gerd Hoffmann, qemu-devel
On Thu, Mar 08, 2012 at 03:12:03PM +0800, Wen Congyang wrote:
> At 02/28/2012 06:20 PM, Gerd Hoffmann Wrote:
> > From: Alon Levy <alevy@redhat.com>
> >
> > Signed-off-by: Alon Levy <alevy@redhat.com>
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> > libcacard/vcardt.h | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libcacard/vcardt.h b/libcacard/vcardt.h
> > index 538bdde..d4d8e2e 100644
> > --- a/libcacard/vcardt.h
> > +++ b/libcacard/vcardt.h
> > @@ -26,8 +26,8 @@ typedef struct VCardEmulStruct VCardEmul;
> > #define MAX_CHANNEL 4
> >
> > /* create an ATR with appropriate historical bytes */
> > -#define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \
> > - 'V', 'C', 'A', 'R', 'D', '_'
> > +#define VCARD_ATR_PREFIX(size) (0x3b, 0x68+(size), 0x00, 0xff, \
> > + 'V', 'C', 'A', 'R', 'D', '_')
> >
> >
> > typedef enum {
>
> qemu build faile with this patch:
This is fixed by a patch on the list:
http://patchwork.ozlabs.org/patch/144276/
Anthony, could you please apply that patch, or should I send a pull request with it?
Alon
>
> CC libcacard/vcard_emul_nss.o
> cc1: warnings being treated as errors
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: left-hand operand of comma expression has no effect
> vcard_emul_nss.c:528: error: initializer element is not constant
> vcard_emul_nss.c:528: error: (near initialization for ‘nss_atr[0]’)
> make[1]: *** [vcard_emul_nss.o] Error 1
> make: *** [subdir-libcacard] Error 2
>
> I donot know this patch's purpose, so I donot know how to fix it. I guess this
> patch is unnecessary.
>
> Thanks
> Wen Congyang
^ permalink raw reply [flat|nested] 47+ messages in thread
end of thread, other threads:[~2012-03-08 8:16 UTC | newest]
Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-28 10:20 [Qemu-devel] [PULL] usb patch queue Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 01/21] usb-hid: fix tablet activation Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 02/21] usb-ehci: fix reset Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 03/21] usb-uhci: cleanup UHCIAsync allocation & initialization Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 04/21] usb-uhci: add UHCIQueue Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 05/21] usb-uhci: process uhci_handle_td return code via switch Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 06/21] usb-uhci: implement packet queuing Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 07/21] usb-xhci: enable " Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 08/21] usb: add tracepoint for usb packet state changes Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 09/21] usb-ehci: sanity-check iso xfers Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 10/21] usb-desc: fix user trigerrable segfaults (!config) Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 11/21] libcacard: link with glib for g_strndup Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 12/21] usb-ccid: advertise SELF_POWERED Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 13/21] libcacard: fix reported ATR length Gerd Hoffmann
2012-03-08 7:12 ` Wen Congyang
2012-03-08 8:15 ` Alon Levy
2012-02-28 10:20 ` [Qemu-devel] [PATCH 14/21] usb-ehci: Handle ISO packets failing with an error other then NAK Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 15/21] ehci: drop old stuff Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 16/21] usb-redir: Fix printing of device version Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 17/21] usb-redir: Always clear device state on filter reject Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 18/21] usb-redir: Let the usb-host know about our device filtering Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 19/21] usb-redir: Limit return values returned by iso packets Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 20/21] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint Gerd Hoffmann
2012-02-28 10:20 ` [Qemu-devel] [PATCH 21/21] usb: Resolve warnings about unassigned bus on usb device creation Gerd Hoffmann
2012-02-29 21:07 ` [Qemu-devel] [PULL] usb patch queue Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2011-11-01 14:56 Gerd Hoffmann
2011-11-01 18:13 ` Anthony Liguori
2011-10-13 11:08 Gerd Hoffmann
2011-10-14 16:25 ` Anthony Liguori
2011-09-02 9:56 Gerd Hoffmann
2011-09-07 8:41 ` Gerd Hoffmann
2011-09-08 14:23 ` Anthony Liguori
2011-08-11 7:03 Gerd Hoffmann
2011-08-12 7:02 ` Michael Tokarev
2011-08-12 7:57 ` Gerd Hoffmann
2011-08-12 13:04 ` Anthony Liguori
2011-07-20 10:23 Gerd Hoffmann
2011-07-08 9:50 Gerd Hoffmann
2011-07-12 14:52 ` Gerd Hoffmann
2011-07-19 15:59 ` Anthony Liguori
2011-06-24 10:59 Gerd Hoffmann
2011-06-24 13:30 ` Hans de Goede
2011-06-27 20:19 ` Anthony Liguori
2011-06-14 11:05 Gerd Hoffmann
2011-06-15 14:17 ` Anthony Liguori
2011-05-04 15:41 Gerd Hoffmann
2011-05-05 18:28 ` Anthony Liguori
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).