- 26 4月, 2012 1 次提交
-
-
由 Gerd Hoffmann 提交于
This patch adds a function which creates unique serial numbers for usb devices and puts it into use. Windows guests tend to become unhappy if they find two identical usb devices in the system. Effects range from non-functional devices (with yellow exclamation mark in device manager) to BSODs. Handing out unique serial numbers to devices fixes this. With this patch applied almost all emulated devices get a generated, unique serial number. There are two exceptions: * usb-storage devices will prefer a user-specified serial number and will only get a generated number in case the serial property is unset. * usb-hid devices keep the fixed serial number "42" as it is used to signal "remote wakeup actually works". See commit 7b074a22Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 17 4月, 2012 1 次提交
-
-
由 Gerd Hoffmann 提交于
Add tracepoints to the usb hub emulation. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 13 3月, 2012 1 次提交
-
-
由 Gerd Hoffmann 提交于
Reorganize usb source files. Create a new hw/usb/ directory and move all usb source code to that place. Also make filenames a bit more descriptive. Host adapters are prefixed with "hch-" now, usb device emulations are prefixed with "dev-". Fixup paths Makefile and include paths to make it compile. No code changes. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 15 2月, 2012 1 次提交
-
-
由 Andreas Färber 提交于
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: NAndreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 10 2月, 2012 5 次提交
-
-
由 Gerd Hoffmann 提交于
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 from constant polling to event driven usb device emulation. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
With the separation of the device lookup (via usb_find_device) and packet processing we can lookup device and endpoint before setting up the usb packet. So we can initialize USBPacket->ep early and keep it valid for the whole lifecycle of the USBPacket. Also the devaddr and devep fields are not needed any more. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
All drivers except usb-hub use usb_generic_handle_packet. The only reason the usb hub has its own function is that it used to be called with packets which are intended for downstream devices. With the new, separate device lookup step this doesn't happen any more, so the need for a different handle_packet callback is gone. So we can kill the handle_packet callback and just call usb_generic_handle_packet directly. The special hub handling in usb_handle_packet() can go away for the same reason. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Implement the find_device callback for the usb hub. It'll loop over all ports, calling usb_find_device for all enabled ports until it finds a matching device. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
The USB subsystem pipes internal reset notifications through usb_handle_packet() with a special magic PID. This indirection is a pretty pointless excercise as it ends up being handled by usb_generic_handle_packet anyway. Replace the USB_MSG_RESET with a usb_device_reset() function which can be called directly. Also rename the existing usb_reset() function to usb_port_reset() to avoid confusion. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 04 2月, 2012 2 次提交
-
-
由 Anthony Liguori 提交于
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
由 Anthony Liguori 提交于
Type registeration is going to get turned into a QOM call so decouple the legacy support. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 28 1月, 2012 1 次提交
-
-
由 Anthony Liguori 提交于
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 13 1月, 2012 1 次提交
-
-
由 Gerd Hoffmann 提交于
Also handle {GET,SET}_INTERFACE in common code (usb-desc.c). Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 23 11月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
based on a patch from hkran@linux.vnet.ibm.com Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 22 11月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
When detaching devices from the usb hub we must wakeup too, otherwise the host misses the detach event. Commit 4a33a9ea does the same for device attach. Found by hkran@linux.vnet.ibm.com Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 01 11月, 2011 2 次提交
-
-
由 Roy Tam 提交于
Some USB drivers, for example USBASPI.SYS, will skip different type of device which has same VID/PID. The following patch helps preventing usb-msd being skipped by the driver. Signed-off-by: NRoy Tam <roytam@gmail.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
When attaching a new device we must send a wakeup request to the root hub, otherwise the guest will not notice the new device in case the usb hub is suspended. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 13 10月, 2011 2 次提交
-
-
由 Gerd Hoffmann 提交于
Calling usb_packet_complete() recursively when passing up the completion event up the chain for devices connected via usb hub will trigger an assert. So don't do that, make the usb hub emulation call the upstream completion callback directly instead. Based on a patch from Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
commit 891fb2cd did that for all host controllers, the usb hub was left out by accident. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 07 9月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com>
-
- 04 8月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com>
-
- 08 7月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
Somehow they where left over when converting the hub to the new usb descriptor infrastructure ... Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 05 7月, 2011 2 次提交
-
-
由 Hans de Goede 提交于
Note this fixes 2 things in one go, first of all the device_destroy bus op should be a device_detach bus op, as pending async packets from the device should be cancelled on detach not on destroy. Secondly having this as a bus op won't work with companion controllers, since then there will be 1 bus driven by the ehci controller and thus 1 set of bus ops, but the device being detached may be downstream of a handed over port. Making the detach of a downstream device a port op allows the ehci controller to forward this to the companion controller port for handed over ports. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Hans de Goede 提交于
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: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 26 5月, 2011 3 次提交
-
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com>
-
由 Hans de Goede 提交于
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: NHans de Goede <hdegoede@redhat.com>
-
由 Brad Hards 提交于
Previously we relied on the .bNumInterfaces, but that won't always be accurate after the introduction of grouped interfaces. Signed-off-by: NBrad Hards <bradh@frogmouth.net> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 04 5月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
-
- 25 1月, 2011 1 次提交
-
-
由 Gerd Hoffmann 提交于
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 12 1月, 2011 6 次提交
-
-
由 Gerd Hoffmann 提交于
It isn't needed any more. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Add a path string to USBPort. Add usb_port_location() function to set the physical location of the usb port. Update all drivers implementing usb ports to call it. Update the monitor commands to print it. Wind it up in qdev. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Add a field to usb ports indicating the speed(s) they are able to handle. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
This patch makes the usb hub handle remote wakeup requests from devices properly by updating the port status register and forwarding the wakeup to the upstream port. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
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: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Create USBPortOps struct, move the attach function to that struct. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 11 1月, 2011 4 次提交
-
-
由 Gerd Hoffmann 提交于
This patch moves setting and clearing the remote_wakeup feature bit (via USB_REQ_{SET,CLEAR}_FEATURE) to common code. Also USB_REQ_GET_STATUS handling is moved to common code. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
This patch adds fields to the USBDevice struct for the current speed (hard-wired to full speed for now) and current device configuration. Also a init function is added which inializes these fields. This allows USB_REQ_{GET,SET}_CONFIGURATION handling to be moved to common code. For most drivers the conversion is trivial ad they support a single configuration only anyway. One exception is bluetooth where some device-specific setup code runs after get/set configuration. The other is usb-net which actually has two configurations so the the code to check for the active configuration has been adapted. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
USB_REQ_SET_ADDRESS handling is identical in *all* emulated devices. Move it to common code. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
由 Gerd Hoffmann 提交于
Switch the usb hub driver over to the new descriptor infrastructure. It also removes the nr_ports variable and MAX_PORTS define and introduces a NUM_PORTS define instead. The numver of ports was (and still is) fixed at 8 anyway. Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 12 12月, 2010 1 次提交
-
-
由 Gleb Natapov 提交于
Ports on root hub will have NULL here. This is needed to reconstruct path from device to its root hub to build device path. Signed-off-by: NGleb Natapov <gleb@redhat.com> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-