xref: /csrg-svn/sys/vax/stand/conf.c (revision 11111)
1*11111Ssam /*	conf.c	4.17	83/02/16	*/
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 {
1611082Ssam 	int cc;
17318Sbill 
1810022Ssam 	io->i_flgs |= F_RDDATA;
1911082Ssam 	io->i_error = 0;
2011082Ssam 	cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ);
2110022Ssam 	io->i_flgs &= ~F_TYPEMASK;
2211082Ssam 	return (cc);
23318Sbill }
24318Sbill 
25318Sbill devwrite(io)
263261Swnj 	register struct iob *io;
27318Sbill {
2811082Ssam 	int cc;
293261Swnj 
3010022Ssam 	io->i_flgs |= F_WRDATA;
3111082Ssam 	io->i_error = 0;
3211082Ssam 	cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE);
3310022Ssam 	io->i_flgs &= ~F_TYPEMASK;
3411082Ssam 	return (cc);
35318Sbill }
36318Sbill 
37318Sbill devopen(io)
383261Swnj 	register struct iob *io;
39318Sbill {
403261Swnj 
41318Sbill 	(*devsw[io->i_ino.i_dev].dv_open)(io);
42318Sbill }
43318Sbill 
44318Sbill devclose(io)
453261Swnj 	register struct iob *io;
46318Sbill {
473261Swnj 
48318Sbill 	(*devsw[io->i_ino.i_dev].dv_close)(io);
49318Sbill }
50318Sbill 
5110022Ssam devioctl(io, cmd, arg)
5210022Ssam 	register struct iob *io;
5310022Ssam 	int cmd;
5410022Ssam 	caddr_t arg;
553261Swnj {
56318Sbill 
5710022Ssam 	return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg));
5810022Ssam }
5910022Ssam 
6010022Ssam /*ARGSUSED*/
6110022Ssam nullsys(io)
6210022Ssam 	struct iob *io;
6310022Ssam {
6410022Ssam 
653261Swnj 	;
663261Swnj }
673261Swnj 
6810022Ssam /*ARGSUSED*/
6910022Ssam nullioctl(io, cmd, arg)
7010022Ssam 	struct iob *io;
7110022Ssam 	int cmd;
7210022Ssam 	caddr_t arg;
7310022Ssam {
7410022Ssam 
7510022Ssam 	return (ECMD);
7610022Ssam }
7710022Ssam 
7810022Ssam int	nullsys(), nullioctl();
796970Ssam #if defined(VAX780) || defined(VAX750)
8010022Ssam int	hpstrategy(), hpopen(), hpioctl();
816970Ssam #endif
8210022Ssam int	upstrategy(), upopen(), upioctl();
8310022Ssam int	rkstrategy(), rkopen(), rkioctl();
84*11111Ssam int	rastrategy(), raopen(), raioctl();
8510022Ssam int	idcstrategy(), idcopen(), idcioctl();
86*11111Ssam int	rlstrategy(), rlopen(), rlioctl();
877277Swnj #ifndef BOOT
881812Sbill int	tmstrategy(), tmopen(), tmclose();
893261Swnj int	tsstrategy(), tsopen(), tsclose();
906970Ssam #if defined(VAX780) || defined(VAX750)
917277Swnj int	htstrategy(), htopen(), htclose();
924868Sroot int	mtstrategy(), mtopen(), mtclose();
936970Ssam #endif
945156Ssam int	utstrategy(), utopen(), utclose();
957277Swnj #endif
96318Sbill 
97318Sbill struct devsw devsw[] = {
986970Ssam #if defined(VAX780) || defined(VAX750)
9910022Ssam 	{ "hp",	hpstrategy,	hpopen,		nullsys,	hpioctl },
1006970Ssam #endif
10110022Ssam 	{ "up",	upstrategy,	upopen,		nullsys,	upioctl },
10210022Ssam 	{ "hk",	rkstrategy,	rkopen,		nullsys,	rkioctl },
103*11111Ssam 	{ "ra",	rastrategy,	raopen,		nullsys,	raioctl },
10410022Ssam #if defined(VAX730)
10510022Ssam 	{ "rb",	idcstrategy,	idcopen,	nullsys,	idcioctl },
10610022Ssam #endif
107*11111Ssam 	{ "rl",	rlstrategy,	rlopen,		nullsys,	rlioctl },
1087277Swnj #ifndef BOOT
10910022Ssam 	{ "ts",	tsstrategy,	tsopen,		tsclose,	nullioctl },
1106970Ssam #if defined(VAX780) || defined(VAX750)
11110022Ssam 	{ "ht",	htstrategy,	htopen,		htclose,	nullioctl },
11210022Ssam 	{ "mt",	mtstrategy,	mtopen,		mtclose,	nullioctl },
1136970Ssam #endif
11410022Ssam 	{ "tm",	tmstrategy,	tmopen,		tmclose,	nullioctl },
11510022Ssam 	{ "ut",	utstrategy,	utopen,		utclose,	nullioctl },
1167277Swnj #endif
11710022Ssam 	{ 0, 0, 0, 0, 0 },
118318Sbill };
119