hb.c revision 1.1 1
2 #include <sys/param.h>
3 #include <sys/systm.h>
4 #include <sys/device.h>
5
6 #include <machine/autoconf.h>
7 #include <machine/adrsmap.h>
8
9 static int hb_match __P((struct device *, struct cfdata *, void *));
10 static void hb_attach __P((struct device *, struct device *, void *));
11 static int hb_print __P((void *, const char *));
12
13 struct cfattach hb_ca = {
14 sizeof(struct device), hb_match, hb_attach
15 };
16
17 extern struct cfdriver hb_cd;
18
19 static int
20 hb_match(parent, cf, aux)
21 struct device *parent;
22 struct cfdata *cf;
23 void *aux;
24 {
25 struct confargs *ca = aux;
26
27 if (strcmp(ca->ca_name, hb_cd.cd_name) != 0)
28 return 0;
29
30 return 1;
31 }
32
33 static char *hbdevs[] = {
34 "clock",
35 "fb",
36 "zsc",
37 "kb",
38 "ms",
39 "le",
40 "sc",
41 NULL
42 };
43
44 static void
45 hb_attach(parent, self, aux)
46 struct device *parent;
47 struct device *self;
48 void *aux;
49 {
50 struct confargs ca;
51 char **p = hbdevs;
52
53 printf("\n");
54 bzero(&ca, sizeof(ca));
55
56 while (*p) {
57 ca.ca_name = *p;
58 config_found(self, &ca, hb_print);
59 p++;
60 }
61 }
62
63 /*
64 * Print out the confargs. The (parent) name is non-NULL
65 * when there was no match found by config_found().
66 */
67 static int
68 hb_print(args, name)
69 void *args;
70 const char *name;
71 {
72 #if 0
73 struct confargs *ca = args;
74 #endif
75
76 /* Be quiet about empty HB locations. */
77 if (name)
78 return(QUIET);
79
80 #if 0
81 if (ca->ca_addr != -1)
82 printf(" addr 0x%x", ca->ca_addr);
83 #endif
84
85 return(UNCONF);
86 }
87
88