Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'usb-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are a few minor USB fixes for 4.15-rc3.

The largest here is the Kconfig text and configuration changes for the
USB TypeC build options that you reported during the -rc1 merge
window. The others are all just small fixes for reported issues, as
well as some new device ids.

The most "interesting" of anything here is the usbip fixes as it seems
lots of people are starting to pay attention to that driver at the
moment. These fixes should resolve all of the reported problems as of
now.

Of course there are the usual xhci and gadget fixes as well, can't go
a pull request without those...

All of these have been in linux-next for a while with no reported
issues"

* tag 'usb-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (22 commits)
usb: xhci: fix panic in xhci_free_virt_devices_depth_first
xhci: Don't show incorrect WARN message about events for empty rings
usbip: fix usbip attach to find a port that matches the requested speed
usbip: Fix USB device hang due to wrong enabling of scatter-gather
uas: Always apply US_FL_NO_ATA_1X quirk to Seagate devices
usb: quirks: Add no-lpm quirk for KY-688 USB 3.1 Type-C Hub
usb: build drivers/usb/common/ when USB_SUPPORT is set
usb: hub: Cycle HUB power when initialization fails
USB: core: Add type-specific length check of BOS descriptors
usb: host: fix incorrect updating of offset
USB: ulpi: fix bus-node lookup
USB: usbfs: Filter flags passed in from user space
usb: add user selectable option for the whole USB Type-C Support
usb: f_fs: Force Reserved1=1 in OS_DESC_EXT_COMPAT
usb: gadget: core: Fix ->udc_set_speed() speed handling
usb: gadget: allow to enable legacy drivers without USB_ETH
usb: gadget: udc: renesas_usb3: fix number of the pipes
usb: gadget: don't dereference g until after it has been null checked
USB: serial: usb_debug: add new USB device id
usb: bdc: fix platform_no_drv_owner.cocci warnings
...

+169 -40
+1
drivers/Makefile
··· 105 105 obj-$(CONFIG_UWB) += uwb/ 106 106 obj-$(CONFIG_USB_PHY) += usb/ 107 107 obj-$(CONFIG_USB) += usb/ 108 + obj-$(CONFIG_USB_SUPPORT) += usb/ 108 109 obj-$(CONFIG_PCI) += usb/ 109 110 obj-$(CONFIG_USB_GADGET) += usb/ 110 111 obj-$(CONFIG_OF) += usb/
+2 -2
drivers/usb/common/ulpi.c
··· 180 180 /* Find a ulpi bus underneath the parent or the grandparent */ 181 181 parent = ulpi->dev.parent; 182 182 if (parent->of_node) 183 - np = of_find_node_by_name(parent->of_node, "ulpi"); 183 + np = of_get_child_by_name(parent->of_node, "ulpi"); 184 184 else if (parent->parent && parent->parent->of_node) 185 - np = of_find_node_by_name(parent->parent->of_node, "ulpi"); 185 + np = of_get_child_by_name(parent->parent->of_node, "ulpi"); 186 186 if (!np) 187 187 return 0; 188 188
+24 -4
drivers/usb/core/config.c
··· 905 905 } 906 906 } 907 907 908 + static const __u8 bos_desc_len[256] = { 909 + [USB_CAP_TYPE_WIRELESS_USB] = USB_DT_USB_WIRELESS_CAP_SIZE, 910 + [USB_CAP_TYPE_EXT] = USB_DT_USB_EXT_CAP_SIZE, 911 + [USB_SS_CAP_TYPE] = USB_DT_USB_SS_CAP_SIZE, 912 + [USB_SSP_CAP_TYPE] = USB_DT_USB_SSP_CAP_SIZE(1), 913 + [CONTAINER_ID_TYPE] = USB_DT_USB_SS_CONTN_ID_SIZE, 914 + [USB_PTM_CAP_TYPE] = USB_DT_USB_PTM_ID_SIZE, 915 + }; 916 + 908 917 /* Get BOS descriptor set */ 909 918 int usb_get_bos_descriptor(struct usb_device *dev) 910 919 { 911 920 struct device *ddev = &dev->dev; 912 921 struct usb_bos_descriptor *bos; 913 922 struct usb_dev_cap_header *cap; 923 + struct usb_ssp_cap_descriptor *ssp_cap; 914 924 unsigned char *buffer; 915 - int length, total_len, num, i; 925 + int length, total_len, num, i, ssac; 926 + __u8 cap_type; 916 927 int ret; 917 928 918 929 bos = kzalloc(sizeof(struct usb_bos_descriptor), GFP_KERNEL); ··· 976 965 dev->bos->desc->bNumDeviceCaps = i; 977 966 break; 978 967 } 968 + cap_type = cap->bDevCapabilityType; 979 969 length = cap->bLength; 970 + if (bos_desc_len[cap_type] && length < bos_desc_len[cap_type]) { 971 + dev->bos->desc->bNumDeviceCaps = i; 972 + break; 973 + } 974 + 980 975 total_len -= length; 981 976 982 977 if (cap->bDescriptorType != USB_DT_DEVICE_CAPABILITY) { ··· 990 973 continue; 991 974 } 992 975 993 - switch (cap->bDevCapabilityType) { 976 + switch (cap_type) { 994 977 case USB_CAP_TYPE_WIRELESS_USB: 995 978 /* Wireless USB cap descriptor is handled by wusb */ 996 979 break; ··· 1003 986 (struct usb_ss_cap_descriptor *)buffer; 1004 987 break; 1005 988 case USB_SSP_CAP_TYPE: 1006 - dev->bos->ssp_cap = 1007 - (struct usb_ssp_cap_descriptor *)buffer; 989 + ssp_cap = (struct usb_ssp_cap_descriptor *)buffer; 990 + ssac = (le32_to_cpu(ssp_cap->bmAttributes) & 991 + USB_SSP_SUBLINK_SPEED_ATTRIBS) + 1; 992 + if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac)) 993 + dev->bos->ssp_cap = ssp_cap; 1008 994 break; 1009 995 case CONTAINER_ID_TYPE: 1010 996 dev->bos->ss_id =
+9 -5
drivers/usb/core/devio.c
··· 1442 1442 int number_of_packets = 0; 1443 1443 unsigned int stream_id = 0; 1444 1444 void *buf; 1445 - 1446 - if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP | 1447 - USBDEVFS_URB_SHORT_NOT_OK | 1445 + unsigned long mask = USBDEVFS_URB_SHORT_NOT_OK | 1448 1446 USBDEVFS_URB_BULK_CONTINUATION | 1449 1447 USBDEVFS_URB_NO_FSBR | 1450 1448 USBDEVFS_URB_ZERO_PACKET | 1451 - USBDEVFS_URB_NO_INTERRUPT)) 1452 - return -EINVAL; 1449 + USBDEVFS_URB_NO_INTERRUPT; 1450 + /* USBDEVFS_URB_ISO_ASAP is a special case */ 1451 + if (uurb->type == USBDEVFS_URB_TYPE_ISO) 1452 + mask |= USBDEVFS_URB_ISO_ASAP; 1453 + 1454 + if (uurb->flags & ~mask) 1455 + return -EINVAL; 1456 + 1453 1457 if ((unsigned int)uurb->buffer_length >= USBFS_XFER_MAX) 1454 1458 return -EINVAL; 1455 1459 if (uurb->buffer_length > 0 && !uurb->buffer)
+9
drivers/usb/core/hub.c
··· 4948 4948 usb_put_dev(udev); 4949 4949 if ((status == -ENOTCONN) || (status == -ENOTSUPP)) 4950 4950 break; 4951 + 4952 + /* When halfway through our retry count, power-cycle the port */ 4953 + if (i == (SET_CONFIG_TRIES / 2) - 1) { 4954 + dev_info(&port_dev->dev, "attempt power cycle\n"); 4955 + usb_hub_set_port_power(hdev, hub, port1, false); 4956 + msleep(2 * hub_power_on_good_delay(hub)); 4957 + usb_hub_set_port_power(hdev, hub, port1, true); 4958 + msleep(hub_power_on_good_delay(hub)); 4959 + } 4951 4960 } 4952 4961 if (hub->hdev->parent || 4953 4962 !hcd->driver->port_handed_over ||
+3
drivers/usb/core/quirks.c
··· 146 146 /* appletouch */ 147 147 { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, 148 148 149 + /* Genesys Logic hub, internally used by KY-688 USB 3.1 Type-C Hub */ 150 + { USB_DEVICE(0x05e3, 0x0612), .driver_info = USB_QUIRK_NO_LPM }, 151 + 149 152 /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */ 150 153 { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM }, 151 154
+2 -2
drivers/usb/gadget/Kconfig
··· 508 508 controller, and the relevant drivers for each function declared 509 509 by the device. 510 510 511 - source "drivers/usb/gadget/legacy/Kconfig" 512 - 513 511 endchoice 512 + 513 + source "drivers/usb/gadget/legacy/Kconfig" 514 514 515 515 endif # USB_GADGET
+5 -2
drivers/usb/gadget/composite.c
··· 146 146 struct usb_function *f, 147 147 struct usb_ep *_ep) 148 148 { 149 - struct usb_composite_dev *cdev = get_gadget_data(g); 150 149 struct usb_endpoint_descriptor *chosen_desc = NULL; 151 150 struct usb_descriptor_header **speed_desc = NULL; 152 151 ··· 225 226 _ep->maxburst = comp_desc->bMaxBurst + 1; 226 227 break; 227 228 default: 228 - if (comp_desc->bMaxBurst != 0) 229 + if (comp_desc->bMaxBurst != 0) { 230 + struct usb_composite_dev *cdev; 231 + 232 + cdev = get_gadget_data(g); 229 233 ERROR(cdev, "ep0 bMaxBurst must be 0\n"); 234 + } 230 235 _ep->maxburst = 1; 231 236 break; 232 237 }
+12 -3
drivers/usb/gadget/function/f_fs.c
··· 1012 1012 else 1013 1013 ret = ep->status; 1014 1014 goto error_mutex; 1015 - } else if (!(req = usb_ep_alloc_request(ep->ep, GFP_KERNEL))) { 1015 + } else if (!(req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC))) { 1016 1016 ret = -ENOMEM; 1017 1017 } else { 1018 1018 req->buf = data; ··· 2282 2282 int i; 2283 2283 2284 2284 if (len < sizeof(*d) || 2285 - d->bFirstInterfaceNumber >= ffs->interfaces_count || 2286 - !d->Reserved1) 2285 + d->bFirstInterfaceNumber >= ffs->interfaces_count) 2287 2286 return -EINVAL; 2287 + if (d->Reserved1 != 1) { 2288 + /* 2289 + * According to the spec, Reserved1 must be set to 1 2290 + * but older kernels incorrectly rejected non-zero 2291 + * values. We fix it here to avoid returning EINVAL 2292 + * in response to values we used to accept. 2293 + */ 2294 + pr_debug("usb_ext_compat_desc::Reserved1 forced to 1\n"); 2295 + d->Reserved1 = 1; 2296 + } 2288 2297 for (i = 0; i < ARRAY_SIZE(d->Reserved2); ++i) 2289 2298 if (d->Reserved2[i]) 2290 2299 return -EINVAL;
+10
drivers/usb/gadget/legacy/Kconfig
··· 13 13 # both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 14 14 # 15 15 16 + menuconfig USB_GADGET_LEGACY 17 + bool "Legacy USB Gadget Support" 18 + help 19 + Legacy USB gadgets are USB gadgets that do not use the USB gadget 20 + configfs interface. 21 + 22 + if USB_GADGET_LEGACY 23 + 16 24 config USB_ZERO 17 25 tristate "Gadget Zero (DEVELOPMENT)" 18 26 select USB_LIBCOMPOSITE ··· 498 490 499 491 Say "y" to link the driver statically, or "m" to build a 500 492 dynamically linked module called "g_webcam". 493 + 494 + endif
-1
drivers/usb/gadget/udc/bdc/bdc_core.c
··· 642 642 static struct platform_driver bdc_driver = { 643 643 .driver = { 644 644 .name = BRCM_BDC_NAME, 645 - .owner = THIS_MODULE, 646 645 .pm = &bdc_pm_ops, 647 646 .of_match_table = bdc_of_match, 648 647 },
+6 -2
drivers/usb/gadget/udc/core.c
··· 1069 1069 static inline void usb_gadget_udc_set_speed(struct usb_udc *udc, 1070 1070 enum usb_device_speed speed) 1071 1071 { 1072 - if (udc->gadget->ops->udc_set_speed) 1073 - udc->gadget->ops->udc_set_speed(udc->gadget, speed); 1072 + if (udc->gadget->ops->udc_set_speed) { 1073 + enum usb_device_speed s; 1074 + 1075 + s = min(speed, udc->gadget->max_speed); 1076 + udc->gadget->ops->udc_set_speed(udc->gadget, s); 1077 + } 1074 1078 } 1075 1079 1076 1080 /**
+1 -1
drivers/usb/gadget/udc/renesas_usb3.c
··· 252 252 #define USB3_EP0_SS_MAX_PACKET_SIZE 512 253 253 #define USB3_EP0_HSFS_MAX_PACKET_SIZE 64 254 254 #define USB3_EP0_BUF_SIZE 8 255 - #define USB3_MAX_NUM_PIPES 30 255 + #define USB3_MAX_NUM_PIPES 6 /* This includes PIPE 0 */ 256 256 #define USB3_WAIT_US 3 257 257 #define USB3_DMA_NUM_SETTING_AREA 4 258 258 /*
+1 -1
drivers/usb/host/ehci-dbg.c
··· 827 827 default: /* unknown */ 828 828 break; 829 829 } 830 - temp = (cap >> 8) & 0xff; 830 + offset = (cap >> 8) & 0xff; 831 831 } 832 832 } 833 833 #endif
+7
drivers/usb/host/xhci-mem.c
··· 934 934 if (!vdev) 935 935 return; 936 936 937 + if (vdev->real_port == 0 || 938 + vdev->real_port > HCS_MAX_PORTS(xhci->hcs_params1)) { 939 + xhci_dbg(xhci, "Bad vdev->real_port.\n"); 940 + goto out; 941 + } 942 + 937 943 tt_list_head = &(xhci->rh_bw[vdev->real_port - 1].tts); 938 944 list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) { 939 945 /* is this a hub device that added a tt_info to the tts list */ ··· 953 947 } 954 948 } 955 949 } 950 + out: 956 951 /* we are now at a leaf device */ 957 952 xhci_debugfs_remove_slot(xhci, slot_id); 958 953 xhci_free_virt_device(xhci, slot_id);
+8 -4
drivers/usb/host/xhci-ring.c
··· 2477 2477 */ 2478 2478 if (list_empty(&ep_ring->td_list)) { 2479 2479 /* 2480 - * A stopped endpoint may generate an extra completion 2481 - * event if the device was suspended. Don't print 2482 - * warnings. 2480 + * Don't print wanings if it's due to a stopped endpoint 2481 + * generating an extra completion event if the device 2482 + * was suspended. Or, a event for the last TRB of a 2483 + * short TD we already got a short event for. 2484 + * The short TD is already removed from the TD list. 2483 2485 */ 2486 + 2484 2487 if (!(trb_comp_code == COMP_STOPPED || 2485 - trb_comp_code == COMP_STOPPED_LENGTH_INVALID)) { 2488 + trb_comp_code == COMP_STOPPED_LENGTH_INVALID || 2489 + ep_ring->last_td_was_short)) { 2486 2490 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", 2487 2491 TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), 2488 2492 ep_index);
+3
drivers/usb/serial/option.c
··· 238 238 /* These Quectel products use Quectel's vendor ID */ 239 239 #define QUECTEL_PRODUCT_EC21 0x0121 240 240 #define QUECTEL_PRODUCT_EC25 0x0125 241 + #define QUECTEL_PRODUCT_BG96 0x0296 241 242 242 243 #define CMOTECH_VENDOR_ID 0x16d8 243 244 #define CMOTECH_PRODUCT_6001 0x6001 ··· 1182 1181 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), 1183 1182 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1184 1183 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), 1184 + .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1185 + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), 1185 1186 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 1186 1187 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, 1187 1188 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
+2
drivers/usb/serial/usb_debug.c
··· 31 31 }; 32 32 33 33 static const struct usb_device_id dbc_id_table[] = { 34 + { USB_DEVICE(0x1d6b, 0x0010) }, 34 35 { USB_DEVICE(0x1d6b, 0x0011) }, 35 36 { }, 36 37 }; 37 38 38 39 static const struct usb_device_id id_table_combined[] = { 39 40 { USB_DEVICE(0x0525, 0x127a) }, 41 + { USB_DEVICE(0x1d6b, 0x0010) }, 40 42 { USB_DEVICE(0x1d6b, 0x0011) }, 41 43 { }, 42 44 };
+4
drivers/usb/storage/uas-detect.h
··· 112 112 } 113 113 } 114 114 115 + /* All Seagate disk enclosures have broken ATA pass-through support */ 116 + if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2) 117 + flags |= US_FL_NO_ATA_1X; 118 + 115 119 usb_stor_adjust_quirks(udev, &flags); 116 120 117 121 if (flags & US_FL_IGNORE_UAS) {
+46 -8
drivers/usb/typec/Kconfig
··· 1 1 2 - menu "USB Power Delivery and Type-C drivers" 2 + menuconfig TYPEC 3 + tristate "USB Type-C Support" 4 + help 5 + USB Type-C Specification defines a cable and connector for USB where 6 + only one type of plug is supported on both ends, i.e. there will not 7 + be Type-A plug on one end of the cable and Type-B plug on the other. 8 + Determination of the host-to-device relationship happens through a 9 + specific Configuration Channel (CC) which goes through the USB Type-C 10 + cable. The Configuration Channel may also be used to detect optional 11 + Accessory Modes - Analog Audio and Debug - and if USB Power Delivery 12 + is supported, the Alternate Modes, where the connector is used for 13 + something else then USB communication. 3 14 4 - config TYPEC 5 - tristate 15 + USB Power Delivery Specification defines a protocol that can be used 16 + to negotiate the voltage and current levels with the connected 17 + partners. USB Power Delivery allows higher voltages then the normal 18 + 5V, up to 20V, and current up to 5A over the cable. The USB Power 19 + Delivery protocol is also used to negotiate the optional Alternate 20 + Modes when they are supported. USB Power Delivery does not depend on 21 + USB Type-C connector, however it is mostly used together with USB 22 + Type-C connectors. 23 + 24 + USB Type-C and USB Power Delivery Specifications define a set of state 25 + machines that need to be implemented in either software or firmware. 26 + Simple USB Type-C PHYs, for example USB Type-C Port Controller 27 + Interface Specification compliant "Port Controllers" need the state 28 + machines to be handled in the OS, but stand-alone USB Type-C and Power 29 + Delivery controllers handle the state machines inside their firmware. 30 + The USB Type-C and Power Delivery controllers usually function 31 + autonomously, and do not necessarily require drivers. 32 + 33 + Enable this configurations option if you have USB Type-C connectors on 34 + your system and 1) you know your USB Type-C hardware requires OS 35 + control (a driver) to function, or 2) if you need to be able to read 36 + the status of the USB Type-C ports in your system, or 3) if you need 37 + to be able to swap the power role (decide are you supplying or 38 + consuming power over the cable) or data role (host or device) when 39 + both roles are supported. 40 + 41 + For more information, see the kernel documentation for USB Type-C 42 + Connector Class API (Documentation/driver-api/usb/typec.rst) 43 + <https://www.kernel.org/doc/html/latest/driver-api/usb/typec.html> 44 + and ABI (Documentation/ABI/testing/sysfs-class-typec). 45 + 46 + if TYPEC 6 47 7 48 config TYPEC_TCPM 8 49 tristate "USB Type-C Port Controller Manager" 9 50 depends on USB 10 - select TYPEC 11 51 help 12 52 The Type-C Port Controller Manager provides a USB PD and USB Type-C 13 53 state machine for use with Type-C Port Controllers. ··· 62 22 depends on INTEL_SOC_PMIC 63 23 depends on INTEL_PMC_IPC 64 24 depends on BXT_WC_PMIC_OPREGION 65 - select TYPEC 66 25 help 67 26 This driver adds support for USB Type-C detection on Intel Broxton 68 27 platforms that have Intel Whiskey Cove PMIC. The driver can detect the ··· 70 31 To compile this driver as module, choose M here: the module will be 71 32 called typec_wcove 72 33 73 - endif 34 + endif # TYPEC_TCPM 74 35 75 36 source "drivers/usb/typec/ucsi/Kconfig" 76 37 77 38 config TYPEC_TPS6598X 78 39 tristate "TI TPS6598x USB Power Delivery controller driver" 79 40 depends on I2C 80 - select TYPEC 81 41 help 82 42 Say Y or M here if your system has TI TPS65982 or TPS65983 USB Power 83 43 Delivery controller. ··· 84 46 If you choose to build this driver as a dynamically linked module, the 85 47 module will be called tps6598x.ko. 86 48 87 - endmenu 49 + endif # TYPEC
-1
drivers/usb/typec/ucsi/Kconfig
··· 1 1 config TYPEC_UCSI 2 2 tristate "USB Type-C Connector System Software Interface driver" 3 3 depends on !CPU_BIG_ENDIAN 4 - select TYPEC 5 4 help 6 5 USB Type-C Connector System Software Interface (UCSI) is a 7 6 specification for an interface that allows the operating system to
-1
drivers/usb/usbip/vhci_hcd.c
··· 1098 1098 static int vhci_setup(struct usb_hcd *hcd) 1099 1099 { 1100 1100 struct vhci *vhci = *((void **)dev_get_platdata(hcd->self.controller)); 1101 - hcd->self.sg_tablesize = ~0; 1102 1101 if (usb_hcd_is_primary_hcd(hcd)) { 1103 1102 vhci->vhci_hcd_hs = hcd_to_vhci_hcd(hcd); 1104 1103 vhci->vhci_hcd_hs->vhci = vhci;
+3
include/uapi/linux/usb/ch9.h
··· 880 880 __u8 bReserved; 881 881 } __attribute__((packed)); 882 882 883 + #define USB_DT_USB_WIRELESS_CAP_SIZE 11 884 + 883 885 /* USB 2.0 Extension descriptor */ 884 886 #define USB_CAP_TYPE_EXT 2 885 887 ··· 1074 1072 __u8 bDevCapabilityType; 1075 1073 } __attribute__((packed)); 1076 1074 1075 + #define USB_DT_USB_PTM_ID_SIZE 3 1077 1076 /* 1078 1077 * The size of the descriptor for the Sublink Speed Attribute Count 1079 1078 * (SSAC) specified in bmAttributes[4:0].
+11 -3
tools/usb/usbip/libsrc/vhci_driver.c
··· 329 329 int usbip_vhci_get_free_port(uint32_t speed) 330 330 { 331 331 for (int i = 0; i < vhci_driver->nports; i++) { 332 - if (speed == USB_SPEED_SUPER && 333 - vhci_driver->idev[i].hub != HUB_SPEED_SUPER) 334 - continue; 332 + 333 + switch (speed) { 334 + case USB_SPEED_SUPER: 335 + if (vhci_driver->idev[i].hub != HUB_SPEED_SUPER) 336 + continue; 337 + break; 338 + default: 339 + if (vhci_driver->idev[i].hub != HUB_SPEED_HIGH) 340 + continue; 341 + break; 342 + } 335 343 336 344 if (vhci_driver->idev[i].status == VDEV_ST_NULL) 337 345 return vhci_driver->idev[i].port;