[BACK]Return to devopen.c CVS log [TXT][DIR] Up to [local] / sys / arch / mvme88k / stand / netboot

File: [local] / sys / arch / mvme88k / stand / netboot / devopen.c (download)

Revision 1.1, Tue Mar 4 16:04:34 2008 UTC (16 years, 3 months ago) by nbrk
Branch point for: MAIN

Initial revision

/*	$OpenBSD: devopen.c,v 1.3 2006/05/16 22:52:09 miod Exp $ */

#include <sys/param.h>
#include <stand.h>

/*
 * Open the device named by the combined device/file name
 * given as the "fname" arg, something like: "sd()bsd"
 *
 * However, Sun PROMs don't really let you choose which
 * device you will talk to.  You can only open the device
 * that was used to load the boot program.  Therefore, we
 * do not accept a "device" part in the "fname" string.
 * Pass the PROM device name to open in case it needs it.
 */
int
devopen(f, fname, file)
	struct open_file *f;
	const char *fname;
	char **file;
{
	struct devsw *dp;
	int error;

	*file = (char *)fname;
	dp = &devsw[0];
	f->f_dev = dp;
	error = (*dp->dv_open)(f, NULL);

	return (error);
}