Annotation of src/etc/MAKEDEV.common, Revision 1.32
1.32 ! deraadt 1: vers(a, {-$OpenBSD: MAKEDEV.common,v 1.31 2006/12/15 20:42:19 kettenis Exp $-})dnl
1.24 todd 2: dnl
3: dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org>
4: dnl
5: dnl Permission to use, copy, modify, and distribute this software for any
6: dnl purpose with or without fee is hereby granted, provided that the above
7: dnl copyright notice and this permission notice appear in all copies.
8: dnl
9: dnl THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10: dnl WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11: dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12: dnl ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13: dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14: dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15: dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.1 miod 16: dnl
17: dnl Common device definitions.
18: dnl
19: dnl This file contains the MI device definitions (as well as some MD
20: dnl definitions not cleaned up yet...)
21: dnl
22: dnl Diversions: (upon termination, concatenated output queues)
23: dnl
24: dnl 0 - very top
25: dnl 1 - descriptions of devices
26: dnl 2 - init of script, function definitions, etc
27: dnl 3 - beginning of global recursive R() function
28: dnl 7 - body of MAKEDEV, device creations, etc
29: dnl 9 - end
30: dnl
31: dnl Diversions 2, 3 and 7 are not filled when generating the manual page.
32: dnl
33: dnl HOW TO ADD A DEVICE:
34: dnl
35: dnl In this file, you must use at least two macros:
36: dnl
37: dnl Use '__devitem(uniqueid, name-pattern, description)' to create an entry
38: dnl in the description at the top of the generated MAKEDEV file:
39: dnl
40: dnl __devitem(sca, sca*, Sugar Generic device)dnl
41: dnl __devitem(cry, crypto, hardware crypto access driver)dnl
42: dnl
43: dnl This is ultimately shown as:
44: dnl
45: dnl # sca* Sugar Generic device
46: dnl # crypto hardware crypto access driver
47: dnl
48: dnl Use '_mkdev(uniqueid, shell-pattern, {-shell-script-})dnl' to create
49: dnl a shell script fragment used to 'create' the device (be sure to match
50: dnl the uniqueid from above):
51: dnl
52: dnl _mkdev(sca, sca*, {-M sca$U c major_sca_c $U
53: dnl M rsca$U b major_sca_b Add($U, 128)-})dnl
54: dnl _mkdev(cry, crypto, {-M crypto c major_cry_c 0-})dnl
55: dnl
56: dnl This is ultimately expanded into:
57: dnl
58: dnl sca*)
59: dnl M sca$U c 24 $U
60: dnl M sca$U b 42 $(($U+128))
61: dnl ;;
62: dnl
63: dnl crypto)
64: dnl M crypto c 47 0
65: dnl ;;
66: dnl
67: dnl In the MAKEDEV.md file, add a '_DEV(uniqueid, charmajor, blockmajor)'
68: dnl entry:
69: dnl
70: dnl _DEV(sca, 24, 42)
71: dnl _DEV(cry, 47)
72: dnl
73: dnl Final step is to use the 'target/twrget' macros to have the 'all)' target
74: dnl generate one or more device(s). Usage of 'target/twrget' is:
75: dnl target(target_name, device_name [, append_string ] .. )
76: dnl twrget(target_name, uniqueid, device_name, [, append_string ] .. )
77: dnl
78: dnl target_name a unique name that later is used as an argument to
79: dnl 'show_target()' (which expands all devices for a
80: dnl given 'target_name').
81: dnl uniqueid same as 'uniqueid' above
82: dnl device_name string representing the device to be mknod'ed
83: dnl append_string for each append_string, `device_name' is prepended
84: dnl
85: dnl Note: 'target(a,b,c)' is equivalent to 'twrget(a,b,b,c)'
86: dnl
87: dnl
88: dnl For a short example:
89: dnl
90: dnl target(all, std)dnl
91: dnl target(all, sca, 0, 1, 2, 3)dnl
92: dnl twrget(all, cry, crypto)dnl
93: dnl
94: dnl would expand to:
95: dnl
96: dnl all)
97: dnl R std sca0 sca1 sca2 sca3 crypto
98: dnl ;;
99: dnl
100: dnl presuming '_DEV(sca, ?, ?)' and '_DEV(std)' were in the MAKEDEV.md file.
101: dnl
102: dnl
103: dnl Everything is 'automatically' added to 'MAKEDEV' based on whether or
104: dnl not the '_DEV()' entry has a corresponding _mkdev() and __devitem()
105: dnl entry in MAKEDEV.mi (this file).
106: dnl
107: dnl Note: be very wary of adding whitespace, carriage returns, or not
108: dnl finishing a macro with ')dnl' .. otherwise, extra blank lines show up
109: dnl in the output.
110: dnl
111: dnl TODO:
112: dnl
113: dnl make a 'disktgt' macro that automatically does:
114: dnl disktgt(rd, {-rd-})
115: dnl
116: dnl target(all,rd,0)
117: dnl target(ramd,rd,0)
118: dnl disk_q(rd)
119: dnl __devitem(rd, {-rd*-}, {-rd-})dnl
120: dnl
121: dnl Note: not all disks are generated in 'all)'. (e.g. vax has a lot of
122: dnl disks that are not generated by 'all)')
123: dnl
1.24 todd 124: divert(1)dnl
1.1 miod 125: target(all, mcd, 0)dnl
126: twrget(all, fdesc, fd)dnl
127: target(all, st, 0, 1)dnl
128: target(all, std)dnl
129: target(all, raid, 0, 1, 2, 3)dnl
130: target(all, rz, 0, 1, 2, 3, 4)dnl
131: target(all, hp, 0, 1, 2, 3)dnl
132: target(all, ra, 0, 1, 2, 3)dnl
133: target(all, rx, 0, 1)dnl
134: target(all, wd, 0, 1, 2, 3)dnl
135: target(all, xd, 0, 1, 2, 3)dnl
136: target(all, systrace)dnl
137: target(all, pctr)dnl
138: target(all, pctr0)dnl
139: target(all, pf)dnl
140: twrget(all, cry, crypto)dnl
141: target(all, apm)dnl
1.18 tholo 142: target(all, acpi)dnl
1.1 miod 143: twrget(all, tth, ttyh, 0, 1)dnl
144: target(all, ttyA, 0, 1)dnl
145: target(all, ttyB, 0, 1, 2, 3, 4, 5)dnl
146: twrget(all, attyB, ttyB, 0, 1, 2, 3, 4)dnl
147: twrget(all, mac_tty0, tty0, 0, 1)dnl
148: twrget(all, tzs, tty, a, b, c, d)dnl
149: twrget(all, czs, cua, a, b, c, d)dnl
150: target(all, ttyc, 0, 1, 2, 3, 4, 5, 6, 7)dnl
151: twrget(all, com, tty0, 0, 1, 2, 3)dnl
152: target(all, lkm)dnl
153: twrget(all, mmcl, mmclock)dnl
154: target(all, lpt, 0, 1, 2)dnl
155: twrget(all, lpt, lpa, 0, 1, 2)dnl
156: target(all, joy, 0, 1)dnl
157: twrget(all, rnd, random)dnl
158: target(all, uk, 0)dnl
159: target(all, wt, 0)dnl
160: twrget(all, au, audio, 0)dnl
161: twrget(all, speak, speaker)dnl
162: target(all, asc, 0)dnl
163: target(all, music, 0)dnl
164: target(all, radio, 0)dnl
165: target(all, tuner, 0)dnl
166: target(all, rmidi, 0, 1, 2, 3, 4, 5, 6, 7)dnl
1.4 deraadt 167: target(all, uall)dnl
1.1 miod 168: target(all, adb)dnl
169: target(all, iop, 0, 1)dnl
1.31 kettenis 170: target(all, pci, 0, 1, 2, 3)dnl
1.1 miod 171: twrget(all, wsmouse, wscons)dnl
172: twrget(all, grf_mac, grf, 0, 1, 2, 3)dnl
173: target(all, par, 0)dnl
174: twrget(all, amouse, mouse, 0, 1)dnl
175: twrget(all, akbd, kbd)dnl
176: target(all, apci, 0)dnl
177: target(all, ppi, 0)dnl
178: target(all, view0, 0, 1, 2, 3, 4, 5)dnl
179: target(all, local)dnl
180: target(all, gpr, 0)dnl
181: target(all, ptm)dnl
1.9 grange 182: target(all, hotplug)dnl
1.1 miod 183: dnl
184: _mkdev(all, {-all-}, {-dnl
185: show_target(all)dnl
186: -})dnl
187: dnl
188: dnl XXX some arches use ramd, others ramdisk - needs to be fixed eventually
1.3 miod 189: __devitem(ramdisk, ramdisk, Ramdisk kernel devices,nothing)dnl
1.1 miod 190: dnl
1.16 otto 191: target(usb, usb, 0, 1, 2, 3, 4, 5)dnl
1.1 miod 192: target(usb, urio, 0)dnl
193: twrget(usb, uscan, uscanner, 0)dnl
194: target(usb, uhid, 0, 1, 2, 3)dnl
195: target(usb, ulpt, 0, 1)dnl
196: target(usb, ugen, 0, 1)dnl
1.30 todd 197: target(usb, ttyU, 0, 1, 2, 3)dnl
1.1 miod 198: dnl
1.4 deraadt 199: __devitem({-uall-}, uall, All USB devices,usb)dnl
200: _mkdev(uall, uall, {-dnl
1.1 miod 201: show_target({-usb-})dnl
202: -})dnl
203: __devtitle(tap, Tapes)dnl
1.3 miod 204: __devitem(wt, {-wt*-}, Archive/Wangtek QIC-cartridge tape drives)dnl
1.1 miod 205: _mkdev(wt, wt*,
206: {-name=wt
207: n=Mult($U, 8) m=Add($n, 4)
208: M $name$U b major_wt_b $n 640 operator
209: M r$name$U c major_wt_c $n 640 operator
210: M n$name$U b major_wt_b $m 640 operator
211: M nr$name$U c major_wt_c $m 640 operator-})dnl
212: __devitem(tz, tz*, {-DEC TK50 cartridge tape drives-})dnl
213: __devitem(st, {-st*-}, SCSI tape drives)dnl
214: _mkdev(st, st*, {-n=Mult($U, 16)
215: for pre in " " n e en
216: do
217: M ${pre}st$U b major_st_b $n 660 operator
218: M ${pre}rst$U c major_st_c $n 660 operator
219: n=Add($n, 1)
220: done-})dnl
221: __devitem(mt, mt*, (Magnetic) 9-track reel tape drives)dnl
222: __devitem(ht, ht*, MASSBUS TM03 and TU?? devices)dnl
223: __devitem(tm, tm*, UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11))dnl
224: __devitem(ts, ts*, UNIBUS TS11)dnl
225: __devitem(ut, ut*, UNIBUS TU45 emulations (e.g. 9700))dnl
226: __devtitle(dis, Disks)dnl
1.3 miod 227: __devitem(sd, {-sd*-}, {-SCSI disks{-,-} including flopticals-})dnl
228: __devitem(cd, {-cd*-}, ATAPI and SCSI CD-ROM drives)dnl
1.1 miod 229: _mkdev(cd, cd*, {-dodisk2 cd $U major_cd_b major_cd_c $U 0{--}ifstep(cd)-})dnl
1.3 miod 230: __devitem(mcd, mcd*, Mitsumi CD-ROM drives)dnl
1.1 miod 231: _mkdev(mcd, mcd*, {-dodisk2 mcd $U major_mcd_b major_mcd_c $U 0{--}ifstep(mcd)dnl
232: -})dnl
233: __devitem(ch, {-ch*-}, SCSI media changers)dnl
234: _mcdev(ch, ch*, ch, {-major_ch_c-}, 660, operator)dnl
1.12 miod 235: __devitem(uk, uk*, Unknown SCSI devices)dnl
1.1 miod 236: _mcdev(uk, uk*, uk, {-major_uk_c-}, 640, operator)dnl
237: __devitem(ss, ss*, SCSI scanners)dnl
238: _mkdev(ss, ss*, {-M ss$U c major_ss_c Mult($U,16) 640 operator
239: M nss$U c major_ss_c Add(Mult($U,16),1) 640 operator
240: M enss$U c major_ss_c Add(Mult($U,16),3) 640 operator
1.21 otto 241: RMlist[${#RMlist[*]}]="scan$U"
242: MKlist[${#MKlist[*]}]=";umask 77;ln -s ss$U scan$U"-})dnl
1.1 miod 243: dnl XXX see ramdisk above
1.3 miod 244: __devitem(ramd, ramdisk, Ramdisk kernel devices,nothing)dnl
1.25 todd 245: dnl
1.1 miod 246: _mkdev(ramd, ramdisk, {-dnl
247: show_target(ramd)dnl
248: -})dnl
1.25 todd 249: dnl
1.1 miod 250: target(ramd, std)dnl
251: target(ramd, bpf, 0)dnl
1.25 todd 252: twrget(ramd, com, tty0, 0, 1)dnl
1.26 todd 253: target(ramd, sd, 0, 1, 2, 3, 4)dnl
254: target(ramd, wd, 0, 1, 2, 3, 4)dnl
255: target(ramd, st, 0, 1)dnl
256: target(ramd, cd, 0, 1)dnl
257: target(ramd, wt, 0)dnl
258: target(ramd, rd, 0)dnl
1.25 todd 259: dnl
1.1 miod 260: __devitem(rd, {-rd*-}, quote(rd)pseudo-disks)dnl
261: _mkdev(rd, rd*, {-dodisk2 rd $U major_rd_b major_rd_c $U 0{--}ifstep(rd)-})dnl
262: __devitem(xd, xd*, Xylogic 753/7053 disks)dnl
263: __devitem(xy, xy*, {- Xylogic 450/451 disks-})dnl
1.3 miod 264: __devitem(flo, {-fd*-}, {-Floppy disk drives (3 1/2"{-,-} 5 1/4")-},fd)dnl
1.1 miod 265: _mkdev(flo, fd*,
266: {-typnam=$U${i#fd[01]*}
267: case $typnam in
268: 0|1) typnum=0;; # no type specified, assume A
269: *A) typnum=0; typnam=0;;
270: *B) typnum=1;;
271: *C) typnum=2;;
272: *D) typnum=3;;
273: *E) typnum=4;;
274: *F) typnum=5;;
275: *G) typnum=6;;
276: *H) typnum=7;;
277: *) echo bad type $typnam for $i; exit 1;;
278: esac
279: case $U in
280: 0|1) blk=major_flo_b; chr=major_flo_c;;
281: *) echo bad unit $U for $i; exit 1;;
282: esac
283: nam=fd${typnam}
284: n=Add(Mult($U, 128), Mult($typnum, 16))
285: M ${nam}a b $blk $n 640 operator
286: M ${nam}b b $blk Add($n, 1) 640 operator
287: M ${nam}c b $blk Add($n, 2) 640 operator
1.32 ! deraadt 288: M ${nam}i b $blk Add($n, 8) 640 operator
1.1 miod 289: M r${nam}a c $chr $n 640 operator
290: M r${nam}b c $chr Add($n, 1) 640 operator
1.32 ! deraadt 291: M r${nam}c c $chr Add($n, 2) 640 operator
! 292: M r${nam}i c $chr Add($n, 8) 640 operator-}, 664)dnl
1.1 miod 293: __devitem(iop, iop*, I2O controller devices)dnl
294: _mcdev(iop, iop*, iop, {-major_iop_c-}, 660)dnl
1.3 miod 295: __devitem(wd, {-wd*-}, {-quote(winchester)disk drives (ST506{-,-} IDE{-,-} ESDI{-,-} RLL{-,-} ...)-})dnl
1.1 miod 296: __devitem(ccd, ccd*, Concatenated disk devices)dnl
297: __devitem(raid, raid*, RAIDframe disk devices)dnl
298: __devitem(vnd, vnd*, quote(file)pseudo-disk devices)dnl
299: _mkdev(vnd, vnd*, {-dodisk vnd $U major_vnd_b major_vnd_c $U 0{--}ifstep(vnd)
300: dodisk svnd $U major_vnd_b major_vnd_c $U 2048{--}ifstep(vnd)-})dnl
301: __devitem(ra, ra*, {-MSCP disks-})dnl
302: __devitem(hp, hp*, {-MASSBUSS disks-})dnl
303: __devitem(hk, hk*, {-UNIBUS RK06 and RK07 disks-})dnl
304: __devitem(up, up*, {-Other UNIBUS devices-})dnl
305: __devitem(rb, rb*, {-730 IDC w/ RB80 and/or RB02-})dnl
306: __devitem(rx, rx*, {-RX02 floppy disks-})dnl
307: __devitem(rl, rl*, {-UNIBUS RL02-})dnl
308: dnl
309: dnl For normal disk devices, add a disk_q entry; anything else define like
310: dnl the rest (such as vnd above).
311: dnl
312: disk_q({-ccd-})dnl
313: disk_q({-hd-})dnl
314: disk_q({-hk-})dnl
315: disk_q({-hp-})dnl
316: disk_q({-ra-})dnl
317: disk_q({-raid-})dnl
318: disk_q({-rb-})dnl
319: disk_q({-rl-})dnl
320: disk_q({-rx-})dnl
321: disk_q({-sd-})dnl
322: disk_q({-xy-})dnl
323: disk_q({-xd-})dnl
324: disk_q({-up-})dnl
325: disk_q({-wd-})dnl
326: disk_q({-rz-})dnl
327: _mkdev({-disks-}, {-undefine({-C_ase-})show_disks()undefine({-C_ase-})-},
328: {-case $i in
329: show_disks2()dnl
330: esac-})dnl
331: __mkdev({-disks-}){--}dnl
332: dnl
333: __devtitle(cons, Console ports)dnl
1.23 miod 334: __devitem(wscons, wscons, Minimal wscons devices)dnl
1.1 miod 335: twrget(wscons, wscons, ttyC, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl
336: target(wscons, wsmux)dnl
337: target(wscons, wskbd, 0, 1, 2, 3)dnl
338: target(wscons, wsmouse, 0, 1, 2, 3)dnl
339: _mkdev({-wscons-}, {-wscons-}, {-dnl
340: show_target(wscons)dnl
341: -})dnl
1.29 tsi 342: __devitem(wsdisp, ttyC-J*, wscons display devices,wsdisplay)dnl
343: _mkdev({-wsdisp-}, tty[C-J]*, {-U=${i##tty[C-J]}
1.1 miod 344: case $i in
345: ttyC*) n=C m=expr(0*256);;
346: ttyD*) n=D m=expr(1*256);;
347: ttyE*) n=E m=expr(2*256);;
348: ttyF*) n=F m=expr(3*256);;
1.29 tsi 349: ttyG*) n=G m=expr(4*256);;
350: ttyH*) n=H m=expr(5*256);;
351: ttyI*) n=I m=expr(6*256);;
352: ttyJ*) n=J m=expr(7*256);;
1.1 miod 353: esac
354: case $U in
1.15 danh 355: [0-9a-f]) M tty$n$U c major_wsdisp_c Add(16#$U, $m) 600;;
1.1 miod 356: cfg) M tty${n}cfg c major_wsdisp_c Add(255,$m) 600;;
357: *) echo bad unit $U for $i; exit 1;;
358: esac-})dnl
359: __devitem(wskbd, wskbd*, wscons keyboards)dnl
360: _mkdev(wskbd, wskbd*, {-M wskbd$U c major_wskbd_c $U 600-})dnl
361: __devitem(wsmux, wsmux, wscons keyboard/mouse mux devices)dnl
362: _mkdev(wsmux, wsmux|wsmouse|wskbd, {-M wsmouse c major_wsmux_c 0 600
363: M wskbd c major_wsmux_c 1 600-})dnl
364: __devitem(pcons, console, PROM console)dnl
365: __devtitle(point, Pointing devices)dnl
366: __devitem(wsmouse, wsmouse*, wscons mice)dnl
367: _mkdev(wsmouse, wsmouse*, {-M wsmouse$U c major_wsmouse_c $U 600-})dnl
368: __devtitle(pty, Pseudo terminals)dnl
369: __devitem(ptm, ptm, pty master device)dnl
370: _mkdev(ptm, ptm, {-M ptm c major_ptm_c 0 666-})dnl
1.7 millert 371: __devitem(tty, tty*, Set of 62 slave pseudo terminals)dnl
372: __devitem(pty, pty*, Set of 62 master pseudo terminals)dnl
1.1 miod 373: _mkdev(pty, pty*, {-if [ $U -gt 15 ]; then
374: echo bad unit for pty in: $i
375: continue
376: fi
1.6 millert 377: set -A letters p q r s t u v w x y z P Q R S T
378: set -A suffixes 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q \
379: r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X \
380: Y Z
381:
382: name=${letters[$U]}
1.1 miod 383: n=0
1.6 millert 384: while [ $n -lt 62 ]
1.1 miod 385: do
1.6 millert 386: nam=$name${suffixes[$n]}
387: off=Mult($U, 62)
1.1 miod 388: M tty$nam c major_tty_c Add($off, $n)
389: M pty$nam c major_pty_c Add($off, $n)
390: n=Add($n, 1)
391: done-})dnl
392: __devitem(dc, dc*, {-4 channel serial interface (keyboard{-,-} mouse{-,-}modem{-,-} printer)-})dnl
393: __devtitle(prn, Printers)dnl
394: __devitem(lpt, lpt*, IEEE 1284 centronics printer)dnl
395: _mkdev(lpt, lpt*|lpa*,
396: {-case $i in
397: lpt*) n=lpt f=0;;
398: lpa*) n=lpa f=128;;
399: esac
400: M $n$U c major_lpt_c Add($U, $f) 600-})dnl
1.3 miod 401: __devitem(lpa, lpa*, Polled printer port,lpt)dnl
1.1 miod 402: __devitem(ppi, ppi*, HP-IB plotters)dnl
403: __devtitle({-usb-}, USB devices)dnl
404: __devitem({-usb-}, usb*, Bus control devices used by usbd for attach/detach)dnl
405: _mkdev({-usb-}, usb*, {-[ "$i" = "usb" ] && u= || u=$U
406: M usb$u c major_usb_c $U 660-})dnl
407: __devitem(uhid, uhid*, Generic HID devices)dnl
408: _mcdev({-uhid-}, uhid*, {-uhid-}, {-major_uhid_c-}, 660)dnl
409: __devitem(ulpt, ulpt*, Printer devices)dnl
410: _mcdev({-ulpt-}, ulpt*, {-ulpt-}, {-major_ulpt_c-}, 660)dnl
1.3 miod 411: __devitem(ttyU, ttyU*, USB serial ports,ucom)dnl
1.1 miod 412: _mkdev({-ttyU-}, {-ttyU[0-9a-zA-Z]-}, {-U=${i#ttyU*}
413: o=$(alph2d $U)
1.13 dlg 414: M ttyU$U c major_ttyU_c $o 660 dialer uucp
415: M cuaU$U c major_ttyU_c Add($o, 128) 660 dialer uucp-})dnl
1.1 miod 416: __devitem(urio, urio*, Diamond Multimedia Rio 500)dnl
417: _mcdev({-urio-}, urio*, {-urio-}, {-major_urio_c-}, 660)dnl
1.3 miod 418: __devitem(uscan, uscanner*, Scanners,uscanner)dnl
1.1 miod 419: _mcdev({-uscan-}, uscanner*, {-uscanner-}, {-major_uscan_c-}, 660)dnl
420: __devitem(ugen, ugen*, Generic USB devices)dnl
421: _mkdev(ugen, ugen*, {-n=Mult($U, 16)
1.15 danh 422: for j in 0{0,1,2,3,4,5,6,7,8,9} 1{0,1,2,3,4,5}
1.1 miod 423: do
1.15 danh 424: M ugen$U.$j c major_ugen_c Add($n, 10#$j) 660
1.1 miod 425: done-})dnl
426: __devtitle(call, Call units)dnl
427: __devtitle(term, Terminal ports)dnl
428: __devitem(dca, dca*, HP200/300 single port serial interface)dnl
429: __devitem(dcm, dcm*, HP200/300 4 port serial mux interface)dnl
430: __devitem(apci, apci*, HP400 4 port serial mux interface)dnl
431: __devitem({-com-}, {-tty[0-7][0-9a-f]-}, NS16x50 serial ports)dnl
432: _mkdev(com, {-tty[0-7][0-9a-f]-}, {-U=${i#tty*}
433: o=$(h2d $U)
434: M tty$U c major_com_c $o 660 dialer uucp
435: M cua$U c major_com_c Add($o, 128) 660 dialer uucp-})dnl
1.3 miod 436: __devitem(ttyc, ttyc*, Cyclades serial ports,cy)dnl
437: __devitem(tzs, tty[a-z]*, Zilog 8530 Serial Port,zs)dnl
1.1 miod 438: _mkdev(tzs, {-tty[a-z]-}, {-u=${i#tty*}
439: case $u in
440: a) n=0 ;;
441: b) n=1 ;;
442: c) n=4 ;;
443: d) n=5 ;;
444: *) echo unknown tty device $i ;;
445: esac
446: M tty$u c major_tzs_c $n 660 dialer uucp-})dnl
1.3 miod 447: __devitem(tth, ttyh*, Sab82532 serial devices,sab)dnl
1.1 miod 448: _mkdev(tth, ttyh*, {-M ttyh$U c major_tth_c $U 660 dialer uucp-})dnl
1.3 miod 449: __devitem(czs, cua[a-z]*, Zilog 8530 Serial Port,zs)dnl
1.1 miod 450: _mkdev(czs, cua[a-z], {-u=${i#cua*}
451: case $u in
452: a) n=0 ;;
453: b) n=1 ;;
454: c) n=4 ;;
455: d) n=5 ;;
456: *) echo unknown cua device $i ;;
457: esac
458: M cua$u c major_czs_c Add($n, 128) 660 dialer uucp-})dnl
1.3 miod 459: __devitem(tty0, tty00, Standard serial port,com)dnl
460: __devitem(mac_tty0, tty00, Standard serial port,zsc)dnl
461: __devitem(ttyz, tty[a-d], On-board zs serial ports,zs)dnl
462: __devitem(cuaz, cua[a-d], On-board zs serial ports,zs)dnl
463: __devitem(ttyB, ttyB?, DEC 3000 ZS8530 ("scc") serial ports,scc)dnl
464: __devitem(scc, scc*, 82530 serial interface,scc)dnl
1.1 miod 465: __devtitle(spec, Special purpose devices)dnl
466: _mkdev(apm, apm*, {-M apm c major_apm_c 0 644
467: M apmctl c major_apm_c 8 644-})dnl
1.18 tholo 468: _mkdev(acpi, acpi*, {-M acpi c major_acpi_c 0 644-})dnl
1.1 miod 469: __devitem(pctr, pctr*, PC Performance Tuning Register access device)dnl
470: _mkdev(pctr, pctr, {-M pctr c major_pctr_c 0 644-})dnl
471: __devitem(systrace, systrace*, System call tracing device)dnl
472: _mkdev(systrace, systrace, {-M systrace c major_systrace_c 0 644-})dnl
1.3 miod 473: __devitem(au, audio*, Audio devices,audio)dnl
1.1 miod 474: _mkdev(au, audio*, {-M sound$U c major_au_c $U
475: M mixer$U c major_au_c Add($U, 16)
476: M audio$U c major_au_c Add($U, 128)
477: M audioctl$U c major_au_c Add($U, 192)
1.21 otto 478: MKlist[${#MKlist[*]}]=";[ -e audio ] || ln -s audio$U audio"
479: MKlist[${#MKlist[*]}]=";[ -e mixer ] || ln -s mixer$U mixer"
480: MKlist[${#MKlist[*]}]=";[ -e sound ] || ln -s sound$U sound"
481: MKlist[${#MKlist[*]}]=";[ -e audioctl ] || ln -s audioctl$U audioctl"-})dnl
1.1 miod 482: __devitem(asc, asc*, ASC Audio device)dnl
483: _mkdev(asc, asc*, {-M asc$U major_asc_c 0-})dnl
1.19 todd 484: __devitem(bio, bio, {-ioctl tunnel pseudo-device-})dnl
485: _mkdev(bio, bio, {-M bio c major_bio_c 0 600-})dnl
1.3 miod 486: __devitem(music, music*, MIDI devices,midi)dnl
1.1 miod 487: _mkdev(music, music*, {-M music$U c major_music_c $U
488: M sequencer$U c major_music_c Add($U, 128)
1.21 otto 489: MKlist[${#MKlist[*]}]=";[ -e music ] || ln -s music$U music"
490: MKlist[${#MKlist[*]}]=";[ -e sequencer ] || ln -s sequencer$U sequencer"-})dnl
1.1 miod 491: __devitem(radio, radio*, FM tuner devices)dnl
492: _mkdev(radio, radio*, {-M radio$U c major_radio_c $U
1.21 otto 493: MKlist[${#MKlist[*]}]=";[ -e radio ] || ln -s radio$U radio"-})dnl
1.23 miod 494: __devitem(fdesc, fd, fd/* nodes, fd)dnl
1.21 otto 495: _mkdev(fdesc, fd, {-RMlist[${#RMlist[*]}]=";mkdir -p fd;rm -f" n=0
1.1 miod 496: while [ $n -lt 64 ];do M fd/$n c major_fdesc_c $n;n=Add($n, 1);done
1.21 otto 497: MKlist[${#MKlist[*]}]=";chmod 555 fd"-})dnl
1.3 miod 498: __devitem(grf_mac, grf*, Raw interface to the mac68k graphics devices,grf)dnl
1.11 miod 499: __devitem(oppr, openprom,PROM settings,openprom)dnl
1.1 miod 500: _cdev(oppr, openprom, 70, 0)dnl
1.3 miod 501: __devitem(cry, crypto, Hardware crypto access driver,crypto)dnl
1.1 miod 502: _mkdev(cry, crypto, {-M crypto c major_cry_c-} 0)dnl
503: __devitem(pf, pf*, Packet Filter)dnl
504: _mkdev(pf, {-pf*-}, {-M pf c major_pf_c 0 600-})dnl
505: __devitem(bpf, bpf*, Berkeley Packet Filter)dnl
506: _mkdev(bpf, {-bpf*-}, {-M bpf$U c major_bpf_c $U 600-}, 600)dnl
507: _mkdev(tun, {-tun*-}, {-M tun$U c major_tun_c $U 600-}, 600)dnl
1.3 miod 508: __devitem(speak, speaker, PC speaker,spkr)dnl
1.1 miod 509: _mkdev(speak, speaker, {-M speaker c major_speak_c 0 600-})dnl
510: __devitem(lkm, lkm, Loadable kernel modules interface)dnl
511: _cdev(lkm, lkm, {-major_lkm_c-}, 0, 640, _lkm)dnl
512: __devitem(tun, tun*, Network tunnel driver)dnl
1.3 miod 513: __devitem(rnd, *random, In-kernel random data source,random)dnl
1.1 miod 514: _mkdev(rnd, *random, {-n=0
515: for pre in " " s u p a
516: do
517: M ${pre}random c major_rnd_c $n 644
518: n=Add($n, 1)
519: done-}, 644)dnl
520: __devitem(joy, joy*, Joystick driver)dnl
521: _mcdev(joy, joy*, joy, {-major_joy_c-}, 666)dnl
1.3 miod 522: __devitem(mag, magma*, Magma multiport cards,magma)dnl
523: __devitem(bppmag, bppmag[mno], Magma parallel port,magma)dnl
1.1 miod 524: __devitem(spif, spif*, quote(spif)multiport cards)dnl
1.3 miod 525: __devitem(bppsp, bpp[jkl], quote(spif)parallel port,spif)dnl
1.1 miod 526: _mkdev(mag, magma*, {-case $U in
527: 0) offset=0 nam=m;;
528: 1) offset=16 nam=n;;
529: 2) offset=32 nam=o;;
530: *) echo "bad unit for $i: $U"; exit 127;;
531: esac
532: offset=Mult($U, 64)
533: n=0
534: while [ $n -lt 16 ]
535: do
536: name=${nam}`hex $n`
537: M tty$name c major_mag_c Add($offset, $n) 660 dialer uucp
538: n=Add($n, 1)
539: done
540: M bpp${nam}0 c major_bppmag_c Add($offset, 0) 600
541: M bpp${nam}1 c major_bppmag_c Add($offset, 1) 600-})dnl
542: _mkdev(spif, spif*, {-case $U in
543: 0) offset=0 nam=j;;
544: 1) offset=16 nam=k;;
545: 2) offset=32 nam=l;;
546: *) echo "bad unit for $i: $U"; exit 127;;
547: esac
548: offset=Mult($U, 64)
549: n=0
550: while [ $n -lt 8 ]
551: do
552: name=${nam}`hex $n`
553: M tty$name c major_spif_c Add($offset, $n) 660 dialer uucp
554: n=Add($n, 1)
555: done
556: M bpp${nam}0 c major_bppsp_c Add($offset, 0) 600-})dnl
557: __devitem(bpp, bpp*, Parallel port)dnl
558: _mkdev(bpp, {-bpp*-}, {-M bpp$U c major_bpp_c $U 600-}, 600)dnl
1.3 miod 559: __devitem(xfs, xfs*, XFS filesystem node, mount_xfs 8)dnl
1.1 miod 560: _mcdev(xfs, xfs*, xfs, {-major_xfs_c-}, 600)dnl
1.3 miod 561: __devitem(rmidi, rmidi*, Raw MIDI devices,midi)dnl
1.1 miod 562: _mcdev(rmidi, rmidi*, rmidi, {-major_rmidi_c-}, 666)dnl
563: __devtitle(plat, Platform-specific devices)dnl
564: __devitem(bktr, bktr*, Video frame grabbers)dnl
565: _mcdev(bktr, bktr*, bktr, {-major_bktr_c-}, 644)dnl
566: __devitem(tuner, tuner*, Tuner devices)dnl
567: _mkdev(tuner, tuner*, {-M tuner$U c major_bktr_c Add(Mult($U, 2), 16) 644-}, 644)dnl
1.31 kettenis 568: __devitem(pci, pci*, PCI bus devices)dnl
569: _mkdev(pci, pci*, {-M pci$U c major_pci_c $U 600
570: MKlist[${#MKlist[*]}]=";[ -e pci ] || ln -s pci0 pci"-})dnl
1.1 miod 571: __devitem(adb, adb, Apple Desktop bus event interface)dnl
572: _mkdev(adb, adb, {-M adb c major_adb_c 0-})dnl
573: __devitem(pdc, pdc, PDC device)dnl
574: __devitem(gpr, gpr*, GPR400 smartcard reader)dnl
575: _mcdev(gpr, gpr*, gpr, {-major_gpr_c-})dnl
1.9 grange 576: __devitem(hotplug, hotplug, devices hot plugging)dnl
577: _mkdev(hotplug, hotplug, {-M hotplug c major_hotplug_c $U 400-})dnl
1.10 grange 578: __devitem(gpio, gpio*, General Purpose Input/Output)dnl
579: _mcdev(gpio, gpio*, gpio, {-major_gpio_c-}, 600)dnl
1.1 miod 580: _mkdev(local, local, {-test -s $T.local && sh $T.local-})dnl