1. 14 5月, 2014 1 次提交
  2. 18 2月, 2014 1 次提交
  3. 10 2月, 2014 1 次提交
  4. 14 10月, 2013 1 次提交
  5. 31 8月, 2013 1 次提交
  6. 23 8月, 2013 2 次提交
  7. 30 7月, 2013 1 次提交
  8. 29 7月, 2013 1 次提交
  9. 04 7月, 2013 2 次提交
  10. 07 5月, 2013 1 次提交
    • H
      uhci: Use an intermediate buffer for usb packet data · 9822261c
      Hans de Goede 提交于
      Due to various unfortunate reasons we cannot reliable detect a guest
      cancelling a packet as soon as it happens, instead we detect cancels
      with some delay.
      
      When packets are handled async, and we directly pass the guest memory for
      the packet to the usb-device as iovec, this means that the usb-device can
      write to guest-memory which the guest has already re-used for other purposes
      -> not good!
      
      This patch fixes this by adding an intermediate buffer and writing back not
      only the result, but also the data, of async completed packets when scanning
      the schedule.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9822261c
  11. 19 2月, 2013 1 次提交
  12. 08 1月, 2013 1 次提交
  13. 07 1月, 2013 6 次提交
  14. 19 12月, 2012 2 次提交
  15. 17 12月, 2012 1 次提交
  16. 29 11月, 2012 1 次提交
  17. 21 11月, 2012 3 次提交
  18. 09 11月, 2012 1 次提交
    • H
      usb: split packet result into actual_length + status · 9a77a0f5
      Hans de Goede 提交于
      Since with the ehci and xhci controllers a single packet can be larger
      then maxpacketsize, it is possible for the result of a single packet
      to be both having transferred some data as well as the transfer to have
      an error.
      
      An example would be an input transfer from a bulk endpoint successfully
      receiving 1 or more maxpacketsize packets from the device, followed
      by a packet signalling halt.
      
      While already touching all the devices and controllers handle_packet /
      handle_data / handle_control code, also change the return type of
      these functions to void, solely storing the status in the packet. To
      make the code paths for regular versus async packet handling more
      uniform.
      
      This patch unfortunately is somewhat invasive, since makeing the qemu
      usb core deal with this requires changes everywhere. This patch only
      prepares the usb core for this, all the hcd / device changes are done
      in such a way that there are no functional changes.
      
      This patch has been tested with uhci and ehci hcds, together with usb-audio,
      usb-hid and usb-storage devices, as well as with usb-redir redirection
      with a wide variety of real devices.
      
      Note that there is usually no need to directly set packet->actual_length
      form devices handle_data callback, as that is done by usb_packet_copy()
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9a77a0f5
  19. 01 11月, 2012 5 次提交
  20. 25 10月, 2012 7 次提交
    • H
      uhci: Use only one queue for ctrl endpoints · 6fe30910
      Hans de Goede 提交于
      ctrl endpoints use different pids for different phases of a control
      transfer, this patch makes us use only one queue for a ctrl ep, rather
      then 3.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      6fe30910
    • H
      uhci: Retry to fill the queue while waiting for td completion · 8928c9c4
      Hans de Goede 提交于
      If the guest is using multiple transfers to try and keep the usb bus busy /
      used at maximum efficiency, currently we would see / do the following:
      
      1) submit transfer 1 to the device
      2) submit transfer 2 to the device
      3) report transfer 1 completion to guest
      4) report transfer 2 completion to guest
      5) submit transfer 1 to the device
      6) report transfer 1 completion to guest
      7) submit transfer 2 to the device
      8) report transfer 2 completion to guest
      etc.
      
      So after the initial submission we would effectively only have 1 transfer
      in flight, rather then 2. This is caused by us not checking the queue for
      addition of new transfers by the guest (ie the resubmission of a recently
      finished transfer), while waiting for a pending transfer to complete.
      This patch does add a check for this, changing the sequence to:
      
      1) submit transfer 1 to the device
      2) submit transfer 2 to the device
      3) report transfer 1 completion to guest
      4) submit transfer 1 to the device
      5) report transfer 2 completion to guest
      6) submit transfer 2 to the device
      etc.
      
      Thus keeping 2 transfers in flight (most of the time, and always 1),
      as intended by the guest.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8928c9c4
    • H
      uhci: Always mark a queue valid when we encounter it · 3905097e
      Hans de Goede 提交于
      Before this patch we would not mark a queue valid when its head was a
      non-active td. This causes us to misbehave in the following scenario:
      
      1) queue with multiple input transfers queued
      2) We hit some latency issue, causing qemu to get behind processing frames
      3) When qemu gets to run again, it notices the first transfer ends short,
         marking the head td non-active
      4) It now processes 32+ frames in a row without giving the guest a chance
         to run since it is behind
      5) valid is decreased to 0, causing the queue to get cancelled also cancelling
         already queued up further input transfers
      6) guest gets to run, notices the inactive td, cleanups up further tds
         from the short transfer, and lets the queue continue at the first td of
         the next input transfer
      7) we re-start the queue, issuing the second input transfer for the *second*
         time, and any data read by the first time we issued it has been lost
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3905097e
    • H
    • H
      uhci: Detect guest td re-use · 8c75a899
      Hans de Goede 提交于
      A td can be reused by the guest in a different queue, before we notice
      the original queue has been unlinked. So search for tds by addr only, detect
      guest td reuse, and cancel the original queue, this is necessary to keep our
      packet ids unique.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8c75a899
    • H
      uhci: Verify queue has not been changed by guest · 66a08cbe
      Hans de Goede 提交于
      According to the spec a guest can unlink a qh, and then as soon as frindex
      has changed by 1 since the unlink, assume it is idle and re-use it. However
      for various reasons, we cannot simply consider a qh as unlinked if we've not
      seen it for 1 frame. This means that it is possible for a guest to re-use /
      restart the queue while we still see its old state. This patch adds a safety
      check for this, and "early" retires queues when they were changed by the guest.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      66a08cbe
    • H
      uhci: Immediately free queues on device disconnect · 5ad23e87
      Hans de Goede 提交于
      There is no need to just cancel any in-flight packets, and then wait
      for validate-end to clean things up, we can simply clean things up
      immediately on device removal.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      5ad23e87