Author: imp
Date: Sat Feb 17 06:57:17 2018
New Revision: 329440
URL: https://svnweb.freebsd.org/changeset/base/329440

Log:
  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@

Modified:
  head/sys/dev/usb/usb_hub.c
  head/sys/dev/usb/usbdi.h

Modified: head/sys/dev/usb/usb_hub.c
==============================================================================
--- head/sys/dev/usb/usb_hub.c  Sat Feb 17 06:57:12 2018        (r329439)
+++ head/sys/dev/usb/usb_hub.c  Sat Feb 17 06:57:17 2018        (r329440)
@@ -1733,7 +1733,12 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch
        }
        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 ch
                    "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,

Modified: head/sys/dev/usb/usbdi.h
==============================================================================
--- head/sys/dev/usb/usbdi.h    Sat Feb 17 06:57:12 2018        (r329439)
+++ head/sys/dev/usb/usbdi.h    Sat Feb 17 06:57:17 2018        (r329440)
@@ -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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to