1: /*
2: * Copyright (c) 1982, 1986 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)saio.h 7.1 (Berkeley) 6/5/86
7: */
8:
9: /*
10: * Header file for standalone package
11: */
12:
13: /*
14: * Io block: includes an
15: * inode, cells for the use of seek, etc,
16: * and a buffer.
17: */
18: struct iob {
19: int i_flgs; /* see F_ below */
20: struct inode i_ino; /* inode, if file */
21: int i_unit; /* pseudo device unit */
22: daddr_t i_boff; /* block offset on device */
23: daddr_t i_cyloff; /* cylinder offset on device */
24: off_t i_offset; /* seek offset in file */
25: daddr_t i_bn; /* 1st block # of next read */
26: char *i_ma; /* memory address of i/o buffer */
27: int i_cc; /* character count of transfer */
28: int i_error; /* error # return */
29: int i_errcnt; /* error count for driver retries */
30: int i_errblk; /* block # in error for error reporting */
31: char i_buf[MAXBSIZE];/* i/o buffer */
32: union {
33: struct fs ui_fs; /* file system super block info */
34: char dummy[SBSIZE];
35: } i_un;
36: };
37: #define i_fs i_un.ui_fs
38: #define NULL 0
39:
40: #define F_READ 0x1 /* file opened for reading */
41: #define F_WRITE 0x2 /* file opened for writing */
42: #define F_ALLOC 0x4 /* buffer allocated */
43: #define F_FILE 0x8 /* file instead of device */
44: #define F_NBSF 0x10 /* no bad sector forwarding */
45: #define F_SSI 0x40 /* set skip sector inhibit */
46: /* io types */
47: #define F_RDDATA 0x0100 /* read data */
48: #define F_WRDATA 0x0200 /* write data */
49: #define F_HDR 0x0400 /* include header on next i/o */
50: #define F_CHECK 0x0800 /* perform check of data read/write */
51: #define F_HCHECK 0x1000 /* perform check of header and data */
52:
53: #define F_TYPEMASK 0xff00
54:
55: /*
56: * Device switch.
57: */
58: struct devsw {
59: char *dv_name;
60: int (*dv_strategy)();
61: int (*dv_open)();
62: int (*dv_close)();
63: int (*dv_ioctl)();
64: };
65:
66: struct devsw devsw[];
67:
68: /*
69: * Drive description table.
70: * Returned from SAIODEVDATA call.
71: */
72: struct st {
73: short nsect; /* # sectors/track */
74: short ntrak; /* # tracks/surfaces/heads */
75: short nspc; /* # sectors/cylinder */
76: short ncyl; /* # cylinders */
77: short *off; /* partition offset table (cylinders) */
78: };
79:
80: /*
81: * Request codes. Must be the same a F_XXX above
82: */
83: #define READ 1
84: #define WRITE 2
85:
86: #define NBUFS 4
87:
88: char b[NBUFS][MAXBSIZE];
89: daddr_t blknos[NBUFS];
90:
91: #define NFILES 4
92: struct iob iob[NFILES];
93:
94: extern int errno; /* just like unix */
95:
96: /* error codes */
97: #define EBADF 1 /* bad file descriptor */
98: #define EOFFSET 2 /* relative seek not supported */
99: #define EDEV 3 /* improper device specification on open */
100: #define ENXIO 4 /* unknown device specified */
101: #define EUNIT 5 /* improper unit specification */
102: #define ESRCH 6 /* directory search for file failed */
103: #define EIO 7 /* generic error */
104: #define ECMD 10 /* undefined driver command */
105: #define EBSE 11 /* bad sector error */
106: #define EWCK 12 /* write check error */
107: #define EECC 13 /* uncorrectable ecc error */
108: #define EHER 14 /* hard error */
109:
110: /* ioctl's -- for disks just now */
111: #define SAIOHDR (('d'<<8)|1) /* next i/o includes header */
112: #define SAIOCHECK (('d'<<8)|2) /* next i/o checks data */
113: #define SAIOHCHECK (('d'<<8)|3) /* next i/o checks header & data */
114: #define SAIONOBAD (('d'<<8)|4) /* inhibit bad sector forwarding */
115: #define SAIODOBAD (('d'<<8)|5) /* enable bad sector forwarding */
116: #define SAIOECCLIM (('d'<<8)|6) /* set limit to ecc correction, bits */
117: #define SAIORETRIES (('d'<<8)|7) /* set retry count for unit */
118: #define SAIODEVDATA (('d'<<8)|8) /* get device data */
119: #define SAIOSSI (('d'<<8)|9) /* set skip sector inhibit */
120: #define SAIONOSSI (('d'<<8)|10) /* inhibit skip sector handling */
121: #define SAIOSSDEV (('d'<<8)|11) /* is device skip sector type? */
122: #define SAIODEBUG (('d'<<8)|12) /* enable/disable debugging */
123: #define SAIOGBADINFO (('d'<<8)|13) /* get bad-sector table */
Defined variables
b
defined in line
88; used 5 times
devsw
defined in line
66; used 46 times
- in /usr/src/sys/stand/conf.c line
26,
38,
47,
54,
63
- in /usr/src/sys/stand/confhp.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confhpup.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confra.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confrk.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confrl.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confup.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/confxx.c line
23,
35,
44,
51,
60
- in /usr/src/sys/stand/drtest.c line
69
- in /usr/src/sys/stand/format.c line
483
- in /usr/src/sys/stand/sys.c line
473,
507,
527,
537
iob
defined in line
92; used 14 times
Defined struct's
devsw
defined in line
58; used 24 times
iob
defined in line
18; used 254 times
- in line 92(2)
- in /usr/src/sys/stand/conf.c line
20(2),
32(2),
44(2),
51(2),
58(2),
68(2),
76(2)
- in /usr/src/sys/stand/confhp.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confhpup.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confra.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confrk.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confrl.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confup.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/confxx.c line
17(2),
29(2),
41(2),
48(2),
55(2),
65(2),
73(2)
- in /usr/src/sys/stand/hp.c line
74(2),
84(2),
130(2),
333(2),
445(2)
- in /usr/src/sys/stand/hp.old.c line
27(2),
52(2),
85(2)
- in /usr/src/sys/stand/ht.c line
30(2),
56(2),
63(2)
- in /usr/src/sys/stand/idc.c line
31(2),
65(2),
143(2)
- in /usr/src/sys/stand/imptst.c line
129(2),
154(2)
- in /usr/src/sys/stand/mba.c line
24(2),
91(2)
- in /usr/src/sys/stand/mt.c line
31(2),
62(2),
69(2)
- in /usr/src/sys/stand/rk.c line
28(2),
41(2),
103(2)
- in /usr/src/sys/stand/rl.c line
36(2),
84(2),
216(2)
- in /usr/src/sys/stand/sys.c line
19-24(4),
42(2),
85(2),
163(2),
202(2),
238(2),
262(2),
319(2),
398(2),
440(2),
605(2),
624(2)
- in /usr/src/sys/stand/tm.c line
28(2),
41(2),
48(2)
- in /usr/src/sys/stand/tmscp.c line
71(2),
93(2),
194(2),
263(2),
294(2)
- in /usr/src/sys/stand/ts.c line
27(2),
40(2),
83(2),
90(2)
- in /usr/src/sys/stand/uba.c line
29(2),
59(2)
- in /usr/src/sys/stand/uda.c line
36(2),
65(2),
172(2),
194(2)
- in /usr/src/sys/stand/up.c line
59(2),
74(2),
113(2),
299(2),
429(2),
481(2)
- in /usr/src/sys/stand/up.old.c line
21(2),
42(2),
90(2)
- in /usr/src/sys/stand/ut.c line
29(2),
40(2),
49(2)
st
defined in line
72; used 56 times
- in /usr/src/sys/stand/drtest.c line
29(2)
- in /usr/src/sys/stand/format.c line
111(2),
320(2),
339(2),
387(2),
502(2)
- in /usr/src/sys/stand/hp.c line
35(2),
78(2),
137(2),
340(2),
451(2),
463(2)
- in /usr/src/sys/stand/hp.old.c line
24(2),
31(2),
57(2)
- in /usr/src/sys/stand/hpmaptype.c line
62(2)
- in /usr/src/sys/stand/up.c line
36(2),
64(2),
122(2),
306(2),
435(2),
487(2),
496(2)
- in /usr/src/sys/stand/up.old.c line
18(2),
25(2),
49(2)
- in /usr/src/sys/stand/upmaptype.c line
33(2),
47(2)
Defined macros
EBADF
defined in line
97; used 8 times
EBSE
defined in line
105; used 7 times
ECMD
defined in line
104; used 23 times
EDEV
defined in line
99; used 2 times
EECC
defined in line
107; used 2 times
EHER
defined in line
108; used 4 times
EIO
defined in line
103; used 1 times
EWCK
defined in line
106; used 2 times
F_HDR
defined in line
49; used 7 times
F_SSI
defined in line
45; used 5 times
F_TYPEMASK
defined in line
53; used 21 times
- in /usr/src/sys/stand/conf.c line
27,
39
- in /usr/src/sys/stand/confhp.c line
24,
36
- in /usr/src/sys/stand/confhpup.c line
24,
36
- in /usr/src/sys/stand/confra.c line
24,
36
- in /usr/src/sys/stand/confrk.c line
24,
36
- in /usr/src/sys/stand/confrl.c line
24,
36
- in /usr/src/sys/stand/confup.c line
24,
36
- in /usr/src/sys/stand/confxx.c line
24,
36
- in /usr/src/sys/stand/mba.c line
46,
86
- in /usr/src/sys/stand/up.c line
109,
443,
473
NBUFS
defined in line
86; used 2 times
NFILES
defined in line
91; used 10 times
NULL
defined in line
38; used 6 times
READ
defined in line
83; used 23 times
WRITE
defined in line
84; used 14 times
i_fs
defined in line
37; used 17 times
Usage of this include