Subject: Re: CFR: The Auto-Generation Block/Character Device Switch Tables
To: MAEKAWA Masahide <gehenna@netbsd.org>
From: John Franklin <franklin@elfie.org>
List: tech-kern
Date: 05/14/2002 12:40:21
On Thu, May 09, 2002 at 06:37:35PM +0900, MAEKAWA Masahide wrote:
> For config(8):
> In order to support this feature, a new grammer 'device-major' is added to
> 'files'.  All 'device-major' is put within the new machine-dependent file
> 'majors.<ARCH>' under sys/arch/<ARCH>/conf, which is included from
> 'files.<ARCH>'. This is the only file which contains the device number
> definitions.
> 
> To support the dynamic assignment of the device major, devsw_attach(9) and
> devsw_detach(9) are added; these can be used to attach/detach the device
> switch data dynamically instead of memcpy. These functions are useful for
> LKM framework.

I like it.  It maintains compatibility with the existing setup while
making independent device driver development and LKMs less dependent on
global lists.  Ultimately, I think devfs is the way to go, but until
devfs is ported and 100% adopted (which may take a long time), this is
A Good Thing.

Two points:

First, how similar is the devsw_attach(9) API to the devfs registration
API?  If they were identical, this would be a win for drivers as they'd
be source (and binary?) compatible which would ease adoption of devfs.
Easing the transition to devfs would make this An Even Better Thing.

Second, even though it would change the device numbers for some devices
on some ports, I echo Darren Reed's call to make it a single MI list,
rather than a list per port under /sys/arch/<ARCH>/conf, perhaps
allocating a section of majors for MD devices.

(Darren, I read your post right, yes?)

jf
-- 
John Franklin
franklin@elfie.org
ICBM: 35°43'56"N 78°53'27"W