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.
This commit is contained in:
ws 2018-03-05 09:35:01 +00:00
parent 589a0b0fde
commit eac3b33f4f
2 changed files with 8 additions and 9 deletions

View File

@ -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 needs-flag
# 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

View File

@ -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 match, void *aux)
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