History | View | Annotate | Download (17.5 kB)
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Fix spelling in comments and documentation
These spelling bugs were found by codespell:
supressing -> suppressingtransfered -> transferred
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
usb: Don't allow USB_RET_ASYNC for interrupt packets
It is tempting to use USB_RET_ASYNC for interrupt packets, rather then thecurrent NAK + polling approach, but this causes issues for migration, asan async completed packet will not getting written back to guest memory until...
usb: Allow overriding of usb_desc at the device level
This allows devices to present a different set of descriptors based ondevice properties.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: split packet result into actual_length + status
Since with the ehci and xhci controllers a single packet can be largerthen maxpacketsize, it is possible for the result of a single packetto be both having transferred some data as well as the transfer to have...
usb/ehci-pci: add helper to create ich9 usb controllers
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: Add packet combining functions
Currently we only do pipelining for output endpoints, since to properlysupport short-not-ok semantics we can only have one outstanding inputpacket. Since the ehci and uhci controllers have a limited per td packetsize guests will split large input transfers to into multiple packets,...
usb: Move clearing of queue on halt to the core
hcds which queue up more then one packet at once (uhci, ehci and xhci),must clear the queue after an error which has caused the queue to halt.
Currently this is handled as a special case inside the hcd code, this...
usb: Move short-not-ok handling to the core
After a short-not-ok packet ending short, we should not advance the queue.Move enforcing this to the core, rather then handling it in the hcd code.
This may result in the queue now actually containing multiple input packets...
usb: Add an int_req flag to USBPacket
usb: Rename __usb_packet_complete to usb_packet_complete_one
And make it available for use outside of core.c
usb: Add USB_RET_ADD_TO_QUEUE packet result code
This can be used by usb-device code which wishes to process an entire endpointqueue at once, to do this the usb-device code returns USB_RET_ADD_TO_QUEUEfrom its handle_data class method and defines a flush_ep_queue class method...
usb3: superspeed endpoint companion
Add support for building superspeed endpoint companion descriptors,create them for superspeed usb devices.
usb3: bos decriptor
Add support for creating BOS descriptor anddevice cappability descriptors.
usb-core: Add a usb_ep_find_packet_by_id() helper function
usb: unique packet ids
This patch adds IDs to usb packets. Those IDs are (a) supposed to beunique for the lifecycle of a packet (from packet setup until the packetis either completed or canceled) and (b) stable across migration.
uhci, ohci, ehci and xhci use the guest physical address of the transfer...
usb: Halt ep queue en cancel pending packets on a packet error
For controllers which queue up more then 1 packet at a time, we must halt theep queue, and inside the controller code cancel all pending packets on anerror.
There are multiple reasons for this:...
hw/block-common: Move BlockConf & friends from block.h
This stuff doesn't belong to block layer, and was put there onlybecause a better home didn't exist then. Now it does.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
usb: fix interface initialization
zero is a valid interface number, so don't use it when resetting theendpoints.
usb: split endpoint init and reset
Create a new usb_ep_reset() function to reset endpoint state, withoutre-initialiting the queues, so we don't unlink in-flight packets justbecause usb-host has to re-parse the descriptor tables.
usb: Convert usb_packet_{map, unmap} to universal DMA helpers
The USB UHCI and EHCI drivers were converted some time ago to use thepci_dma_*() helper functions. However, this conversion was not completebecause in some places both these drivers do DMA via the usb_packet_map()...
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to eachBusState and then register the types appropriately. Most of the interestingrefactoring will follow in the next patches.
Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...
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.
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.
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.