|
|
1.1 root 1: /* (-lgl
2: * COHERENT 386 Device Driver Kit release 2.0
3: * Copyright (c) 1982, 1992 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * File: sbp.c
8: *
9: * Purpose: Sound Blaster Pro device driver
10: *
11: * Master devices are named /dev/sbp[pqrs][0-f].
12: * Corresponding slaves are /dev/tty[pqrs][0-f].
13: *
14: */
15:
16: /*
17: * -----------------------------------------------------------------
18: * Includes.
19: */
20: #include <sys/coherent.h>
21: #include <sys/stat.h>
22: #include <sys/proc.h>
23: #include <sys/tty.h> /* indirectly includes sgtty.h */
24: #include <sys/con.h>
25: #include <sys/devices.h>
26: #include <errno.h>
27: #include <poll.h>
28: #include <sys/sched.h> /* CVTTOUT, IVTTOUT, SVTTOUT */
29:
30: /*
31: * -----------------------------------------------------------------
32: * Definitions.
33: * Constants.
34: * Macros with argument lists.
35: * Typedefs.
36: * Enums.
37: */
38:
39: #define channel(dev) (dev & 0x7F)
40: #define master(dev) (dev & 0x80)
41: #ifdef _I386
42: #define EEBUSY EBUSY
43: #else
44: #define EEBUSY EDBUSY
45: #endif
46:
47: /*
48: * -----------------------------------------------------------------
49: * Functions.
50: * Import Functions.
51: * Export Functions.
52: * Local Functions.
53: */
54: int nulldev();
55:
56: /*
57: * Configuration functions (local functions).
58: */
59: static void sbpclose();
60: static void sbpioctl();
61: static void sbpload();
62: static void sbpopen();
63: static void sbpread();
64: static void sbpunload();
65: static void sbpwrite();
66: static void sbpstart();
67: static int sbppoll();
68:
69: /*
70: * Support functions (local functions).
71: */
72:
73: /*
74: * -----------------------------------------------------------------
75: * Global Data.
76: * Import Variables.
77: * Export Variables.
78: * Local Variables.
79: */
80: int SBP_BASE = 0x220;
81: int SBP_IRQ = 7;
82: int SBP_DMA_CHAN = 1;
83:
84: /*
85: * Configuration table (export data).
86: */
87: CON sbpcon ={
88: DFCHR|DFPOL, /* Flags */
89: SBP_MAJOR, /* Major index */
90: sbpopen, /* Open */
91: sbpclose, /* Close */
92: nulldev, /* Block */
93: sbpread, /* Read */
94: sbpwrite, /* Write */
95: sbpioctl, /* Ioctl */
96: nulldev, /* Powerfail */
97: nulldev, /* Timeout */
98: sbpload, /* Load */
99: sbpunload, /* Unload */
100: sbppoll /* Poll */
101: };
102:
103: /*
104: * -----------------------------------------------------------------
105: * Code.
106: */
107:
108: /*
109: * sbpload()
110: */
111: static void
112: sbpload()
113: {
114: printf("Loaded sbp driver at major number %d\n", SBP_MAJOR);
115: }
116:
117: /*
118: * sbpunload()
119: */
120: static void
121: sbpunload()
122: {
123: }
124:
125: /*
126: * sbpopen()
127: */
128: static void
129: sbpopen(dev, mode)
130: dev_t dev;
131: int mode;
132: {
133: }
134:
135: /*
136: * sbpclose()
137: */
138: static void
139: sbpclose(dev, mode)
140: dev_t dev;
141: int mode;
142: {
143: }
144:
145: /*
146: * sbpread()
147: */
148: static void
149: sbpread(dev, iop)
150: dev_t dev;
151: register IO * iop;
152: {
153: }
154:
155: /*
156: * sbpwrite()
157: */
158: static void
159: sbpwrite(dev, iop)
160: dev_t dev;
161: register IO * iop;
162: {
163: }
164:
165: /*
166: * sbpioctl()
167: */
168: static void
169: sbpioctl(dev, com, vec)
170: dev_t dev;
171: int com;
172: struct sgttyb *vec;
173: {
174: }
175:
176: /*
177: * sbppoll()
178: */
179: static int
180: sbppoll(dev, ev, msec)
181: dev_t dev;
182: int ev;
183: int msec;
184: {
185: }
186:
187: /* end of sbp.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.