Home | History | Annotate | Line # | Download | only in libsa
devopen.c revision 1.1.8.2
      1 /*	$NetBSD: devopen.c,v 1.1.8.2 2001/06/14 12:57:15 fredette 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(f, fname, file)
     22 	struct open_file *f;
     23 	const char *fname;
     24 	char **file;
     25 {
     26 	struct devsw *dp;
     27 	int error;
     28 
     29 	*file = (char*)fname;
     30 	dp = &devsw[0];
     31 	f->f_dev = dp;
     32 	error = (*dp->dv_open)(f, prom_bootdev);
     33 
     34 	return (error);
     35 }
     36