1. 17 1月, 2012 1 次提交
    • G
      usb: add USBEndpoint · d8e17efd
      Gerd Hoffmann 提交于
      Start maintaining endpoint state at USBDevice level.  Add USBEndpoint
      struct and some helper functions to deal with it.  For now it contains
      the endpoint type only.  Moved over some bits from usb-linux.c
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d8e17efd
  2. 13 1月, 2012 3 次提交
    • G
      usb: track altsetting in USBDevice · 1de14d43
      Gerd Hoffmann 提交于
      Also handle {GET,SET}_INTERFACE in common code (usb-desc.c).
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      1de14d43
    • G
      usb: track configuration and interface count in USBDevice. · 65360511
      Gerd Hoffmann 提交于
      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.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      65360511
    • G
      usb-host: rip out legacy procfs support · 097db438
      Gerd Hoffmann 提交于
      This patch removes support for parsing /proc/bus/usb/devices for device
      discovery.  The code lacks a few features compared to the sysfs code and
      is also bitrotting as everybody has sysfs these days.
      
      This implies having sysfs mounted is mandatory now to use the usb-host
      driver.  udev isn't required though.  qemu will prefer the udev-managed
      device nodes below /dev/bus/usb, but in case this directory isn't preset
      qemu will use the device nodes below /proc/bus/usb (default usbfs mount
      point).
      
      Bottom line: make sure you have both sysfs and usbfs mounted properly,
      and everything should continue to work as it did before.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      097db438
  3. 06 1月, 2012 1 次提交
    • G
      usb-host: properly release port on unplug & exit · c75fead6
      Gerd Hoffmann 提交于
      Factor out port release into a separate function.  Call release function
      in exit notifier too.  Add explicit call the USBDEVFS_RELEASE_PORT
      ioctl, just closing the hub file handle seems not to be enougth.  Make
      sure we release the port before resetting the device, otherwise host
      drivers will not re-attach.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c75fead6
  4. 04 1月, 2012 1 次提交
    • C
      Fix parse of usb device description with multiple configurations · 7279a85f
      Cao,Bing Bu 提交于
      Changed From V1:
      Use DPRINTF instead of fprintf,because it is not an error.
      
      When testing ipod on QEMU by He Jie Xu<xuhj@linux.vnet.ibm.com>,qemu made a assertion.
      We found that the ipod with 2 configurations,and the usb-linux did not parse the descriptor correctly.
      The descr_len returned is the total length of the all configurations,not one configuration.
      The older version will through the other configurations instead of skip,continue parsing the descriptor of interfaces/endpoints in other configurations,then went wrong.
      
      This patch will put the configuration descriptor parse in loop outside and dispel the other configurations not requested.
      Signed-off-by: NCao,Bing Bu <mars@linux.vnet.ibm.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7279a85f
  5. 24 11月, 2011 1 次提交
    • G
      usb-host: add usb_host_do_reset function. · c7662daa
      Gerd Hoffmann 提交于
      Add a special function to reset the host usb device.  It tracks the time
      needed by the USBDEVFS_RESET ioctl and prints a warning in case it needs
      too long.  Usually it should be finished in 200 - 300 miliseconds.
      Warning threshold is one second.
      
      Intention is to help troubleshooting by indicating that the usb device
      stopped responding even to a reset request and is possibly broken.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c7662daa
  6. 21 11月, 2011 1 次提交
  7. 01 11月, 2011 1 次提交
    • G
      usb-host: fix host close · 39fba3ad
      Gerd Hoffmann 提交于
      The whole usb_host_close() function is skipped in case the device is not
      in attached state.  This is wrong though, only then usb_device_detach()
      must be skipped, all other cleanup (especially device reset and closing
      the file handle) still needs to be done.  There are code paths where
      usb_host_close() is called with the device in detached state already.
      
      This fixes usb-host devices not being released and returned to the host
      after removing them with device_del.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      39fba3ad
  8. 13 10月, 2011 2 次提交
  9. 07 9月, 2011 10 次提交
  10. 21 8月, 2011 1 次提交
  11. 04 8月, 2011 2 次提交
    • G
      usb-host: iovec support · b621bab4
      Gerd Hoffmann 提交于
      Add full support for iovecs to usb-host.  The code can split large
      transfers into smaller ones already, we are using this to also split
      requests at iovec borders.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      b621bab4
    • G
      usb: use iovecs in USBPacket · 4f4321c1
      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>
      4f4321c1
  12. 24 7月, 2011 1 次提交
  13. 23 6月, 2011 6 次提交
  14. 14 6月, 2011 8 次提交
  15. 08 6月, 2011 1 次提交