Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Check that the hub ports actually power up.
details: https://anonhg.NetBSD.org/src/rev/76839a98b33c
branches: trunk
changeset: 473676:76839a98b33c
user: augustss <augustss%NetBSD.org@localhost>
date: Mon Jun 14 16:59:47 1999 +0000
description:
Check that the hub ports actually power up.
diffstat:
sys/dev/usb/uhub.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (35 lines):
diff -r b8258dee4995 -r 76839a98b33c sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c Mon Jun 14 08:53:06 1999 +0000
+++ b/sys/dev/usb/uhub.c Mon Jun 14 16:59:47 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhub.c,v 1.16 1999/01/10 19:13:15 augustss Exp $ */
+/* $NetBSD: uhub.c,v 1.17 1999/06/14 16:59:47 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -278,9 +278,6 @@
r = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
if (r != USBD_NORMAL_COMPLETION)
return (r);
- r = usbd_get_port_status(dev, port, &up->status);
- if (r != USBD_NORMAL_COMPLETION)
- return (r);
DPRINTF(("usb_init_port: turn on port %d power status=0x%04x "
"change=0x%04x\n",
port, UGETW(up->status.wPortStatus),
@@ -288,6 +285,15 @@
/* Wait for stable power. */
usbd_delay_ms(dev, dev->hub->hubdesc.bPwrOn2PwrGood *
UHD_PWRON_FACTOR);
+ /* Get the port status again. */
+ r = usbd_get_port_status(dev, port, &up->status);
+ if (r != USBD_NORMAL_COMPLETION)
+ return (r);
+ pstatus = UGETW(up->status.wPortStatus);
+ if ((pstatus & UPS_PORT_POWER) == 0)
+ printf("%s: port %d did not power up\n",
+ USBDEVNAME(((struct uhub_softc *)dev->hub->hubsoftc)->sc_dev), port);
+
}
if (dev->self_powered)
/* Self powered hub, give ports maximum current. */
Home |
Main Index |
Thread Index |
Old Index