xref: /csrg-svn/sys/vax/stand/conf.c (revision 11111)
1 /*	conf.c	4.17	83/02/16	*/
2 
3 #include "../machine/pte.h"
4 
5 #include "../h/param.h"
6 #include "../h/inode.h"
7 #include "../h/fs.h"
8 
9 #include "../vaxmba/mbareg.h"
10 
11 #include "saio.h"
12 
13 devread(io)
14 	register struct iob *io;
15 {
16 	int cc;
17 
18 	io->i_flgs |= F_RDDATA;
19 	io->i_error = 0;
20 	cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ);
21 	io->i_flgs &= ~F_TYPEMASK;
22 	return (cc);
23 }
24 
25 devwrite(io)
26 	register struct iob *io;
27 {
28 	int cc;
29 
30 	io->i_flgs |= F_WRDATA;
31 	io->i_error = 0;
32 	cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE);
33 	io->i_flgs &= ~F_TYPEMASK;
34 	return (cc);
35 }
36 
37 devopen(io)
38 	register struct iob *io;
39 {
40 
41 	(*devsw[io->i_ino.i_dev].dv_open)(io);
42 }
43 
44 devclose(io)
45 	register struct iob *io;
46 {
47 
48 	(*devsw[io->i_ino.i_dev].dv_close)(io);
49 }
50 
51 devioctl(io, cmd, arg)
52 	register struct iob *io;
53 	int cmd;
54 	caddr_t arg;
55 {
56 
57 	return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg));
58 }
59 
60 /*ARGSUSED*/
61 nullsys(io)
62 	struct iob *io;
63 {
64 
65 	;
66 }
67 
68 /*ARGSUSED*/
69 nullioctl(io, cmd, arg)
70 	struct iob *io;
71 	int cmd;
72 	caddr_t arg;
73 {
74 
75 	return (ECMD);
76 }
77 
78 int	nullsys(), nullioctl();
79 #if defined(VAX780) || defined(VAX750)
80 int	hpstrategy(), hpopen(), hpioctl();
81 #endif
82 int	upstrategy(), upopen(), upioctl();
83 int	rkstrategy(), rkopen(), rkioctl();
84 int	rastrategy(), raopen(), raioctl();
85 int	idcstrategy(), idcopen(), idcioctl();
86 int	rlstrategy(), rlopen(), rlioctl();
87 #ifndef BOOT
88 int	tmstrategy(), tmopen(), tmclose();
89 int	tsstrategy(), tsopen(), tsclose();
90 #if defined(VAX780) || defined(VAX750)
91 int	htstrategy(), htopen(), htclose();
92 int	mtstrategy(), mtopen(), mtclose();
93 #endif
94 int	utstrategy(), utopen(), utclose();
95 #endif
96 
97 struct devsw devsw[] = {
98 #if defined(VAX780) || defined(VAX750)
99 	{ "hp",	hpstrategy,	hpopen,		nullsys,	hpioctl },
100 #endif
101 	{ "up",	upstrategy,	upopen,		nullsys,	upioctl },
102 	{ "hk",	rkstrategy,	rkopen,		nullsys,	rkioctl },
103 	{ "ra",	rastrategy,	raopen,		nullsys,	raioctl },
104 #if defined(VAX730)
105 	{ "rb",	idcstrategy,	idcopen,	nullsys,	idcioctl },
106 #endif
107 	{ "rl",	rlstrategy,	rlopen,		nullsys,	rlioctl },
108 #ifndef BOOT
109 	{ "ts",	tsstrategy,	tsopen,		tsclose,	nullioctl },
110 #if defined(VAX780) || defined(VAX750)
111 	{ "ht",	htstrategy,	htopen,		htclose,	nullioctl },
112 	{ "mt",	mtstrategy,	mtopen,		mtclose,	nullioctl },
113 #endif
114 	{ "tm",	tmstrategy,	tmopen,		tmclose,	nullioctl },
115 	{ "ut",	utstrategy,	utopen,		utclose,	nullioctl },
116 #endif
117 	{ 0, 0, 0, 0, 0 },
118 };
119