1. 12 7月, 2012 1 次提交
  2. 28 6月, 2012 1 次提交
    • D
      usb: Convert usb_packet_{map, unmap} to universal DMA helpers · e2f89926
      David Gibson 提交于
      The USB UHCI and EHCI drivers were converted some time ago to use the
      pci_dma_*() helper functions.  However, this conversion was not complete
      because in some places both these drivers do DMA via the usb_packet_map()
      function in usb-libhw.c.  That function directly used
      cpu_physical_memory_map().
      
      Now that the sglist code uses DMA wrappers properly, we can convert the
      functions in usb-libhw.c, thus conpleting the conversion of UHCI and EHCI
      to use the DMA wrappers.
      
      Note that usb_packet_map() invokes dma_memory_map() with a NULL invalidate
      callback function.  When IOMMU support is added, this will mean that
      usb_packet_map() and the corresponding usb_packet_unmap() must be called in
      close proximity without dropping the qemu device lock - otherwise the guest
      might invalidate IOMMU mappings while they are still in use by the device
      code.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      e2f89926
  3. 20 6月, 2012 1 次提交
  4. 07 6月, 2012 5 次提交
    • G
      uhci: fix irq routing · 973002c1
      Gerd Hoffmann 提交于
      The multifunction ich9 ehci controller with uhci companions uses a
      different interrupt pin for each function.  The three uhci devices
      get pins A, B and C, whereas ehci uses pin D.  This way the guest
      can assign different IRQ lines to each controller.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      973002c1
    • G
      uhci: zap uhci_pre_save · 5852d3bf
      Gerd Hoffmann 提交于
      Cancel transactions before saving vmstate is pretty pointless and just
      causes disruptions.  We need to cancel them before *loading* vmstate,
      but in that case uhci_reset() handles it already and no special action
      is needed.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      5852d3bf
    • G
      uhci: make bandwidth tunable · 40141d12
      Gerd Hoffmann 提交于
      Add a property for the uhci bandwidth.  Can be used to make uhci
      emulation run faster than real hardware.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      40141d12
    • G
      uhci: use bottom half · 9a16c595
      Gerd Hoffmann 提交于
      Schedule bottom half on completion of async packets instead of calling
      uhci_process_frame directly.  This way we run uhci_process_frame only
      once in case multiple packets finish in a row.  Also check whenever
      there is bandwidth left before scheduling uhci_process_frame.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9a16c595
    • G
      uhci: fix bandwidth management · 4aed20e2
      Gerd Hoffmann 提交于
      uhci_process_frame() can be invoked multiple times per frame, so
      accounting usb bandwith in a local variable doesn't fly, use a variable
      in UHCIState instead.  Also check the limit more frequently.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4aed20e2
  5. 26 4月, 2012 1 次提交
  6. 17 4月, 2012 2 次提交
    • G
      usb-uhci: queuing fix · ee008ba6
      Gerd Hoffmann 提交于
      When we queue up usb packets we may happen to find a already queued
      packet, which also might be finished at that point already.  We don't
      want continue processing the packet at this point though, so lets
      just signal back we've found a in-flight packet when in queuing mode.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      ee008ba6
    • G
      usb-uhci: stop queue filling when we find a in-flight td · 52b0fecd
      Gerd Hoffmann 提交于
      Not only QHs can form rings, but TDs too.  With the new
      queuing/pipelining support we are following TD chains and
      can actually walk in circles.  An assert() prevents us from
      entering an endless loop then.
      
      Fix is easy:  Just stop queuing when we figure the TD we are
      about to queue up is in flight already.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      52b0fecd
  7. 13 3月, 2012 10 次提交
  8. 07 3月, 2012 2 次提交
    • G
      uhci_fill_queue: zap debug printf · 7c308b7e
      Gerd Hoffmann 提交于
      7c308b7e
    • 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
  9. 27 2月, 2012 4 次提交
  10. 15 2月, 2012 1 次提交
  11. 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
  12. 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
  13. 28 1月, 2012 2 次提交
  14. 17 1月, 2012 1 次提交
  15. 13 12月, 2011 1 次提交
  16. 02 11月, 2011 1 次提交
  17. 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