Subject: Re: Locator values and usage
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Martin Husemann <>
List: tech-kern
Date: 07/31/1997 07:50:18
Jonathan Stone wrote:

> Uh, locators are intended for use at both match and attach time.
> They're provided at match time via the third argument to your
> device-attach routine.  Cast the void* argument to (in our example) a
> ``struct isdnbus_attach_args *''
> The names and order of locators in the structure are of course derived
> from the order you declare them in a config file.

Either I don't understand the last sentence or I must have overlooked something
and be doing it completely wrong. What I'm doing is:

1) Someway the ISDN card is found and attached. At Attach time it's driver
   fills a "struct isdncontroller ic" (which I defined myself) and calls 
   "config_found(self, &ic, isdnprint)".
2) config_found (indirectly) calls the isdnbus match routine, where I get
   struct cfdata *cf as second argument (hidden as a void* due to 
   __BROKEN_INDIRECT_CONFIG being defined). My match routine currently always
   returns 1, but that will change, as it has to match some real values for
   cards supporting multiple ISDN interfaces.
3) Then the isdnbus attach routine is called, which gets the "&ic" handed to
   config_found in (1) as "void *aux".

So does your statement imply I should not define my own attach args structure
and config(8) will do it for me? Or should I copy the necessary information
to my homemade attach args structure before passing it to config_found? How
would I get to the config file values at that point?

Or is this all a consequence of my misunderstanding how locators should be
used? I guess this all works quite well if I use the physical interface number
(on a multi-interface card) as a locator, iterate over all physicaly available
interface and setting the current interface number in the attach args structure
for every call to config_found.

P.S.: The usual question at this point: any pointers to documentation of 
our current auto config system?