summaryrefslogtreecommitdiffstats
path: root/hw/usb-bus.c
Commit message (Collapse)AuthorAgeFilesLines
* Add get_fw_dev_path callback for usb bus.Gleb Natapov2010-12-111-0/+42
| | | | | Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Record which USBDevice USBPort belongs too.Gleb Natapov2010-12-111-1/+2
| | | | | | | | 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: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* usb: remove dead assignments, spotted by clang analyzerBlue Swirl2010-04-251-2/+1
| | | | | | Value stored is never read. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* usb-bus: fix no paramsTeLeMan2010-04-021-1/+1
| | | | | | | | | After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params is nerver NULL. It should check *params instead of params to determine whether the params is empty. Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Avoid crash on '-usbdevice <device>' without parametersJan Kiszka2010-03-171-1/+3
| | | | | | | Many usbdevice_init implementors assume params is non-NULL. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* error: Replace qemu_error() by error_report()Markus Armbruster2010-03-161-2/+2
| | | | | | | | | | | | | error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
* Fix -usbdevice crashPaul Brook2010-02-251-0/+3
| | | | | | | | If -usbdevice is used on a machine with no USB busses, usb_create will fail and return NULL. Patch below handles this failure gracefully rather than crashing when we try to init the device. Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev: Replace device names containing whitespaceMarkus Armbruster2009-12-121-1/+1
| | | | | | | | | | | | Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't. The place for verbose device names is DeviceInfo member desc. The name should be short & sweet. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Separate USB product description from qdev nameMarkus Armbruster2009-12-121-1/+1
| | | | | | | | | | | | Using the qdev name for the product description makes for inconvenient qdev names. Put the product description in new USBDeviceInfo member product_desc. Make usb_qdev_init() use it. No user or guest visible change, since the value is still the same. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Rename USBDevice member devname to product_descMarkus Armbruster2009-12-121-5/+6
| | | | | | | 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>
* usb: print attached status in info qtreeGerd Hoffmann2009-10-301-3/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: make attach optional.Gerd Hoffmann2009-10-301-1/+2
| | | | | | | | | | | | | | 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 device being attached (i.e. plugged into a usb port) automatically after successfull init(). Use cases (see next patches): * attaching encrypted mass storage devices. * -usbdevice host:... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb core: use qdev for -usbdeviceGerd Hoffmann2009-10-301-0/+47
| | | | | | | | | | | | | | This patchs adds infrastructure to handle -usbdevice via qdev callbacks. USBDeviceInfo gets a name field (for the -usbdevice driver name) and a callback for -usbdevice parameter parsing. The new usbdevice_create() function walks the qdev driver list and looks for a usb driver with a matching name. When a parameter parsing callback is present it is called, otherwise the device is created via usb_create_simple(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* New qdev_init_nofail()Markus Armbruster2009-10-071-1/+1
| | | | | | | | | | | | | | | | | | | Like qdev_init(), but terminate program via hw_error() instead of returning an error value. Use it instead of qdev_init() where terminating the program on failure is okay, either because it's during machine construction, or because we know that failure can't happen. Because relying in the latter is somewhat unclean, and the former is not always obvious, it would be nice to go back to qdev_init() in the not-so-obvious cases, only with proper error handling. I'm leaving that for another day, because it involves making sure that error values are properly checked by all callers. Patchworks-ID: 35168 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: hotplug windupGerd Hoffmann2009-10-051-0/+2
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* usb: hook unplug into qdev, cleanups + fixes.Gerd Hoffmann2009-10-051-8/+49
| | | | | | | | | | | | | | | Hook into DeviceInfo->exit(). handle_destroy() must not free the state struct, this is handled by the new usb_qdev_exit() function now. qdev_free(usb_device) works now. Fix usb hub to qdev_free() all connected devices on unplug. Unplugging a usb hub works now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* switch usb bus to inplace allocation.Gerd Hoffmann2009-10-051-5/+2
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-16/+16
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev/usb: make qemu aware of usb busses.Gerd Hoffmann2009-09-091-4/+136
| | | | | | | | | | | | | | Move usb code from vl.c to usb-bus.c and make it use the new data structures added by qdev conversion. qemu usb core should be able to handle multiple USB busses just fine now (untested though). Kill some usb_*_init() legacy functions, use usb_create_simple() instead. Kill some FIXMEs added by the first qdev/usb patch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev/usb: add usb bus support to qdev, convert drivers.Gerd Hoffmann2009-09-091-0/+82
* 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>
OpenPOWER on IntegriCloud