Module Name:    src
Committed By:   pooka
Date:           Thu Sep 24 22:33:05 UTC 2009

Modified Files:
        src/sys/dev/usb: ugen.c

Log Message:
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?)


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/usb/ugen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.104 src/sys/dev/usb/ugen.c:1.105
--- src/sys/dev/usb/ugen.c:1.104	Thu Sep 24 15:36:59 2009
+++ src/sys/dev/usb/ugen.c	Thu Sep 24 22:33:04 2009
@@ -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 (ugen_override != -1)
+		override = ugen_override;
+	else
+		override = match->cf_flags & 1;
 
-	if (match->cf_flags & 1)
+	if (override)
 		return (UMATCH_HIGHEST);
 	else if (uaa->usegeneric)
 		return (UMATCH_GENERIC);

Reply via email to