Home | History | Annotate | Line # | Download | only in netboot
devopen.c revision 1.2
      1 /*	$NetBSD: devopen.c,v 1.2 2000/07/24 18:39:50 jdolecek 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, NULL);
     29 
     30 	return (error);
     31 }
     32