From owner-freebsd-arch@FreeBSD.ORG Wed Sep 17 14:03:06 2003 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 C764B16A4B3; Wed, 17 Sep 2003 14:03:06 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F99043F75; Wed, 17 Sep 2003 14:03:05 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h8HL8Obi001784; Wed, 17 Sep 2003 17:08:24 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h8HL2a5T078700; Wed, 17 Sep 2003 14:02:36 -0700 (PDT) (envelope-from jmg) Date: Wed, 17 Sep 2003 14:02:36 -0700 From: John-Mark Gurney To: Robert Watson Message-ID: <20030917210236.GB75714@funkthat.com> Mail-Followup-To: Robert Watson , Poul-Henning Kamp , bms@spc.org, "M. Warner Losh" , freebsd-arch@freebsd.org References: <30912.1063828673@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: bms@spc.org cc: Poul-Henning Kamp cc: "M. Warner Losh" cc: freebsd-arch@freebsd.org Subject: Re: devd limitations / automounting removable storage X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2003 21:03:06 -0000 Robert Watson wrote this message on Wed, Sep 17, 2003 at 16:19 -0400: > > Apart from that, it's just a matter of telling me how to send the > > event... > > This is a very similar concern to the question I raised at BSDCon about > distinguishing network interfaces at the newbus and network service > levels. My temptation would be to assign a "layer" as well as a device > name to devices when they are announced. I.e., > > Layer Device Meaning > newbus xl0 A device named xl0 is now available > devfs net/xl0 A device node named net/xl0 is now available > ifnet xl0 A network interface named xl0 is now available > newbus ad0 A device named ad0 is now available > devfs ad0 A device node named ad0 is now available > geom ad0 A storage device named ad0 is now available > > We might skip the devfs layer since it's probably implicit in the > completion of ifnet_attach() and disk_create(), but it's worth thinking > about. This would allow ifconfig commands to be issued once the network > device is available, rather than once newbus has attached an xl0. Or for > geom to announce ad0s1e even though newbus doesn't know about it. Or for > devd to handle the introduction of synthetic interfaces such as vlan, tun, > etc, which aren't visible to newbus. Or for the device driver names and > interface names to differ (or for a non-one-one mapping, interface > renames, etc). I was thinking about a more generic event posting mechanism, where modules can register to receive notifications when events came in. We should have each event contain: system (enum/int) subsystem? (enum/int) event (enum/int) device (char[64?]) additionaldata (void *, size_t combo) This means we can make it more extensible, and have a set of well defined system/subsystem/event triplets, while at the same time, letting future interfaces expand. The subsystem would be used for something like the network stack, which has multiple subsystems, like interface, routing, connections. The advantage is then we can reduce the number of /dev entries that convey the same information, but have different calling conventions. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."