Re: [PATCH] usb: Add a new quirk: USB_QUIRK_HONOR_BNUMINTERFACES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 03/14/2010 09:35 PM, Alan Stern wrote:
On Sun, 14 Mar 2010, Hans de Goede wrote:

Hi,

The attached patch adds a new usb device quirk
USB_QUIRK_HONOR_BNUMINTERFACES, when this quirk is set and a device
has more interface descriptors in a configuration then it claims to
have in config->bNumInterfaces, ignore all additional interfaces.

This is needed for devices which try to hide unused interfaces by only
lowering config->bNumInterfaces, and which can't handle if you try to talk
to the "hidden" interfaces.

This patch also adds a quirk table entry for one such device, which existence
is the reason for this patch.

The problem with this patch is that it assumes the "hidden" interfaces
are always the last ones in the descriptor listing.  That's not
necessarily true; devices don't have to list their interfaces in any
particular order.

If instead you decide that the "hidden" interfaces are the ones with
bInterfaceNumber>= bNumInterfaces, then you face possible problems
with devices that leave gaps in the series of bInterfaceNumber values.
I don't know whether any such devices exist, but they might.


I've thought about this too (while writing the patch) the patch as is
works for the particular device I'm dealing with atm. As you indicate
above neither solution is perfect, so I opted for this variant for now.

I decided it would be best to cross the what if the interfaces are
listed in such an order that the "hidden" interfaces are not last bridge,
if and when we encounter a quirky device which actually has that problem.

Don't get me wrong, I'm fine with making the quirk code handle all
possible variants of this quirk while at it, but as you indicate
yourself, there is no 100% solution.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux