From owner-freebsd-usb@FreeBSD.ORG Fri Aug 22 19:48:47 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DE19106567E for ; Fri, 22 Aug 2008 19:48:47 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from mother.ludd.ltu.se (mother.ludd.ltu.se [130.240.16.3]) by mx1.freebsd.org (Postfix) with ESMTP id CFD8E8FC1D for ; Fri, 22 Aug 2008 19:48:46 +0000 (UTC) (envelope-from pb@ludd.ltu.se) Received: from brother.ludd.ltu.se (root@brother.ludd.ltu.se [130.240.16.78]) by mother.ludd.ltu.se (8.13.6+Sun/8.12.10) with ESMTP id m7MJmg3a029455 for ; Fri, 22 Aug 2008 21:48:42 +0200 (MEST) Received: from brother.ludd.ltu.se (pb@localhost [127.0.0.1]) by brother.ludd.ltu.se (8.13.6+Sun/8.12.2) with ESMTP id m7MJmgPL004099 for ; Fri, 22 Aug 2008 21:48:42 +0200 (MEST) Received: (from pb@localhost) by brother.ludd.ltu.se (8.13.6+Sun/8.13.6/Submit) id m7MJmglt004097 for freebsd-usb@freebsd.org; Fri, 22 Aug 2008 21:48:42 +0200 (MEST) From: Peter B Message-Id: <200808221948.m7MJmglt004097@brother.ludd.ltu.se> To: freebsd-usb@freebsd.org Date: Fri, 22 Aug 2008 21:48:42 +0200 (MEST) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: usb match() function X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2008 19:48:47 -0000 Within the usb drivers (/usr/src/sys/dev/usb/u*.c) there's an matching routine where the 'uaa->iface' is supposed to be assigned before the routine is called. However for a new device or class this doesn't seem to work. Instead 'uaa' is set like for an generic device (two interfaces, no "default" in my case). So how is one supposed to make the kernel fill in 'uaa->iface' ..? Code excerpt: static int *_match(device_t self) { struct usb_attach_arg *uaa = device_get_ivars(self); usb_interface_descriptor_t *id; DPRINTFN(10,("*_match\n")); if (uaa->iface == NULL) return (UMATCH_NONE);