xref: /netbsd-src/sys/arch/mvme68k/stand/netboot/devopen.c (revision 2a399c6883d870daece976daec6ffa7bb7f934ce)
1 /*	$NetBSD: devopen.c,v 1.1 1996/05/17 21:18:07 chuck 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 	char *cp, *path, *devname;
24 	int error;
25 
26 	*file = (char*)fname;
27 	dp = &devsw[0];
28 	f->f_dev = dp;
29 	error = (*dp->dv_open)(f, NULL);
30 
31 	return (error);
32 }
33