Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/usb/uhub.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/usb/uhub.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.18 retrieving revision 1.19 diff -u -p -r1.18 -r1.19 --- src/sys/dev/usb/uhub.c 1999/06/30 06:44:23 1.18 +++ src/sys/dev/usb/uhub.c 1999/08/14 14:49:32 1.19 @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.18 1999/06/30 06:44:23 augustss Exp $ */ +/* $NetBSD: uhub.c,v 1.19 1999/08/14 14:49:32 augustss Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -59,8 +59,8 @@ #include #ifdef USB_DEBUG -#define DPRINTF(x) if (usbdebug) printf x -#define DPRINTFN(n,x) if (usbdebug>(n)) printf x +#define DPRINTF(x) if (usbdebug) logprintf x +#define DPRINTFN(n,x) if (usbdebug>(n)) logprintf x extern int usbdebug; extern char *usbd_error_strs[]; #else @@ -257,6 +257,11 @@ uhub_init_port(up) /* First let the device go through a good power cycle, */ usbd_delay_ms(dev, USB_PORT_POWER_DOWN_TIME); +#if 0 +usbd_clear_hub_feature(dev, UHF_C_HUB_OVER_CURRENT); +usbd_clear_port_feature(dev, port, UHF_C_PORT_OVER_CURRENT); +#endif + /* then turn the power on. */ r = usbd_set_port_feature(dev, port, UHF_PORT_POWER); if (r != USBD_NORMAL_COMPLETION) @@ -272,6 +277,17 @@ uhub_init_port(up) r = usbd_get_port_status(dev, port, &up->status); if (r != USBD_NORMAL_COMPLETION) return (r); + DPRINTF(("usb_init_port: after power on status=0x%04x " + "change=0x%04x\n", + UGETW(up->status.wPortStatus), + UGETW(up->status.wPortChange))); + +#if 0 +usbd_clear_hub_feature(dev, UHF_C_HUB_OVER_CURRENT); +usbd_clear_port_feature(dev, port, UHF_C_PORT_OVER_CURRENT); +usbd_get_port_status(dev, port, &up->status); +#endif + pstatus = UGETW(up->status.wPortStatus); if ((pstatus & UPS_PORT_POWER) == 0) printf("%s: port %d did not power up\n", @@ -537,5 +553,6 @@ uhub_intr(reqh, addr, status) } #if defined(__FreeBSD__) -DRIVER_MODULE(uhub, usb, uhub_driver, uhub_devclass, usbd_driver_load, 0); +DRIVER_MODULE(uhub, usb, uhubroot_driver, uhubroot_devclass, 0, 0); +DRIVER_MODULE(uhub, uhub, uhub_driver, uhub_devclass, usbd_driver_load, 0); #endif