From owner-freebsd-usb@FreeBSD.ORG Tue May 24 21:19:33 2011 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 A691F106566C for ; Tue, 24 May 2011 21:19:33 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4D24B8FC08 for ; Tue, 24 May 2011 21:19:33 +0000 (UTC) Received: by gyg13 with SMTP id 13so3574423gyg.13 for ; Tue, 24 May 2011 14:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=ONJ2dfe69tDMfYDY+eOmgt8AK/d4cJhhZRDZw46Ja3U=; b=vzKic1yikU98YS5U5rhSvjGIyZ16gA1ZUaOBb5x4tEr/AXQiYOhjp8+Loi4EOmi5Y8 S/bj98fg4sY8SGY0yJkMOrU/i0I6DDWDkQxgtoV9u9D5v15vrZ/Bq0Dz4zrciG23shk7 tnnsN4sbO1gRk3yWwBQtUkg+TwuyoFo4rSKoM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=Z2bwHTKN5ZDCgt7MFapKMO+SgX5OUtCECnDuGwU56dN8xvgTmQBWzKmTUpPPedXdEv cOs0uIQUlXEdwgSJoAXm2lLtk5Lk57YH0r6Hnj6LFHp6ldq7yxN5+iBkF7RxyxZ7HLOY JC7RHJMDHq0VYUPYfXVZGS7k+73d0N6ZxXDvI= Received: by 10.236.201.233 with SMTP id b69mr5268157yho.468.1306271972412; Tue, 24 May 2011 14:19:32 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id 65sm3399705yhl.85.2011.05.24.14.19.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 14:19:31 -0700 (PDT) Message-ID: <4DDC20DF.6060805@gmail.com> Date: Tue, 24 May 2011 16:19:27 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org Subject: traditional syscalls with DRIVER_MODULE ???? 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: Tue, 24 May 2011 21:19:33 -0000 i'm in the process of both learning the driver interface and writing a usb driver for a multimedia product. i'm kind of stuck here, as i'm seeing two distinct, and possibly mutually exclusive interfaces here. the test framework i'm currently using is the DRIVER_MODULE macro, but it lacks the traditional syscalls provided by cdevsw (in particular, i'm wanting open, close, poll, read, and write). if i add such an interface to the current DRIVER_MODULE version, how would i go about *NOT* having DRIVER_MODULE create the devfs entries? i would prefer to have the devfs entries handled by make_dev, so to have access to the desired syscalls. the only thing in the usb framework using the cdevsw framework seems to be usb_dev.c, but it seems to be an abstraction, and not an end-device in the sense that i'm doing. any tips? any pointers? i've done a grep, and found that there is no existing driver that uses DRIVER_MODULE with any *_read, *_write, or *_close. i can do the job with ioctls, but doing so would rule out select in userland code, and for the interrupt endpoints, i would rather have a poll and read interface that allows for select(2) and read(2). also, i would like to thank hans selasky for the pointer to his meetbsd/krakow presentation on the usb stack, i did learn a couple of new things about capabilities from it, but it lacked the detail i'm looking for. jim