xref: /netbsd/sys/arch/sun68k/stand/libsa/devopen.c (revision 6550d01e)
1 /*	$NetBSD: devopen.c,v 1.3 2005/12/11 12:19:29 christos Exp $	*/
2 
3 
4 #include <sys/types.h>
5 #include <machine/mon.h>
6 
7 #include <stand.h>
8 #include "libsa.h"
9 
10 /*
11  * Open the device named by the combined device/file name
12  * given as the "fname" arg, something like: "sd()netbsd"
13  *
14  * However, Sun PROMs don't really let you choose which
15  * device you will talk to.  You can only open the device
16  * that was used to load the boot program.  Therefore, we
17  * do not accept a "device" part in the "fname" string.
18  * Pass the PROM device name to open in case it needs it.
19  */
20 int
21 devopen(struct open_file *f, const char *fname, char **file)
22 {
23 	struct devsw *dp;
24 	int error;
25 
26 	*file = (char*)fname;
27 	dp = &devsw[0];
28 	f->f_dev = dp;
29 	error = (*dp->dv_open)(f, prom_bootdev);
30 
31 	return (error);
32 }
33