From owner-freebsd-usb@FreeBSD.ORG Wed May 25 19:03:11 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 3523B106566B; Wed, 25 May 2011 19:03:11 +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 CC9898FC17; Wed, 25 May 2011 19:03:10 +0000 (UTC) Received: by gyg13 with SMTP id 13so4082819gyg.13 for ; Wed, 25 May 2011 12:03:10 -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:references:in-reply-to:content-type :content-transfer-encoding; bh=ag/0guOxoa5Do0k29gG/3XU8Gtu0r6GheQ/ld78rrf0=; b=NRYT5EcfNg9/ZFGzTdNHQ4xrIV/o8j/WLP4W5PIux/lOecKs5O5WP1WotqYTgTN2YS KOH1to79x7cQvYA/uFzwtKIiVgmRkWhwtU6TG011FhK5znsCQDgwc/U/jJ+Z9rYHfWdk 3L06lYcDEpH+Ek/ax36DsbkCqP7TZXmuvnnCQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=bphQSTpX5MMEUq4xgTlWvF3vg1X/1e/7/0gOx2mdiTTaKv/tpBQLqG8eKcTdsrf6Ka GDTu15LJUSg0Y8CjJgGY5tOCIz7PWBw+ipuph5dShPkYTNR9rPy40UjpIerzD58lGe0v P8/sciHNqSauLsOtr/2WR4G3V6WXhr1nuogS8= Received: by 10.236.191.200 with SMTP id g48mr7003420yhn.437.1306350190030; Wed, 25 May 2011 12:03:10 -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 f2sm79954ani.19.2011.05.25.12.02.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 12:03:08 -0700 (PDT) Message-ID: <4DDD5245.3040500@gmail.com> Date: Wed, 25 May 2011 14:02:29 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Hans Petter Selasky References: <4DDC20DF.6060805@gmail.com> <201105242324.15541.hselasky@c2i.net> In-Reply-To: <201105242324.15541.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org, freebsd-usb@freebsd.org Subject: Re: 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: Wed, 25 May 2011 19:03:11 -0000 do start_read/stop_read and start_write/stop_write map directly to the userland read(2) and write(2) calls? i had looked at this previously, and am a bit confused on if the above is correct. even if they are the direct interface to read(2)/write(2), the issue of a poll method for select(2) still exists... grepping all DRIVER_MODULE usages comes up with only two poll methods: powerpc/powermac/pmu.c: DEVMETHOD(adb_hb_controller_poll, pmu_poll), powerpc/powermac/cuda.c: DEVMETHOD(adb_hb_controller_poll, cuda_poll), and those are unhelpful. usb_fifo_methods doesn't seem to have a poll, how would i go about this? select(2) is a more familiar interface for application programmers to use for this purpose, instead of using an ioctl for the same functionality in a way that is not compatible with select(2). please excuse me if these are newbie questions, but, i'm still in the learning process. i can do this if there is a way to prevent DRIVER_MODULE from creating the devfs nodes, and instead do this in a hybrid way using DRIVER_MODULE and make_dev(9), which has the exact traditional functionality i want in this. any ideas? two of the three device nodes this driver will create will require read(2)/select(2) interfaces visible to userland, and the third driver will require write(2) visible to userland. the question is: is there a way to use DRIVER_MODULE, which seems necessary for usbdi, yet create the devfs nodes using make_dev/cdevsw? i would prefer to not have DRIVER_MODULE create the device nodes. am i missing something? i again apologize for the newbie questions... jim Hans Petter Selasky wrote: > On Tuesday 24 May 2011 23:19:27 Jim Bryant wrote: > >> 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. >> > > Look at /sys/dev/usb/serial/ulpt.c > > For a simple example. > > More abstract: > > "cd /usr/ports/multimedia/cuse4bsd" and "man libusb20" > > --HPS > >