Re: [PATCH] usb: hub add filter for device with specific VID&PID

From: Peter Chen
Date: Sun Sep 29 2019 - 02:29:21 EST


> > >
> > > In fact, the system should respond the same way to any unrecognized
> > > device that doesn't support HNP, right? There's nothing special about
> > > these VID/PID values.
> >
> > Yes, but I saw there are already some implementation in upstream kernel for this
> > purpose, just PID different: drivers/usb/core/otg_whitelist.h function
> > is_targeted()
> >
> > > > > And why those specific vid/pid values? What do they refer to?
> > > >
> > > > For step 5, we got the VID / PID number from USB IF certified
> > > > lab(Allion.inc at Taiwang). Looks like this is a reserved ID pair
> > > > and will not be allocated to any vendor for their products. So it's
> > > > hence used for
> > > this case test (like saying: you should be able to pop a not-support
> > > message for this reserved VID&PID).
> > >
> > > Don't we do this already?
> >
> > Yes, but in function is_stargeted(), I found it's a little be different:
> > Current upstream: VID = 0x1a0a, PID = 0x0200
> > Info from USB-IF certified lab: VID = 0x1a0a, PID = 0x0201
> >
>
> Sorry that I mis-understood the logic of is_stargeted() and it's caller.
>
> So the proper way to resolve my problem is:
> 1. Select CONFIG_USB_OTG in .config
> 2. Add property 'tpl-support' to device tree
> 3. Customize whitelist_table[] according to my Target-Peripheral-List
> requirement.
>

Yan, this is the correct way, we (NXP i.MX Series) have followed this
way for USB EH certification
several years.

Peter

> Am I right? :)
>
> Regards,
> Ran