Subject: Locator values and usage
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <martin@rumolt.teuto.de>
List: tech-kern
Date: 07/31/1997 01:02:11
I'm a bit confused about the cf_loc values in struct cfdata.
I would like to use them for some special runtime configuration options
on ISDN devices. This could look like this:
teles0 at isa? port 0xd80 irq 5 # the physical controller
isdnbus0 at teles0 # the "line" (BRI)
ipp0 at isdnbus0 bchannel 1 # the "PPP over ISDN" device
This would be usefull if ipp0 has a "leased line". The b-channel assignement
is usualy done dynamicaly by the exchange, but would be forced to the given
bchannel locator in the example. This value is used only at connection setup
time (a flag in the setup packet). It's got nothing todo with how to talk to
the hardware, it's not needed to identify, match or configure the device.
It's just a runtime option, that is not going to change during kernel runtime
- simmilar to SCSI target/lun <-> device mapping (yeah, we had that thread
several times).
What I'm not sure about is: (a) should the cf_loc values be used for this and
(b) how should that data given in the config file be looked up when the
driver needs it? An example of such a lookup could be found in
sys/ipkdb/ipkdb_if.c, where the "disabled" locator is queried by searching
through the cfdata array looking for the right driver name and unit number.
The values are conveniently passed at match ("probe") time, where they can't
be used in my case. They are quite hard to find later (e.g.: at attach time),
when they could be easily copied to a flag in struct softc...
If config file locators aren't the appreciated way to configure such options,
they may end in a userland config file parsed by the isdn management daemon,
which scatters the information but is not a realy problem (say: you wouldn't
specify phone numbers and passwords in a kernel config file).
Martin