xref: /csrg-svn/sys/vax/stand/conf.c (revision 13812)
1*13812Ssam /*	conf.c	4.19	83/07/06	*/
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
82*13812Ssam #if defined(VAX780) || defined(VAX750)
8310022Ssam int	upstrategy(), upopen(), upioctl();
84*13812Ssam #endif
8510022Ssam int	rkstrategy(), rkopen(), rkioctl();
8611111Ssam int	rastrategy(), raopen(), raioctl();
87*13812Ssam #if defined(VAX730)
8810022Ssam int	idcstrategy(), idcopen(), idcioctl();
89*13812Ssam #endif
9011111Ssam int	rlstrategy(), rlopen(), rlioctl();
917277Swnj #ifndef BOOT
921812Sbill int	tmstrategy(), tmopen(), tmclose();
933261Swnj int	tsstrategy(), tsopen(), tsclose();
946970Ssam #if defined(VAX780) || defined(VAX750)
957277Swnj int	htstrategy(), htopen(), htclose();
964868Sroot int	mtstrategy(), mtopen(), mtclose();
976970Ssam #endif
985156Ssam int	utstrategy(), utopen(), utclose();
997277Swnj #endif
100318Sbill 
101318Sbill struct devsw devsw[] = {
1026970Ssam #if defined(VAX780) || defined(VAX750)
10310022Ssam 	{ "hp",	hpstrategy,	hpopen,		nullsys,	hpioctl },
1046970Ssam #endif
105*13812Ssam #if defined(VAX780) || defined(VAX750)
10610022Ssam 	{ "up",	upstrategy,	upopen,		nullsys,	upioctl },
107*13812Ssam #endif
10810022Ssam 	{ "hk",	rkstrategy,	rkopen,		nullsys,	rkioctl },
10911111Ssam 	{ "ra",	rastrategy,	raopen,		nullsys,	raioctl },
11010022Ssam #if defined(VAX730)
11110022Ssam 	{ "rb",	idcstrategy,	idcopen,	nullsys,	idcioctl },
11210022Ssam #endif
11311111Ssam 	{ "rl",	rlstrategy,	rlopen,		nullsys,	rlioctl },
1147277Swnj #ifndef BOOT
11510022Ssam 	{ "ts",	tsstrategy,	tsopen,		tsclose,	nullioctl },
1166970Ssam #if defined(VAX780) || defined(VAX750)
11710022Ssam 	{ "ht",	htstrategy,	htopen,		htclose,	nullioctl },
11810022Ssam 	{ "mt",	mtstrategy,	mtopen,		mtclose,	nullioctl },
1196970Ssam #endif
12010022Ssam 	{ "tm",	tmstrategy,	tmopen,		tmclose,	nullioctl },
12110022Ssam 	{ "ut",	utstrategy,	utopen,		utclose,	nullioctl },
1227277Swnj #endif
12310022Ssam 	{ 0, 0, 0, 0, 0 },
124318Sbill };
125