diff options
author | 2015-07-09 12:23:17 +0000 | |
---|---|---|
committer | 2015-07-09 12:23:17 +0000 | |
commit | 823ac0dc605bb727c0c485597535ef2f14ee9a92 (patch) | |
tree | 155a564b46f75fc5222adeab0578655b90dbfb80 | |
parent | Fix documentation error: rtwn(4) loads firmware on if up, not if attach. (diff) | |
download | wireguard-openbsd-823ac0dc605bb727c0c485597535ef2f14ee9a92.tar.xz wireguard-openbsd-823ac0dc605bb727c0c485597535ef2f14ee9a92.zip |
Do not use usbd_endpoint_count(), this function is almost unused and
creates confusion. Do like the rest of the drivers and simply get a
interface descriptor with usbd_get_interface_descriptor().
Tested by stsp@
-rw-r--r-- | sys/dev/usb/ulpt.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 3694ede6bc8..f083ca26dfc 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.50 2015/03/14 03:38:50 jsg Exp $ */ +/* $OpenBSD: ulpt.c,v 1.51 2015/07/09 12:23:17 mpi Exp $ */ /* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -216,7 +216,6 @@ ulpt_attach(struct device *parent, struct device *self, void *aux) usb_config_descriptor_t *cdesc; usbd_status err; usb_endpoint_descriptor_t *ed; - u_int8_t epcount; int i, altno; DPRINTFN(10,("ulpt_attach: sc=%p\n", sc)); @@ -268,12 +267,12 @@ ulpt_attach(struct device *parent, struct device *self, void *aux) } } - epcount = 0; - (void)usbd_endpoint_count(iface, &epcount); sc->sc_in = -1; sc->sc_out = -1; - for (i = 0; i < epcount; i++) { + + id = usbd_get_interface_descriptor(iface); + for (i = 0; i < id->bNumEndpoints; i++) { ed = usbd_interface2endpoint_descriptor(iface, i); if (ed == NULL) { printf("%s: couldn't get ep %d\n", |