Commit | Line | Data |
---|---|---|
8ae0e4b4 | 1 | /* |
0880b18e | 2 | * Copyright (c) 1982, 1986 Regents of the University of California. |
8ae0e4b4 KM |
3 | * All rights reserved. The Berkeley software License Agreement |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
95f51977 | 6 | * @(#)confra.c 7.1 (Berkeley) 6/5/86 |
8ae0e4b4 | 7 | */ |
faeec66d SL |
8 | |
9 | #include "../machine/pte.h" | |
667c50a7 RE |
10 | |
11 | #include "../h/param.h" | |
12 | #include "../h/inode.h" | |
667c50a7 RE |
13 | #include "../h/fs.h" |
14 | #include "saio.h" | |
15 | ||
16 | devread(io) | |
17 | register struct iob *io; | |
18 | { | |
76780d43 | 19 | int cc; |
667c50a7 | 20 | |
75f313ad | 21 | io->i_flgs |= F_RDDATA; |
76780d43 SL |
22 | io->i_error = 0; |
23 | cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ); | |
75f313ad | 24 | io->i_flgs &= ~F_TYPEMASK; |
76780d43 | 25 | return (cc); |
667c50a7 RE |
26 | } |
27 | ||
28 | devwrite(io) | |
29 | register struct iob *io; | |
30 | { | |
76780d43 | 31 | int cc; |
667c50a7 | 32 | |
75f313ad | 33 | io->i_flgs |= F_WRDATA; |
76780d43 SL |
34 | io->i_error = 0; |
35 | cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE); | |
75f313ad | 36 | io->i_flgs &= ~F_TYPEMASK; |
76780d43 | 37 | return (cc); |
667c50a7 RE |
38 | } |
39 | ||
40 | devopen(io) | |
41 | register struct iob *io; | |
42 | { | |
43 | ||
44 | (*devsw[io->i_ino.i_dev].dv_open)(io); | |
45 | } | |
46 | ||
47 | devclose(io) | |
48 | register struct iob *io; | |
49 | { | |
50 | ||
51 | (*devsw[io->i_ino.i_dev].dv_close)(io); | |
52 | } | |
53 | ||
75f313ad SL |
54 | devioctl(io, cmd, arg) |
55 | register struct iob *io; | |
56 | int cmd; | |
57 | caddr_t arg; | |
58 | { | |
59 | ||
60 | return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg)); | |
61 | } | |
62 | ||
63 | /*ARGSUSED*/ | |
64 | nullsys(io) | |
65 | struct iob *io; | |
667c50a7 RE |
66 | { |
67 | ||
68 | ; | |
69 | } | |
70 | ||
75f313ad SL |
71 | /*ARGSUSED*/ |
72 | nullioctl(io, cmd, arg) | |
73 | struct iob *io; | |
74 | int cmd; | |
75 | caddr_t arg; | |
76 | { | |
77 | ||
78 | return (ECMD); | |
79 | } | |
80 | ||
81 | int nullsys(), nullioctl(); | |
e6412cae | 82 | int rastrategy(), raopen(), raioctl(); |
667c50a7 RE |
83 | |
84 | struct devsw devsw[] = { | |
e6412cae | 85 | { "ra", rastrategy, raopen, nullsys, raioctl }, |
75f313ad | 86 | { 0, 0, 0, 0, 0 } |
667c50a7 | 87 | }; |