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 simple kvm integer toggle to control ugen ...



details:   https://anonhg.NetBSD.org/src/rev/bae5e61b5ff1
branches:  trunk
changeset: 747625:bae5e61b5ff1
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Sep 24 22:33:04 2009 +0000

description:
Add a simple kvm integer toggle to control ugen priority and override
the autoconf flags value.  This helps to change the priority at
runtime.  (XXX: is there a better way to do this?)

diffstat:

 sys/dev/usb/ugen.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 0ce7e3b41d9c -r bae5e61b5ff1 sys/dev/usb/ugen.c
--- a/sys/dev/usb/ugen.c        Thu Sep 24 21:36:42 2009 +0000
+++ b/sys/dev/usb/ugen.c        Thu Sep 24 22:33:04 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ugen.c,v 1.104 2009/09/24 15:36:59 pooka Exp $ */
+/*     $NetBSD: ugen.c,v 1.105 2009/09/24 22:33:04 pooka Exp $ */
 
 /*
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.104 2009/09/24 15:36:59 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.105 2009/09/24 22:33:04 pooka Exp $");
 
 #include "opt_ugen_bulk_ra_wb.h"
 #include "opt_compat_netbsd.h"
@@ -205,11 +205,20 @@
 
 USB_DECLARE_DRIVER(ugen);
 
+/* toggle to control attach priority. -1 means "let autoconf decide" */
+int ugen_override = -1;
+
 USB_MATCH(ugen)
 {
        USB_MATCH_START(ugen, uaa);
+       int override;
 
-       if (match->cf_flags & 1)
+       if (ugen_override != -1)
+               override = ugen_override;
+       else
+               override = match->cf_flags & 1;
+
+       if (override)
                return (UMATCH_HIGHEST);
        else if (uaa->usegeneric)
                return (UMATCH_GENERIC);



Home | Main Index | Thread Index | Old Index