1. 07 3月, 2012 1 次提交
    • H
      usb: add USB_RET_IOERROR · d61000a8
      Hans de Goede 提交于
      We already have USB_RET_NAK, but that means that a device does not want
      to send/receive right now. But with host / network redirection we can
      actually have a transaction fail due to some io error, rather then ie
      the device just not having any data atm.
      
      This patch adds a new error code named USB_RET_IOERROR for this, and uses
      it were appropriate.
      
      Notes:
      -Currently all usb-controllers handle this the same as NODEV, but that
       may change in the future, OHCI could indicate a CRC error instead for example.
      -This patch does not touch hw/usb-musb.c, that is because the code in there
       handles STALL and NAK specially and has a if status < 0 generic catch all
       for all other errors
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      d61000a8
  2. 27 2月, 2012 4 次提交
  3. 15 2月, 2012 1 次提交
  4. 10 2月, 2012 5 次提交
    • G
      usb: Set USBEndpoint in usb_packet_setup(). · 079d0b7f
      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>
      079d0b7f
    • G
      usb: USBPacket: add status, rename owner -> ep · f53c398a
      Gerd Hoffmann 提交于
      Add enum to track the status of USBPackets, use that instead of the
      owner pointer to figure whenever a usb packet is currently in flight
      or not.  Add some more packet status sanity checks.  Also rename the
      USBEndpoint pointer from "owner" to "ep".
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      f53c398a
    • G
      usb-uhci: switch to usb_find_device() · 461700c1
      Gerd Hoffmann 提交于
      Switch over UHCI to use the new usb_find_device()
      function for device lookup.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      461700c1
    • G
      usb: kill USB_MSG_RESET · d28f4e2d
      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>
      d28f4e2d
    • G
      usb-uhci: implement bandwidth management · 3200d108
      Gerd Hoffmann 提交于
      The OS is allowed to make the UHCI Controller run in circles.  That is
      usually done to serve multiple connected USB devices in a robin-round
      fashion, so the available USB bandwidth is evenly distributed between
      devices.
      
      The uhci emulation handles this in a very poor way though.  When it
      figures it runs in circles it stops processing unconditionally, so
      it usually processes at most a single transfer desriptor per queue,
      even if there are multiple transfer descriptors are queued up.
      
      This patch makes uhci act in a more sophisticated way.  It keeps track
      of successful processed transfer descriptors and transfered bytes.  Then
      it will stop processing when there is nothing to do (no transfer
      descriptor was completed the last round) or when the transfered data
      reaches the usb bandwidth limit.
      
      Result is that the usb-storage devices connected to uhci are ten times
      faster, mkfs.vfat time for a 64M stick goes down from five seconds to
      a half second.  Reason for this is that we are now processing up to 20
      transfer descriptors (with 64 bytes each) per frame instead of a single
      one.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3200d108
  5. 04 2月, 2012 1 次提交
    • A
      qdev: register all types natively through QEMU Object Model · 39bffca2
      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>
      39bffca2
  6. 28 1月, 2012 2 次提交
  7. 17 1月, 2012 1 次提交
  8. 13 12月, 2011 1 次提交
  9. 02 11月, 2011 1 次提交
  10. 13 10月, 2011 1 次提交
    • G
      usb: fix port reset · e0b8e72d
      Gerd Hoffmann 提交于
      commit 891fb2cd removed the implicit
      detach before (re-)attaching in usb_attach().  Some usb host controllers
      used that behavior though to do a port reset by a detach+attach
      sequence.
      
      This patch establishes old behavior by adding a new usb_reset() function
      for port resets and putting it into use, thereby also unifying port
      reset behavior of all host controllers.  The patch also adds asserts to
      usb_attach() and usb_detach() to make sure the calls are symmetrical.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      e0b8e72d
  11. 20 9月, 2011 1 次提交
  12. 07 9月, 2011 1 次提交
    • G
      usb: claim port at device initialization time. · 891fb2cd
      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>
      891fb2cd
  13. 21 8月, 2011 1 次提交
  14. 08 8月, 2011 2 次提交
  15. 04 8月, 2011 2 次提交
    • G
      uhci: remove buffer · df5e66ee
      Gerd Hoffmann 提交于
      Map guest memory and pass on a direct pointer instead of copying
      the bits to a indirect buffer.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      df5e66ee
    • 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
  16. 22 7月, 2011 1 次提交
  17. 05 7月, 2011 5 次提交
  18. 14 6月, 2011 3 次提交
  19. 12 6月, 2011 1 次提交
  20. 26 5月, 2011 2 次提交
  21. 04 5月, 2011 3 次提交