Subject: how facilitate custom driver development: the cdevsw/conf.c problem
To: None <tech-kern@NetBSD.ORG>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: current-users
Date: 09/07/1997 20:30:41
-----BEGIN PGP SIGNED MESSAGE-----
I know we have been through this before, but perhaps without any
resolution. Certainly none that I'm aware of.
I am just updating my IPsec development tree to 1.2G from Friday.
I notice that the major device number that I was using is not the
planetconnect satlink device. No big deal, I can patch, but it really
annoys me that I need a private copy of conf.c.
[I realize that most of arch/foo/foo/conf.c could be generated,
but I don't think we are ready for that yet]
This is what I'd like to propose: conf.c will include two files
if a kernel compile option is set. The first file should contain
additional #includes and cdev_decl, and cdev_foo_init's if required.
The second file contains the necessary stubs for cdevsw.
Now, to avoid the problem with major numbers changing, I propose
that we pad cdevsw with a bunch of reserved numbers. We are at minor
number 45 on the i386. Do other ports have much higher values? I
padded up to minor number 64, and then put the include for the cdevsw.
[oops, it is zero based. I should have stopped at 63]
That way the first "custom" number occurs at 64, and will remain
like that for at least a release or two.
It is PR #kern/4094.
:!mcr!: | Network security programming, currently
Michael Richardson | on contract with DataFellows F-Secure IPSec
WWW: mcr@sandelman.ottawa.on.ca. PGP key available.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQB0AwUBNBNHL6ZpLyXYhL+BAQErCwL4sXsY0ZhWH/4SOruQG7kGI3NgcXhiDwfx
80kQEolV3MpQsW8WfvuwdkRfW0+rpdxalVvj/6aMD5/mk+Z50V0JM2B5C/SRVh7U
ZT6HBLTzqU0TOtDoPxg3hMFZ+J4HO3o=
=eyQd
-----END PGP SIGNATURE-----