#
891fb2cd |
| 01-Sep-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: claim port at device initialization time.
This patch makes qemu assign a port when creating the device, not when attaching it. For most usb devices this isn't a noticable difference because th
usb: claim port at device initialization time.
This patch makes qemu assign a port when creating the device, not when attaching it. For most usb devices this isn't a noticable difference because they are in attached state all the time.
The change affects usb-host devices which live in detached state while the real device is unplugged from the host. They have a fixed port assigned all the time now instead of getting grabbing one on attach and releasing it at detach, i.e. they stop floating around at the usb bus.
The change also allows to simplify usb-hub. It doesn't need the handle_attach() callback any more to configure the downstream ports. This can be done at device initialitation time now. The changed initialization order (first grab upstream port, then register downstream ports) also fixes some icky corner cases. For example it is not possible any more to plug the hub into one of its own downstream ports.
The usb host adapters must care too. USBPort->dev being non-NULL doesn't imply any more the device is in attached state. The host adapters must additionally check the USBPort->dev->attached flag.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
4d8debba |
| 25-Aug-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: fix use after free
The ->complete() callback might have released the USBPacket (uhci actually does), so we must not touch it after the callback returns.
Signed-off-by: Gerd Hoffmann <kraxel@re
usb: fix use after free
The ->complete() callback might have released the USBPacket (uhci actually does), so we must not touch it after the callback returns.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
4f4321c1 |
| 12-Jul-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: use iovecs in USBPacket
Zap data pointer from USBPacket, add a QEMUIOVector instead. Add a bunch of helper functions to manage USBPacket data. Switch over users to the new interface.
Note that
usb: use iovecs in USBPacket
Zap data pointer from USBPacket, add a QEMUIOVector instead. Add a bunch of helper functions to manage USBPacket data. Switch over users to the new interface.
Note that USBPacket->len was used for two purposes: First to pass in the buffer size and second to return the number of transfered bytes or the status code on async transfers. There is a new result variable for the latter. A new status code was added to catch uninitialized result.
Nobody creates iovecs with more than one element (yet). Some users are (temporarely) limited to iovecs with a single element to keep the patch size as small as possible.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
45b9fd34 |
| 24-Jun-2011 |
Hans de Goede <hdegoede@redhat.com> |
usb: assert on calling usb_attach(port, NULL) on a port without a dev
with the "usb-ehci: cleanup port reset handling" patch in place no callers are calling usb_attach(port, NULL) for a port where p
usb: assert on calling usb_attach(port, NULL) on a port without a dev
with the "usb-ehci: cleanup port reset handling" patch in place no callers are calling usb_attach(port, NULL) for a port where port->dev is NULL.
Doing that makes no sense as that causes the port detach op to get called for a port with nothing attached. Add an assert that port->dev != NULL when dev == NULL, and remove the check for not having a port->dev in the dev == NULL case.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
d47e59b8 |
| 21-Jun-2011 |
Hans de Goede <hdegoede@redhat.com> |
usb: Make port wakeup and complete ops take a USBPort instead of a Device
This makes them consistent with the attach and detach ops, and in general it makes sense to make portops take a port as argu
usb: Make port wakeup and complete ops take a USBPort instead of a Device
This makes them consistent with the attach and detach ops, and in general it makes sense to make portops take a port as argument. This also makes adding support for a companion controller easier / cleaner.
[ kraxel: fix usb-musb.c build ]
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
eb5e680a |
| 16-May-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it over to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
Signed-off-by: Gerd Ho
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it over to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
4ff658fb |
| 12-May-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: keep track of packet owner.
Keep track of the device which owns the usb packet for async processing.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
#
53aa8c0e |
| 12-May-2011 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: add usb_handle_packet
Add a usb_handle_packet function, put it into use everywhere. Right now it just calls dev->info->handle_packet(), that will change in future patches though.
Signed-off-by
usb: add usb_handle_packet
Add a usb_handle_packet function, put it into use everywhere. Right now it just calls dev->info->handle_packet(), that will change in future patches though.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
50b7963e |
| 02-Feb-2011 |
Hans de Goede <hdegoede@redhat.com> |
usb-linux: use usb_generic_handle_packet()
Make the linux usb host passthrough code use the usb_generic_handle_packet() function, rather then the curent DYI code. This removes 200 lines of almost id
usb-linux: use usb_generic_handle_packet()
Make the linux usb host passthrough code use the usb_generic_handle_packet() function, rather then the curent DYI code. This removes 200 lines of almost identical code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
#
007fd62f |
| 02-Feb-2011 |
Hans de Goede <hdegoede@redhat.com> |
usb: Pass the packet to the device's handle_control callback
This allows using the generic usb_generic_handle_packet function from device code which does ASYNC control requests (such as the linux ho
usb: Pass the packet to the device's handle_control callback
This allows using the generic usb_generic_handle_packet function from device code which does ASYNC control requests (such as the linux host pass through code).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
#
19f33223 |
| 02-Feb-2011 |
Hans de Goede <hdegoede@redhat.com> |
usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise our control buffer size to 4k. For control out transfers the usb core code copies the control request da
usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise our control buffer size to 4k. For control out transfers the usb core code copies the control request data to a buffer before calling the device's handle_control callback. Add a check for overflowing the buffer before copying the data.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
#
b6f77fbe |
| 03-Dec-2010 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: add attach callback
Add handle_attach() callback to USBDeviceInfo which is called by the generic package handler when the device is attached to the usb bus (i.e. plugged into a port).
Signed-o
usb: add attach callback
Add handle_attach() callback to USBDeviceInfo which is called by the generic package handler when the device is attached to the usb bus (i.e. plugged into a port).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
01eacab6 |
| 01-Dec-2010 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: add usb_wakeup() + wakeup callback to port ops
Add wakeup callback to port ops for remote wakeup handling. Also add a usb_wakeup() function for devices which want trigger a remote wakeup.
Sign
usb: add usb_wakeup() + wakeup callback to port ops
Add wakeup callback to port ops for remote wakeup handling. Also add a usb_wakeup() function for devices which want trigger a remote wakeup.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
618c169b |
| 01-Dec-2010 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: rework attach/detach workflow
Add separate detach callback to USBPortOps, split uhci/ohci/musb/usbhub attach functions into two.
Move common code to the usb_attach() function, only the hardwar
usb: rework attach/detach workflow
Add separate detach callback to USBPortOps, split uhci/ohci/musb/usbhub attach functions into two.
Move common code to the usb_attach() function, only the hardware-specific bits remain in the attach/detach callbacks.
Keep track of the port it is attached to for each usb device.
[ v3: fix tyops in usb-musb.c ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
show more ...
|
#
0d86d2be |
| 01-Dec-2010 |
Gerd Hoffmann <kraxel@redhat.com> |
usb: create USBPortOps, move attach there.
Create USBPortOps struct, move the attach function to that struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
#
806b6024 |
| 31-Aug-2009 |
Gerd Hoffmann <kraxel@redhat.com> |
qdev/usb: add usb bus support to qdev, convert drivers.
* Add USBBus. * Add USBDeviceInfo, move device callbacks here. * Add usb-qdev helper functions. * Switch drivers to qdev.
TODO: * make th
qdev/usb: add usb bus support to qdev, convert drivers.
* Add USBBus. * Add USBDeviceInfo, move device callbacks here. * Add usb-qdev helper functions. * Switch drivers to qdev.
TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs added by this patch.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
show more ...
|
#
89b9b79f |
| 21-Aug-2008 |
aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> |
usb: generic packet handler cleanup and documentation (Max Krasnyansky)
A bit better documentation of the USB device API, namely return codes. Rewrite of usb_generic_handle_packet() to make it more
usb: generic packet handler cleanup and documentation (Max Krasnyansky)
A bit better documentation of the USB device API, namely return codes. Rewrite of usb_generic_handle_packet() to make it more reable and easier to follow.
Signed-off-by: Max Krasnyansky <maxk@kernel.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5049 c046a42c-6fe2-441c-8c8c-71466251a162
show more ...
|
#
87ecb68b |
| 17-Nov-2007 |
pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> |
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
5fafdf24 |
| 16-Sep-2007 |
ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> |
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
aa1f17c1 |
| 11-Jul-2007 |
ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> |
Spelling fixes, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3066 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
4d611c9a |
| 12-Aug-2006 |
pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> |
SCSI and USB async IO support.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
059809e4 |
| 19-Jul-2006 |
bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> |
usb destroy API change (Lonnie Mendez)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2066 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
2e5d83bb |
| 25-May-2006 |
pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> |
Rearrange SCSI disk emulation code. Add USB mass storage device emulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1940 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
72899afc |
| 24-Apr-2006 |
bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> |
separate file for usb hub device
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1848 c046a42c-6fe2-441c-8c8c-71466251a162
|
#
56bebe70 |
| 24-Apr-2006 |
bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> |
usb setup state machine fix when driver reads or writes too many bytes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1847 c046a42c-6fe2-441c-8c8c-71466251a162
|