1 /*
2 * Copyright (c) 1982, 1986, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 *
7 * @(#)conf.c 8.1 (Berkeley) 06/10/93
8 */
9
10 #include <sys/param.h>
11 #include <stand.att/saio.h>
12
13 extern int nullsys(), nodev(), noioctl();
14
15 #ifdef BOOT
16 #define ctstrategy nullsys
17 #define ctopen nodev
18 #define ctclose nullsys
19 #else
20 int ctstrategy(), ctopen(), ctclose();
21 #endif
22 #define ctioctl noioctl
23
24 int rdstrategy(), rdopen();
25 #define rdioctl noioctl
26
27 int sdstrategy(), sdopen();
28 #define sdioctl noioctl
29
30
31 struct devsw devsw[] = {
32 { "ct", ctstrategy, ctopen, ctclose, ctioctl }, /*0*/
33 { "??", nullsys, nodev, nullsys, noioctl }, /*1*/
34 { "rd", rdstrategy, rdopen, nullsys, rdioctl }, /*2*/
35 { "??", nullsys, nodev, nullsys, noioctl }, /*3*/
36 { "sd", sdstrategy, sdopen, nullsys, sdioctl }, /*4*/
37 };
38
39 int ndevs = (sizeof(devsw)/sizeof(devsw[0]));
40
41 /*
42 * Convert old style unit syntax into adaptor/controller/unit
43 */
devconvert(io)44 devconvert(io)
45 register struct iob *io;
46 {
47 if (io->i_unit == 0 || io->i_adapt || io->i_ctlr)
48 return;
49 io->i_adapt = io->i_unit / 8;
50 io->i_ctlr = io->i_unit % 8;
51 io->i_unit = 0;
52 }
53