Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Add a quirk for devices that lie about how they ...



details:   https://anonhg.NetBSD.org/src/rev/e0b644d1f45d
branches:  trunk
changeset: 477103:e0b644d1f45d
user:      augustss <augustss%NetBSD.org@localhost>
date:      Mon Oct 11 09:16:39 1999 +0000

description:
Add a quirk for devices that lie about how they are powered.

diffstat:

 sys/dev/usb/usb_quirks.h |  3 ++-
 sys/dev/usb/usb_subr.c   |  5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r ae17567b6c43 -r e0b644d1f45d sys/dev/usb/usb_quirks.h
--- a/sys/dev/usb/usb_quirks.h  Mon Oct 11 09:15:34 1999 +0000
+++ b/sys/dev/usb/usb_quirks.h  Mon Oct 11 09:16:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_quirks.h,v 1.7 1999/06/26 00:09:15 augustss Exp $  */
+/*     $NetBSD: usb_quirks.h,v 1.8 1999/10/11 09:16:39 augustss Exp $  */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@
 #define UQ_MS_REVZ     0x04    /* mouse has Z-axis reversed */
 #define UQ_NO_STRINGS  0x08    /* string descriptors are broken. */
 #define UQ_BAD_ADC     0x10    /* bad audio spec version number. */
+#define UQ_BUS_POWERED 0x20    /* device is bus powered, despite claim */
 };
 
 extern struct usbd_quirks usbd_no_quirk;
diff -r ae17567b6c43 -r e0b644d1f45d sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Mon Oct 11 09:15:34 1999 +0000
+++ b/sys/dev/usb/usb_subr.c    Mon Oct 11 09:16:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.48 1999/09/16 19:20:34 augustss Exp $   */
+/*     $NetBSD: usb_subr.c,v 1.49 1999/10/11 09:16:39 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -578,7 +578,8 @@
                goto bad;
        }
        selfpowered = 0;
-       if (cdp->bmAttributes & UC_SELF_POWERED) {
+       if (!(dev->quirks->uq_flags & UQ_BUS_POWERED) &&
+           cdp->bmAttributes & UC_SELF_POWERED) {
                /* May be self powered. */
                if (cdp->bmAttributes & UC_BUS_POWERED) {
                        /* Must ask device. */



Home | Main Index | Thread Index | Old Index