Correct the PNP information generated by the usb driver to match the

artificial NOMATCH usb does in lieu of creating a device_t for devices
with no drivers. Also, correct bus to be 'uhub' since where USB
devices attach, even though 'usb' is more logical, we need the
physical bus here.

Submitted by: hps@
This commit is contained in:
Warner Losh 2018-02-17 06:57:17 +00:00
parent a164a319eb
commit 1e7e4fd25a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329440
2 changed files with 13 additions and 5 deletions

View File

@ -1733,7 +1733,12 @@ uhub_child_pnpinfo_string(device_t parent, device_t child,
}
iface = usbd_get_iface(res.udev, res.iface_index);
if (iface && iface->idesc) {
snprintf(buf, buflen, "vendor=0x%04x product=0x%04x "
snprintf(buf, buflen,
"bus=usb "
#if USB_HAVE_UGEN
"device=%s "
#endif
"vendor=0x%04x product=0x%04x "
"devclass=0x%02x devsubclass=0x%02x "
"devproto=0x%02x "
"sernum=\"%s\" "
@ -1741,6 +1746,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t child,
"mode=%s "
"intclass=0x%02x intsubclass=0x%02x "
"intprotocol=0x%02x" "%s%s",
#if USB_HAVE_UGEN
res.udev->ugen_name,
#endif
UGETW(res.udev->ddesc.idVendor),
UGETW(res.udev->ddesc.idProduct),
res.udev->ddesc.bDeviceClass,

View File

@ -337,18 +337,18 @@ struct usb_device_id {
} __aligned(32);
#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \
"U8:devclass;U8:devsubclass;U8:devprotocol;" \
"U8:devclass;U8:devsubclass;U8:devproto;" \
"U8:intclass;U8:intsubclass;U8:intprotocol;"
#define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;"
#define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;"
#define USB_PNP_HOST_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, usb, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, uhub, table, table, sizeof(table[0]), \
sizeof(table) / sizeof(table[0]))
#define USB_PNP_DEVICE_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, usb, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, uhub, table, table, sizeof(table[0]), \
sizeof(table) / sizeof(table[0]))
#define USB_PNP_DUAL_INFO(table) \
MODULE_PNP_INFO(USB_STD_PNP_INFO, usb, table, table, sizeof(table[0]), \
MODULE_PNP_INFO(USB_STD_PNP_INFO, uhub, table, table, sizeof(table[0]), \
sizeof(table) / sizeof(table[0]))
/* check that the size of the structure above is correct */