diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2011-01-16 22:35:30 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2011-01-16 22:35:30 +0000 |
commit | bf7dd43b0ff651c5b7ba593bceb215dc29ad45d7 (patch) | |
tree | 45e6e943d25ebc8148bddd5d6a8250fbb43a6d85 /sys/dev/usb/if_cdce.c | |
parent | 3ea785dfac3b842c38d5b36eb3a32b8af8086460 (diff) |
* instead of NULLing pointers to interface descriptors in the uaa, mark
interfaces as being claimed in the usbd_device's copy of the interface
descriptors
* allow ugen(4) to be attached if there are unused interfaces in a
configuration that has had drivers attached
* make ugen(4) aware that it may be sharing a device with (an)other
driver(s), and if so:
* do not let ugen(4) change the configuration
* do not let ugen(4) access the already claimed interfaces
discussed with deraadt and miod
Diffstat (limited to 'sys/dev/usb/if_cdce.c')
-rw-r--r-- | sys/dev/usb/if_cdce.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index cb91ba3e0b9..2e91ec8c0bb 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdce.c,v 1.47 2010/10/27 17:51:11 jakemsr Exp $ */ +/* $OpenBSD: if_cdce.c,v 1.48 2011/01/16 22:35:29 jakemsr Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -224,12 +224,12 @@ cdce_attach(struct device *parent, struct device *self, void *aux) DPRINTF(("cdce_attach: union interface: ctl=%d, data=%d\n", ctl_ifcno, data_ifcno)); for (i = 0; i < uaa->nifaces; i++) { - if (uaa->ifaces[i] == NULL) + if (usbd_iface_claimed(sc->cdce_udev, i)) continue; id = usbd_get_interface_descriptor(uaa->ifaces[i]); if (id != NULL && id->bInterfaceNumber == data_ifcno) { sc->cdce_data_iface = uaa->ifaces[i]; - uaa->ifaces[i] = NULL; + usbd_claim_iface(sc->cdce_udev, i); } } } |