summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usbdivar.h
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2016-05-18 18:28:58 +0000
committerpatrick <patrick@openbsd.org>2016-05-18 18:28:58 +0000
commit2261702e3e2071d9ebf81d37fead1cc3f6b7f5be (patch)
treed521e1a1cf935ff78975b372d18845939f2a4018 /sys/dev/usb/usbdivar.h
parentupdate links; from ray (diff)
downloadwireguard-openbsd-2261702e3e2071d9ebf81d37fead1cc3f6b7f5be.tar.xz
wireguard-openbsd-2261702e3e2071d9ebf81d37fead1cc3f6b7f5be.zip
Cache vendor, product and serial info for each usb device. This allows
ioctl(USB_DEVICEINFO) not to issue any further requests to gather information. Thus reducing stress on connected usb devices. This fixes an issue where usbdevs called in a loop causes a USB mass storage device to halt operation. Adapted from a similar commit in NetBSD. ok mpi@
Diffstat (limited to 'sys/dev/usb/usbdivar.h')
-rw-r--r--sys/dev/usb/usbdivar.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/usb/usbdivar.h b/sys/dev/usb/usbdivar.h
index 3a7bac3c48c..59c42f0dcda 100644
--- a/sys/dev/usb/usbdivar.h
+++ b/sys/dev/usb/usbdivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdivar.h,v 1.69 2014/12/21 12:04:01 mpi Exp $ */
+/* $OpenBSD: usbdivar.h,v 1.70 2016/05/18 18:28:58 patrick Exp $ */
/* $NetBSD: usbdivar.h,v 1.70 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdivar.h,v 1.11 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -150,6 +150,10 @@ struct usbd_device {
struct usbd_hub *hub; /* only if this is a hub */
struct device **subdevs; /* sub-devices, 0 terminated */
int ndevs; /* # of subdevs */
+
+ char *serial; /* serial number, can be NULL */
+ char *vendor; /* vendor string, can be NULL */
+ char *product; /* product string, can be NULL */
};
struct usbd_interface {
@@ -229,6 +233,7 @@ void usbd_dump_pipe(struct usbd_pipe *);
/* Routines from usb_subr.c */
int usbctlprint(void *, const char *);
+void usbd_get_device_strings(struct usbd_device *);
void usb_delay_ms(struct usbd_bus *, u_int);
usbd_status usbd_port_disown_to_1_1(struct usbd_device *, int);
int usbd_reset_port(struct usbd_device *, int);