diff options
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
| -rw-r--r-- | sys/dev/usb/usb_subr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 2bdeaeb6053..2bf4124fba2 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_subr.c,v 1.102 2014/07/09 18:15:04 mpi Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.103 2014/07/10 11:47:14 mpi 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 $ */ @@ -828,9 +828,6 @@ usbd_set_address(struct usbd_device *dev, int addr) if (usbd_do_request(dev, &req, 0)) return (1); - dev->address = addr; - dev->bus->devices[addr] = dev; - /* Allow device time to set new address */ usbd_delay_ms(dev, USB_SET_ADDRESS_SETTLE); @@ -1200,6 +1197,13 @@ usbd_new_device(struct device *parent, struct usbd_bus *bus, int depth, return (USBD_SET_ADDR_FAILED); } + /* + * If this device is attached to an xHCI controller, this + * address does not correspond to the hardware one. + */ + dev->address = addr; + bus->devices[addr] = dev; + /* Re-establish the default pipe with the new address. */ usbd_close_pipe(dev->default_pipe); err = usbd_setup_pipe(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL, |
