diff options
-rw-r--r-- | sys/dev/usb/ubser.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/udbp.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/ufm.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/ugen.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/uhid.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uhub.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/ukbd.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/ulpt.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/umass.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/ums.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/urio.c | 1 | ||||
-rw-r--r-- | sys/dev/usb/usb_port.h | 13 | ||||
-rw-r--r-- | sys/dev/usb/usb_subr.c | 14 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.h | 3 | ||||
-rw-r--r-- | sys/dev/usb/uscanner.c | 1 |
15 files changed, 29 insertions, 28 deletions
diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c index 34cee90..eab35be 100644 --- a/sys/dev/usb/ubser.c +++ b/sys/dev/usb/ubser.c @@ -257,7 +257,6 @@ USB_ATTACH(ubser) devinfo = malloc(1024, M_USBDEV, M_WAITOK); usbd_devinfo(udev, 0, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); DPRINTFN(10,("\nubser_attach: sc=%p\n", sc)); diff --git a/sys/dev/usb/udbp.c b/sys/dev/usb/udbp.c index cc8cc82..2bedbbe 100644 --- a/sys/dev/usb/udbp.c +++ b/sys/dev/usb/udbp.c @@ -267,10 +267,8 @@ USB_ATTACH(udbp) /* fetch the interface handle for the first interface */ (void) usbd_device2interface_handle(uaa->device, 0, &iface); id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; - printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), - devinfo, id->bInterfaceClass, id->bInterfaceSubClass); /* Find the two first bulk endpoints */ for (i = 0 ; i < id->bNumEndpoints; i++) { diff --git a/sys/dev/usb/ufm.c b/sys/dev/usb/ufm.c index db5531d..66b7376 100644 --- a/sys/dev/usb/ufm.c +++ b/sys/dev/usb/ufm.c @@ -160,7 +160,6 @@ USB_ATTACH(ufm) DPRINTFN(10,("ufm_attach: sc=%p\n", sc)); usbd_devinfo(uaa->device, 0, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); sc->sc_udev = udev = uaa->device; diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 732c29a..4ff006f 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -215,7 +215,6 @@ USB_ATTACH(ugen) usbd_devinfo(uaa->device, 0, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); sc->sc_udev = udev = uaa->device; diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 72d5fac..3258963 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -210,10 +210,8 @@ USB_ATTACH(uhid) sc->sc_udev = uaa->device; sc->sc_iface = iface; id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; - printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), - devinfo, id->bInterfaceClass, id->bInterfaceSubClass); ed = usbd_interface2endpoint_descriptor(iface, 0); if (ed == NULL) { diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 2e99a1f..aebc3ed 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -180,7 +180,6 @@ USB_ATTACH(uhub) sc->sc_hub = dev; usbd_devinfo(dev, 1, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); err = usbd_set_config_index(dev, 0, 1); if (err) { diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index 50f695b..d1eea00 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -171,10 +171,8 @@ USB_ATTACH(ukbd) USB_ATTACH_ERROR_RETURN; id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; - printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), - devinfo, id->bInterfaceClass, id->bInterfaceSubClass); arg[0] = (void *)uaa; arg[1] = (void *)ukbd_intr; diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index e89cf23..4be53b3 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -226,10 +226,8 @@ USB_ATTACH(ulpt) int i, altno; DPRINTFN(10,("ulpt_attach: sc=%p\n", sc)); - usbd_devinfo(dev, 0, devinfo); + usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; - printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), - devinfo, ifcd->bInterfaceClass, ifcd->bInterfaceSubClass); /* XXX * Stepping through the alternate settings needs to be abstracted out. diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 040964d..32802b3 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -875,7 +875,6 @@ USB_ATTACH(umass) (void) umass_match_proto(sc, sc->iface, uaa->device); id = usbd_get_interface_descriptor(sc->iface); - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); #ifdef USB_DEBUG printf("%s: ", USBDEVNAME(sc->sc_dev)); switch (sc->proto&UMASS_PROTO_COMMAND) { diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index a9d0fc0..ff9ab5a 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -214,10 +214,8 @@ USB_ATTACH(ums) sc->sc_disconnected = 1; sc->sc_iface = iface; id = usbd_get_interface_descriptor(iface); - usbd_devinfo(uaa->device, 0, devinfo); + usbd_devinfo(uaa->device, USBD_SHOW_INTERFACE_CLASS, devinfo); USB_ATTACH_SETUP; - printf("%s: %s, iclass %d/%d\n", USBDEVNAME(sc->sc_dev), - devinfo, id->bInterfaceClass, id->bInterfaceSubClass); ed = usbd_interface2endpoint_descriptor(iface, 0); if (!ed) { printf("%s: could not read endpoint descriptor\n", diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 117b307..f2df650 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -200,7 +200,6 @@ USB_ATTACH(urio) DPRINTFN(10,("urio_attach: sc=%p\n", sc)); usbd_devinfo(uaa->device, 0, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); sc->sc_udev = udev = uaa->device; diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index abfac81..95bb8adc 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -134,7 +134,8 @@ void __CONCAT(dname,_attach)(struct device *parent, struct device *self, void *a #define USB_ATTACH_ERROR_RETURN return #define USB_ATTACH_SUCCESS_RETURN return -#define USB_ATTACH_SETUP printf("\n") +#define USB_ATTACH_SETUP + printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); #define USB_DETACH(dname) \ int __CONCAT(dname,_detach)(struct device *self, int flags) @@ -301,7 +302,8 @@ __CONCAT(dname,_attach)(parent, self, aux) \ #define USB_ATTACH_ERROR_RETURN return #define USB_ATTACH_SUCCESS_RETURN return -#define USB_ATTACH_SETUP printf("\n") +#define USB_ATTACH_SETUP + printf("\n%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); #define USB_DETACH(dname) \ int \ @@ -474,8 +476,11 @@ __CONCAT(dname,_attach)(device_t self) #define USB_ATTACH_SUCCESS_RETURN return 0 #define USB_ATTACH_SETUP \ - sc->sc_dev = self; \ - device_set_desc_copy(self, devinfo) + do { \ + sc->sc_dev = self; \ + device_set_desc_copy(self, devinfo); \ + device_printf(self, "%s\n", devinfo); \ + } while (0); #define USB_DETACH(dname) \ Static int \ diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 3f50e63..6b930d1 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -321,15 +321,17 @@ void usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) { usb_device_descriptor_t *udd = &dev->ddesc; + usbd_interface_handle iface; char vendor[USB_MAX_STRING_LEN]; char product[USB_MAX_STRING_LEN]; int bcdDevice, bcdUSB; + usb_interface_descriptor_t *id; usbd_devinfo_vp(dev, vendor, product, 1); cp += sprintf(cp, "%s %s", vendor, product); - if (showclass) + if (showclass & USBD_SHOW_DEVICE_CLASS) cp += sprintf(cp, ", class %d/%d", - udd->bDeviceClass, udd->bDeviceSubClass); + udd->bDeviceClass, udd->bDeviceSubClass); bcdUSB = UGETW(udd->bcdUSB); bcdDevice = UGETW(udd->bcdDevice); cp += sprintf(cp, ", rev "); @@ -337,6 +339,14 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) *cp++ = '/'; cp += usbd_printBCD(cp, bcdDevice); cp += sprintf(cp, ", addr %d", dev->address); + if (showclass & USBD_SHOW_INTERFACE_CLASS) + { + /* fetch the interface handle for the first interface */ + (void)usbd_device2interface_handle(dev, 0, &iface); + id = usbd_get_interface_descriptor(iface); + cp += sprintf(cp, ", iclass %d/%d", + id->bInterfaceClass, id->bInterfaceSubClass); + } *cp = 0; } diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index b9e1c1e..0fd24fe 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -263,6 +263,9 @@ struct usb_attach_arg { #endif +#define USBD_SHOW_DEVICE_CLASS 0x1 +#define USBD_SHOW_INTERFACE_CLASS 0x2 + #if defined(__FreeBSD__) int usbd_driver_load(module_t mod, int what, void *arg); #endif diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c index a06aac4..fad3dc1 100644 --- a/sys/dev/usb/uscanner.c +++ b/sys/dev/usb/uscanner.c @@ -313,7 +313,6 @@ USB_ATTACH(uscanner) usbd_devinfo(uaa->device, 0, devinfo); USB_ATTACH_SETUP; - printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); sc->sc_dev_flags = uscanner_lookup(uaa->vendor, uaa->product)->flags; |