History | View | Annotate | Download (15.5 kB)
usb/vmstate: add parent dev path
... to make vmstate id string truely unique with multiple hostcontrollers, i.e. move from "1/usb-ptr" to "0000:00:01.3/1/usb-ptr" (usb tabled connected to piix3 uhci).
This obviously breaks migration. To handle this the usb bus...
usb: improve packet state sanity checks
Add a new function to check whenever the packet state is as expected,log more informations in case it isn't.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add pipelining option to usb endpoints
With this patch applied USB drivers can enable pipelining per endpoint.With pipelining enabled the usb core will continue submitting packetseven when there are still async transfers in flight instead of passing...
usb: add shortcut for control transfers
Add a more direct code path to submit control transfers. Instead offeeding three usb packets (setup, data, ack) to usb_handle_packet andhave the do_token_* functions in usb.c poke the control transferparameters out of it just submit a single packet carrying the actual...
usb: add USB_RET_IOERROR
We already have USB_RET_NAK, but that means that a device does not wantto send/receive right now. But with host / network redirection we canactually have a transaction fail due to some io error, rather then iethe device just not having any data atm....
usb: Resolve warnings about unassigned bus on usb device creation
When creating an USB device the old way, there is no way to specify thetarget bus. Thus the warning issued by usb_create makes no sense andrather confuses our users.
Resolve this by passing a bus reference to the usbdevice_init handler...
usb: pass USBEndpoint to usb_wakeup
Devices must specify which endpoint has data to transfer now.The plan is to use the usb_wakeup() not only for remove wakeup support,but for "data ready" signaling in general, so we can move away fromconstant polling to event driven usb device emulation....
usb: add USBBusOps->wakeup_endpoint
Add usb bus op which is called whenever a usb endpoint becomes ready,so the host adapter emulation can react on that event.
usb: maintain async packet list per endpoint
Maintain a list of async packets per endpoint. With the current codethe list will never receive more than a single item. I think you canguess what the future plan is though ;)
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: 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.
qdev: register all types natively through QEMU Object Model
This was done in a mostly automated fashion. I did it in three steps and thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
usb: separate out legacy usb registration from type registration
Type registeration is going to get turned into a QOM call so decouple thelegacy support.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: convert to QEMU Object Model
Merge remote-tracking branch 'kraxel/usb.37' into staging
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.
vmstate: extract declarations out of hw/hw.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb: track configuration and interface count in USBDevice.
Move fields from USBHostDevice to USBDevice.Add bits to usb-desc.c to fill them for emulated devices too.Also allow to set configuration 0 (== None) for emulated devices.
usb: track altsetting in USBDevice
Also handle {GET,SET}_INTERFACE in common code (usb-desc.c).
usb: add audio device model
This brings a usb audio device to qemu. Output only, fixed at16bit stereo @ 480000 Hz. Based on a patch fromH. Peter Anvin <hpa@linux.intel.com>
Usage: add '-device usb-audio' to your qemu command line.
Works sorta ok on a idle machine. Known issues:...
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: Remove leading underscores from __musb_irq_max
Identifiers with double leading underscore are reserved, so rename__musb_irq_max so we don't encroach on reserved namespace.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-musb: Take a DeviceState* in init function
Initialise usb-musb by passing it a DeviceState* and the offset of theIRQs in its gpio array, rather than a plain pointer to an irq array.This is simpler for callers and also allows us to pass in a valid parent...
usb-musb: Add reset function
Add a separate reset function musb_reset() to the usb-musb interface,so that users who implement a reset function can also reset usb-musb.Use this in tusb6010.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]...
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-hid: remove usb_hid_datain_cb
No users left, all migrated over to hw/hid.[ch].Yea! Zap it!
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: Add a register_companion USB bus op.
This is a preparation patch for adding support for USB companion controllers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@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 generalit makes sense to make portops take a port as argument. This also makesadding support for a companion controller easier / cleaner....
usb: Replace device_destroy bus op with a child_detach port op
Note this fixes 2 things in one go, first of all the device_destroy busop should be a device_detach bus op, as pending async packets from thedevice should be cancelled on detach not on destroy....
usb: ignore USB_DT_DEBUG
usb: Add a speedmask to devices
This is used to indicate at which speed[s] the device can operate,so that this can be checked to match the ports capabilities when it getsattached to a bus.
Note that currently all usb1 emulated device claim to be fullspeed, this...
usb: Add defines for USB Serial Bus Release Number register
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: cancel async packets on unplug
This patch adds USBBusOps struct with (for now) only a single callbackwhich is called when a device is about to be destroyed. The USB Hostadapters are implementing this callback and use it to cancel any asyncrequests which might be in flight before the device actually goes away....
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: Add Interface Association Descriptor descriptor type
usb: add support for "grouped" interfaces and the Interface Association Descriptor
This is used for some devices that have multiple interfaces that form a logicdevice. An example is Video Class, which has a Control interface and aStreaming interface. There can be additional interfaces on the same (physical)...
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: move complete callback to port ops
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 core: add migration support
Yes, seriously. There is no migration support at all for usb devices.They loose state, especially the device address, and stop respondingbecause of that. Oops.
Luckily there is so much broken usb hardware out there that the guest...
usb: zap pdev from usbport
It isn't needed any more.
usb: add port property.
This allows to explictily set the physical port where you want toplug the usb device. Example:
-device usb-tablet,bus=usb.0,port=2
With explicit port addressing qemu can and will not automagically addUSB Hubs. This means that:...
usb: keep track of physical port address.
Add a path string to USBPort. Add usb_port_location() function to setthe physical location of the usb port. Update all drivers implementingusb ports to call it. Update the monitor commands to print it. Wind it...
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: add device qualifier support
Add support for device_qualifier and other_speed_config descriptors.These are used to query the "other speed" configuration of usb 2.0devices, i.e. in high-speed mode they return the full-speedconfiguration and visa versa....
usb: add speed mask to ports
Add a field to usb ports indicating the speed(s) they areable to handle.
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.
usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code
This patch adds fields to the USBDevice struct for the currentspeed (hard-wired to full speed for now) and current deviceconfiguration. Also a init function is added which inializesthese fields. This allows USB_REQ_{GET,SET}_CONFIGURATION...
usb: data structs and helpers for usb descriptors.
This patch adds hw/usb-desc.[ch] files. They carry data structuresfor various usb descriptors and helper functions to generate usbpackets from the structures.
The intention is to have a internal representation of the device...
usb descriptors: add settable strings.
This patch allows to set usb descriptor strings per device instance.
Record which USBDevice USBPort belongs too.
Ports on root hub will have NULL here. This is needed to reconstructpath from device to its root hub to build device path.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
usb: class specific interface requests
Mass Storage Reset and Get Max LUN are class specific requests, butthey were not marked as such in hw/usb-msd.c, moved thereforeClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.cto hw/usb.h.Furthermore there was a problem in hw/usb-ohci.c when using DEBUG...
usb-net: use qdev for -usbdevice
Rebased to master, adapted to device renaming by armbru,no other changes.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Rename USBDevice member devname to product_desc
It's not a device name, it's the USB product description string.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Separate USB product description from qdev name
Using the qdev name for the product description makes for inconvenientqdev names.
Put the product description in new USBDeviceInfo member product_desc.Make usb_qdev_init() use it. No user or guest visible change, since...
usb-serial and braille: use qdev for -usbdevice
usb: make attach optional.
Add a auto_attach field to USBDevice, which is enabled by default.USB drivers can clear this field in case they do not want the devicebeing attached (i.e. plugged into a usb port) automatically aftersuccessfull init().
Use cases (see next patches):...
usb-storage: use qdev for -usbdevice
Hook up usb_msd_init.
Also rework handling of encrypted block devices,move the code out vl.c.
usb core: use qdev for -usbdevice
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.USBDeviceInfo gets a name field (for the -usbdevice driver name) and acallback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks...
usb: hook unplug into qdev, cleanups + fixes.
Hook into DeviceInfo->exit().
handle_destroy() must not free the state struct, this is handledby the new usb_qdev_exit() function now.
qdev_free(usb_device) works now.
Fix usb hub to qdev_free() all connected devices on unplug....
switch usb bus to inplace allocation.
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
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....
qdev/usb: make qemu aware of usb busses.
Move usb code from vl.c to usb-bus.c and make it use the new datastructures added by qdev conversion. qemu usb core should be ableto handle multiple USB busses just fine now (untested though).
Kill some usb_*_init() legacy functions, use usb_create_simple()...
Follow coding conventions
Remove explicit struct qualifiers and rename structure types.
Signed-off-by: Paul Brook <paul@codesourcery.com>
monitor: Rework API (Jan Kiszka)
Refactor the monitor API and prepare it for decoupled terminals:term_print functions are renamed to monitor_* and all monitor servicesgain a new parameter (mon) that will once refer to the monitor instancethe output is supposed to appear on. However, the argument remains...
monitor: Rework modal password input (Jan Kiszka)
Currently, waiting for the user to type in some password blocks thewhole VM because monitor_readline starts its own I/O loop. And this loopalso screws up reading passwords from virtual console.
Patch below fixes the shortcomings by using normal I/O processing also...
monitor: Rework early disk password inquiry (Jan Kiszka)
Reading the passwords for encrypted hard disks during early startup isbroken (I guess for quiet a while now): - No monitor terminal is ready for input at this point - Forcing all mux'ed terminals into monitor mode can confuse other...
Emulate a USB bluetooth dongle (or HCI Transport layer).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5349 c046a42c-6fe2-441c-8c8c-71466251a162
Bluetooth HIDP emulation on top of usb-hid.c and L2CAP and SDP.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5347 c046a42c-6fe2-441c-8c8c-71466251a162
usb: Support for removing device by host addr, improved auto filter syntax (Max Krasnyansky)
This patch adds support for removing USB devices by host address.Which is usefull for things like libvirtd because there is no easy way tofind guest USB address of the host device....
Fix some warnings that would be generated by gcc -Wredundant-decls
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5115 c046a42c-6fe2-441c-8c8c-71466251a162
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>...
husb: support for USB host device auto connect (Max Krasnyansky)
QEMU can now automatically grab host USB devices that match the filter.For now I just extended 'host:X.Y' and 'host:VID:PID' syntax to handlewildcards. So for example if you do something like...
husb: support for USB host device auto disconnect (Max Krasnyansky)
I got really annoyed by the fact that you have to manually dousb_del in the monitor when host device is unplugged and decidedto fix it :)
Basically we now automatically remove guest USB device...
Add CDC-Ethernet usb NIC (original patch from Thomas Sailer).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4884 c046a42c-6fe2-441c-8c8c-71466251a162
Inventra MUSB-HDRC host-mode USB.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4232 c046a42c-6fe2-441c-8c8c-71466251a162
USB-to-serial device (Samuel Thibault).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3914 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
find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in the regex.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 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
Add USB HID keyboard.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2996 c046a42c-6fe2-441c-8c8c-71466251a162
Wacom PenPartner tablet (virtual USB device).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2977 c046a42c-6fe2-441c-8c8c-71466251a162
Use the correct PCI IDs for Malta.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2945 c046a42c-6fe2-441c-8c8c-71466251a162