From owner-freebsd-hackers@FreeBSD.ORG Mon May 29 15:01:29 2006 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A611B16A640 for ; Mon, 29 May 2006 15:01:29 +0000 (UTC) (envelope-from volker@vwsoft.com) Received: from Mail.elbekies.net (mail.elbekies.net [217.6.211.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0904443D48 for ; Mon, 29 May 2006 15:01:28 +0000 (GMT) (envelope-from volker@vwsoft.com) Received: from mail.vtec.ipme.de (gprs-pool-1-014.eplus-online.de [212.23.126.14]) by Mail.elbekies.net (Postfix) with ESMTP id 8592167870 for ; Mon, 29 May 2006 17:01:23 +0200 (CEST) Received: from [127.0.0.1] (unknown [192.168.201.3]) by mail.vtec.ipme.de (Postfix) with ESMTP id 28EDE2E51E for ; Mon, 29 May 2006 17:01:15 +0200 (CEST) Message-ID: <447B0CD3.1080309@vwsoft.com> Date: Mon, 29 May 2006 17:01:39 +0200 From: Volker User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.6.0.101 MIME-Version: 1.0 To: hackers@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-VWSoft-MailScanner: Found to be clean X-Elbekies-MailScanner: Found to be clean X-MailScanner-From: volker@vwsoft.com Cc: Subject: USB device with multiple interfaces, sample code anyone? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2006 15:01:30 -0000 Hi hackers, I'm trying to correctly implement a driver for an USB device which has multiple (serial) interfaces (at least 3). Each interface should be seen by the kernel as a tty device entry /dev(/cuaU* or /dev/ttyU*). After reading the usb kernel sources I'm not quite sure how to deal with that. As the device entry is being created in ucom.c (ucom_attach calls ttycreate) I'm not quite sure which code is responsible for scanning (enumerating) and correctly attaching to the usb device interfaces or if there's just a wrong enumeration return code. I haven't found any usb code which deals with more than 1 interface per usb device (except sound/pcm/uaudio but while doing a quick read of that code I do not understand much of uaudio). Does any of the hackers have a piece of sample code on how to scan usb device interfaces and attach a device file entry (/dev/) to it? Or any pseudo-code or graphical explanation on how the usb code is actually doing device enumeration? Thanks, Volker