NetBSD-Bugs archive

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

kern/37687: [PATCH] quirks of USB_MATCH logic change



>Number:         37687
>Category:       kern
>Synopsis:       change requrest of umass quirks logic in USB_MATCH()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 04 06:45:00 +0000 2008
>Originator:     Yojiro UO
>Release:        NetBSD 4.99.48 (20080104)
>Organization:
        
>Environment:
System: NetBSD robohoc-ha 4.99.48 NetBSD 4.99.48 (ALIX) #225: Fri Jan 4 
03:03:33 JST 2008 
yuo%ns.robohoc.net@localhost:/Volumes/work/Users2/yuo/ROBOHOC/NetBSD-original/src/sys/arch/i386/compile/obj/ALIX
 i386
Architecture: i386
Machine: i386
>Description:
        current umass-quirks can only specify a retern value of USB_MATCH().
        And once umass_quirks entry added to quriks table, flexibility of
        USB_MATCH() stage are limitted.
        Some umass device need to more flexible logic even though umass-qurik
        are used.
        This tiny patch enable to specify to use original USB_MATCH() logic
        when the quriks in use.

>How-To-Repeat:
>Fix:
        apply attached patch


Index: umass.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umass.c,v
retrieving revision 1.125
diff -u -r1.125 umass.c
--- umass.c     9 Dec 2007 20:28:24 -0000       1.125
+++ umass.c     4 Jan 2008 06:28:40 -0000
@@ -262,7 +262,7 @@
        const struct umass_quirk *quirk;
 
        quirk = umass_lookup(uaa->vendor, uaa->product);
-       if (quirk != NULL)
+       if (quirk != NULL && quirk->uq_match != UMASS_QUIRK_USE_DEFAULTMATCH)
                return (quirk->uq_match);
 
        if (uaa->class != UICLASS_MASS)
Index: umassvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umassvar.h,v
retrieving revision 1.25
diff -u -r1.25 umassvar.h
--- umassvar.h  9 Jan 2007 16:46:02 -0000       1.25
+++ umassvar.h  4 Jan 2008 06:28:40 -0000
@@ -180,6 +180,8 @@
 #define        UMASS_QUIRK_WRONG_CSWTAG        0x00000002
 #define        UMASS_QUIRK_RBC_PAD_TO_12       0x00000004
 
+#define        UMASS_QUIRK_USE_DEFAULTMATCH    -1
+
        u_int32_t               sc_busquirks;
 
        /* Bulk specific variables for transfers in progress */




Home | Main Index | Thread Index | Old Index