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