Module Name:    src
Committed By:   ws
Date:           Mon Mar  5 09:35:01 UTC 2018

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

Log Message:
Fix last:

Since config(1) could not distinguish between device and
interface attachments, it was generating only the latter.
Thus devices without their own driver wouldn't match the
ugen driver anymore.

Fix this by using a different device name for interface attachments.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.138 -r1.139 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/files.usb
diff -u src/sys/dev/usb/files.usb:1.149 src/sys/dev/usb/files.usb:1.150
--- src/sys/dev/usb/files.usb:1.149	Tue Feb 20 15:48:37 2018
+++ src/sys/dev/usb/files.usb	Mon Mar  5 09:35:01 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.usb,v 1.149 2018/02/20 15:48:37 ws Exp $
+#	$NetBSD: files.usb,v 1.150 2018/03/05 09:35:01 ws Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -138,8 +138,9 @@ file	dev/usb/ucom.c			ucom | ucombus		ne
 # Generic devices
 device	ugen
 attach	ugen at usbdevif
-attach	ugen at usbifif with ugenif
-file	dev/usb/ugen.c			ugen			needs-flag
+device	ugenif
+attach	ugenif at usbifif
+file	dev/usb/ugen.c			ugen | ugenif		needs-flag
 
 
 # HID

Index: src/sys/dev/usb/ugen.c
diff -u src/sys/dev/usb/ugen.c:1.138 src/sys/dev/usb/ugen.c:1.139
--- src/sys/dev/usb/ugen.c:1.138	Tue Feb 20 15:48:37 2018
+++ src/sys/dev/usb/ugen.c	Mon Mar  5 09:35:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ugen.c,v 1.138 2018/02/20 15:48:37 ws Exp $	*/
+/*	$NetBSD: ugen.c,v 1.139 2018/03/05 09:35:01 ws 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.138 2018/02/20 15:48:37 ws Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.139 2018/03/05 09:35:01 ws Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -218,10 +218,8 @@ ugen_match(device_t parent, cfdata_t mat
 int
 ugenif_match(device_t parent, cfdata_t match, void *aux)
 {
-	if (match->cf_flags & 1)
-		return UMATCH_HIGHEST;
-	else
-		return UMATCH_NONE;
+	/* Assume that they knew what they configured! (see ugenif(4)) */
+	return UMATCH_HIGHEST;
 }
 
 void

Reply via email to