-/* $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 $ */
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);
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,
-/* $OpenBSD: xhci.c,v 1.14 2014/07/09 15:54:39 mpi Exp $ */
+/* $OpenBSD: xhci.c,v 1.15 2014/07/10 11:47:14 mpi Exp $ */
/*
* Copyright (c) 2014 Martin Pieuchot
if (addr == 0)
return (EINVAL);
- DPRINTF(("%s: dev %d new addr %d\n", DEVNAME(sc), slot, addr));
-
- dev->address = addr;
- dev->bus->devices[addr] = dev;
+ DPRINTF(("%s: dev %d internal addr %d\n", DEVNAME(sc), slot, addr));
return (0);
}