1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

MFp4 //depot/projects/usb@159948

Add more debugging output on enumeration failures.

Submitted by:	Hans Petter Selasky
This commit is contained in:
Andrew Thompson 2009-04-05 18:21:31 +00:00
parent 4565300d56
commit 03797f3300
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=190739
2 changed files with 12 additions and 11 deletions

View File

@ -1505,10 +1505,6 @@ usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
udev->speed = speed;
udev->flags.usb2_mode = usb2_mode;
/* speed combination should be checked by the parent HUB */
hub = udev->parent_hub;
/* search for our High Speed USB HUB, if any */
adev = udev;
@ -1564,7 +1560,8 @@ usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
*/
if (err) {
DPRINTFN(0, "set address %d failed "
"(ignored)\n", udev->address);
"(%s, ignored)\n", udev->address,
usb2_errstr(err));
}
/* allow device time to set new address */
usb2_pause_mtx(NULL,
@ -1600,7 +1597,8 @@ usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0);
if (err) {
DPRINTFN(0, "getting device descriptor "
"at addr %d failed!\n", udev->address);
"at addr %d failed, %s!\n", udev->address,
usb2_errstr(err));
/* XXX try to re-enumerate the device */
err = usb2_req_re_enumerate(udev, NULL);
if (err) {

View File

@ -1487,7 +1487,8 @@ usb2_req_re_enumerate(struct usb2_device *udev, struct mtx *mtx)
retry:
err = usb2_req_reset_port(parent_hub, mtx, udev->port_no);
if (err) {
DPRINTFN(0, "addr=%d, port reset failed\n", old_addr);
DPRINTFN(0, "addr=%d, port reset failed, %s\n",
old_addr, usb2_errstr(err));
goto done;
}
/*
@ -1505,8 +1506,8 @@ usb2_req_re_enumerate(struct usb2_device *udev, struct mtx *mtx)
err = usb2_req_set_address(udev, mtx, old_addr);
if (err) {
/* XXX ignore any errors! */
DPRINTFN(0, "addr=%d, set address failed! (ignored)\n",
old_addr);
DPRINTFN(0, "addr=%d, set address failed! (%s, ignored)\n",
old_addr, usb2_errstr(err));
}
/* restore device address */
udev->address = old_addr;
@ -1519,14 +1520,16 @@ usb2_req_re_enumerate(struct usb2_device *udev, struct mtx *mtx)
USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0);
if (err) {
DPRINTFN(0, "getting device descriptor "
"at addr %d failed!\n", udev->address);
"at addr %d failed, %s!\n", udev->address,
usb2_errstr(err));
goto done;
}
/* get the full device descriptor */
err = usb2_req_get_device_desc(udev, mtx, &udev->ddesc);
if (err) {
DPRINTFN(0, "addr=%d, getting device "
"descriptor failed!\n", old_addr);
"descriptor failed, %s!\n", old_addr,
usb2_errstr(err));
goto done;
}
done: