available device interfaces is called 'bNumInterfaces'.
ok phessler@, thfr@ (who provided the man page diff)
-.\" $OpenBSD: ugen.4,v 1.17 2016/05/24 05:47:16 mpi Exp $
+.\" $OpenBSD: ugen.4,v 1.18 2021/01/27 17:28:19 mglocker Exp $
.\" $NetBSD: ugen.4,v 1.7 1999/07/30 01:32:05 augustss Exp $
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: May 24 2016 $
+.Dd $Mdocdate: January 27 2021 $
.Dt UGEN 4
.Os
.Sh NAME
can be found by iterating the
.Fa interface_index
from 0 to
-.Fa config_desc->bNumInterface-1
+.Fa config_desc->bNumInterfaces-1
and for each of these iterating the
.Fa endpoint_index
from 0 to
-/* $OpenBSD: ugen.c,v 1.111 2021/01/27 08:32:46 mglocker Exp $ */
+/* $OpenBSD: ugen.c,v 1.112 2021/01/27 17:28:19 mglocker Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
}
memset(sc->sc_endpoints, 0, sizeof sc->sc_endpoints);
- for (ifaceno = 0; ifaceno < cdesc->bNumInterface; ifaceno++) {
+ for (ifaceno = 0; ifaceno < cdesc->bNumInterfaces; ifaceno++) {
DPRINTFN(1,("ugen_set_config: ifaceno %d\n", ifaceno));
if (usbd_iface_claimed(sc->sc_udev, ifaceno)) {
DPRINTF(("%s: iface %d not available\n", __func__,
DPRINTFN(15, ("ugen_set_interface %d %d\n", ifaceidx, altno));
cdesc = usbd_get_config_descriptor(sc->sc_udev);
- if (ifaceidx < 0 || ifaceidx >= cdesc->bNumInterface ||
+ if (ifaceidx < 0 || ifaceidx >= cdesc->bNumInterfaces ||
usbd_iface_claimed(sc->sc_udev, ifaceidx))
return (USBD_INVAL);
-/* $OpenBSD: uplcom.c,v 1.76 2020/11/13 13:04:53 patrick Exp $ */
+/* $OpenBSD: uplcom.c,v 1.77 2021/01/27 17:28:19 mglocker Exp $ */
/* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* BulkIN(0x02) |
* BulkOUT(0x83) |
*/
- if (cdesc->bNumInterface == 2) {
+ if (cdesc->bNumInterfaces == 2) {
err = usbd_device2interface_handle(dev,
UPLCOM_SECOND_IFACE_INDEX, &sc->sc_iface);
if (err) {
-/* $OpenBSD: usb.h,v 1.61 2018/07/19 12:35:14 mpi Exp $ */
+/* $OpenBSD: usb.h,v 1.62 2021/01/27 17:28:19 mglocker Exp $ */
/* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
uByte bLength;
uByte bDescriptorType;
uWord wTotalLength;
- uByte bNumInterface;
+ uByte bNumInterfaces;
uByte bConfigurationValue;
uByte iConfiguration;
uByte bmAttributes;
-/* $OpenBSD: usb_subr.c,v 1.152 2020/08/27 19:34:37 mglocker Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.153 2021/01/27 17:28:19 mglocker Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
if (dev->config != USB_UNCONFIG_NO) {
DPRINTF(("%s: free old config\n", __func__));
/* Free all configuration data structures. */
- nifc = dev->cdesc->bNumInterface;
+ nifc = dev->cdesc->bNumInterfaces;
for (ifcidx = 0; ifcidx < nifc; ifcidx++)
usbd_free_iface_data(dev, ifcidx);
free(dev->ifaces, M_USB, nifc * sizeof(*dev->ifaces));
}
/* Allocate and fill interface data. */
- nifc = cdp->bNumInterface;
+ nifc = cdp->bNumInterfaces;
dev->ifaces = mallocarray(nifc, sizeof(*dev->ifaces), M_USB,
M_NOWAIT | M_ZERO);
if (dev->ifaces == NULL) {
goto fail;
}
- nifaces = dev->cdesc->bNumInterface;
+ nifaces = dev->cdesc->bNumInterfaces;
uaa.configno = dev->cdesc->bConfigurationValue;
ifaces = mallocarray(nifaces, sizeof(*ifaces), M_USB, M_NOWAIT);
if (ifaces == NULL) {
if (dev->default_pipe != NULL)
usbd_close_pipe(dev->default_pipe);
if (dev->ifaces != NULL) {
- nifc = dev->cdesc->bNumInterface;
+ nifc = dev->cdesc->bNumInterfaces;
for (ifcidx = 0; ifcidx < nifc; ifcidx++)
usbd_free_iface_data(dev, ifcidx);
free(dev->ifaces, M_USB, nifc * sizeof(*dev->ifaces));
-/* $OpenBSD: usbdi.c,v 1.106 2020/04/03 20:11:47 patrick Exp $ */
+/* $OpenBSD: usbdi.c,v 1.107 2021/01/27 17:28:19 mglocker Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
{
if (dev->cdesc == NULL)
return (USBD_NOT_CONFIGURED);
- if (ifaceno >= dev->cdesc->bNumInterface)
+ if (ifaceno >= dev->cdesc->bNumInterfaces)
return (USBD_INVAL);
*iface = &dev->ifaces[ifaceno];
return (USBD_NORMAL_COMPLETION);
-/* $OpenBSD: uvideo.c,v 1.210 2020/11/17 12:39:56 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.211 2021/01/27 17:28:19 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
printf("bLength=%d\n", d->bLength);
printf("bDescriptorType=0x%02x\n", d->bDescriptorType);
printf("wTotalLength=%d\n", UGETW(d->wTotalLength));
- printf("bNumInterface=0x%02x\n", d->bNumInterface);
+ printf("bNumInterfaces=0x%02x\n", d->bNumInterfaces);
printf("bConfigurationValue=0x%02x\n", d->bConfigurationValue);
printf("iConfiguration=0x%02x\n", d->iConfiguration);
printf("bmAttributes=0x%02x\n", d->bmAttributes);