From owner-freebsd-arch@FreeBSD.ORG Wed Sep 1 18:14:56 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A847F16A4CE; Wed, 1 Sep 2004 18:14:56 +0000 (GMT) Received: from athena.softcardsystems.com (mail.softcardsystems.com [12.34.136.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6901E43D54; Wed, 1 Sep 2004 18:14:56 +0000 (GMT) (envelope-from sah@softcardsystems.com) Received: from athena (athena [12.34.136.114])i81JEnBW001866; Wed, 1 Sep 2004 14:14:50 -0500 Date: Wed, 1 Sep 2004 14:14:49 -0500 (EST) From: Sam X-X-Sender: sah@athena To: Brian Fundakowski Feldman In-Reply-To: <20040901170154.GG45292@green.homeunix.org> Message-ID: References: <20040901170154.GG45292@green.homeunix.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: freebsd-arch@freebsd.org Subject: Re: disk_create and cdevsw_add X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2004 18:14:56 -0000 On Wed, 1 Sep 2004, Brian Fundakowski Feldman wrote: > On Wed, Sep 01, 2004 at 12:32:58PM -0500, Sam wrote: >> 'lo again, >> >> kern/subr_disk.c:/^disk_create/ takes >> two cdevsw types, and I only vaguely >> understand why. Can someone explain it to me? >> >> I'm generally confused about resolving >> entry points into the driver. Does a >> block device only get an open() after >> registering it with disk_create? >> Supposing I want to set some ioctls for >> an aoecontrol utility (show all devices >> known, eg), what would aoecontrol open >> to ioctl? > > Create /dev/aoectl which exists only to do global aoe things; alternately, > you could use a sysctl interface, but that's not really as clean. I presume this means I should do a make_dev with a minor of 0 on module load as I see is recommended in DEV_MODULE(9). Should I then assume that unit 0 is this control file and be prepared to fail any strategy calls to it?