[BACK]Return to MAKEDEV.common CVS log [TXT][DIR] Up to [local] / src / etc

Annotation of src/etc/MAKEDEV.common, Revision 1.3

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