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