[Spice-commits] Changes to 'usb-patches'

Hans de Goede jwrdegoede at kemper.freedesktop.org
Tue May 3 06:55:44 PDT 2011


New branch 'usb-patches' available with the following commits:
commit cf0bb5a7d3fdbf87ad1ad8aa9e957315b042e7e1
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Feb 2 17:46:00 2011 +0100

    usb: control buffer fixes
    
    Windows allows control transfers to pass up to 4k of data, so raise our
    control buffer size to 4k. For control out transfers the usb core code copies
    the control request data to a buffer before calling the device's handle_control
    callback. Add a check for overflowing the buffer before copying the data.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 88ccd179226a29d6a379366ec9f4ceee6589bc6c
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Feb 2 17:36:29 2011 +0100

    usb-linux: use usb_generic_handle_packet()
    
    Make the linux usb host passthrough code use the usb_generic_handle_packet()
    function, rather then the curent DYI code. This removes 200 lines of almost
    identical code.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 90afdecc0e445b03a50211d121669bfc6b91ba01
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Feb 2 16:33:13 2011 +0100

    usb: Pass the packet to the device's handle_control callback
    
    This allows using the generic usb_generic_handle_packet function from
    device code which does ASYNC control requests (such as the linux host
    pass through code).
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 756bfdf46f2bb07056dfacff239a167fbbd9f92e
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Nov 26 19:11:03 2010 +0100

    usb-linux: Add support for buffering iso out usb packets
    
    Extend the iso buffering code to also buffer iso out packets, this
    fixes for example using usb speakers with usb redirection.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 3894348f8d0c34c3faf9d8ccb11dfb6b196e26c5
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Nov 26 15:02:16 2010 +0100

    usb-linux: We only need to keep track of 15 endpoints
    
    Currently we reserve room for endpoint data for 16 endpoints, but given
    that we only use endpoint data for endpoints 1-15, and always index the
    array with the endpoint-number - 1, 15 is enough.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 607b7b207dd6c440cabd17aeb98e9a884acd2d76
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Nov 26 14:59:35 2010 +0100

    usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)
    
    Refuse iso usb packets when then max packet size for the endpoint is 0,
    this avoids an abort in usb_host_alloc_iso() caused by trying to qemu_malloc
    a 0 bytes large buffer.

commit 24de52265ca9d8451b6a06437b98a81d8c6d6bc4
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Nov 26 14:56:17 2010 +0100

    usb-linux: Refuse packets for endpoints which are not in the usb descriptor
    
    If an endpoint is not in the usb descriptor we've no idea what kind of
    endpoint it is and thus how to handle it, refuse packages in this case.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit df01987e319884420dbda81a786a11883a768afc
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Fri Nov 26 11:41:08 2010 +0100

    usb-linux: Add support for buffering iso usb packets
    
    Currently we are submitting iso packets to the host one at a time, as we
    receive them from the emulated host controller. This has 2 problems:
    1) If we were fast enough to submit every packet in time for the next host host
    controller usb frame, we would be generating 1000 hardware interrupts per
    second on the host
    2) We are not fast enough to submit every packet in time for the next host host
    controller usb frame, causing us to not submit iso urbs in some usb frames
    which causes devices with an endpoint with an interval of 1 ms (so every
    frame) to loose data. This causes for example ubs-1.1 webcams to not work
    properly (usb-2.0 is not supported at all atm).
    
    This patch fixes both problems by changing the iso packet pass through handling
    to buffer packets. This version only does so for iso input packets (webcams,
    audio in) I'm working on a second patch extending this to iso output packets
    (audio out).
    
    This patch makes use of the linux batching of iso packets in one urb.
    When an iso in packet gets received from the emulated host controller,
    it immediately submits 3 urbs with 32 iso in packets each. This causes
    the host to only get an hw interrupt every 32 packets dropping the
    interrupt rate to 32 interrupts per second and gives it a queue of urbs
    to work from once the first 32 iso in packets have been received to make sure
    no packets are dropped.
    
    Besides submitting a whole bunch or urbs as soon as the first urb is
    received, effectively creating a buffer inside the kernel, this patch also
    gets rid of the asynchroneous completion for iso in urbs. Instead they are
    only marked as complete in the fd write callback (which usbfs uses to signal
    complete urbs). These complete packets then get consumed by returning them
    synchroneously to the emulated host controller when it submits an iso in
    packet for the ep in question. When no complete packets are ready (which
    happens when the stream is starting) a 0 length packet gets returned to
    the emulated host controller.
    
    With this patch I've several usb-1.1 webcams working well with usb pass
    through, where as without this patch none of them work.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 356c1b90b52d9dc6204094b61e812e23d52b66f8
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Nov 24 12:57:59 2010 +0100

    usb-linux: Get the alt. setting from sysfs rather then asking the dev
    
    At least one device I have lies when receiving a USB_REQ_GET_INTERFACE,
    always returning 0 even if the alternate setting is different. This is
    likely caused because in practice this control message is never used as
    the operating system's usb stack knows which alternate setting it has
    told the device to get into, and thus this ctrl message does not get
    tested by device manufacturers.
    
    When usb_fs_type == USB_FS_SYS, the active alt. setting can be read directly
    from sysfs, which allows using this device through qemu's usb redirection.
    More in general it seems a good idea to not send needless control msg's to
    devices, esp. as the code in question is called every time a set_interface
    is done. Which happens multiple times during virtual machine startup, and
    when device drivers are activating the usb device.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

commit 4c95b1936a0d1db9d2347bd512596a4dda6c243c
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Nov 24 12:50:00 2010 +0100

    usb-linux: introduce a usb_linux_alt_setting function
    
    The next patch in this series introduces multiple ways to get the
    alt setting dependent upon usb_fs_type, it is cleaner to put this
    into its own function.
    
    Note that this patch also changes the assumed alt setting in case
    of an error getting the alt setting to be 0 (a sane default) rather
    then the interface numberwhich makes no sense.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>



More information about the Spice-commits mailing list