1. 26 5月, 2014 3 次提交
  2. 15 2月, 2014 1 次提交
  3. 22 10月, 2013 3 次提交
    • H
      usb-host-libusb: Detach kernel drivers earlier · f34d5c75
      Hans de Goede 提交于
      If we detach the kernel drivers on the first set_config, then they will
      be still attached when the device gets its initial reset. Causing the drivers
      to re-initialize the device after the reset, dirtying the device state.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f34d5c75
    • H
      usb-host-libusb: Configuration 0 may be a valid configuration · 1294ca79
      Hans de Goede 提交于
      Quoting from: linux/Documentation/ABI/stable/sysfs-bus-usb:
      
      	Note that some devices, in violation of the USB spec, have a
      	configuration with a value equal to 0. Writing 0 to
      	bConfigurationValue for these devices will install that
      	configuration, rather then unconfigure the device.
      
      So don't compare the configuration value against 0 to check for unconfigured
      devices, instead check for a LIBUSB_ERROR_NOT_FOUND return from
      libusb_get_active_config_descriptor().
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      1294ca79
    • H
      usb-host-libusb: Fix reset handling · 5af35d7f
      Hans de Goede 提交于
      The guest will issue an initial device reset when the device is attached, but
      since the current usb-host-libusb code only actually does the reset when
      udev->configuration != 0, and on attach the device is not yet configured,
      the reset gets ignored. This means that the device gets passed to the guest
      in an unknown state, which is not good.
      
      The udev->configuration check is there because of the release / claim
      interfaces done around the libusb_device_reset call, but these are not
      necessary. If interfaces are claimed when libusb_device_reset gets called
      libusb will release + reclaim them itself.
      
      The usb_host_ep_update call also is not necessary. If the reset succeeds the
      original config and interface alt settings will be restored.
      
      Last if the reset fails, that means the device has either disconnected or
      morphed into an another device and has been completely re-enumerated,
      so it is treated by the host as a new device and our handle is invalid,
      so on reset failure we need to call usb_host_nodev().
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      5af35d7f
  4. 23 8月, 2013 1 次提交
  5. 29 7月, 2013 1 次提交
  6. 24 6月, 2013 2 次提交
  7. 03 6月, 2013 1 次提交
  8. 07 5月, 2013 2 次提交
  9. 23 4月, 2013 1 次提交
  10. 16 4月, 2013 1 次提交
    • G
      use libusb for usb-host · 2b2325ff
      Gerd Hoffmann 提交于
      Reimplement usb-host on top of libusb.
      Reasons to do this:
      
       (1) Largely rewritten from scratch, nice opportunity to kill historical
           cruft.
       (2) Offload usbfs handling to libusb.
       (3) Have a single portable code base instead of bsd + linux variants.
       (4) Bring usb-host support to any platform supported by libusbx.
      
      For now this goes side-by-side to the existing code.  That is only to
      simplify regression testing though, at the end of the day I want remove
      the old code and support libusb exclusively.  Merge early in 1.5 cycle,
      remove the old code after 1.5 release or something like this.
      
      Thanks to qdev the old and new code can coexist nicely on linux.  Just
      use "-device usb-host-linux" to use the old linux driver instead of the
      libusb one (which takes over the "usb-host" name).
      
      The bsd driver isn't qdev'ified so it isn't that easy for bsd.
      I didn't bother making it runtime switchable, so you have to rebuild
      qemu with --disable-libusb to get back the old code.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      2b2325ff