xref: /csrg-svn/sys/vax/stand/conf.c (revision 10022)
1*10022Ssam /*	conf.c	4.15	82/12/30	*/
2318Sbill 
39803Ssam #include "../machine/pte.h"
49803Ssam 
5318Sbill #include "../h/param.h"
6318Sbill #include "../h/inode.h"
77444Sroot #include "../h/fs.h"
89186Ssam 
99186Ssam #include "../vaxmba/mbareg.h"
109186Ssam 
11318Sbill #include "saio.h"
12318Sbill 
13318Sbill devread(io)
143261Swnj 	register struct iob *io;
15318Sbill {
16*10022Ssam 	int error;
17318Sbill 
18*10022Ssam 	io->i_flgs |= F_RDDATA;
19*10022Ssam 	error = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ);
20*10022Ssam 	io->i_flgs &= ~F_TYPEMASK;
21*10022Ssam 	return (error);
22318Sbill }
23318Sbill 
24318Sbill devwrite(io)
253261Swnj 	register struct iob *io;
26318Sbill {
27*10022Ssam 	int error;
283261Swnj 
29*10022Ssam 	io->i_flgs |= F_WRDATA;
30*10022Ssam 	error = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE);
31*10022Ssam 	io->i_flgs &= ~F_TYPEMASK;
32*10022Ssam 	return (error);
33318Sbill }
34318Sbill 
35318Sbill devopen(io)
363261Swnj 	register struct iob *io;
37318Sbill {
383261Swnj 
39318Sbill 	(*devsw[io->i_ino.i_dev].dv_open)(io);
40318Sbill }
41318Sbill 
42318Sbill devclose(io)
433261Swnj 	register struct iob *io;
44318Sbill {
453261Swnj 
46318Sbill 	(*devsw[io->i_ino.i_dev].dv_close)(io);
47318Sbill }
48318Sbill 
49*10022Ssam devioctl(io, cmd, arg)
50*10022Ssam 	register struct iob *io;
51*10022Ssam 	int cmd;
52*10022Ssam 	caddr_t arg;
533261Swnj {
54318Sbill 
55*10022Ssam 	return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg));
56*10022Ssam }
57*10022Ssam 
58*10022Ssam /*ARGSUSED*/
59*10022Ssam nullsys(io)
60*10022Ssam 	struct iob *io;
61*10022Ssam {
62*10022Ssam 
633261Swnj 	;
643261Swnj }
653261Swnj 
66*10022Ssam /*ARGSUSED*/
67*10022Ssam nullioctl(io, cmd, arg)
68*10022Ssam 	struct iob *io;
69*10022Ssam 	int cmd;
70*10022Ssam 	caddr_t arg;
71*10022Ssam {
72*10022Ssam 
73*10022Ssam 	return (ECMD);
74*10022Ssam }
75*10022Ssam 
76*10022Ssam int	nullsys(), nullioctl();
776970Ssam #if defined(VAX780) || defined(VAX750)
78*10022Ssam int	hpstrategy(), hpopen(), hpioctl();
796970Ssam #endif
80*10022Ssam int	upstrategy(), upopen(), upioctl();
81*10022Ssam int	rkstrategy(), rkopen(), rkioctl();
82*10022Ssam int	udstrategy(), udopen(), udioctl();
83*10022Ssam int	idcstrategy(), idcopen(), idcioctl();
847277Swnj #ifndef BOOT
851812Sbill int	tmstrategy(), tmopen(), tmclose();
863261Swnj int	tsstrategy(), tsopen(), tsclose();
876970Ssam #if defined(VAX780) || defined(VAX750)
887277Swnj int	htstrategy(), htopen(), htclose();
894868Sroot int	mtstrategy(), mtopen(), mtclose();
906970Ssam #endif
915156Ssam int	utstrategy(), utopen(), utclose();
927277Swnj #endif
93318Sbill 
94318Sbill struct devsw devsw[] = {
956970Ssam #if defined(VAX780) || defined(VAX750)
96*10022Ssam 	{ "hp",	hpstrategy,	hpopen,		nullsys,	hpioctl },
976970Ssam #endif
98*10022Ssam 	{ "up",	upstrategy,	upopen,		nullsys,	upioctl },
99*10022Ssam 	{ "hk",	rkstrategy,	rkopen,		nullsys,	rkioctl },
100*10022Ssam 	{ "ra",	udstrategy,	udopen,		nullsys,	udioctl },
101*10022Ssam #if defined(VAX730)
102*10022Ssam 	{ "rb",	idcstrategy,	idcopen,	nullsys,	idcioctl },
103*10022Ssam #endif
1047277Swnj #ifndef BOOT
105*10022Ssam 	{ "ts",	tsstrategy,	tsopen,		tsclose,	nullioctl },
1066970Ssam #if defined(VAX780) || defined(VAX750)
107*10022Ssam 	{ "ht",	htstrategy,	htopen,		htclose,	nullioctl },
108*10022Ssam 	{ "mt",	mtstrategy,	mtopen,		mtclose,	nullioctl },
1096970Ssam #endif
110*10022Ssam 	{ "tm",	tmstrategy,	tmopen,		tmclose,	nullioctl },
111*10022Ssam 	{ "ut",	utstrategy,	utopen,		utclose,	nullioctl },
1127277Swnj #endif
113*10022Ssam 	{ 0, 0, 0, 0, 0 },
114318Sbill };
115