Home | History | Annotate | Line # | Download | only in boot
devopen.c revision 1.2
      1  1.2  junyoung /*	$NetBSD: devopen.c,v 1.2 2005/06/28 20:55:55 junyoung Exp $	*/
      2  1.1       scw 
      3  1.1       scw #include <sys/param.h>
      4  1.2  junyoung #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.2  junyoung 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.2  junyoung 	return error;
     28  1.1       scw }
     29