diff options
author | Landry Breuil <landry@cvs.openbsd.org> | 2018-05-01 18:14:47 +0000 |
---|---|---|
committer | Landry Breuil <landry@cvs.openbsd.org> | 2018-05-01 18:14:47 +0000 |
commit | c9e7c3964bbfdc4be983152cc3929cacb3c94458 (patch) | |
tree | 8c92ed669fab71857f9537878a21c62e18f67021 /sys/dev/usb/uhid.c | |
parent | 9e3144e4e2a147d8448c24c92f9f1ee3036b9ae4 (diff) |
Simplify/refactor the way vendor/product/serial informations are
gathered from usb devices.
Cache them early in usbd_new_device() instead of querying the device
several times (the content wont change anyway) and uselessly generating
usb traffic (which could conflict with other access..)
The heuristic stays the same, first look in the device descriptor, then
try to match against usb_known_vendors/usb_known_products, then fallback
to use the idVendor/idProduct codes.
Remove the now useless 'usedev' parameter from usbd_fill_deviceinfo().
Tested from bsd & bsd.rd.
suggested by and ok mpi@
Diffstat (limited to 'sys/dev/usb/uhid.c')
-rw-r--r-- | sys/dev/usb/uhid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 547be4181d8..526f068b035 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.70 2017/12/30 20:46:59 guenther Exp $ */ +/* $OpenBSD: uhid.c,v 1.71 2018/05/01 18:14:46 landry Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -364,7 +364,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, case USB_GET_DEVICEINFO: usbd_fill_deviceinfo(sc->sc_hdev.sc_udev, - (struct usb_device_info *)addr, 1); + (struct usb_device_info *)addr); break; case USB_GET_REPORT_DESC: |