USB: fix up some old and obsolete terminology, we can do better
Subsystems (6)
Greg Kroah-Hartman
maintainercover USB: fix up some old and obsolete terminology, we can do better
There are a number of places in the USB kernel code where terms that are "loaded" are used. Fix this up to be more specific and inclusive as there is no need for us to use these terms at all.
In one case, this ends up saving code, a nice side affect.
Greg Kroah-Hartman (8):
USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
USB: rename USB OTG hub configuration option
USB: OHCI: remove obsolete FIXME comment
USB: serial: qcserial: fix up wording in a comment
USB: serial: sierra: unify quirk handling logic
USB: storage: fix wording in error message
USB: storage: scsi: fix up comment to be more specific
USB: OTG: rename product list of devices
arch/mips/configs/fuloong2e_defconfig | 2 +-
arch/mips/configs/gcw0_defconfig | 2 +-
arch/mips/configs/lemote2f_defconfig | 2 +-
drivers/usb/core/Kconfig | 8 +--
drivers/usb/core/config.c | 8 +--
drivers/usb/core/hub.c | 6 +-
.../{otg_whitelist.h => otg_productlist.h} | 14 ++---
drivers/usb/core/quirks.c | 18 +++---
drivers/usb/core/usb.h | 2 +-
drivers/usb/host/ohci-pci.c | 4 --
drivers/usb/musb/Kconfig | 2 +-
drivers/usb/musb/musb_core.c | 4 +-
drivers/usb/serial/qcserial.c | 5 +-
drivers/usb/serial/sierra.c | 57 +++++++------------
drivers/usb/storage/scsiglue.c | 2 +-
drivers/usb/storage/uas-detect.h | 2 +-
include/linux/usb/quirks.h | 4 +-
17 files changed, 57 insertions(+), 85 deletions(-)
rename drivers/usb/core/{otg_whitelist.h => otg_productlist.h} (90%)Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 1/8 USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
The USB core has a quirk flag to ignore specific endpoints, so rename it to be more obvious what this quirk does.
--- drivers/usb/core/config.c | 8 ++++---- drivers/usb/core/quirks.c | 18 +++++++++--------- drivers/usb/core/usb.h | 2 +- include/linux/usb/quirks.h | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/usb/core/config.c +4 -4
@@ -298,10 +298,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, goto skip_to_next_endpoint_or_interface_descriptor; } -/* Ignore blacklisted endpoints */ -if (udev->quirks &USB_QUIRK_ENDPOINT_BLACKLIST ) { -if (usb_endpoint_is_blacklisted (udev, ifp, d)) { -dev_warn (ddev,"config %d interface %d altsetting %d has a blacklisted endpoint with address 0x%X, skipping\n" , +/* Ignore some endpoints */ +if (udev->quirks &USB_QUIRK_ENDPOINT_IGNORE ) { +if (usb_endpoint_is_ignored (udev, ifp, d)) { +dev_warn (ddev,"config %d interface %d altsetting %d has an ignored endpoint with address 0x%X, skipping\n" , cfgno, inum, asnum, d->bEndpointAddress); goto skip_to_next_endpoint_or_interface_descriptor;
drivers/usb/core/quirks.c +9 -9
@@ -359,7 +359,7 @@ static const struct usb_device_id usb_quirk_list[] = {/* Sound Devices USBPre2 */ { USB_DEVICE(0x0926, 0x0202), .driver_info = - USB_QUIRK_ENDPOINT_BLACKLIST }, + USB_QUIRK_ENDPOINT_IGNORE }, /* Keytouch QWERTY Panel keyboard */ { USB_DEVICE(0x0926, 0x3333), .driver_info =
@@ -493,24 +493,24 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { };/* -* Entries for blacklisted endpoints that should be ignored when parsing -* configuration descriptors. +* Entries for endpoints that should be ignored when parsing configuration +* descriptors. * -* Matched for devices with USB_QUIRK_ENDPOINT_BLACKLIST. +* Matched for devices with USB_QUIRK_ENDPOINT_IGNORE. */ -static const struct usb_device_id usb_endpoint_blacklist[] = { +static const struct usb_device_id usb_endpoint_ignore[] = { {USB_DEVICE_INTERFACE_NUMBER (0x0926 ,0x0202 ,1 ), .driver_info =0x85 }, { } }; -bool usb_endpoint_is_blacklisted (struct usb_device *udev, -struct usb_host_interface *intf, -struct usb_endpoint_descriptor *epd) +bool usb_endpoint_is_ignored (struct usb_device *udev, +struct usb_host_interface *intf, +struct usb_endpoint_descriptor *epd) {const struct usb_device_id *id;unsigned int address; -for (id = usb_endpoint_blacklist; id->match_flags; ++id) { +for (id = usb_endpoint_ignore; id->match_flags; ++id) {if (!usb_match_device (udev, id))continue ;
drivers/usb/core/usb.h +1 -1
@@ -37,7 +37,7 @@ extern void usb_authorize_interface(struct usb_interface *);extern void usb_detect_quirks (struct usb_device *udev);extern void usb_detect_interface_quirks (struct usb_device *udev);extern void usb_release_quirk_list (void ); -extern bool usb_endpoint_is_blacklisted (struct usb_device *udev, +extern bool usb_endpoint_is_ignored (struct usb_device *udev,struct usb_host_interface *intf,struct usb_endpoint_descriptor *epd);extern int usb_remove_device (struct usb_device *udev);
include/linux/usb/quirks.h +2 -2
@@ -69,7 +69,7 @@/* Hub needs extra delay after resetting its port. */ #define USB_QUIRK_HUB_SLOW_RESET BIT(14) -/* device has blacklisted endpoints */ -#define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15) +/* device has endpoints that should be ignored */ +#define USB_QUIRK_ENDPOINT_IGNORE BIT(15)#endif /* __LINUX_USB_QUIRKS_H */
Signature · 1 line
2.27.0
Re: [PATCH 1/8] USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
Quoted 4 lines · Greg Kroah-Hartman
The USB core has a quirk flag to ignore specific endpoints, so rename it
to be more obvious what this quirk does.
Quoted 9 lines
Cc Johan Hovold <[email protected]>Cc Alan Stern <[email protected]>Cc Richard Dodd <[email protected]>Cc Hans de Goede <[email protected]>Cc Jonathan Cox <[email protected]>Cc Bastien Nocera <[email protected]>Cc "Thiébaud Weksteen" <[email protected]>Cc Nishad Kamdar <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
If the driver API change below is agreeable, you can add my:
Good job.
<snip>
Quoted 14 lines
include/linux/usb/quirks.h +2
-2@@ -69,7 +69,7 @@/* Hub needs extra delay after resetting its port. */ #define USB_QUIRK_HUB_SLOW_RESET BIT(14) -/* device has blacklisted endpoints */ -#define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15) +/* device has endpoints that should be ignored */ +#define USB_QUIRK_ENDPOINT_IGNORE BIT(15)#endif /* __LINUX_USB_QUIRKS_H */
Re: [PATCH 1/8] USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
Hi Bastien,
Quoted 15 lines · Bastien Nocera
Quoted 4 lines · Greg Kroah-Hartman
The USB core has a quirk flag to ignore specific endpoints, so rename it
to be more obvious what this quirk does.Quoted 9 lines
Cc Johan Hovold <[email protected]>Cc Alan Stern <[email protected]>Cc Richard Dodd <[email protected]>Cc Hans de Goede <[email protected]>Cc Jonathan Cox <[email protected]>Cc Bastien Nocera <[email protected]>Cc "Thiébaud Weksteen" <[email protected]>Cc Nishad Kamdar <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Quoted 2 lines
If the driver API change below is agreeable, you can add my:
Reviewed-by Bastien Nocera <[email protected]>
A note for future reference, not sure what you mean with driver API here. If you mean the in kernel API, the kernel rules are that we are always free to change that (Linux does not have a stable driver API).
So if a header does not sit under include/uapi (indicating that it is an userspace API) then a change like this is fine.
Regards,
Hans
Quoted 20 lines
Good job.
<snip>
Quoted 14 lines
include/linux/usb/quirks.h +2
-2@@ -69,7 +69,7 @@/* Hub needs extra delay after resetting its port. */ #define USB_QUIRK_HUB_SLOW_RESET BIT(14) -/* device has blacklisted endpoints */ -#define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15) +/* device has endpoints that should be ignored */ +#define USB_QUIRK_ENDPOINT_IGNORE BIT(15)#endif /* __LINUX_USB_QUIRKS_H */
Re: [PATCH 1/8] USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
Quoted 6 lines · Hans de Goede
A note for future reference, not sure what you mean with driver
API here. If you mean the in kernel API, the kernel rules are
that we are always free to change that (Linux does not have a
Quoted 7 lines
stable driver API).
So if a header does not sit under
include/uapi(indicating thatit is an userspace API) then a change like this is fine.
I meant the internal driver API, which might break out-of-tree drivers. I know that this API is fluid, and that there are no stability guarantees, but I'd still expect at least a note in the commit message to that effect.
Greg Kroah-Hartman
maintainerRe: [PATCH 1/8] USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE
Quoted 11 lines · Bastien Nocera
Quoted 10 lines · Hans de Goede
A note for future reference, not sure what you mean with driver
API here. If you mean the in kernel API, the kernel rules are
that we are always free to change that (Linux does not have a
stable driver API).
Quoted 5 lines
Quoted 3 lines
So if a header does not sit under
include/uapi(indicating thatit is an userspace API) then a change like this is fine.
I meant the internal driver API, which might break out-of-tree drivers.
There is no such thing. Well, there might be, but we don't care and have to act as if there are no such thing otherwise we would never be able to change anything :)
Quoted 3 lines
I know that this API is fluid, and that there are no stability guarantees, but I'd still expect at least a note in the commit message to that effect.
Why? Who cares? Anyone who lives outside of the kernel already knows they have to dig in the kernel if their code breaks, that's the cost of living outside of the kernel.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 2/8 USB: rename USB OTG hub configuration option
In reply to Greg Kroah-HartmanThe USB OTG code has the ability to disable external hubs, but the configuration option for it is oddly named. Rename it to be more obvious as to what it does.
--- arch/mips/configs/gcw0_defconfig | 2 +- drivers/usb/core/Kconfig | 2 +- drivers/usb/core/hub.c | 2 +- drivers/usb/musb/Kconfig | 2 +- drivers/usb/musb/musb_core.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)
arch/mips/configs/gcw0_defconfig +1 -1
@@ -96,7 +96,7 @@ CONFIG_SND_SIMPLE_CARD=y CONFIG_USB_CONN_GPIO=y CONFIG_USB=y CONFIG_USB_OTG=y -CONFIG_USB_OTG_BLACKLIST_HUB=y +CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_MUSB_HDRC=y
drivers/usb/core/Kconfig +1 -1
@@ -66,7 +66,7 @@ config USB_OTG_WHITELIST "Targeted Peripherals List". "Embedded Hosts" are likewise allowed to support only a limited number of peripherals. -config USB_OTG_BLACKLIST_HUB +config USB_OTG_DISABLE_EXTERNAL_HUB bool "Disable external hubs" depends on USB_OTG || EXPERT help
drivers/usb/core/hub.c +1 -1
@@ -1834,7 +1834,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)return -E2BIG ; } -#ifdef CONFIG_USB_OTG_BLACKLIST_HUB +#ifdef CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB if (hdev->parent) {dev_warn (&intf->dev,"ignoring external hub\n" );return -ENODEV ;
drivers/usb/musb/Kconfig +1 -1
@@ -113,7 +113,7 @@ config USB_MUSB_JZ4740 depends on OF depends on MIPS || COMPILE_TEST depends on USB_MUSB_GADGET - depends on USB=n || USB_OTG_BLACKLIST_HUB + depends on USB=n || USB_OTG_DISABLE_EXTERNAL_HUB select USB_ROLE_SWITCH config USB_MUSB_MEDIATEK
drivers/usb/musb/musb_core.c +2 -2
@@ -1637,8 +1637,8 @@ static int musb_core_init(u16 musb_type, struct musb *musb) musb->is_multipoint =0 ; type ="" ;if (IS_ENABLED (CONFIG_USB ) && - !IS_ENABLED (CONFIG_USB_OTG_BLACKLIST_HUB )) { -pr_err ("%s: kernel must blacklist external hubs\n" , + !IS_ENABLED (CONFIG_USB_OTG_DISABLE_EXTERNAL_HUB )) { +pr_err ("%s: kernel must disable external hubs, please fix the configuration\n" , musb_driver_name); } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 3/8 USB: OHCI: remove obsolete FIXME comment
In reply to Greg Kroah-HartmanThis comment has been present since the start of git. Since no one is going to do anything about it, and all seems to work well, just drop the thing entirely.
--- drivers/usb/host/ohci-pci.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/usb/host/ohci-pci.c +0 -4
@@ -232,10 +232,6 @@ static const struct pci_device_id ohci_pci_quirks[] = { .driver_data = (unsigned long)ohci_quirk_qemu, }, -/* FIXME for some of the early AMD 760 southbridges, OHCI -* won't work at all. blacklist them. -*/ - {}, };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 4/8 USB: serial: qcserial: fix up wording in a comment
In reply to Greg Kroah-HartmanBetter describe what is happening with a list of devices that are being ignored by the driver.
--- drivers/usb/serial/qcserial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/serial/qcserial.c +2 -3
@@ -365,9 +365,8 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)* a specific function, while the subclass indicate a * specific firmware source * -* This is a blacklist of functions known to be -* non-serial. The rest are assumed to be serial and -* will be handled by this driver +* This is a list of functions known to be non-serial. The rest +* are assumed to be serial and will be handled by this driver */ switch (intf->desc.bInterfaceProtocol) {/* QMI combined (qmi_wwan) */
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 5/8 USB: serial: sierra: unify quirk handling logic
In reply to Greg Kroah-HartmanThe sierra driver had two different functions for trying to determine different quirks that did the same exact thing. Remove one and rename things to make it more obvious exactly what the different lists do.
--- drivers/usb/serial/sierra.c | 57 +++++++++++++------------------------ 1 file changed, 19 insertions(+), 38 deletions(-)
drivers/usb/serial/sierra.c +19 -38
@@ -45,9 +45,9 @@static bool nmea; -/* Used in interface blacklisting */ -struct sierra_iface_info { -const u32 infolen;/* number of interface numbers on blacklist */ +/* Used in interface quirks */ +struct sierra_iface_quirk { +const u32 infolen;/* number of interface numbers on the list */ const u8 *ifaceinfo;/* pointer to the array holding the numbers */ };
@@ -101,33 +101,15 @@ static int sierra_calc_num_ports(struct usb_serial *serial,return num_ports; } -static int is_blacklisted (const u8 ifnum, -const struct sierra_iface_info *blacklist) +static int is_quirk (const u8 ifnum,const struct sierra_iface_quirk *quirk) {const u8 *info;int i; -if (blacklist) { - info = blacklist->ifaceinfo; +if (quirk) { + info = quirk->ifaceinfo; -for (i =0 ; i < blacklist->infolen; i++) { -if (info[i] == ifnum) -return 1 ; - } - } -return 0 ; -} - -static int is_himemory (const u8 ifnum, -const struct sierra_iface_info *himemorylist) -{ -const u8 *info; -int i; - -if (himemorylist) { - info = himemorylist->ifaceinfo; - -for (i=0 ; i < himemorylist->infolen; i++) { +for (i =0 ; i < quirk->infolen; i++) {if (info[i] == ifnum)return 1 ; }
@@ -161,10 +143,9 @@ static int sierra_probe(struct usb_serial *serial,usb_set_interface (udev, ifnum,1 ); } -if (is_blacklisted (ifnum, - (struct sierra_iface_info *)id->driver_info)) { +if (is_quirk (ifnum, (struct sierra_iface_quirk *)id->driver_info)) {dev_dbg (&serial->dev->dev, -"Ignoring blacklisted interface #%d\n" , ifnum); +"Ignoring interface #%d\n" , ifnum);return -ENODEV ; }
@@ -173,20 +154,20 @@ static int sierra_probe(struct usb_serial *serial,/* interfaces with higher memory requirements */ static const u8 hi_memory_typeA_ifaces[] = {0 ,2 }; -static const struct sierra_iface_info typeA_interface_list = { +static const struct sierra_iface_quirk typeA_interface_list = { .infolen =ARRAY_SIZE (hi_memory_typeA_ifaces), .ifaceinfo = hi_memory_typeA_ifaces, };static const u8 hi_memory_typeB_ifaces[] = {3 ,4 ,5 ,6 }; -static const struct sierra_iface_info typeB_interface_list = { +static const struct sierra_iface_quirk typeB_interface_list = { .infolen =ARRAY_SIZE (hi_memory_typeB_ifaces), .ifaceinfo = hi_memory_typeB_ifaces, }; -/* 'blacklist' of interfaces not served by this driver */ +/* 'ignorelist' of interfaces not served by this driver */ static const u8 direct_ip_non_serial_ifaces[] = {7 ,8 ,9 ,10 ,11 ,19 ,20 }; -static const struct sierra_iface_info direct_ip_interface_blacklist = { +static const struct sierra_iface_quirk direct_ip_interface_ignore = { .infolen =ARRAY_SIZE (direct_ip_non_serial_ifaces), .ifaceinfo = direct_ip_non_serial_ifaces, };
@@ -264,19 +245,19 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */ /* Sierra Wireless Direct IP modems */ { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68A3, 0xFF, 0xFF, 0xFF), - .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + .driver_info = (kernel_ulong_t)&direct_ip_interface_ignore }, { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x68AA, 0xFF, 0xFF, 0xFF), - .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + .driver_info = (kernel_ulong_t)&direct_ip_interface_ignore }, { USB_DEVICE(0x1199, 0x68AB) }, /* Sierra Wireless AR8550 */ /* AT&T Direct IP LTE modems */ { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68AA, 0xFF, 0xFF, 0xFF), - .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + .driver_info = (kernel_ulong_t)&direct_ip_interface_ignore },/* Airprime/Sierra Wireless Direct IP modems */ { USB_DEVICE_AND_INTERFACE_INFO(0x0F3D, 0x68A3, 0xFF, 0xFF, 0xFF), - .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist + .driver_info = (kernel_ulong_t)&direct_ip_interface_ignore }, { }
@@ -879,7 +860,7 @@ static int sierra_port_probe(struct usb_serial_port *port) {struct usb_serial *serial = port->serial;struct sierra_port_private *portdata; -const struct sierra_iface_info *himemoryp; +const struct sierra_iface_quirk *himemoryp;u8 ifnum; portdata =kzalloc (sizeof (*portdata),GFP_KERNEL );
@@ -907,7 +888,7 @@ static int sierra_port_probe(struct usb_serial_port *port) himemoryp = &typeA_interface_list; } -if (is_himemory (ifnum, himemoryp)) { +if (is_quirk (ifnum, himemoryp)) { portdata->num_out_urbs =N_OUT_URB_HM ; portdata->num_in_urbs =N_IN_URB_HM ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 6/8 USB: storage: fix wording in error message
In reply to Greg Kroah-HartmanMake it obvious that the UAS driver is being ignored for a specific device by fixing up the wording to be more clear.
--- drivers/usb/storage/uas-detect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/uas-detect.h +1 -1
@@ -120,7 +120,7 @@ static int uas_use_uas_driver(struct usb_interface *intf,if (flags &US_FL_IGNORE_UAS ) {dev_warn (&udev->dev, -"UAS is blacklisted for this device, using usb-storage instead\n" ); +"UAS is ignored for this device, using usb-storage instead\n" );return 0 ; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 7/8 USB: storage: scsi: fix up comment to be more specific
In reply to Greg Kroah-HartmanFix up the wording in a comment for the scsi driver saying what it does using better terminology.
--- drivers/usb/storage/scsiglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/scsiglue.c +1 -1
@@ -298,7 +298,7 @@ static int slave_configure(struct scsi_device *sdev) }else {/* -* Non-disk-type devices don't need to blacklist any pages +* Non-disk-type devices don't need to ignore any pages * or to force 192-byte transfer lengths for MODE SENSE. * But they do need to use MODE SENSE(10). */
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 8/8 USB: OTG: rename product list of devices
In reply to Greg Kroah-HartmanRename the list of specific devices that an OTG device could support to make it more obvious as to what this list is for and what it is doing. Also rename the configuration option to make it more obvious as well.
---
arch/mips/configs/fuloong2e_defconfig | 2 +-
arch/mips/configs/lemote2f_defconfig | 2 +-
drivers/usb/core/Kconfig | 6 +++---
drivers/usb/core/hub.c | 4 ++--
.../core/{otg_whitelist.h => otg_productlist.h} | 14 +++++---------
5 files changed, 12 insertions(+), 16 deletions(-)
rename drivers/usb/core/{otg_whitelist.h => otg_productlist.h} (90%)arch/mips/configs/fuloong2e_defconfig +1 -1
@@ -159,7 +159,7 @@ CONFIG_USB_KBD=y CONFIG_USB_MOUSE=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -CONFIG_USB_OTG_WHITELIST=y +CONFIG_USB_OTG_PRODUCTLIST=y CONFIG_USB_WUSB_CBAF=m CONFIG_USB_C67X00_HCD=m CONFIG_USB_EHCI_HCD=y
arch/mips/configs/lemote2f_defconfig +1 -1
@@ -207,7 +207,7 @@ CONFIG_ZEROPLUS_FF=y CONFIG_USB_HIDDEV=y CONFIG_USB=y CONFIG_USB_DYNAMIC_MINORS=y -CONFIG_USB_OTG_WHITELIST=y +CONFIG_USB_OTG_PRODUCTLIST=y CONFIG_USB_MON=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y
drivers/usb/core/Kconfig +3 -3
@@ -55,12 +55,12 @@ config USB_OTG Select this only if your board has Mini-AB/Micro-AB connector. -config USB_OTG_WHITELIST +config USB_OTG_PRODUCTLIST bool "Rely on OTG and EH Targeted Peripherals List" depends on USB help - If you say Y here, the "otg_whitelist.h" file will be used as a - product whitelist, so USB peripherals not listed there will be + If you say Y here, the "otg_productlist.h" file will be used as a + product list, so USB peripherals not listed there will be rejected during enumeration. This behavior is required by the USB OTG and EH specification for all devices not on your product's "Targeted Peripherals List". "Embedded Hosts" are likewise
drivers/usb/core/hub.c +2 -2
@@ -35,7 +35,7 @@#include <asm/byteorder.h> #include "hub.h" -#include "otg_whitelist.h" +#include "otg_productlist.h" #define USB_VENDOR_GENESYS_LOGIC 0x05e3#define USB_VENDOR_SMSC 0x0424
@@ -2403,7 +2403,7 @@ static int usb_enumerate_device(struct usb_device *udev)if (err <0 )return err; -if (IS_ENABLED (CONFIG_USB_OTG_WHITELIST ) && hcd->tpl_support && +if (IS_ENABLED (CONFIG_USB_OTG_PRODUCTLIST ) && hcd->tpl_support && !is_targeted (udev)) {/* Maybe it can talk to us, though we can't talk to it. * (Includes HNP test device.)
drivers/usb/core/otg_productlist.h renamed from drivers/usb/core/otg_whitelist.h +5 -9
@@ -1,18 +1,14 @@/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* drivers/usb/core/otg_whitelist.h -* -* Copyright (C) 2004 Texas Instruments -*/ +/* Copyright (C) 2004 Texas Instruments */ /* -* This OTG and Embedded Host Whitelist is "Targeted Peripheral List". +* This OTG and Embedded Host list is "Targeted Peripheral List". * It should mostly use of USB_DEVICE() or USB_DEVICE_VER() entries.. * * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING! */ -static struct usb_device_id whitelist_table[] = { +static struct usb_device_id productlist_table[] = {/* hubs are optional in OTG, but very handy ... */ {USB_DEVICE_INFO (USB_CLASS_HUB ,0 ,0 ), },
@@ -44,7 +40,7 @@ static struct usb_device_id whitelist_table[] = {static int is_targeted (struct usb_device *dev) { -struct usb_device_id *id = whitelist_table; +struct usb_device_id *id = productlist_table;/* HNP test device is _never_ targeted (see OTG spec 6.6.6) */ if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
@@ -59,7 +55,7 @@ static int is_targeted(struct usb_device *dev)/* NOTE: can't use usb_match_id() since interface caches * aren't set up yet. this is cut/paste from that code. */ -for (id = whitelist_table; id->match_flags; id++) { +for (id = productlist_table; id->match_flags; id++) {if ((id->match_flags &USB_DEVICE_ID_MATCH_VENDOR ) && id->idVendor !=le16_to_cpu (dev->descriptor.idVendor))continue ;
Signature · 1 line
2.27.0