Subject: auxp info; Forwarded from Chris Hopps
To: None <amiga-dev@sun-lamp.cs.berkeley.edu>
From: None <rhealey@aggregate.com>
List: amiga-dev
Date: 05/23/1994 15:30:44
	Below is some info Chris sent me to clearify the life of the auxp
	variable. We thought it might be useful to others so I'm forwarding
	it to the list.

		-Rob

> auxp is a generic pointer to the parents configure args. it shouldn't be
> NULL, unless the drivers parent passes NULL.  e.g.:
> 
> void
> mbattach(pdp, dp, auxp)
>         struct device *pdp, *dp;
>         void *auxp;
> {
>         printf ("\n");
>         config_found(dp, "clock", simple_devprint);
>         config_found(dp, "ser", simple_devprint);
>         config_found(dp, "par", simple_devprint);
>         config_found(dp, "kbd", simple_devprint);
>         config_found(dp, "fdc", simple_devprint);
>         config_found(dp, "grfcc", simple_devprint);
>         config_found(dp, "ztwobus", simple_devprint);
>         if (is_a3000())
>                 config_found(dp, "ahsc", simple_devprint);
>         if (is_a3000() || is_a4000()) {
>                 config_found(dp, "zthreebus", simple_devprint);
>         }
>         if (is_a4000())
>                 config_found(dp, "idesc", simple_devprint);
> }
> 
> In the case of mainbus its args are strings.  Whereas with ztwobus
> its args are: (ztwobusvar.h)
> struct ztwobus_args {
>         void *pa;
>         void *va;
>         int size;
>         int slot;
>         int manid;
>         int prodid;
>         int serno;
> };
> 
> so a match function for a zorro two board would do something like:
> #include <amiga/dev/ztwobusvar.h>
> .
> .
> .
> 
> int
> foomatch(pdp, cfp, auxp)
> 	struct device *pdp;
> 	struct cfdata *cfp;
> 	void *auxp;
> {
> 	struct ztwobus_args *zap;
> 
> 	zap = auxp;
> 	if (zap->manid != FOMANID || zap->prodid != FOOPRODID)
> 		return(0);
> 	.
> 	.
> 	.
> 
> matchname() is just a utility routine that I use to exactly match 2 strings
> strncmp will match strings of non-equal len if they are similar to the 
> NUL byte.
> 
> Does that help? (I can provide assistance with this stuff as it is new
> to everyone)
> 
> Chris.

------------------------------------------------------------------------------