Device with two interfaces - what is the probing order?
Hi all,
Given a USB Wifi device with two "identical" interfaces, in what order are the interfaces probed? Is the order guaranteed?
The driver uses these:
static const struct usb_device_id rtl8192d_usb_ids[] = {
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x0bda,
.idProduct = 0x8193,
.driver_info = (kernel_ulong_t)&rtl92du_hal_cfg
},
{}
};static struct usb_driver rtl8192du_driver = {
.name = "rtl8192du",
.probe = rtl8192du_probe,
.disconnect = rtl_usb_disconnect,
.id_table = rtl8192d_usb_ids,
.disable_hub_initiated_lpm = 1,
};The device looks like this:
Bus 003 Device 004: ID 0bda:8193 Realtek Semiconductor Corp. RTL8192DU 802.11an WLAN Adapter Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0bda Realtek Semiconductor Corp. idProduct 0x8193 RTL8192DU 802.11an WLAN Adapter bcdDevice 0.00 iManufacturer 1 Realtek iProduct 2 801.11n NIC iSerial 3 ... bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0037
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x89 EP 9 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x0a EP 10 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
Quoted 4 lines · Bitterblue Smith
Hi all,
Given a USB Wifi device with two "identical" interfaces, in what order are the interfaces probed? Is the order guaranteed?
They are probed in the order that they are listed in the Get-Config-Descriptor output. But this is not guaranteed.
Alan Stern
Quoted 10 lines · Alan Stern
Quoted 4 lines · Bitterblue Smith
Hi all,
Given a USB Wifi device with two "identical" interfaces, in what order are the interfaces probed? Is the order guaranteed?
They are probed in the order that they are listed in the Get-Config-Descriptor output. But this is not guaranteed.
Alan Stern
Is it guaranteed that they are probed one at a time, not in parallel?
Oh, and what about the disconnect function? Is that guaranteed to be called not in parallel?
Greg KH
maintainerQuoted 7 lines · Bitterblue Smith
Quoted 6 lines · Alan Stern
Quoted 4 lines · Bitterblue Smith
Hi all,
Given a USB Wifi device with two "identical" interfaces, in what order are the interfaces probed? Is the order guaranteed?
Quoted 6 lines
Quoted 4 lines
They are probed in the order that they are listed in the Get-Config-Descriptor output. But this is not guaranteed.
Alan Stern
Is it guaranteed that they are probed one at a time, not in parallel?
Yes, all USB probes are in sequence.
Quoted 1 line
Oh, and what about the disconnect function? Is that guaranteed to be called not in parallel?
Yes.
hope this helps,
greg k-h
Quoted 17 lines · Greg KH
Quoted 7 lines · Bitterblue Smith
Quoted 6 lines · Alan Stern
Quoted 4 lines · Bitterblue Smith
Hi all,
Given a USB Wifi device with two "identical" interfaces, in what order are the interfaces probed? Is the order guaranteed?
Quoted 6 lines
Quoted 4 lines
They are probed in the order that they are listed in the Get-Config-Descriptor output. But this is not guaranteed.
Alan Stern
Is it guaranteed that they are probed one at a time, not in parallel?
Yes, all USB probes are in sequence.
Quoted 7 lines
Quoted 1 line
Oh, and what about the disconnect function? Is that guaranteed to be called not in parallel?
Yes.
hope this helps,
greg k-h
That's very helpful. Thank you both.