1 /* $NetBSD: clkinit.c,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
4 ** dynamically loadable clk driver
6 ** william robertson <rob@agate.berkeley.edu>
11 #include <sys/errno.h>
12 #include <sys/stream.h>
13 #include <sys/syslog.h>
15 #include <sun/openprom.h>
16 #include <sun/vddrv.h>
18 extern int findmod(); /* os/str_io.c */
20 extern struct streamtab clkinfo
;
29 xxxinit(function_code
, vdp
, vdi
, vds
)
30 unsigned int function_code
;
38 switch (function_code
) {
41 if (findmod("clk") >= 0) {
42 log(LOG_ERR
, "clk stream module already loaded\n");
48 if (i
== -1 || fmodsw
[i
].f_name
[0] != '\0')
51 for (j
= 0; vd
.Drv_name
[j
] != '\0'; j
++) /* XXX check bounds */
52 fmodsw
[i
].f_name
[j
] = vd
.Drv_name
[j
];
54 fmodsw
[i
].f_name
[j
] = '\0';
55 fmodsw
[i
].f_str
= &clkinfo
;
57 vdp
->vdd_vdtab
= (struct vdlinkage
*) &vd
;
62 if ((i
= findmod(vd
.Drv_name
)) == -1)
65 fmodsw
[i
].f_name
[0] = '\0';