[Spice-devel] [usbredir PATCH] usbredirfilter_check: block device if all its interfaces skipped

Hans de Goede hdegoede at redhat.com
Fri Jul 10 00:00:42 PDT 2015


Hi,

On 09-07-15 16:51, Uri Lublin wrote:
> On Thu, 2015-07-09 at 10:13 +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 09-07-15 09:19, Christophe Fergeau wrote:
>>> On Wed, Jul 08, 2015 at 07:36:40PM +0200, Hans de Goede wrote:
>>>> Can you ask the reporter to provide lsusb -v output for the usb
>>>> interface
>>>> of the kvm in question, then we can better analyse what exactly
>>>> is going
>>>> wrong here. Perhaps my analyses of the problem is wrong.
>>>
>>> Is https://bugzilla.redhat.com/attachment.cgi?id=980879 enough or
>>> do you
>>> need something even more detailed?
>>
>> That is good enough, but all the hid devices in there have at least
>> one
>> interface which has:
>>
>> bInterfaceSubClass      1 Boot Interface Subclass
>>
>> So atleast 1 interface will not be skipped for the filter check and
>> the
>> Uri's patch will be a nop on these devices.
>
>
> I've tested with a different KVM switch device, see below its
> descriptors.
>
> The patch fixes the problem I found with "my" KVM device.

Looking at the descriptors for your kvm, yes that makes sense
(and those descriptors ar weird btw, as said this kvm will likely
not work with many BIOS-es).

> You are probably right it will not fix the problem in the bug.

Ok, so can you please respin the patch to re-call the filter function
with the usbredirfilter_fl_dont_skip_non_boot_hid flag or-ed
into the flags argument, rather then returning -ENOENT? This way e.g.
a vid:pid filter will still do what the user requested for devices
like your kvm, rather then always denying passthrough of them.

Regards,

Hans


>
>
> ---
> Bus 002 Device 043: ID 10d5:55a4 Uni Class Technology Co., Ltd
> Device Descriptor:
>    bLength                18
>    bDescriptorType         1
>    bcdUSB               1.10
>    bDeviceClass            0 (Defined at Interface level)
>    bDeviceSubClass         0
>    bDeviceProtocol         0
>    bMaxPacketSize0         8
>    idVendor           0x10d5 Uni Class Technology Co., Ltd
>    idProduct          0x55a4
>    bcdDevice            1.00
>    iManufacturer           1 No brand
>    iProduct                2 4 Port KVMSwicther
>    iSerial                 3 04’
>    bNumConfigurations      1
>    Configuration Descriptor:
>      bLength                 9
>      bDescriptorType         2
>      wTotalLength           59
>      bNumInterfaces          2
>      bConfigurationValue     1
>      iConfiguration          4 HID Mouse
>      bmAttributes         0x80
>        (Bus Powered)
>      MaxPower              100mA
>      Interface Descriptor:
>        bLength                 9
>        bDescriptorType         4
>        bInterfaceNumber        0
>        bAlternateSetting       0
>        bNumEndpoints           1
>        bInterfaceClass         3 Human Interface Device
>        bInterfaceSubClass      0 No Subclass
>        bInterfaceProtocol      0 None
>        iInterface              7 Keyboard
>          HID Device Descriptor:
>            bLength                 9
>            bDescriptorType        33
>            bcdHID               1.10
>            bCountryCode            0 Not supported
>            bNumDescriptors         1
>            bDescriptorType        34 Report
>            wDescriptorLength      65
>           Report Descriptors:
>             ** UNAVAILABLE **
>        Endpoint Descriptor:
>          bLength                 7
>          bDescriptorType         5
>          bEndpointAddress     0x81  EP 1 IN
>          bmAttributes            3
>            Transfer Type            Interrupt
>            Synch Type               None
>            Usage Type               Data
>          wMaxPacketSize     0x0008  1x 8 bytes
>          bInterval              10
>      Interface Descriptor:
>        bLength                 9
>        bDescriptorType         4
>        bInterfaceNumber        1
>        bAlternateSetting       0
>        bNumEndpoints           1
>        bInterfaceClass         3 Human Interface Device
>        bInterfaceSubClass      0 No Subclass
>        bInterfaceProtocol      0 None
>        iInterface              6 Mouse
>          HID Device Descriptor:
>            bLength                 9
>            bDescriptorType        33
>            bcdHID               1.10
>            bCountryCode            0 Not supported
>            bNumDescriptors         1
>            bDescriptorType        34 Report
>            wDescriptorLength      24
>            Report Descriptor: (length is 24)
>              Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
>                              (null)
>              Item(Local ): Usage, data= [ 0x01 ] 1
>                              (null)
>              Item(Main  ): Collection, data= [ 0x01 ] 1
>                              Application
>              Item(Global): Logical Minimum, data= [ 0x00 ] 0
>              Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
>              Item(Local ): Usage Minimum, data= [ 0x00 ] 0
>                              (null)
>              Item(Local ): Usage Maximum, data= [ 0xff 0x00 ] 255
>                              (null)
>              Item(Global): Report Count, data= [ 0x08 ] 8
>              Item(Global): Report Size, data= [ 0x08 ] 8
>              Item(Main  ): Output, data= [ 0x02 ] 2
>                              Data Variable Absolute No_Wrap Linear
>                              Preferred_State No_Null_Position
> Non_Volatile Bitfield
>              Item(Main  ): End Collection, data=none
>        Endpoint Descriptor:
>          bLength                 7
>          bDescriptorType         5
>          bEndpointAddress     0x02  EP 2 OUT
>          bmAttributes            3
>            Transfer Type            Interrupt
>            Synch Type               None
>            Usage Type               Data
>          wMaxPacketSize     0x0008  1x 8 bytes
>          bInterval              10
> Device Status:     0x0040
>    (Bus Powered)
>    Debug Mode
>
> ---
>
> Thanks,
>      Uri
>


More information about the Spice-devel mailing list