History | View | Annotate | Download (14.2 kB)
usb: handle dev == NULL in usb_handle_packet()
Allow passing in a NULL pointer, return USB_RET_NODEV in that case.Removes the burden to to a NULL pointer check from the callers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: kill handle_packet callback
All drivers except usb-hub use usb_generic_handle_packet. The onlyreason the usb hub has its own function is that it used to be calledwith packets which are intended for downstream devices. With the new,separate device lookup step this doesn't happen any more, so the need...
usb: fold usb_generic_handle_packet into usb_handle_packet
There is no reason to have a separate usb_generic_handle_packet functionany more, fold it into usb_handle_packet(). Also call the do_token_*functions which handle control transfer emulation for control pipe...
usb: USBPacket: add status, rename owner -> ep
Add enum to track the status of USBPackets, use that instead of theowner pointer to figure whenever a usb packet is currently in flightor not. Add some more packet status sanity checks. Also rename theUSBEndpoint pointer from "owner" to "ep"....
usb: add USBEndpoint->{nr,pid}
Add a "nr" and "pid" fields to USBEndpoint so you can easily figure theendpoint number and direction of any given endpoint.
usb: Set USBEndpoint in usb_packet_setup().
With the separation of the device lookup (via usb_find_device) andpacket processing we can lookup device and endpoint before setting upthe usb packet. So we can initialize USBPacket->ep early and keep itvalid for the whole lifecycle of the USBPacket. Also the devaddr and...
usb: add usb_find_device()
Add usb_find_device(). This function will check whenever a device witha specific address is connected to the specified port. Usually thiswill just check state and address of the device hooked up to the port,but in case of a hub it will ask the hub to check all hub ports for a...
usb: kill USB_MSG_{ATTACH,DETACH}
The USB subsystem pipes internal attach/detach notifications throughusb_handle_packet() with a special magic PID. This indirection is apretty pointless excercise as it ends up being handled byusb_generic_handle_packet anyway. Remove it....
usb: kill USB_MSG_RESET
The USB subsystem pipes internal reset notifications throughusb_handle_packet() with a special magic PID. This indirectionis a pretty pointless excercise as it ends up being handled byusb_generic_handle_packet anyway.
Replace the USB_MSG_RESET with a usb_device_reset() function...
usb: kill usb_send_msg
No users left. Zap it.
usb: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: add USBEndpoint
Start maintaining endpoint state at USBDevice level. Add USBEndpointstruct and some helper functions to deal with it. For now it containsthe endpoint type only. Moved over some bits from usb-linux.c
usb: add ifnum to USBEndpoint
usb/debug: add usb_ep_dump
Add function to dump endpoint data, for debugging purposes.
usb: add max_packet_size to USBEndpoint
usb: link packets to endpoints not devices
Add USBEndpoint for the control endpoint to USBDevices. Link asyncpackets to the USBEndpoint instead of the USBDevice.
usb: fix port reset
commit 891fb2cd4592b6fe76106a69e0ca40efbf82726a removed the implicitdetach before (re-)attaching in usb_attach(). Some usb host controllersused that behavior though to do a port reset by a detach+attachsequence.
This patch establishes old behavior by adding a new usb_reset() function...
usb: fix use after free
The ->complete() callback might have released the USBPacket (uhciactually does), so we must not touch it after the callback returns.
usb: claim port at device initialization time.
This patch makes qemu assign a port when creating the device, not whenattaching it. For most usb devices this isn't a noticable differencebecause they are in attached state all the time.
The change affects usb-host devices which live in detached state while...
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 topass in the buffer size and second to return the number of...
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 generalit makes sense to make portops take a port as argument. This also makesadding support for a companion controller easier / cleaner....
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 callersare 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...
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 willchange in future patches though.
usb: keep track of packet owner.
Keep track of the device which owns the usb packet for async processing.
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it overto USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
usb: Pass the packet to the device's handle_control callback
This allows using the generic usb_generic_handle_packet function fromdevice code which does ASYNC control requests (such as the linux hostpass through code).
Signed-off-by: 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 almostidentical code.
usb: control buffer fixes
Windows allows control transfers to pass up to 4k of data, so raise ourcontrol buffer size to 4k. For control out transfers the usb core code copiesthe control request data to a buffer before calling the device's handle_control...
usb: add attach callback
Add handle_attach() callback to USBDeviceInfo which is called by thegeneric package handler when the device is attached to the usb bus(i.e. plugged into a port).
usb: create USBPortOps, move attach there.
Create USBPortOps struct, move the attach function to that struct.
usb: rework attach/detach workflow
Add separate detach callback to USBPortOps, splituhci/ohci/musb/usbhub attach functions into two.
Move common code to the usb_attach() function, onlythe hardware-specific bits remain in the attach/detachcallbacks.
Keep track of the port it is attached to for each usb device....
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 wanttrigger a remote wakeup.
qdev/usb: add usb bus support to qdev, convert drivers.
TODO: * make the rest of qemu aware of usb busses and kill the FIXMEs added by this patch....
usb: generic packet handler cleanup and documentation (Max Krasnyansky)
A bit better documentation of the USB device API, namelyreturn codes.Rewrite of usb_generic_handle_packet() to make it morereable and easier to follow.
Signed-off-by: Max Krasnyansky <maxk@kernel.org>...
Break up vl.h.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 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
Spelling fixes, by Stefan Weil.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3066 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
usb destroy API change (Lonnie Mendez)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2066 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
separate file for usb hub device
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1848 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
Fix off by one length calciulation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1781 c046a42c-6fe2-441c-8c8c-71466251a162
USB user interface
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1603 c046a42c-6fe2-441c-8c8c-71466251a162
cosmetics
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1598 c046a42c-6fe2-441c-8c8c-71466251a162
initial USB support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1597 c046a42c-6fe2-441c-8c8c-71466251a162