home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
You can browse this item here: atapi_i386~
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
100%
| file
| POSIX tar archive (GNU)
| default
| |
99%
| file
| POSIX tar archive (GNU), file README, mode 100644 , uid 2272 , gid 467 , size 5550 , seconds 6155600236, user bouyer, group cei
| default
| |
98%
| file
| data
| default
| |
41%
| TrID
| Sybase iAnywhere database files
| default (weak)
| |
36%
| TrID
| TAR - Tape ARchive (GNU)
| default
| |
21%
| TrID
| TAR - Tape ARchive (file)
| default
| |
100%
| siegfried
| x-fmt/265 Tape Archive Format
| default
| |
100%
| lsar
| Tar
| default
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| GNU tar archive
| default
| |
100%
| detectItEasy
| Archive: tar
| default
| |
100%
| binwalkID
| POSIX tar archive (GNU)
| default
| |
100%
| xdgMime
| application/x-tar
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 52 45 41 44 4d 45 00 00 | 00 00 00 00 00 00 00 00 |README..|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 32 32 |....1006|44 . 22|
|00000070| 37 32 20 00 20 20 20 34 | 36 37 20 00 20 20 20 20 |72 . 4|67 . |
|00000080| 20 20 20 35 35 35 30 20 | 20 36 31 35 35 36 30 30 | 5550 | 6155600|
|00000090| 32 33 36 20 20 31 30 33 | 30 32 00 20 30 00 00 00 |236 103|02. 0...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 62 6f 75 79 65 72 00 |.ustar |.bouyer.|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 63 65 69 00 00 00 00 |........|.cei....|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 49 20 68 61 76 65 20 61 | 20 77 6f 72 6b 69 6e 67 |I have a| working|
|00000210| 20 64 72 69 76 65 72 20 | 66 6f 72 20 41 54 41 50 | driver |for ATAP|
|00000220| 49 20 63 64 72 6f 6d 73 | 20 66 6f 72 20 62 65 74 |I cdroms| for bet|
|00000230| 61 2d 74 65 73 74 73 2e | 20 54 68 65 72 65 20 69 |a-tests.| There i|
|00000240| 73 20 6e 6f 20 61 75 64 | 69 6f 0a 73 75 70 70 6f |s no aud|io.suppo|
|00000250| 72 74 20 79 65 74 2c 20 | 62 75 74 20 49 20 63 61 |rt yet, |but I ca|
|00000260| 6e 20 6d 6f 75 6e 74 20 | 61 6e 64 20 72 65 61 64 |n mount |and read|
|00000270| 20 61 20 63 64 72 6f 6d | 2e 20 49 27 76 65 20 6f | a cdrom|. I've o|
|00000280| 6e 6c 79 20 74 65 73 74 | 65 64 20 69 74 20 6f 6e |nly test|ed it on|
|00000290| 0a 6d 79 20 70 31 30 30 | 20 6d 61 63 68 69 6e 65 |.my p100| machine|
|000002a0| 20 77 68 69 63 68 20 68 | 61 73 20 61 20 49 44 45 | which h|as a IDE|
|000002b0| 20 64 72 69 76 65 20 61 | 6e 64 20 41 54 41 50 49 | drive a|nd ATAPI|
|000002c0| 20 63 64 72 6f 6d 20 6f | 6e 20 69 74 73 20 49 44 | cdrom o|n its ID|
|000002d0| 45 20 62 75 73 2e 0a 54 | 68 65 20 49 44 45 20 64 |E bus..T|he IDE d|
|000002e0| 72 69 76 65 20 73 75 70 | 70 6f 72 74 73 20 6d 79 |rive sup|ports my|
|000002f0| 20 72 6f 6f 74 2c 20 73 | 77 61 70 20 61 6e 64 20 | root, s|wap and |
|00000300| 2f 75 73 72 20 70 61 72 | 74 69 74 69 6f 6e 73 2e |/usr par|titions.|
|00000310| 20 49 20 61 6c 73 6f 20 | 68 61 76 65 20 0a 61 20 | I also |have .a |
|00000320| 4e 43 52 20 53 43 53 49 | 20 63 6f 6e 74 72 6f 6c |NCR SCSI| control|
|00000330| 6c 65 72 2e 20 54 68 65 | 20 66 69 72 73 74 20 49 |ler. The| first I|
|00000340| 44 45 20 63 6f 6e 74 72 | 6f 6c 6c 65 72 20 69 73 |DE contr|oller is|
|00000350| 20 61 6e 20 50 43 49 20 | 6f 6e 65 2c 20 61 6e 64 | an PCI |one, and|
|00000360| 0a 73 75 70 70 6f 72 74 | 20 74 68 65 20 49 44 45 |.support| the IDE|
|00000370| 20 64 72 69 76 65 2e 20 | 54 68 65 20 73 65 63 6f | drive. |The seco|
|00000380| 6e 64 20 69 73 20 61 6e | 20 49 53 41 20 61 6e 64 |nd is an| ISA and|
|00000390| 20 73 75 70 70 6f 72 74 | 20 74 68 65 20 63 64 72 | support| the cdr|
|000003a0| 6f 6d 2e 0a 49 20 74 68 | 69 6e 6b 20 74 68 65 20 |om..I th|ink the |
|000003b0| 63 64 72 6f 6d 20 64 72 | 69 76 65 20 69 73 20 61 |cdrom dr|ive is a|
|000003c0| 20 4e 45 43 20 62 75 74 | 20 49 27 6d 20 6e 6f 74 | NEC but| I'm not|
|000003d0| 20 73 75 72 65 2e 0a 4e | 6f 74 65 20 74 68 61 74 | sure..N|ote that|
|000003e0| 2c 20 61 6c 74 68 6f 75 | 67 68 20 6d 79 20 6d 6f |, althou|gh my mo|
|000003f0| 74 68 65 72 62 6f 61 72 | 64 20 6f 66 66 65 72 73 |therboar|d offers|
|00000400| 20 32 20 49 44 45 20 62 | 75 73 73 65 73 2c 20 69 | 2 IDE b|usses, i|
|00000410| 20 68 61 64 20 74 6f 20 | 64 69 73 61 62 6c 65 0a | had to |disable.|
|00000420| 74 68 65 20 73 65 63 6f | 6e 64 20 69 6e 20 74 68 |the seco|nd in th|
|00000430| 65 20 42 49 4f 53 20 61 | 6e 64 20 61 64 64 20 61 |e BIOS a|nd add a|
|00000440| 6e 20 49 53 41 20 49 44 | 45 20 63 6f 6e 74 72 6f |n ISA ID|E contro|
|00000450| 6c 6c 65 72 20 66 6f 72 | 20 74 68 65 20 63 64 72 |ller for| the cdr|
|00000460| 6f 6d 2c 0a 62 65 63 61 | 75 73 65 20 74 68 65 20 |om,.beca|use the |
|00000470| 73 65 63 6f 6e 64 20 62 | 75 69 6c 74 2d 69 6e 20 |second b|uilt-in |
|00000480| 49 44 45 20 63 6f 6e 74 | 72 6f 6c 6c 65 72 20 6f |IDE cont|roller o|
|00000490| 66 20 6d 79 20 6d 6f 74 | 68 65 72 62 6f 61 72 64 |f my mot|herboard|
|000004a0| 20 73 65 65 6d 73 20 74 | 6f 0a 73 65 6e 64 20 62 | seems t|o.send b|
|000004b0| 75 67 67 79 20 69 6e 74 | 65 72 72 75 70 74 73 2e |uggy int|errupts.|
|000004c0| 0a 0a 0a 54 68 69 73 20 | 6e 65 65 64 65 64 20 61 |...This |needed a|
|000004d0| 6e 20 69 6d 70 6f 72 74 | 61 6e 74 20 72 65 77 6f |n import|ant rewo|
|000004e0| 72 6b 20 6f 66 20 74 68 | 65 20 77 64 2f 77 64 63 |rk of th|e wd/wdc|
|000004f0| 20 64 72 69 76 65 72 73 | 2e 20 54 68 65 20 66 69 | drivers|. The fi|
|00000500| 6c 65 20 77 64 2e 63 0a | 68 61 73 20 62 65 65 6e |le wd.c.|has been|
|00000510| 20 73 70 6c 69 74 74 65 | 64 20 69 6e 74 6f 20 77 | splitte|d into w|
|00000520| 64 2e 63 20 66 6f 72 20 | 22 68 69 67 68 74 20 6c |d.c for |"hight l|
|00000530| 65 76 65 6c 22 20 49 44 | 45 20 64 72 69 76 65 20 |evel" ID|E drive |
|00000540| 6f 70 65 72 61 74 69 6f | 6e 73 0a 28 70 72 6f 62 |operatio|ns.(prob|
|00000550| 65 2f 61 74 74 61 63 68 | 2c 20 72 65 61 64 2f 77 |e/attach|, read/w|
|00000560| 72 69 74 65 2f 73 74 72 | 61 74 65 67 79 20 72 6f |rite/str|ategy ro|
|00000570| 75 74 69 6e 65 73 20 2e | 2e 2e 29 2c 20 61 6e 64 |utines .|..), and|
|00000580| 20 77 64 63 2e 63 0a 77 | 68 69 63 68 20 6d 61 6e | wdc.c.w|hich man|
|00000590| 61 67 65 73 20 74 68 65 | 20 49 44 45 20 61 6e 64 |ages the| IDE and|
|000005a0| 20 41 54 41 50 49 20 63 | 6f 6d 6d 61 6e 64 73 2e | ATAPI c|ommands.|
|000005b0| 20 54 68 69 73 20 68 61 | 73 20 62 65 65 6e 20 64 | This ha|s been d|
|000005c0| 6f 6e 65 20 74 6f 20 62 | 65 20 61 62 6c 65 0a 74 |one to b|e able.t|
|000005d0| 6f 20 73 65 74 20 75 70 | 20 61 20 70 65 72 2d 63 |o set up| a per-c|
|000005e0| 6f 6e 74 72 6f 6c 6c 65 | 72 20 71 75 65 75 65 20 |ontrolle|r queue |
|000005f0| 6f 66 20 6f 70 65 72 61 | 74 69 6f 6e 73 2e 20 54 |of opera|tions. T|
|00000600| 68 65 20 41 54 41 50 49 | 20 70 61 72 74 20 69 73 |he ATAPI| part is|
|00000610| 0a 63 6f 70 69 65 64 20 | 66 72 6f 6d 20 53 43 53 |.copied |from SCS|
|00000620| 49 2c 20 74 68 65 72 65 | 20 69 73 20 61 20 22 61 |I, there| is a "a|
|00000630| 74 61 70 69 62 75 73 22 | 20 77 68 69 63 68 20 69 |tapibus"| which i|
|00000640| 73 20 75 73 65 64 20 62 | 79 20 74 68 65 20 41 54 |s used b|y the AT|
|00000650| 41 50 49 2d 64 65 76 69 | 63 65 73 0a 64 72 69 76 |API-devi|ces.driv|
|00000660| 65 72 73 20 74 6f 20 73 | 65 6e 64 20 67 65 6e 65 |ers to s|end gene|
|00000670| 72 69 63 20 63 6f 6d 6d | 61 6e 64 73 2e 20 53 6f |ric comm|ands. So|
|00000680| 20 69 74 20 73 68 6f 75 | 6c 64 20 62 65 20 65 61 | it shou|ld be ea|
|00000690| 73 79 20 74 6f 20 68 61 | 76 65 20 41 54 41 50 49 |sy to ha|ve ATAPI|
|000006a0| 20 73 75 70 70 6f 72 74 | 0a 6f 6e 20 6f 74 68 65 | support|.on othe|
|000006b0| 72 73 20 74 79 70 65 73 | 20 6f 66 20 63 6f 6e 74 |rs types| of cont|
|000006c0| 72 6f 6c 6c 65 72 73 2c | 20 61 6c 74 68 6f 75 67 |rollers,| althoug|
|000006d0| 68 20 69 20 64 6f 6e 27 | 74 20 6b 6e 6f 77 20 77 |h i don'|t know w|
|000006e0| 68 65 74 68 65 72 20 74 | 68 65 73 65 20 65 78 69 |hether t|hese exi|
|000006f0| 73 74 2e 0a 0a 54 68 69 | 6e 67 73 20 77 68 69 63 |st...Thi|ngs whic|
|00000700| 68 20 64 6f 6e 27 74 20 | 77 6f 72 6b 20 79 65 74 |h don't |work yet|
|00000710| 3a 0a 09 2d 20 61 75 64 | 69 6f 20 63 6f 6d 6d 61 |:..- aud|io comma|
|00000720| 6e 64 73 20 66 6f 72 20 | 41 54 41 50 49 20 63 64 |nds for |ATAPI cd|
|00000730| 72 6f 6d 20 64 72 69 76 | 65 73 2e 0a 09 2d 20 41 |rom driv|es...- A|
|00000740| 54 41 50 49 20 69 6e 20 | 44 4d 41 20 6d 6f 64 65 |TAPI in |DMA mode|
|00000750| 0a 0a 54 68 69 6e 67 73 | 20 77 68 69 63 68 20 73 |..Things| which s|
|00000760| 68 6f 75 6c 64 20 77 6f | 72 6b 2c 20 62 75 74 20 |hould wo|rk, but |
|00000770| 68 61 76 65 20 6e 6f 74 | 20 79 65 74 20 62 65 65 |have not| yet bee|
|00000780| 6e 20 74 65 73 74 65 64 | 3a 0a 09 2d 20 49 44 45 |n tested|:..- IDE|
|00000790| 20 69 6e 20 44 4d 41 20 | 6d 6f 64 65 0a 0a 54 68 | in DMA |mode..Th|
|000007a0| 65 20 70 61 74 63 68 20 | 66 69 6c 65 20 69 73 20 |e patch |file is |
|000007b0| 61 76 61 69 6c 61 62 6c | 65 20 66 72 6f 6d 0a 66 |availabl|e from.f|
|000007c0| 74 70 3a 2f 2f 66 74 70 | 2e 65 6e 73 74 61 2e 66 |tp://ftp|.ensta.f|
|000007d0| 72 2f 70 75 62 2f 4e 65 | 74 42 53 44 2f 61 74 61 |r/pub/Ne|tBSD/ata|
|000007e0| 70 69 20 28 27 6f 66 66 | 69 63 69 61 6c 20 73 69 |pi ('off|icial si|
|000007f0| 74 65 27 29 20 61 6e 64 | 0a 66 74 70 3a 2f 2f 6c |te') and|.ftp://l|
|00000800| 69 78 2e 70 6f 6c 79 74 | 65 63 68 6e 69 71 75 65 |ix.polyt|echnique|
|00000810| 2e 66 72 2f 70 75 62 2f | 6d 61 6e 75 2f 61 74 61 |.fr/pub/|manu/ata|
|00000820| 70 69 2e 74 61 72 2e 67 | 7a 20 28 77 69 63 68 20 |pi.tar.g|z (wich |
|00000830| 68 61 73 20 61 20 62 65 | 74 74 65 72 20 69 6e 74 |has a be|tter int|
|00000840| 65 72 6e 65 74 0a 6c 69 | 6e 6b 29 2c 20 49 74 20 |ernet.li|nk), It |
|00000850| 63 6f 6e 74 61 69 6e 73 | 20 64 69 66 66 73 20 61 |contains| diffs a|
|00000860| 67 61 69 6e 73 74 20 31 | 2e 31 20 61 6e 64 20 63 |gainst 1|.1 and c|
|00000870| 75 72 72 65 6e 74 20 73 | 6f 75 72 63 65 73 2e 20 |urrent s|ources. |
|00000880| 44 6f 6e 27 74 20 66 6f | 72 67 65 74 20 74 6f 0a |Don't fo|rget to.|
|00000890| 63 72 65 61 74 65 20 74 | 68 65 20 64 69 72 65 63 |create t|he direc|
|000008a0| 74 6f 72 79 20 73 79 73 | 2f 61 74 61 70 69 20 62 |tory sys|/atapi b|
|000008b0| 65 66 6f 72 65 20 61 70 | 70 6c 79 69 6e 67 20 74 |efore ap|plying t|
|000008c0| 68 65 20 64 69 66 66 73 | 2e 0a 54 6f 20 69 6e 73 |he diffs|..To ins|
|000008d0| 74 61 6c 6c 3a 0a 2d 20 | 42 41 43 4b 55 50 20 59 |tall:.- |BACKUP Y|
|000008e0| 4f 55 52 20 49 44 45 20 | 44 52 49 56 45 28 53 29 |OUR IDE |DRIVE(S)|
|000008f0| 2e 20 49 20 64 69 64 6e | 27 74 20 68 61 76 65 20 |. I didn|'t have |
|00000900| 61 6e 79 20 70 72 6f 62 | 6c 65 6d 73 2c 20 62 75 |any prob|lems, bu|
|00000910| 74 20 77 68 6f 20 6b 6e | 6f 77 73 20 2e 2e 2e 0a |t who kn|ows ....|
|00000920| 2d 20 72 65 63 6f 6d 70 | 69 6c 65 20 79 6f 75 72 |- recomp|ile your|
|00000930| 20 6b 65 72 6e 65 6c 20 | 77 69 74 68 20 74 68 65 | kernel |with the|
|00000940| 20 74 77 6f 20 6c 69 6e | 65 73 3a 0a 61 74 61 70 | two lin|es:.atap|
|00000950| 69 62 75 73 2a 20 61 74 | 20 77 64 63 3f 0a 61 63 |ibus* at| wdc?.ac|
|00000960| 64 2a 20 61 74 20 61 74 | 61 70 69 62 75 73 3f 20 |d* at at|apibus? |
|00000970| 64 72 69 76 65 3f 0a 4a | 75 73 74 20 61 66 74 65 |drive?.J|ust afte|
|00000980| 72 20 74 68 65 20 77 64 | 63 2f 77 64 20 64 65 63 |r the wd|c/wd dec|
|00000990| 6c 61 72 61 74 69 6f 6e | 20 69 6e 20 79 6f 75 72 |laration| in your|
|000009a0| 20 6b 65 72 6e 65 6c 20 | 63 6f 6e 66 69 67 20 66 | kernel |config f|
|000009b0| 69 6c 65 2e 20 28 74 68 | 65 20 70 61 74 63 68 20 |ile. (th|e patch |
|000009c0| 66 69 6c 65 0a 61 64 64 | 73 20 74 68 65 73 65 73 |file.add|s theses|
|000009d0| 20 74 6f 20 74 68 65 20 | 47 45 4e 45 52 49 43 20 | to the |GENERIC |
|000009e0| 66 69 6c 65 29 2e 0a 2d | 20 43 72 65 61 74 65 20 |file)..-| Create |
|000009f0| 74 68 65 20 64 65 76 69 | 63 65 73 20 69 6e 20 2f |the devi|ces in /|
|00000a00| 64 65 76 2c 20 77 69 74 | 68 20 6d 61 6a 6f 72 20 |dev, wit|h major |
|00000a10| 31 37 20 28 31 38 20 66 | 6f 72 20 2d 63 75 72 72 |17 (18 f|or -curr|
|00000a20| 65 6e 74 29 20 66 6f 72 | 20 62 6c 6f 63 6b 20 64 |ent) for| block d|
|00000a30| 65 76 69 63 65 0a 61 6e | 64 20 32 31 20 66 6f 72 |evice.an|d 21 for|
|00000a40| 20 63 68 61 72 61 63 74 | 65 72 73 2e 20 54 68 65 | charact|ers. The|
|00000a50| 20 6d 69 6e 6f 72 73 20 | 61 72 65 20 61 73 20 66 | minors |are as f|
|00000a60| 6f 72 20 6f 74 68 65 72 | 20 64 69 73 6b 20 64 65 |or other| disk de|
|00000a70| 76 69 63 65 73 2e 0a 0a | 41 66 74 65 72 20 72 65 |vices...|After re|
|00000a80| 62 6f 6f 74 20 79 6f 75 | 20 73 68 6f 75 6c 64 20 |boot you| should |
|00000a90| 62 65 20 61 62 6c 65 20 | 74 6f 20 6d 6f 75 6e 74 |be able |to mount|
|00000aa0| 20 79 6f 75 72 20 63 64 | 72 6f 6d 2e 20 49 66 20 | your cd|rom. If |
|00000ab0| 74 68 65 20 6d 6f 75 6e | 74 20 66 61 69 6c 73 0a |the moun|t fails.|
|00000ac0| 77 69 74 68 20 61 20 27 | 75 6e 69 74 20 61 74 74 |with a '|unit att|
|00000ad0| 65 6e 74 69 6f 6e 27 20 | 6d 65 73 73 61 67 65 20 |ention' |message |
|00000ae0| 69 6e 20 74 68 65 20 63 | 6f 6e 73 6f 6c 65 2c 20 |in the c|onsole, |
|00000af0| 72 65 74 72 79 20 74 68 | 65 20 6d 6f 75 6e 74 2e |retry th|e mount.|
|00000b00| 0a 0a 46 6f 72 20 6e 6f | 77 20 69 20 70 6c 61 6e |..For no|w i plan|
|00000b10| 20 74 6f 20 61 64 64 20 | 74 68 65 20 66 6f 6c 6c | to add |the foll|
|00000b20| 6f 77 69 6e 67 2c 20 69 | 6e 20 70 72 69 6f 72 69 |owing, i|n priori|
|00000b30| 74 79 20 6f 72 64 65 72 | 3a 0a 2d 20 61 75 64 69 |ty order|:.- audi|
|00000b40| 6f 20 63 6f 6d 6d 61 6e | 64 73 2e 0a 0a 49 66 20 |o comman|ds...If |
|00000b50| 73 6f 6d 65 6f 6e 65 20 | 6d 61 6b 65 73 20 61 6e |someone |makes an|
|00000b60| 79 20 63 68 61 6e 67 65 | 73 20 74 6f 20 74 68 69 |y change|s to thi|
|00000b70| 73 20 28 61 75 64 69 6f | 20 73 75 70 70 6f 72 74 |s (audio| support|
|00000b80| 2c 20 6f 72 20 62 75 67 | 0a 66 69 78 65 73 29 20 |, or bug|.fixes) |
|00000b90| 70 6c 65 61 73 65 20 73 | 65 6e 64 20 6d 65 20 61 |please s|end me a|
|00000ba0| 20 70 61 74 63 68 20 28 | 65 2d 6d 61 69 6c 3a 20 | patch (|e-mail: |
|00000bb0| 62 6f 75 79 65 72 40 65 | 6e 73 74 61 2e 66 72 29 |bouyer@e|nsta.fr)|
|00000bc0| 2e 20 49 27 6c 6c 20 75 | 70 64 61 74 65 20 74 68 |. I'll u|pdate th|
|00000bd0| 65 0a 66 69 6c 65 73 20 | 6f 6e 20 74 68 65 20 66 |e.files |on the f|
|00000be0| 74 70 20 73 65 72 76 65 | 72 20 77 69 74 68 20 63 |tp serve|r with c|
|00000bf0| 6f 6e 74 72 69 62 75 74 | 65 64 20 70 61 74 63 68 |ontribut|ed patch|
|00000c00| 65 73 20 61 6e 64 20 6d | 79 20 6f 77 6e 20 63 68 |es and m|y own ch|
|00000c10| 61 6e 67 65 73 2e 0a 0a | 45 61 63 68 20 75 70 64 |anges...|Each upd|
|00000c20| 61 74 65 20 69 73 20 63 | 6f 6e 73 74 69 74 75 74 |ate is c|onstitut|
|00000c30| 65 64 20 62 79 20 61 20 | 66 69 6c 65 20 70 61 74 |ed by a |file pat|
|00000c40| 63 68 5b 6e 75 6d 62 65 | 72 5d 20 69 6e 0a 66 74 |ch[numbe|r] in.ft|
|00000c50| 70 3a 2f 2f 6c 69 78 2e | 70 6f 6c 79 74 65 63 68 |p://lix.|polytech|
|00000c60| 6e 69 71 75 65 2e 66 72 | 2f 70 75 62 2f 6d 61 6e |nique.fr|/pub/man|
|00000c70| 75 20 6f 72 20 66 74 70 | 3a 2f 2f 66 74 70 2e 65 |u or ftp|://ftp.e|
|00000c80| 6e 73 74 61 2e 66 72 2f | 70 75 62 2f 4e 65 74 42 |nsta.fr/|pub/NetB|
|00000c90| 53 44 2f 61 74 61 70 69 | 0a 73 6f 20 69 66 20 79 |SD/atapi|.so if y|
|00000ca0| 6f 75 20 68 61 76 65 20 | 74 68 65 20 64 72 69 76 |ou have |the driv|
|00000cb0| 65 72 20 61 6c 72 65 61 | 64 79 20 69 6e 73 74 61 |er alrea|dy insta|
|00000cc0| 6c 6c 65 64 2c 20 79 6f | 75 20 63 61 6e 20 75 70 |lled, yo|u can up|
|00000cd0| 64 61 74 65 20 69 74 20 | 77 69 74 68 6f 75 74 0a |date it |without.|
|00000ce0| 70 72 6f 62 6c 65 6d 73 | 2e 20 54 68 65 20 66 69 |problems|. The fi|
|00000cf0| 6c 65 20 61 74 61 70 69 | 2e 74 61 72 2e 67 7a 20 |le atapi|.tar.gz |
|00000d00| 63 6f 6e 74 61 69 6e 20 | 74 68 65 20 6c 61 74 65 |contain |the late|
|00000d10| 73 74 20 76 65 72 73 69 | 6f 6e 20 28 62 6f 74 68 |st versi|on (both|
|00000d20| 20 66 6f 72 20 31 2e 31 | 0a 61 6e 64 20 63 75 72 | for 1.1|.and cur|
|00000d30| 72 65 6e 74 29 2c 20 79 | 6f 75 20 63 61 6e 20 69 |rent), y|ou can i|
|00000d40| 67 6e 6f 72 65 20 74 68 | 65 20 66 69 6c 65 73 20 |gnore th|e files |
|00000d50| 70 61 74 63 68 2a 20 69 | 66 20 79 6f 75 20 67 65 |patch* i|f you ge|
|00000d60| 74 20 74 68 69 73 2e 0a | 00 00 00 00 00 00 00 00 |t this..|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 64 69 66 66 73 2d 31 2e | 31 00 00 00 00 00 00 00 |diffs-1.|1.......|
|00000e10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 32 32 |....1006|44 . 22|
|00000e70| 37 32 20 00 20 20 20 34 | 36 37 20 00 20 20 20 20 |72 . 4|67 . |
|00000e80| 20 35 33 31 36 31 36 20 | 20 36 31 31 37 31 32 30 | 531616 | 6117120|
|00000e90| 31 30 30 20 20 31 30 37 | 36 35 00 20 30 00 00 00 |100 107|65. 0...|
|00000ea0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000eb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f00| 00 75 73 74 61 72 20 20 | 00 62 6f 75 79 65 72 00 |.ustar |.bouyer.|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 00 | 00 63 65 69 00 00 00 00 |........|.cei....|
|00000f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001000| 64 69 66 66 20 2d 62 63 | 72 4e 50 20 73 79 73 2e |diff -bc|rNP sys.|
|00001010| 6f 72 69 67 2f 61 72 63 | 68 2f 69 33 38 36 2f 63 |orig/arc|h/i386/c|
|00001020| 6f 6e 66 2f 47 45 4e 45 | 52 49 43 20 73 79 73 2f |onf/GENE|RIC sys/|
|00001030| 61 72 63 68 2f 69 33 38 | 36 2f 63 6f 6e 66 2f 47 |arch/i38|6/conf/G|
|00001040| 45 4e 45 52 49 43 0a 2a | 2a 2a 20 73 79 73 2e 6f |ENERIC.*|** sys.o|
|00001050| 72 69 67 2f 61 72 63 68 | 2f 69 33 38 36 2f 63 6f |rig/arch|/i386/co|
|00001060| 6e 66 2f 47 45 4e 45 52 | 49 43 09 57 65 64 20 4f |nf/GENER|IC.Wed O|
|00001070| 63 74 20 31 38 20 31 32 | 3a 33 33 3a 34 35 20 31 |ct 18 12|:33:45 1|
|00001080| 39 39 35 0a 2d 2d 2d 20 | 73 79 73 2f 61 72 63 68 |995.--- |sys/arch|
|00001090| 2f 69 33 38 36 2f 63 6f | 6e 66 2f 47 45 4e 45 52 |/i386/co|nf/GENER|
|000010a0| 49 43 09 54 68 75 20 4a | 61 6e 20 31 31 20 32 30 |IC.Thu J|an 11 20|
|000010b0| 3a 35 37 3a 33 37 20 31 | 39 39 36 0a 2a 2a 2a 2a |:57:37 1|996.****|
|000010c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 2a 2a 2a 20 |********|***.*** |
|000010d0| 31 34 33 2c 31 34 38 20 | 2a 2a 2a 2a 0a 2d 2d 2d |143,148 |****.---|
|000010e0| 20 31 34 33 2c 31 35 30 | 20 2d 2d 2d 2d 0a 20 20 | 143,150| ----. |
|000010f0| 77 64 63 30 09 61 74 20 | 69 73 61 3f 20 70 6f 72 |wdc0.at |isa? por|
|00001100| 74 20 30 78 31 66 30 20 | 69 72 71 20 31 34 09 23 |t 0x1f0 |irq 14.#|
|00001110| 20 53 54 35 30 36 2c 20 | 45 53 44 49 2c 20 61 6e | ST506, |ESDI, an|
|00001120| 64 20 49 44 45 20 63 6f | 6e 74 72 6f 6c 6c 65 72 |d IDE co|ntroller|
|00001130| 73 0a 20 20 23 77 64 63 | 31 09 61 74 20 69 73 61 |s. #wdc|1.at isa|
|00001140| 3f 20 70 6f 72 74 20 30 | 78 31 37 30 20 69 72 71 |? port 0|x170 irq|
|00001150| 20 3f 0a 20 20 77 64 2a | 09 61 74 20 77 64 63 3f | ?. wd*|.at wdc?|
|00001160| 20 64 72 69 76 65 20 3f | 0a 2b 20 61 74 61 70 69 | drive ?|.+ atapi|
|00001170| 62 75 73 2a 20 61 74 20 | 77 64 63 3f 0a 2b 20 61 |bus* at |wdc?.+ a|
|00001180| 63 64 2a 20 61 74 20 61 | 74 61 70 69 62 75 73 3f |cd* at a|tapibus?|
|00001190| 20 64 72 69 76 65 3f 0a | 20 20 0a 20 20 77 74 30 | drive?.| . wt0|
|000011a0| 09 61 74 20 69 73 61 3f | 20 70 6f 72 74 20 30 78 |.at isa?| port 0x|
|000011b0| 33 30 30 20 69 72 71 20 | 35 20 64 72 71 20 31 09 |300 irq |5 drq 1.|
|000011c0| 23 20 41 72 63 68 69 76 | 65 20 61 6e 64 20 57 61 |# Archiv|e and Wa|
|000011d0| 6e 67 74 65 6b 20 51 49 | 43 20 74 61 70 65 20 64 |ngtek QI|C tape d|
|000011e0| 72 69 76 65 73 0a 20 20 | 0a 64 69 66 66 20 2d 62 |rives. |.diff -b|
|000011f0| 63 72 4e 50 20 73 79 73 | 2e 6f 72 69 67 2f 61 72 |crNP sys|.orig/ar|
|00001200| 63 68 2f 69 33 38 36 2f | 63 6f 6e 66 2f 66 69 6c |ch/i386/|conf/fil|
|00001210| 65 73 2e 69 33 38 36 20 | 73 79 73 2f 61 72 63 68 |es.i386 |sys/arch|
|00001220| 2f 69 33 38 36 2f 63 6f | 6e 66 2f 66 69 6c 65 73 |/i386/co|nf/files|
|00001230| 2e 69 33 38 36 0a 2a 2a | 2a 20 73 79 73 2e 6f 72 |.i386.**|* sys.or|
|00001240| 69 67 2f 61 72 63 68 2f | 69 33 38 36 2f 63 6f 6e |ig/arch/|i386/con|
|00001250| 66 2f 66 69 6c 65 73 2e | 69 33 38 36 09 53 61 74 |f/files.|i386.Sat|
|00001260| 20 4f 63 74 20 31 34 20 | 30 32 3a 35 35 3a 33 39 | Oct 14 |02:55:39|
|00001270| 20 31 39 39 35 0a 2d 2d | 2d 20 73 79 73 2f 61 72 | 1995.--|- sys/ar|
|00001280| 63 68 2f 69 33 38 36 2f | 63 6f 6e 66 2f 66 69 6c |ch/i386/|conf/fil|
|00001290| 65 73 2e 69 33 38 36 09 | 54 68 75 20 4a 61 6e 20 |es.i386.|Thu Jan |
|000012a0| 31 31 20 32 30 3a 35 37 | 3a 33 37 20 31 39 39 36 |11 20:57|:37 1996|
|000012b0| 0a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.*******|********|
|000012c0| 0a 2a 2a 2a 20 34 31 2c | 34 36 20 2a 2a 2a 2a 0a |.*** 41,|46 ****.|
|000012d0| 2d 2d 2d 20 34 31 2c 35 | 33 20 2d 2d 2d 2d 0a 20 |--- 41,5|3 ----. |
|000012e0| 20 6d 61 6a 6f 72 09 7b | 63 64 20 3d 20 36 7d 0a | major.{|cd = 6}.|
|000012f0| 20 20 0a 20 20 23 0a 2b | 20 23 20 4d 61 63 68 69 | . #.+| # Machi|
|00001300| 6e 65 2d 69 6e 64 65 70 | 65 6e 64 65 6e 74 20 41 |ne-indep|endent A|
|00001310| 54 41 50 49 20 64 72 69 | 76 65 72 73 0a 2b 20 23 |TAPI dri|vers.+ #|
|00001320| 0a 2b 20 0a 2b 20 69 6e | 63 6c 75 64 65 20 22 2e |.+ .+ in|clude ".|
|00001330| 2e 2f 2e 2e 2f 2e 2e 2f | 61 74 61 70 69 2f 66 69 |./../../|atapi/fi|
|00001340| 6c 65 73 2e 61 74 61 70 | 69 22 0a 2b 20 0a 2b 20 |les.atap|i".+ .+ |
|00001350| 23 0a 2b 20 23 0a 20 20 | 23 20 53 79 73 74 65 6d |#.+ #. |# System|
|00001360| 20 62 75 73 20 74 79 70 | 65 73 0a 20 20 23 0a 20 | bus typ|es. #. |
|00001370| 20 0a 64 69 66 66 20 2d | 62 63 72 4e 50 20 73 79 | .diff -|bcrNP sy|
|00001380| 73 2e 6f 72 69 67 2f 61 | 72 63 68 2f 69 33 38 36 |s.orig/a|rch/i386|
|00001390| 2f 69 33 38 36 2f 63 6f | 6e 66 2e 63 20 73 79 73 |/i386/co|nf.c sys|
|000013a0| 2f 61 72 63 68 2f 69 33 | 38 36 2f 69 33 38 36 2f |/arch/i3|86/i386/|
|000013b0| 63 6f 6e 66 2e 63 0a 2a | 2a 2a 20 73 79 73 2e 6f |conf.c.*|** sys.o|
|000013c0| 72 69 67 2f 61 72 63 68 | 2f 69 33 38 36 2f 69 33 |rig/arch|/i386/i3|
|000013d0| 38 36 2f 63 6f 6e 66 2e | 63 09 53 61 74 20 4f 63 |86/conf.|c.Sat Oc|
|000013e0| 74 20 31 34 20 30 32 3a | 35 36 3a 33 36 20 31 39 |t 14 02:|56:36 19|
|000013f0| 39 35 0a 2d 2d 2d 20 73 | 79 73 2f 61 72 63 68 2f |95.--- s|ys/arch/|
|00001400| 69 33 38 36 2f 69 33 38 | 36 2f 63 6f 6e 66 2e 63 |i386/i38|6/conf.c|
|00001410| 09 54 68 75 20 4a 61 6e | 20 31 31 20 32 31 3a 30 |.Thu Jan| 11 21:0|
|00001420| 30 3a 35 30 20 31 39 39 | 36 0a 2a 2a 2a 2a 2a 2a |0:50 199|6.******|
|00001430| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 0a 2a 2a 2a 20 36 30 |********|*.*** 60|
|00001440| 2c 36 35 20 2a 2a 2a 2a | 0a 2d 2d 2d 20 36 30 2c |,65 ****|.--- 60,|
|00001450| 36 37 20 2d 2d 2d 2d 0a | 20 20 62 64 65 76 5f 64 |67 ----.| bdev_d|
|00001460| 65 63 6c 28 73 74 29 3b | 0a 20 20 23 69 6e 63 6c |ecl(st);|. #incl|
|00001470| 75 64 65 20 22 63 64 2e | 68 22 0a 20 20 62 64 65 |ude "cd.|h". bde|
|00001480| 76 5f 64 65 63 6c 28 63 | 64 29 3b 0a 2b 20 23 69 |v_decl(c|d);.+ #i|
|00001490| 6e 63 6c 75 64 65 20 22 | 61 63 64 2e 68 22 0a 2b |nclude "|acd.h".+|
|000014a0| 20 62 64 65 76 5f 64 65 | 63 6c 28 61 63 64 29 3b | bdev_de|cl(acd);|
|000014b0| 0a 20 20 23 69 6e 63 6c | 75 64 65 20 22 6d 63 64 |. #incl|ude "mcd|
|000014c0| 2e 68 22 0a 20 20 62 64 | 65 76 5f 64 65 63 6c 28 |.h". bd|ev_decl(|
|000014d0| 6d 63 64 29 3b 0a 20 20 | 23 69 6e 63 6c 75 64 65 |mcd);. |#include|
|000014e0| 20 22 76 6e 64 2e 68 22 | 0a 2a 2a 2a 2a 2a 2a 2a | "vnd.h"|.*******|
|000014f0| 2a 2a 2a 2a 2a 2a 2a 2a | 0a 2a 2a 2a 20 39 30 2c |********|.*** 90,|
|00001500| 39 35 20 2a 2a 2a 2a 0a | 2d 2d 2d 20 39 32 2c 39 |95 ****.|--- 92,9|
|00001510| 38 20 2d 2d 2d 2d 0a 20 | 20 09 62 64 65 76 5f 64 |8 ----. | .bdev_d|
|00001520| 69 73 6b 5f 69 6e 69 74 | 28 4e 56 4e 44 2c 76 6e |isk_init|(NVND,vn|
|00001530| 64 29 2c 09 2f 2a 20 31 | 34 3a 20 76 6e 6f 64 65 |d),./* 1|4: vnode|
|00001540| 20 64 69 73 6b 20 64 72 | 69 76 65 72 20 2a 2f 0a | disk dr|iver */.|
|00001550| 20 20 09 62 64 65 76 5f | 64 69 73 6b 5f 69 6e 69 | .bdev_|disk_ini|
|00001560| 74 28 4e 53 43 44 2c 73 | 63 64 29 2c 09 2f 2a 20 |t(NSCD,s|cd),./* |
|00001570| 31 35 3a 20 53 6f 6e 79 | 20 43 44 2d 52 4f 4d 20 |15: Sony| CD-ROM |
|00001580| 2a 2f 0a 20 20 09 62 64 | 65 76 5f 64 69 73 6b 5f |*/. .bd|ev_disk_|
|00001590| 69 6e 69 74 28 4e 43 43 | 44 2c 63 63 64 29 2c 09 |init(NCC|D,ccd),.|
|000015a0| 2f 2a 20 31 36 3a 20 63 | 6f 6e 63 61 74 65 6e 61 |/* 16: c|oncatena|
|000015b0| 74 65 64 20 64 69 73 6b | 20 64 72 69 76 65 72 20 |ted disk| driver |
|000015c0| 2a 2f 0a 2b 20 09 62 64 | 65 76 5f 64 69 73 6b 5f |*/.+ .bd|ev_disk_|
|000015d0| 69 6e 69 74 28 4e 41 43 | 44 2c 61 63 64 29 2c 09 |init(NAC|D,acd),.|
|000015e0| 2f 2a 20 31 37 3a 20 41 | 54 41 50 49 20 43 44 2d |/* 17: A|TAPI CD-|
|000015f0| 52 4f 4d 20 2a 2f 0a 20 | 20 7d 3b 0a 20 20 69 6e |ROM */. | };. in|
|00001600| 74 09 6e 62 6c 6b 64 65 | 76 20 3d 20 73 69 7a 65 |t.nblkde|v = size|
|00001610| 6f 66 28 62 64 65 76 73 | 77 29 20 2f 20 73 69 7a |of(bdevs|w) / siz|
|00001620| 65 6f 66 28 62 64 65 76 | 73 77 5b 30 5d 29 3b 0a |eof(bdev|sw[0]);.|
|00001630| 20 20 0a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | .*****|********|
|00001640| 2a 2a 0a 2a 2a 2a 20 31 | 33 39 2c 31 34 34 20 2a |**.*** 1|39,144 *|
|00001650| 2a 2a 2a 0a 2d 2d 2d 20 | 31 34 32 2c 31 34 38 20 |***.--- |142,148 |
|00001660| 2d 2d 2d 2d 0a 20 20 63 | 64 65 76 5f 64 65 63 6c |----. c|dev_decl|
|00001670| 28 73 64 29 3b 0a 20 20 | 63 64 65 76 5f 64 65 63 |(sd);. |cdev_dec|
|00001680| 6c 28 73 74 29 3b 0a 20 | 20 63 64 65 76 5f 64 65 |l(st);. | cdev_de|
|00001690| 63 6c 28 63 64 29 3b 0a | 2b 20 63 64 65 76 5f 64 |cl(cd);.|+ cdev_d|
|000016a0| 65 63 6c 28 61 63 64 29 | 3b 0a 20 20 23 69 6e 63 |ecl(acd)|;. #inc|
|000016b0| 6c 75 64 65 20 22 6c 70 | 74 2e 68 22 0a 20 20 63 |lude "lp|t.h". c|
|000016c0| 64 65 76 5f 64 65 63 6c | 28 6c 70 74 29 3b 0a 20 |dev_decl|(lpt);. |
|000016d0| 20 23 69 6e 63 6c 75 64 | 65 20 22 63 68 2e 68 22 | #includ|e "ch.h"|
|000016e0| 0a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.*******|********|
|000016f0| 0a 2a 2a 2a 20 31 39 36 | 2c 32 30 32 20 2a 2a 2a |.*** 196|,202 ***|
|00001700| 2a 0a 20 20 09 63 64 65 | 76 5f 64 69 73 6b 5f 69 |*. .cde|v_disk_i|
|00001710| 6e 69 74 28 4e 43 43 44 | 2c 63 63 64 29 2c 09 2f |nit(NCCD|,ccd),./|
|00001720| 2a 20 31 38 3a 20 63 6f | 6e 63 61 74 65 6e 61 74 |* 18: co|ncatenat|
|00001730| 65 64 20 64 69 73 6b 20 | 64 72 69 76 65 72 20 2a |ed disk |driver *|
|00001740| 2f 0a 20 20 09 63 64 65 | 76 5f 6e 6f 74 64 65 66 |/. .cde|v_notdef|
|00001750| 28 29 2c 09 09 09 2f 2a | 20 31 39 20 2a 2f 0a 20 |(),.../*| 19 */. |
|00001760| 20 09 63 64 65 76 5f 6e | 6f 74 64 65 66 28 29 2c | .cdev_n|otdef(),|
|00001770| 09 09 09 2f 2a 20 32 30 | 20 2a 2f 0a 21 20 09 63 |.../* 20| */.! .c|
|00001780| 64 65 76 5f 6e 6f 74 64 | 65 66 28 29 2c 09 09 09 |dev_notd|ef(),...|
|00001790| 2f 2a 20 32 31 20 2a 2f | 0a 20 20 09 63 64 65 76 |/* 21 */|. .cdev|
|000017a0| 5f 66 64 5f 69 6e 69 74 | 28 31 2c 66 64 29 2c 09 |_fd_init|(1,fd),.|
|000017b0| 09 2f 2a 20 32 32 3a 20 | 66 69 6c 65 20 64 65 73 |./* 22: |file des|
|000017c0| 63 72 69 70 74 6f 72 20 | 70 73 65 75 64 6f 2d 64 |criptor |pseudo-d|
|000017d0| 65 76 69 63 65 20 2a 2f | 0a 20 20 09 63 64 65 76 |evice */|. .cdev|
|000017e0| 5f 62 70 66 74 75 6e 5f | 69 6e 69 74 28 4e 42 50 |_bpftun_|init(NBP|
|000017f0| 46 49 4c 54 45 52 2c 62 | 70 66 29 2c 2f 2a 20 32 |FILTER,b|pf),/* 2|
|00001800| 33 3a 20 42 65 72 6b 65 | 6c 65 79 20 70 61 63 6b |3: Berke|ley pack|
|00001810| 65 74 20 66 69 6c 74 65 | 72 20 2a 2f 0a 20 20 09 |et filte|r */. .|
|00001820| 63 64 65 76 5f 6e 6f 74 | 64 65 66 28 29 2c 09 09 |cdev_not|def(),..|
|00001830| 09 2f 2a 20 32 34 20 2a | 2f 0a 2d 2d 2d 20 32 30 |./* 24 *|/.--- 20|
|00001840| 30 2c 32 30 36 20 2d 2d | 2d 2d 0a 20 20 09 63 64 |0,206 --|--. .cd|
|00001850| 65 76 5f 64 69 73 6b 5f | 69 6e 69 74 28 4e 43 43 |ev_disk_|init(NCC|
|00001860| 44 2c 63 63 64 29 2c 09 | 2f 2a 20 31 38 3a 20 63 |D,ccd),.|/* 18: c|
|00001870| 6f 6e 63 61 74 65 6e 61 | 74 65 64 20 64 69 73 6b |oncatena|ted disk|
|00001880| 20 64 72 69 76 65 72 20 | 2a 2f 0a 20 20 09 63 64 | driver |*/. .cd|
|00001890| 65 76 5f 6e 6f 74 64 65 | 66 28 29 2c 09 09 09 2f |ev_notde|f(),.../|
|000018a0| 2a 20 31 39 20 2a 2f 0a | 20 20 09 63 64 65 76 5f |* 19 */.| .cdev_|
|000018b0| 6e 6f 74 64 65 66 28 29 | 2c 09 09 09 2f 2a 20 32 |notdef()|,.../* 2|
|000018c0| 30 20 2a 2f 0a 21 20 09 | 63 64 65 76 5f 64 69 73 |0 */.! .|cdev_dis|
|000018d0| 6b 5f 69 6e 69 74 28 4e | 41 43 44 2c 61 63 64 29 |k_init(N|ACD,acd)|
|000018e0| 2c 20 2f 2a 20 32 31 3a | 20 41 54 41 50 49 20 43 |, /* 21:| ATAPI C|
|000018f0| 44 2d 52 4f 4d 20 2a 2f | 0a 20 20 09 63 64 65 76 |D-ROM */|. .cdev|
|00001900| 5f 66 64 5f 69 6e 69 74 | 28 31 2c 66 64 29 2c 09 |_fd_init|(1,fd),.|
|00001910| 09 2f 2a 20 32 32 3a 20 | 66 69 6c 65 20 64 65 73 |./* 22: |file des|
|00001920| 63 72 69 70 74 6f 72 20 | 70 73 65 75 64 6f 2d 64 |criptor |pseudo-d|
|00001930| 65 76 69 63 65 20 2a 2f | 0a 20 20 09 63 64 65 76 |evice */|. .cdev|
|00001940| 5f 62 70 66 74 75 6e 5f | 69 6e 69 74 28 4e 42 50 |_bpftun_|init(NBP|
|00001950| 46 49 4c 54 45 52 2c 62 | 70 66 29 2c 2f 2a 20 32 |FILTER,b|pf),/* 2|
|00001960| 33 3a 20 42 65 72 6b 65 | 6c 65 79 20 70 61 63 6b |3: Berke|ley pack|
|00001970| 65 74 20 66 69 6c 74 65 | 72 20 2a 2f 0a 20 20 09 |et filte|r */. .|
|00001980| 63 64 65 76 5f 6e 6f 74 | 64 65 66 28 29 2c 09 09 |cdev_not|def(),..|
|00001990| 09 2f 2a 20 32 34 20 2a | 2f 0a 64 69 66 66 20 2d |./* 24 *|/.diff -|
|000019a0| 62 63 72 4e 50 20 2f 64 | 65 76 2f 6e 75 6c 6c 20 |bcrNP /d|ev/null |
|000019b0| 73 79 73 2f 61 74 61 70 | 69 2f 61 63 64 2e 63 0a |sys/atap|i/acd.c.|
|000019c0| 2a 2a 2a 20 2f 64 65 76 | 2f 6e 75 6c 6c 09 54 68 |*** /dev|/null.Th|
|000019d0| 75 20 4a 61 6e 20 20 31 | 20 30 31 3a 30 30 3a 30 |u Jan 1| 01:00:0|
|000019e0| 30 20 31 39 37 30 0a 2d | 2d 2d 20 73 79 73 2f 61 |0 1970.-|-- sys/a|
|000019f0| 74 61 70 69 2f 61 63 64 | 2e 63 09 54 75 65 20 4d |tapi/acd|.c.Tue M|
|00001a00| 61 72 20 20 35 20 32 31 | 3a 31 30 3a 32 32 20 31 |ar 5 21|:10:22 1|
|00001a10| 39 39 36 0a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |996.****|********|
|00001a20| 2a 2a 2a 0a 2a 2a 2a 20 | 30 20 2a 2a 2a 2a 0a 2d |***.*** |0 ****.-|
|00001a30| 2d 2d 20 31 2c 31 32 35 | 39 20 2d 2d 2d 2d 0a 2b |-- 1,125|9 ----.+|
|00001a40| 20 2f 2a 0a 2b 20 20 2a | 20 43 6f 70 79 72 69 67 | /*.+ *| Copyrig|
|00001a50| 68 74 20 28 63 29 20 31 | 39 39 36 20 4d 61 6e 75 |ht (c) 1|996 Manu|
|00001a60| 65 6c 20 42 6f 75 79 65 | 72 2e 20 20 41 6c 6c 20 |el Bouye|r. All |
|00001a70| 72 69 67 68 74 73 20 72 | 65 73 65 72 76 65 64 2e |rights r|eserved.|
|00001a80| 0a 2b 20 20 2a 0a 2b 20 | 20 2a 20 52 65 64 69 73 |.+ *.+ | * Redis|
|00001a90| 74 72 69 62 75 74 69 6f | 6e 20 61 6e 64 20 75 73 |tributio|n and us|
|00001aa0| 65 20 69 6e 20 73 6f 75 | 72 63 65 20 61 6e 64 20 |e in sou|rce and |
|00001ab0| 62 69 6e 61 72 79 20 66 | 6f 72 6d 73 2c 20 77 69 |binary f|orms, wi|
|00001ac0| 74 68 20 6f 72 20 77 69 | 74 68 6f 75 74 0a 2b 20 |th or wi|thout.+ |
|00001ad0| 20 2a 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 2c | * modif|ication,|
|00001ae0| 20 61 72 65 20 70 65 72 | 6d 69 74 74 65 64 20 70 | are per|mitted p|
|00001af0| 72 6f 76 69 64 65 64 20 | 74 68 61 74 20 74 68 65 |rovided |that the|
|00001b00| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 63 6f 6e 64 69 | followi|ng condi|
|00001b10| 74 69 6f 6e 73 0a 2b 20 | 20 2a 20 61 72 65 20 6d |tions.+ | * are m|
|00001b20| 65 74 3a 0a 2b 20 20 2a | 20 31 2e 20 52 65 64 69 |et:.+ *| 1. Redi|
|00001b30| 73 74 72 69 62 75 74 69 | 6f 6e 73 20 6f 66 20 73 |stributi|ons of s|
|00001b40| 6f 75 72 63 65 20 63 6f | 64 65 20 6d 75 73 74 20 |ource co|de must |
|00001b50| 72 65 74 61 69 6e 20 74 | 68 65 20 61 62 6f 76 65 |retain t|he above|
|00001b60| 20 63 6f 70 79 72 69 67 | 68 74 0a 2b 20 20 2a 20 | copyrig|ht.+ * |
|00001b70| 20 20 20 6e 6f 74 69 63 | 65 2c 20 74 68 69 73 20 | notic|e, this |
|00001b80| 6c 69 73 74 20 6f 66 20 | 63 6f 6e 64 69 74 69 6f |list of |conditio|
|00001b90| 6e 73 20 61 6e 64 20 74 | 68 65 20 66 6f 6c 6c 6f |ns and t|he follo|
|00001ba0| 77 69 6e 67 20 64 69 73 | 63 6c 61 69 6d 65 72 2e |wing dis|claimer.|
|00001bb0| 0a 2b 20 20 2a 20 32 2e | 20 52 65 64 69 73 74 72 |.+ * 2.| Redistr|
|00001bc0| 69 62 75 74 69 6f 6e 73 | 20 69 6e 20 62 69 6e 61 |ibutions| in bina|
|00001bd0| 72 79 20 66 6f 72 6d 20 | 6d 75 73 74 20 72 65 70 |ry form |must rep|
|00001be0| 72 6f 64 75 63 65 20 74 | 68 65 20 61 62 6f 76 65 |roduce t|he above|
|00001bf0| 20 63 6f 70 79 72 69 67 | 68 74 0a 2b 20 20 2a 20 | copyrig|ht.+ * |
|00001c00| 20 20 20 6e 6f 74 69 63 | 65 2c 20 74 68 69 73 20 | notic|e, this |
|00001c10| 6c 69 73 74 20 6f 66 20 | 63 6f 6e 64 69 74 69 6f |list of |conditio|
|00001c20| 6e 73 20 61 6e 64 20 74 | 68 65 20 66 6f 6c 6c 6f |ns and t|he follo|
|00001c30| 77 69 6e 67 20 64 69 73 | 63 6c 61 69 6d 65 72 20 |wing dis|claimer |
|00001c40| 69 6e 20 74 68 65 0a 2b | 20 20 2a 20 20 20 20 64 |in the.+| * d|
|00001c50| 6f 63 75 6d 65 6e 74 61 | 74 69 6f 6e 20 61 6e 64 |ocumenta|tion and|
|00001c60| 2f 6f 72 20 6f 74 68 65 | 72 20 6d 61 74 65 72 69 |/or othe|r materi|
|00001c70| 61 6c 73 20 70 72 6f 76 | 69 64 65 64 20 77 69 74 |als prov|ided wit|
|00001c80| 68 20 74 68 65 20 64 69 | 73 74 72 69 62 75 74 69 |h the di|stributi|
|00001c90| 6f 6e 2e 0a 2b 20 20 2a | 20 33 2e 20 41 6c 6c 20 |on..+ *| 3. All |
|00001ca0| 61 64 76 65 72 74 69 73 | 69 6e 67 20 6d 61 74 65 |advertis|ing mate|
|00001cb0| 72 69 61 6c 73 20 6d 65 | 6e 74 69 6f 6e 69 6e 67 |rials me|ntioning|
|00001cc0| 20 66 65 61 74 75 72 65 | 73 20 6f 72 20 75 73 65 | feature|s or use|
|00001cd0| 20 6f 66 20 74 68 69 73 | 20 73 6f 66 74 77 61 72 | of this| softwar|
|00001ce0| 65 0a 2b 20 20 2a 20 20 | 20 20 6d 75 73 74 20 64 |e.+ * | must d|
|00001cf0| 69 73 70 6c 61 79 20 74 | 68 65 20 66 6f 6c 6c 6f |isplay t|he follo|
|00001d00| 77 69 6e 67 20 61 63 6b | 6e 6f 77 6c 65 64 67 65 |wing ack|nowledge|
|00001d10| 6d 65 6e 74 3a 0a 2b 20 | 20 2a 20 20 54 68 69 73 |ment:.+ | * This|
|00001d20| 20 70 72 6f 64 75 63 74 | 20 69 6e 63 6c 75 64 65 | product| include|
|00001d30| 73 20 73 6f 66 74 77 61 | 72 65 20 64 65 76 65 6c |s softwa|re devel|
|00001d40| 6f 70 65 64 20 62 79 20 | 4d 61 6e 75 65 6c 20 42 |oped by |Manuel B|
|00001d50| 6f 75 79 65 72 2e 0a 2b | 20 20 2a 20 34 2e 20 54 |ouyer..+| * 4. T|
|00001d60| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 61 |he name |of the a|
|00001d70| 75 74 68 6f 72 20 6d 61 | 79 20 6e 6f 74 20 62 65 |uthor ma|y not be|
|00001d80| 20 75 73 65 64 20 74 6f | 20 65 6e 64 6f 72 73 65 | used to| endorse|
|00001d90| 20 6f 72 20 70 72 6f 6d | 6f 74 65 20 70 72 6f 64 | or prom|ote prod|
|00001da0| 75 63 74 73 0a 2b 20 20 | 2a 20 20 20 20 64 65 72 |ucts.+ |* der|
|00001db0| 69 76 65 64 20 66 72 6f | 6d 20 74 68 69 73 20 73 |ived fro|m this s|
|00001dc0| 6f 66 74 77 61 72 65 20 | 77 69 74 68 6f 75 74 20 |oftware |without |
|00001dd0| 73 70 65 63 69 66 69 63 | 20 70 72 69 6f 72 20 77 |specific| prior w|
|00001de0| 72 69 74 74 65 6e 20 70 | 65 72 6d 69 73 73 69 6f |ritten p|ermissio|
|00001df0| 6e 2e 0a 2b 20 20 2a 0a | 2b 20 20 2a 20 54 48 49 |n..+ *.|+ * THI|
|00001e00| 53 20 53 4f 46 54 57 41 | 52 45 20 49 53 20 50 52 |S SOFTWA|RE IS PR|
|00001e10| 4f 56 49 44 45 44 20 42 | 59 20 54 48 45 20 41 55 |OVIDED B|Y THE AU|
|00001e20| 54 48 4f 52 20 60 60 41 | 53 20 49 53 27 27 20 41 |THOR ``A|S IS'' A|
|00001e30| 4e 44 20 41 4e 59 20 45 | 58 50 52 45 53 53 20 4f |ND ANY E|XPRESS O|
|00001e40| 52 0a 2b 20 20 2a 20 49 | 4d 50 4c 49 45 44 20 57 |R.+ * I|MPLIED W|
|00001e50| 41 52 52 41 4e 54 49 45 | 53 2c 20 49 4e 43 4c 55 |ARRANTIE|S, INCLU|
|00001e60| 44 49 4e 47 2c 20 42 55 | 54 20 4e 4f 54 20 4c 49 |DING, BU|T NOT LI|
|00001e70| 4d 49 54 45 44 20 54 4f | 2c 20 54 48 45 20 49 4d |MITED TO|, THE IM|
|00001e80| 50 4c 49 45 44 20 57 41 | 52 52 41 4e 54 49 45 53 |PLIED WA|RRANTIES|
|00001e90| 0a 2b 20 20 2a 20 4f 46 | 20 4d 45 52 43 48 41 4e |.+ * OF| MERCHAN|
|00001ea0| 54 41 42 49 4c 49 54 59 | 20 41 4e 44 20 46 49 54 |TABILITY| AND FIT|
|00001eb0| 4e 45 53 53 20 46 4f 52 | 20 41 20 50 41 52 54 49 |NESS FOR| A PARTI|
|00001ec0| 43 55 4c 41 52 20 50 55 | 52 50 4f 53 45 20 41 52 |CULAR PU|RPOSE AR|
|00001ed0| 45 20 44 49 53 43 4c 41 | 49 4d 45 44 2e 0a 2b 20 |E DISCLA|IMED..+ |
|00001ee0| 20 2a 20 49 4e 20 4e 4f | 20 45 56 45 4e 54 20 53 | * IN NO| EVENT S|
|00001ef0| 48 41 4c 4c 20 54 48 45 | 20 41 55 54 48 4f 52 20 |HALL THE| AUTHOR |
|00001f00| 42 45 20 4c 49 41 42 4c | 45 20 46 4f 52 20 41 4e |BE LIABL|E FOR AN|
|00001f10| 59 20 44 49 52 45 43 54 | 2c 20 49 4e 44 49 52 45 |Y DIRECT|, INDIRE|
|00001f20| 43 54 2c 0a 2b 20 20 2a | 20 49 4e 43 49 44 45 4e |CT,.+ *| INCIDEN|
|00001f30| 54 41 4c 2c 20 53 50 45 | 43 49 41 4c 2c 20 45 58 |TAL, SPE|CIAL, EX|
|00001f40| 45 4d 50 4c 41 52 59 2c | 20 4f 52 20 43 4f 4e 53 |EMPLARY,| OR CONS|
|00001f50| 45 51 55 45 4e 54 49 41 | 4c 20 44 41 4d 41 47 45 |EQUENTIA|L DAMAGE|
|00001f60| 53 20 28 49 4e 43 4c 55 | 44 49 4e 47 2c 20 42 55 |S (INCLU|DING, BU|
|00001f70| 54 0a 2b 20 20 2a 20 4e | 4f 54 20 4c 49 4d 49 54 |T.+ * N|OT LIMIT|
|00001f80| 45 44 20 54 4f 2c 20 50 | 52 4f 43 55 52 45 4d 45 |ED TO, P|ROCUREME|
|00001f90| 4e 54 20 4f 46 20 53 55 | 42 53 54 49 54 55 54 45 |NT OF SU|BSTITUTE|
|00001fa0| 20 47 4f 4f 44 53 20 4f | 52 20 53 45 52 56 49 43 | GOODS O|R SERVIC|
|00001fb0| 45 53 3b 20 4c 4f 53 53 | 20 4f 46 20 55 53 45 2c |ES; LOSS| OF USE,|
|00001fc0| 0a 2b 20 20 2a 20 44 41 | 54 41 2c 20 4f 52 20 50 |.+ * DA|TA, OR P|
|00001fd0| 52 4f 46 49 54 53 3b 20 | 4f 52 20 42 55 53 49 4e |ROFITS; |OR BUSIN|
|00001fe0| 45 53 53 20 49 4e 54 45 | 52 52 55 50 54 49 4f 4e |ESS INTE|RRUPTION|
|00001ff0| 29 20 48 4f 57 45 56 45 | 52 20 43 41 55 53 45 44 |) HOWEVE|R CAUSED|
|00002000| 20 41 4e 44 20 4f 4e 20 | 41 4e 59 0a 2b 20 20 2a | AND ON |ANY.+ *|
|00002010| 20 54 48 45 4f 52 59 20 | 4f 46 20 4c 49 41 42 49 | THEORY |OF LIABI|
|00002020| 4c 49 54 59 2c 20 57 48 | 45 54 48 45 52 20 49 4e |LITY, WH|ETHER IN|
|00002030| 20 43 4f 4e 54 52 41 43 | 54 2c 20 53 54 52 49 43 | CONTRAC|T, STRIC|
|00002040| 54 20 4c 49 41 42 49 4c | 49 54 59 2c 20 4f 52 20 |T LIABIL|ITY, OR |
|00002050| 54 4f 52 54 0a 2b 20 20 | 2a 20 28 49 4e 43 4c 55 |TORT.+ |* (INCLU|
|00002060| 44 49 4e 47 20 4e 45 47 | 4c 49 47 45 4e 43 45 20 |DING NEG|LIGENCE |
|00002070| 4f 52 20 4f 54 48 45 52 | 57 49 53 45 29 20 41 52 |OR OTHER|WISE) AR|
|00002080| 49 53 49 4e 47 20 49 4e | 20 41 4e 59 20 57 41 59 |ISING IN| ANY WAY|
|00002090| 20 4f 55 54 20 4f 46 20 | 54 48 45 20 55 53 45 20 | OUT OF |THE USE |
|000020a0| 4f 46 0a 2b 20 20 2a 20 | 54 48 49 53 20 53 4f 46 |OF.+ * |THIS SOF|
|000020b0| 54 57 41 52 45 2c 20 45 | 56 45 4e 20 49 46 20 41 |TWARE, E|VEN IF A|
|000020c0| 44 56 49 53 45 44 20 4f | 46 20 54 48 45 20 50 4f |DVISED O|F THE PO|
|000020d0| 53 53 49 42 49 4c 49 54 | 59 20 4f 46 20 53 55 43 |SSIBILIT|Y OF SUC|
|000020e0| 48 20 44 41 4d 41 47 45 | 2e 0a 2b 20 20 2a 2f 0a |H DAMAGE|..+ */.|
|000020f0| 2b 20 0a 2b 20 0a 2b 20 | 23 69 6e 63 6c 75 64 65 |+ .+ .+ |#include|
|00002100| 20 3c 73 79 73 2f 74 79 | 70 65 73 2e 68 3e 0a 2b | <sys/ty|pes.h>.+|
|00002110| 20 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 2f 70 | #includ|e <sys/p|
|00002120| 61 72 61 6d 2e 68 3e 0a | 2b 20 23 69 6e 63 6c 75 |aram.h>.|+ #inclu|
|00002130| 64 65 20 3c 73 79 73 2f | 73 79 73 74 6d 2e 68 3e |de <sys/|systm.h>|
|00002140| 0a 2b 20 23 69 6e 63 6c | 75 64 65 20 3c 73 79 73 |.+ #incl|ude <sys|
|00002150| 2f 6b 65 72 6e 65 6c 2e | 68 3e 0a 2b 20 23 69 6e |/kernel.|h>.+ #in|
|00002160| 63 6c 75 64 65 20 3c 73 | 79 73 2f 63 6f 6e 66 2e |clude <s|ys/conf.|
|00002170| 68 3e 0a 2b 20 23 69 6e | 63 6c 75 64 65 20 3c 73 |h>.+ #in|clude <s|
|00002180| 79 73 2f 66 69 6c 65 2e | 68 3e 0a 2b 20 23 69 6e |ys/file.|h>.+ #in|
|00002190| 63 6c 75 64 65 20 3c 73 | 79 73 2f 73 74 61 74 2e |clude <s|ys/stat.|
|000021a0| 68 3e 0a 2b 20 23 69 6e | 63 6c 75 64 65 20 3c 73 |h>.+ #in|clude <s|
|000021b0| 79 73 2f 69 6f 63 74 6c | 2e 68 3e 0a 2b 20 23 69 |ys/ioctl|.h>.+ #i|
|000021c0| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 62 75 66 2e |nclude <|sys/buf.|
|000021d0| 68 3e 0a 2b 20 23 69 6e | 63 6c 75 64 65 20 3c 73 |h>.+ #in|clude <s|
|000021e0| 79 73 2f 75 69 6f 2e 68 | 3e 0a 2b 20 23 69 6e 63 |ys/uio.h|>.+ #inc|
|000021f0| 6c 75 64 65 20 3c 73 79 | 73 2f 6d 61 6c 6c 6f 63 |lude <sy|s/malloc|
|00002200| 2e 68 3e 0a 2b 20 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.+ #i|nclude <|
|00002210| 73 79 73 2f 65 72 72 6e | 6f 2e 68 3e 0a 2b 20 23 |sys/errn|o.h>.+ #|
|00002220| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 64 65 76 |include |<sys/dev|
|00002230| 69 63 65 2e 68 3e 0a 2b | 20 23 69 6e 63 6c 75 64 |ice.h>.+| #includ|
|00002240| 65 20 3c 73 79 73 2f 64 | 69 73 6b 6c 61 62 65 6c |e <sys/d|isklabel|
|00002250| 2e 68 3e 0a 2b 20 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.+ #i|nclude <|
|00002260| 73 79 73 2f 64 69 73 6b | 2e 68 3e 0a 2b 20 23 69 |sys/disk|.h>.+ #i|
|00002270| 6e 63 6c 75 64 65 20 3c | 73 79 73 2f 63 64 69 6f |nclude <|sys/cdio|
|00002280| 2e 68 3e 0a 2b 20 23 69 | 6e 63 6c 75 64 65 20 3c |.h>.+ #i|nclude <|
|00002290| 73 79 73 2f 70 72 6f 63 | 2e 68 3e 20 20 0a 2b 20 |sys/proc|.h> .+ |
|000022a0| 0a 2b 20 23 69 6e 63 6c | 75 64 65 20 3c 61 74 61 |.+ #incl|ude <ata|
|000022b0| 70 69 2f 61 74 61 70 69 | 6c 69 6e 6b 2e 68 3e 0a |pi/atapi|link.h>.|
|000022c0| 2b 20 23 69 6e 63 6c 75 | 64 65 20 3c 61 74 61 70 |+ #inclu|de <atap|
|000022d0| 69 2f 61 74 61 70 69 2e | 68 3e 0a 2b 20 0a 2b 20 |i/atapi.|h>.+ .+ |
|000022e0| 23 64 65 66 69 6e 65 09 | 43 44 55 4e 49 54 28 7a |#define.|CDUNIT(z|
|000022f0| 29 09 09 09 44 49 53 4b | 55 4e 49 54 28 7a 29 0a |)...DISK|UNIT(z).|
|00002300| 2b 20 23 64 65 66 69 6e | 65 09 43 44 50 41 52 54 |+ #defin|e.CDPART|
|00002310| 28 7a 29 09 09 09 44 49 | 53 4b 50 41 52 54 28 7a |(z)...DI|SKPART(z|
|00002320| 29 0a 2b 20 23 64 65 66 | 69 6e 65 09 4d 41 4b 45 |).+ #def|ine.MAKE|
|00002330| 43 44 44 45 56 28 6d 61 | 6a 2c 20 75 6e 69 74 2c |CDDEV(ma|j, unit,|
|00002340| 20 70 61 72 74 29 09 4d | 41 4b 45 44 49 53 4b 44 | part).M|AKEDISKD|
|00002350| 45 56 28 6d 61 6a 2c 20 | 75 6e 69 74 2c 20 70 61 |EV(maj, |unit, pa|
|00002360| 72 74 29 0a 2b 20 0a 2b | 20 73 74 72 75 63 74 20 |rt).+ .+| struct |
|00002370| 61 63 64 5f 73 6f 66 74 | 63 20 7b 0a 2b 20 09 73 |acd_soft|c {.+ .s|
|00002380| 74 72 75 63 74 20 64 65 | 76 69 63 65 20 73 63 5f |truct de|vice sc_|
|00002390| 64 65 76 3b 0a 2b 20 09 | 73 74 72 75 63 74 20 64 |dev;.+ .|struct d|
|000023a0| 6b 64 65 76 69 63 65 20 | 73 63 5f 64 6b 3b 0a 2b |kdevice |sc_dk;.+|
|000023b0| 20 0a 2b 20 09 69 6e 74 | 20 66 6c 61 67 73 3b 0a | .+ .int| flags;.|
|000023c0| 2b 20 23 64 65 66 69 6e | 65 09 43 44 46 5f 4c 4f |+ #defin|e.CDF_LO|
|000023d0| 43 4b 45 44 09 30 78 30 | 31 0a 2b 20 23 64 65 66 |CKED.0x0|1.+ #def|
|000023e0| 69 6e 65 09 43 44 46 5f | 57 41 4e 54 45 44 09 30 |ine.CDF_|WANTED.0|
|000023f0| 78 30 32 0a 2b 20 23 64 | 65 66 69 6e 65 09 43 44 |x02.+ #d|efine.CD|
|00002400| 46 5f 57 4c 41 42 45 4c | 09 30 78 30 34 09 09 2f |F_WLABEL|.0x04../|
|00002410| 2a 20 6c 61 62 65 6c 20 | 69 73 20 77 72 69 74 61 |* label |is writa|
|00002420| 62 6c 65 20 2a 2f 0a 2b | 20 23 64 65 66 69 6e 65 |ble */.+| #define|
|00002430| 09 43 44 46 5f 4c 41 42 | 45 4c 4c 49 4e 47 09 30 |.CDF_LAB|ELLING.0|
|00002440| 78 30 38 09 09 2f 2a 20 | 77 72 69 74 69 6e 67 20 |x08../* |writing |
|00002450| 6c 61 62 65 6c 20 2a 2f | 0a 2b 20 09 73 74 72 75 |label */|.+ .stru|
|00002460| 63 74 20 61 74 5f 64 65 | 76 5f 6c 69 6e 6b 20 2a |ct at_de|v_link *|
|00002470| 61 64 5f 6c 69 6e 6b 3b | 09 2f 2a 20 63 6f 6e 74 |ad_link;|./* cont|
|00002480| 61 69 6e 73 20 6f 75 72 | 20 64 72 69 76 65 20 6e |ains our| drive n|
|00002490| 75 6d 62 65 72 2c 20 65 | 74 63 20 2e 2e 2e 20 2a |umber, e|tc ... *|
|000024a0| 2f 0a 2b 20 09 73 74 72 | 75 63 74 20 63 64 5f 70 |/.+ .str|uct cd_p|
|000024b0| 61 72 6d 73 20 7b 0a 2b | 20 09 09 69 6e 74 20 62 |arms {.+| ..int b|
|000024c0| 6c 6b 73 69 7a 65 3b 0a | 2b 20 09 09 75 5f 6c 6f |lksize;.|+ ..u_lo|
|000024d0| 6e 67 20 64 69 73 6b 73 | 69 7a 65 3b 09 2f 2a 20 |ng disks|ize;./* |
|000024e0| 74 6f 74 61 6c 20 6e 75 | 6d 62 65 72 20 73 65 63 |total nu|mber sec|
|000024f0| 74 6f 72 73 20 2a 2f 0a | 2b 20 09 7d 20 70 61 72 |tors */.|+ .} par|
|00002500| 61 6d 73 3b 0a 2b 20 09 | 73 74 72 75 63 74 20 62 |ams;.+ .|struct b|
|00002510| 75 66 20 62 75 66 5f 71 | 75 65 75 65 3b 0a 2b 20 |uf buf_q|ueue;.+ |
|00002520| 7d 3b 0a 2b 20 0a 2b 20 | 69 6e 74 20 61 63 64 6d |};.+ .+ |int acdm|
|00002530| 61 74 63 68 20 5f 5f 50 | 28 28 73 74 72 75 63 74 |atch __P|((struct|
|00002540| 20 64 65 76 69 63 65 20 | 2a 2c 20 76 6f 69 64 20 | device |*, void |
|00002550| 2a 2c 20 76 6f 69 64 20 | 2a 29 29 3b 0a 2b 20 76 |*, void |*));.+ v|
|00002560| 6f 69 64 20 61 63 64 61 | 74 74 61 63 68 20 5f 5f |oid acda|ttach __|
|00002570| 50 28 28 73 74 72 75 63 | 74 20 64 65 76 69 63 65 |P((struc|t device|
|00002580| 20 2a 2c 20 73 74 72 75 | 63 74 20 64 65 76 69 63 | *, stru|ct devic|
|00002590| 65 20 2a 2c 20 76 6f 69 | 64 20 2a 29 29 3b 0a 2b |e *, voi|d *));.+|
|000025a0| 20 0a 2b 20 73 74 72 75 | 63 74 20 63 66 64 72 69 | .+ stru|ct cfdri|
|000025b0| 76 65 72 20 61 63 64 63 | 64 20 3d 20 7b 0a 2b 20 |ver acdc|d = {.+ |
|000025c0| 09 4e 55 4c 4c 2c 20 22 | 61 63 64 22 2c 20 61 63 |.NULL, "|acd", ac|
|000025d0| 64 6d 61 74 63 68 2c 20 | 61 63 64 61 74 74 61 63 |dmatch, |acdattac|
|000025e0| 68 2c 20 44 56 5f 44 49 | 53 4b 2c 20 73 69 7a 65 |h, DV_DI|SK, size|
|000025f0| 6f 66 28 73 74 72 75 63 | 74 20 61 63 64 5f 73 6f |of(struc|t acd_so|
|00002600| 66 74 63 29 0a 2b 20 7d | 3b 0a 2b 20 76 6f 69 64 |ftc).+ }|;.+ void|
|00002610| 20 61 63 64 67 65 74 64 | 69 73 6b 6c 61 62 65 6c | acdgetd|isklabel|
|00002620| 20 5f 5f 50 28 28 73 74 | 72 75 63 74 20 61 63 64 | __P((st|ruct acd|
|00002630| 5f 73 6f 66 74 63 20 2a | 29 29 3b 0a 2b 20 69 6e |_softc *|));.+ in|
|00002640| 74 20 61 63 64 5f 67 65 | 74 5f 70 61 72 6d 73 20 |t acd_ge|t_parms |
|00002650| 5f 5f 50 28 28 73 74 72 | 75 63 74 20 61 63 64 5f |__P((str|uct acd_|
|00002660| 73 6f 66 74 63 20 2a 2c | 20 69 6e 74 29 29 3b 0a |softc *,| int));.|
|00002670| 2b 20 76 6f 69 64 20 61 | 63 64 73 74 72 61 74 65 |+ void a|cdstrate|
|00002680| 67 79 20 5f 5f 50 28 28 | 73 74 72 75 63 74 20 62 |gy __P((|struct b|
|00002690| 75 66 20 2a 29 29 3b 0a | 2b 20 76 6f 69 64 20 61 |uf *));.|+ void a|
|000026a0| 63 64 73 74 61 72 74 20 | 5f 5f 50 28 28 73 74 72 |cdstart |__P((str|
|000026b0| 75 63 74 20 61 63 64 5f | 73 6f 66 74 63 20 2a 29 |uct acd_|softc *)|
|000026c0| 29 3b 0a 2b 20 69 6e 74 | 20 61 63 64 5f 70 61 75 |);.+ int| acd_pau|
|000026d0| 73 65 20 5f 5f 50 28 28 | 73 74 72 75 63 74 20 61 |se __P((|struct a|
|000026e0| 63 64 5f 73 6f 66 74 63 | 20 2a 2c 20 69 6e 74 29 |cd_softc| *, int)|
|000026f0| 29 3b 0a 2b 20 76 6f 69 | 64 20 20 20 20 61 63 64 |);.+ voi|d acd|
|00002700| 6d 69 6e 70 68 79 73 20 | 5f 5f 50 28 28 73 74 72 |minphys |__P((str|
|00002710| 75 63 74 20 62 75 66 2a | 29 29 3b 0a 2b 20 75 5f |uct buf*|));.+ u_|
|00002720| 6c 6f 6e 67 20 61 63 64 | 5f 73 69 7a 65 20 5f 5f |long acd|_size __|
|00002730| 50 28 28 73 74 72 75 63 | 74 20 61 63 64 5f 73 6f |P((struc|t acd_so|
|00002740| 66 74 63 2a 2c 20 69 6e | 74 29 29 3b 0a 2b 20 0a |ftc*, in|t));.+ .|
|00002750| 2b 20 73 74 72 75 63 74 | 20 64 6b 64 72 69 76 65 |+ struct| dkdrive|
|00002760| 72 20 61 63 64 64 6b 64 | 72 69 76 65 72 20 3d 20 |r acddkd|river = |
|00002770| 7b 20 61 63 64 73 74 72 | 61 74 65 67 79 20 7d 3b |{ acdstr|ategy };|
|00002780| 0a 2b 20 0a 2b 20 69 6e | 74 0a 2b 20 61 63 64 6d |.+ .+ in|t.+ acdm|
|00002790| 61 74 63 68 28 70 61 72 | 65 6e 74 2c 20 6d 61 74 |atch(par|ent, mat|
|000027a0| 63 68 2c 20 61 75 78 29 | 0a 2b 20 09 73 74 72 75 |ch, aux)|.+ .stru|
|000027b0| 63 74 20 64 65 76 69 63 | 65 20 2a 70 61 72 65 6e |ct devic|e *paren|
|000027c0| 74 3b 0a 2b 20 09 76 6f | 69 64 20 2a 6d 61 74 63 |t;.+ .vo|id *matc|
|000027d0| 68 2c 20 2a 61 75 78 3b | 0a 2b 20 7b 0a 2b 20 09 |h, *aux;|.+ {.+ .|
|000027e0| 73 74 72 75 63 74 20 63 | 66 64 61 74 61 20 2a 63 |struct c|fdata *c|
|000027f0| 66 20 3d 20 6d 61 74 63 | 68 3b 0a 2b 20 09 73 74 |f = matc|h;.+ .st|
|00002800| 72 75 63 74 20 61 74 5f | 64 65 76 5f 6c 69 6e 6b |ruct at_|dev_link|
|00002810| 20 2a 73 61 20 3d 20 61 | 75 78 3b 0a 2b 20 23 69 | *sa = a|ux;.+ #i|
|00002820| 66 64 65 66 20 41 54 41 | 50 49 5f 44 45 42 55 47 |fdef ATA|PI_DEBUG|
|00002830| 5f 50 52 4f 42 45 0a 2b | 20 09 70 72 69 6e 74 66 |_PROBE.+| .printf|
|00002840| 28 22 61 63 64 6d 61 74 | 63 68 3a 20 64 65 76 69 |("acdmat|ch: devi|
|00002850| 63 65 20 25 64 5c 6e 22 | 2c 73 61 2d 3e 69 64 2e |ce %d\n"|,sa->id.|
|00002860| 63 6f 6e 66 69 67 2e 64 | 65 76 69 63 65 5f 74 79 |config.d|evice_ty|
|00002870| 70 65 29 3b 0a 2b 20 23 | 65 6e 64 69 66 0a 2b 20 |pe);.+ #|endif.+ |
|00002880| 09 69 66 20 28 73 61 2d | 3e 69 64 2e 63 6f 6e 66 |.if (sa-|>id.conf|
|00002890| 69 67 2e 64 65 76 69 63 | 65 5f 74 79 70 65 20 3d |ig.devic|e_type =|
|000028a0| 3d 20 41 54 41 50 49 5f | 44 45 56 49 43 45 5f 54 |= ATAPI_|DEVICE_T|
|000028b0| 59 50 45 5f 43 44 29 20 | 72 65 74 75 72 6e 20 31 |YPE_CD) |return 1|
|000028c0| 3b 0a 2b 20 09 72 65 74 | 75 72 6e 20 30 3b 0a 2b |;.+ .ret|urn 0;.+|
|000028d0| 20 09 0a 2b 20 7d 0a 2b | 20 0a 2b 20 2f 2a 0a 2b | ..+ }.+| .+ /*.+|
|000028e0| 20 20 2a 20 54 68 65 20 | 72 6f 75 74 69 6e 65 20 | * The |routine |
|000028f0| 63 61 6c 6c 65 64 20 62 | 79 20 74 68 65 20 6c 6f |called b|y the lo|
|00002900| 77 20 6c 65 76 65 6c 20 | 61 74 61 70 69 20 72 6f |w level |atapi ro|
|00002910| 75 74 69 6e 65 20 77 68 | 65 6e 20 69 74 20 64 69 |utine wh|en it di|
|00002920| 73 63 6f 76 65 72 73 0a | 2b 20 20 2a 20 41 20 64 |scovers.|+ * A d|
|00002930| 65 76 69 63 65 20 73 75 | 69 74 61 62 6c 65 20 66 |evice su|itable f|
|00002940| 6f 72 20 74 68 69 73 20 | 64 72 69 76 65 72 0a 2b |or this |driver.+|
|00002950| 20 20 2a 2f 0a 2b 20 76 | 6f 69 64 0a 2b 20 61 63 | */.+ v|oid.+ ac|
|00002960| 64 61 74 74 61 63 68 28 | 70 61 72 65 6e 74 2c 20 |dattach(|parent, |
|00002970| 73 65 6c 66 2c 20 61 75 | 78 29 0a 2b 20 09 73 74 |self, au|x).+ .st|
|00002980| 72 75 63 74 20 64 65 76 | 69 63 65 20 2a 70 61 72 |ruct dev|ice *par|
|00002990| 65 6e 74 2c 20 2a 73 65 | 6c 66 3b 0a 2b 20 09 76 |ent, *se|lf;.+ .v|
|000029a0| 6f 69 64 20 2a 61 75 78 | 3b 0a 2b 20 7b 0a 2b 20 |oid *aux|;.+ {.+ |
|000029b0| 09 73 74 72 75 63 74 20 | 61 63 64 5f 73 6f 66 74 |.struct |acd_soft|
|000029c0| 63 20 2a 61 63 64 20 3d | 20 28 76 6f 69 64 20 2a |c *acd =| (void *|
|000029d0| 29 73 65 6c 66 3b 0a 2b | 20 09 73 74 72 75 63 74 |)self;.+| .struct|
|000029e0| 20 61 74 5f 64 65 76 5f | 6c 69 6e 6b 20 2a 73 61 | at_dev_|link *sa|
|000029f0| 20 3d 20 61 75 78 3b 0a | 2b 20 09 73 74 72 75 63 | = aux;.|+ .struc|
|00002a00| 74 20 6d 6f 64 65 5f 73 | 65 6e 73 65 20 63 6d 64 |t mode_s|ense cmd|
|00002a10| 3b 0a 2b 20 09 73 74 72 | 75 63 74 20 63 61 70 70 |;.+ .str|uct capp|
|00002a20| 61 67 65 20 63 61 70 3b | 0a 2b 20 0a 2b 20 09 73 |age cap;|.+ .+ .s|
|00002a30| 61 2d 3e 64 65 76 69 63 | 65 5f 73 6f 66 74 63 20 |a->devic|e_softc |
|00002a40| 3d 20 61 63 64 3b 0a 2b | 20 09 73 61 2d 3e 73 74 |= acd;.+| .sa->st|
|00002a50| 61 72 74 20 3d 20 61 63 | 64 73 74 61 72 74 3b 0a |art = ac|dstart;.|
|00002a60| 2b 20 09 73 61 2d 3e 66 | 6c 61 67 73 20 7c 3d 20 |+ .sa->f|lags |= |
|00002a70| 41 44 45 56 5f 52 45 4d | 4f 56 41 42 4c 45 3b 0a |ADEV_REM|OVABLE;.|
|00002a80| 2b 20 09 73 61 2d 3e 6f | 70 65 6e 69 6e 67 73 20 |+ .sa->o|penings |
|00002a90| 3d 20 31 3b 0a 2b 20 09 | 61 63 64 2d 3e 61 64 5f |= 1;.+ .|acd->ad_|
|00002aa0| 6c 69 6e 6b 20 3d 20 73 | 61 3b 0a 2b 20 0a 2b 20 |link = s|a;.+ .+ |
|00002ab0| 09 61 63 64 2d 3e 73 63 | 5f 64 6b 2e 64 6b 5f 64 |.acd->sc|_dk.dk_d|
|00002ac0| 72 69 76 65 72 20 3d 20 | 26 61 63 64 64 6b 64 72 |river = |&acddkdr|
|00002ad0| 69 76 65 72 3b 0a 2b 20 | 23 69 66 20 21 64 65 66 |iver;.+ |#if !def|
|00002ae0| 69 6e 65 64 28 69 33 38 | 36 29 20 7c 7c 20 64 65 |ined(i38|6) || de|
|00002af0| 66 69 6e 65 64 28 4e 45 | 57 43 4f 4e 46 49 47 29 |fined(NE|WCONFIG)|
|00002b00| 0a 2b 20 20 20 20 20 64 | 6b 5f 65 73 74 61 62 6c |.+ d|k_establ|
|00002b10| 69 73 68 28 26 61 63 64 | 2d 3e 73 63 5f 64 6b 2c |ish(&acd|->sc_dk,|
|00002b20| 20 26 61 63 64 2d 3e 73 | 63 5f 64 65 76 29 3b 20 | &acd->s|c_dev); |
|00002b30| 20 20 0a 2b 20 23 65 6e | 64 69 66 0a 2b 20 0a 2b | .+ #en|dif.+ .+|
|00002b40| 20 09 28 76 6f 69 64 29 | 61 74 61 70 69 5f 74 65 | .(void)|atapi_te|
|00002b50| 73 74 5f 75 6e 69 74 5f | 72 65 61 64 79 28 73 61 |st_unit_|ready(sa|
|00002b60| 2c 20 41 5f 50 4f 4c 4c | 45 44 20 7c 20 41 5f 53 |, A_POLL|ED | A_S|
|00002b70| 49 4c 45 4e 54 29 3b 20 | 0a 2b 20 09 64 65 6c 61 |ILENT); |.+ .dela|
|00002b80| 79 28 31 30 30 30 29 3b | 0a 2b 20 09 28 76 6f 69 |y(1000);|.+ .(voi|
|00002b90| 64 29 61 74 61 70 69 5f | 74 65 73 74 5f 75 6e 69 |d)atapi_|test_uni|
|00002ba0| 74 5f 72 65 61 64 79 28 | 73 61 2c 20 41 5f 50 4f |t_ready(|sa, A_PO|
|00002bb0| 4c 4c 45 44 20 7c 20 41 | 5f 53 49 4c 45 4e 54 29 |LLED | A|_SILENT)|
|00002bc0| 3b 0a 2b 20 09 09 09 09 | 09 09 09 09 09 09 2f 2a |;.+ ....|....../*|
|00002bd0| 20 54 6f 20 63 6c 65 61 | 72 20 6d 65 64 69 61 20 | To clea|r media |
|00002be0| 63 68 61 6e 67 65 2c 20 | 65 74 63 20 2e 2e 2e 2a |change, |etc ...*|
|00002bf0| 2f 0a 2b 20 09 62 7a 65 | 72 6f 28 26 63 6d 64 2c |/.+ .bze|ro(&cmd,|
|00002c00| 20 73 69 7a 65 6f 66 28 | 63 6d 64 29 29 3b 0a 2b | sizeof(|cmd));.+|
|00002c10| 20 09 63 6d 64 2e 6f 70 | 65 72 61 74 69 6f 6e 5f | .cmd.op|eration_|
|00002c20| 63 6f 64 65 20 3d 20 41 | 54 41 50 49 5f 4d 4f 44 |code = A|TAPI_MOD|
|00002c30| 45 5f 53 45 4e 53 45 3b | 0a 2b 20 09 63 6d 64 2e |E_SENSE;|.+ .cmd.|
|00002c40| 70 61 67 65 5f 63 6f 64 | 65 20 3d 20 43 41 50 5f |page_cod|e = CAP_|
|00002c50| 50 41 47 45 3b 0a 2b 20 | 09 63 6d 64 2e 6c 65 6e |PAGE;.+ |.cmd.len|
|00002c60| 67 74 68 5b 30 5d 20 3d | 20 73 69 7a 65 6f 66 20 |gth[0] =| sizeof |
|00002c70| 28 63 61 70 29 20 3e 3e | 20 38 3b 0a 2b 20 09 63 |(cap) >>| 8;.+ .c|
|00002c80| 6d 64 2e 6c 65 6e 67 74 | 68 5b 31 5d 20 3d 20 73 |md.lengt|h[1] = s|
|00002c90| 69 7a 65 6f 66 20 28 63 | 61 70 29 3b 0a 2b 20 09 |izeof (c|ap);.+ .|
|00002ca0| 69 66 20 28 61 74 61 70 | 69 5f 65 78 65 63 5f 63 |if (atap|i_exec_c|
|00002cb0| 6d 64 28 73 61 2c 20 26 | 63 6d 64 20 2c 20 73 69 |md(sa, &|cmd , si|
|00002cc0| 7a 65 6f 66 28 63 6d 64 | 29 2c 20 26 63 61 70 2c |zeof(cmd|), &cap,|
|00002cd0| 20 73 69 7a 65 6f 66 28 | 63 61 70 29 2c 0a 2b 20 | sizeof(|cap),.+ |
|00002ce0| 09 09 09 09 09 09 09 09 | 09 09 09 42 5f 52 45 41 |........|...B_REA|
|00002cf0| 44 2c 20 41 5f 50 4f 4c | 4c 45 44 29 20 21 3d 20 |D, A_POL|LED) != |
|00002d00| 30 29 20 7b 0a 2b 20 09 | 09 70 72 69 6e 74 66 28 |0) {.+ .|.printf(|
|00002d10| 22 61 74 61 70 69 5f 65 | 78 65 63 5f 63 6d 64 20 |"atapi_e|xec_cmd |
|00002d20| 66 61 69 6c 65 64 5c 6e | 22 29 3b 0a 2b 20 09 09 |failed\n|");.+ ..|
|00002d30| 72 65 74 75 72 6e 3b 0a | 2b 20 09 7d 0a 2b 20 09 |return;.|+ .}.+ .|
|00002d40| 73 77 69 74 63 68 20 28 | 63 61 70 2e 6d 65 64 69 |switch (|cap.medi|
|00002d50| 75 6d 5f 74 79 70 65 29 | 20 7b 0a 2b 20 09 09 63 |um_type)| {.+ ..c|
|00002d60| 61 73 65 20 4d 44 54 5f | 55 4e 4b 4e 4f 57 4e 3a |ase MDT_|UNKNOWN:|
|00002d70| 20 20 20 70 72 69 6e 74 | 66 20 28 22 6d 65 64 69 | print|f ("medi|
|00002d80| 75 6d 20 74 79 70 65 20 | 75 6e 6b 6e 6f 77 6e 22 |um type |unknown"|
|00002d90| 29 3b 0a 2b 20 09 09 09 | 09 09 09 09 62 72 65 61 |);.+ ...|....brea|
|00002da0| 6b 3b 0a 2b 20 09 09 63 | 61 73 65 20 4d 44 54 5f |k;.+ ..c|ase MDT_|
|00002db0| 44 41 54 41 5f 31 32 30 | 3a 20 20 70 72 69 6e 74 |DATA_120|: print|
|00002dc0| 66 20 28 22 31 32 30 6d | 6d 20 64 61 74 61 20 64 |f ("120m|m data d|
|00002dd0| 69 73 63 20 22 29 3b 0a | 2b 20 09 09 09 09 09 09 |isc ");.|+ ......|
|00002de0| 09 62 72 65 61 6b 3b 0a | 2b 20 09 09 63 61 73 65 |.break;.|+ ..case|
|00002df0| 20 4d 44 54 5f 41 55 44 | 49 4f 5f 31 32 30 3a 20 | MDT_AUD|IO_120: |
|00002e00| 70 72 69 6e 74 66 20 28 | 22 31 32 30 6d 6d 20 61 |printf (|"120mm a|
|00002e10| 75 64 69 6f 20 64 69 73 | 63 20 22 29 3b 0a 2b 20 |udio dis|c ");.+ |
|00002e20| 09 09 09 09 09 09 09 62 | 72 65 61 6b 3b 0a 2b 20 |.......b|reak;.+ |
|00002e30| 09 09 63 61 73 65 20 4d | 44 54 5f 43 4f 4d 42 5f |..case M|DT_COMB_|
|00002e40| 31 32 30 3a 20 20 70 72 | 69 6e 74 66 20 28 22 31 |120: pr|intf ("1|
|00002e50| 32 30 6d 6d 20 64 61 74 | 61 2f 61 75 64 69 6f 20 |20mm dat|a/audio |
|00002e60| 64 69 73 63 20 22 29 3b | 0a 2b 20 09 09 09 09 09 |disc ");|.+ .....|
|00002e70| 09 09 62 72 65 61 6b 3b | 0a 2b 20 09 09 63 61 73 |..break;|.+ ..cas|
|00002e80| 65 20 4d 44 54 5f 50 48 | 4f 54 4f 5f 31 32 30 3a |e MDT_PH|OTO_120:|
|00002e90| 20 70 72 69 6e 74 66 20 | 28 22 31 32 30 6d 6d 20 | printf |("120mm |
|00002ea0| 70 68 6f 74 6f 20 64 69 | 73 63 20 22 29 3b 0a 2b |photo di|sc ");.+|
|00002eb0| 20 09 09 09 09 09 09 09 | 62 72 65 61 6b 3b 0a 2b | .......|break;.+|
|00002ec0| 20 09 09 63 61 73 65 20 | 4d 44 54 5f 44 41 54 41 | ..case |MDT_DATA|
|00002ed0| 5f 38 30 3a 20 20 20 70 | 72 69 6e 74 66 20 28 22 |_80: p|rintf ("|
|00002ee0| 38 30 6d 6d 20 64 61 74 | 61 20 64 69 73 63 20 22 |80mm dat|a disc "|
|00002ef0| 29 3b 0a 2b 20 09 09 09 | 09 09 09 09 62 72 65 61 |);.+ ...|....brea|
|00002f00| 6b 3b 0a 2b 20 09 09 63 | 61 73 65 20 4d 44 54 5f |k;.+ ..c|ase MDT_|
|00002f10| 41 55 44 49 4f 5f 38 30 | 3a 20 20 70 72 69 6e 74 |AUDIO_80|: print|
|00002f20| 66 20 28 22 38 30 6d 6d | 20 61 75 64 69 6f 20 64 |f ("80mm| audio d|
|00002f30| 69 73 63 20 22 29 3b 0a | 2b 20 09 09 09 09 09 09 |isc ");.|+ ......|
|00002f40| 09 62 72 65 61 6b 3b 0a | 2b 20 09 09 63 61 73 65 |.break;.|+ ..case|
|00002f50| 20 4d 44 54 5f 43 4f 4d | 42 5f 38 30 3a 20 20 20 | MDT_COM|B_80: |
|00002f60| 70 72 69 6e 74 66 20 28 | 22 38 30 6d 6d 20 64 61 |printf (|"80mm da|
|00002f70| 74 61 2f 61 75 64 69 6f | 20 64 69 73 63 20 22 29 |ta/audio| disc ")|
|00002f80| 3b 0a 2b 20 09 09 09 09 | 09 09 09 62 72 65 61 6b |;.+ ....|...break|
|00002f90| 3b 0a 2b 20 09 09 63 61 | 73 65 20 4d 44 54 5f 50 |;.+ ..ca|se MDT_P|
|00002fa0| 48 4f 54 4f 5f 38 30 3a | 20 20 70 72 69 6e 74 66 |HOTO_80:| printf|
|00002fb0| 20 28 22 38 30 6d 6d 20 | 70 68 6f 74 6f 20 64 69 | ("80mm |photo di|
|00002fc0| 73 63 20 22 29 3b 0a 2b | 20 09 09 09 09 09 09 09 |sc ");.+| .......|
|00002fd0| 62 72 65 61 6b 3b 0a 2b | 20 09 09 63 61 73 65 20 |break;.+| ..case |
|00002fe0| 4d 44 54 5f 4e 4f 5f 44 | 49 53 43 3a 20 20 20 70 |MDT_NO_D|ISC: p|
|00002ff0| 72 69 6e 74 66 20 28 22 | 64 72 69 76 65 20 65 6d |rintf ("|drive em|
|00003000| 70 74 79 20 22 29 3b 0a | 2b 20 09 09 09 09 09 09 |pty ");.|+ ......|
|00003010| 09 62 72 65 61 6b 3b 0a | 2b 20 09 09 63 61 73 65 |.break;.|+ ..case|
|00003020| 20 4d 44 54 5f 44 4f 4f | 52 5f 4f 50 45 4e 3a 20 | MDT_DOO|R_OPEN: |
|00003030| 70 72 69 6e 74 66 20 28 | 22 64 6f 6f 72 20 6f 70 |printf (|"door op|
|00003040| 65 6e 22 29 3b 0a 2b 20 | 09 09 09 09 09 09 09 62 |en");.+ |.......b|
|00003050| 72 65 61 6b 3b 0a 2b 20 | 09 09 63 61 73 65 20 4d |reak;.+ |..case M|
|00003060| 44 54 5f 46 4d 54 5f 45 | 52 52 4f 52 3a 20 70 72 |DT_FMT_E|RROR: pr|
|00003070| 69 6e 74 66 20 28 22 6d | 65 64 69 75 6d 20 66 6f |intf ("m|edium fo|
|00003080| 72 6d 61 74 20 65 72 72 | 6f 72 22 29 3b 0a 2b 20 |rmat err|or");.+ |
|00003090| 09 09 09 09 09 09 09 62 | 72 65 61 6b 3b 0a 2b 20 |.......b|reak;.+ |
|000030a0| 09 09 64 65 66 61 75 6c | 74 3a 20 20 20 20 70 72 |..defaul|t: pr|
|000030b0| 69 6e 74 66 20 28 22 75 | 6e 6b 6e 6f 77 6e 20 6d |intf ("u|nknown m|
|000030c0| 65 64 69 75 6d 20 74 79 | 70 65 3d 30 78 25 78 22 |edium ty|pe=0x%x"|
|000030d0| 2c 20 63 61 70 2e 6d 65 | 64 69 75 6d 5f 74 79 70 |, cap.me|dium_typ|
|000030e0| 65 29 3b 0a 2b 20 09 09 | 09 09 09 62 72 65 61 6b |e);.+ ..|...break|
|000030f0| 3b 0a 2b 20 09 7d 0a 2b | 20 09 70 72 69 6e 74 66 |;.+ .}.+| .printf|
|00003100| 28 22 5c 6e 22 29 3b 0a | 2b 20 0a 2b 20 7d 0a 2b |("\n");.|+ .+ }.+|
|00003110| 20 0a 2b 20 2f 2a 0a 2b | 20 20 2a 20 57 61 69 74 | .+ /*.+| * Wait|
|00003120| 20 69 6e 74 65 72 72 75 | 70 74 69 62 6c 79 20 66 | interru|ptibly f|
|00003130| 6f 72 20 61 6e 20 65 78 | 63 6c 75 73 69 76 65 20 |or an ex|clusive |
|00003140| 6c 6f 63 6b 2e 0a 2b 20 | 20 2a 0a 2b 20 20 2a 20 |lock..+ | *.+ * |
|00003150| 58 58 58 0a 2b 20 20 2a | 20 53 65 76 65 72 61 6c |XXX.+ *| Several|
|00003160| 20 64 72 69 76 65 72 73 | 20 64 6f 20 74 68 69 73 | drivers| do this|
|00003170| 3b 20 69 74 20 73 68 6f | 75 6c 64 20 62 65 20 61 |; it sho|uld be a|
|00003180| 62 73 74 72 61 63 74 65 | 64 20 61 6e 64 20 6d 61 |bstracte|d and ma|
|00003190| 64 65 20 4d 50 2d 73 61 | 66 65 2e 0a 2b 20 20 2a |de MP-sa|fe..+ *|
|000031a0| 2f 0a 2b 20 69 6e 74 0a | 2b 20 61 63 64 6c 6f 63 |/.+ int.|+ acdloc|
|000031b0| 6b 28 61 63 64 29 0a 2b | 20 09 73 74 72 75 63 74 |k(acd).+| .struct|
|000031c0| 20 61 63 64 5f 73 6f 66 | 74 63 20 2a 61 63 64 3b | acd_sof|tc *acd;|
|000031d0| 0a 2b 20 7b 0a 2b 20 09 | 69 6e 74 20 65 72 72 6f |.+ {.+ .|int erro|
|000031e0| 72 3b 0a 2b 20 0a 2b 20 | 09 77 68 69 6c 65 20 28 |r;.+ .+ |.while (|
|000031f0| 28 61 63 64 2d 3e 66 6c | 61 67 73 20 26 20 43 44 |(acd->fl|ags & CD|
|00003200| 46 5f 4c 4f 43 4b 45 44 | 29 20 21 3d 20 30 29 20 |F_LOCKED|) != 0) |
|00003210| 7b 0a 2b 20 09 09 61 63 | 64 2d 3e 66 6c 61 67 73 |{.+ ..ac|d->flags|
|00003220| 20 7c 3d 20 43 44 46 5f | 57 41 4e 54 45 44 3b 0a | |= CDF_|WANTED;.|
|00003230| 2b 20 09 09 69 66 20 28 | 28 65 72 72 6f 72 20 3d |+ ..if (|(error =|
|00003240| 20 74 73 6c 65 65 70 28 | 61 63 64 2c 20 50 52 49 | tsleep(|acd, PRI|
|00003250| 42 49 4f 20 7c 20 50 43 | 41 54 43 48 2c 20 22 61 |BIO | PC|ATCH, "a|
|00003260| 63 64 6c 63 6b 22 2c 20 | 30 29 29 20 21 3d 20 30 |cdlck", |0)) != 0|
|00003270| 29 0a 2b 20 09 09 09 72 | 65 74 75 72 6e 20 65 72 |).+ ...r|eturn er|
|00003280| 72 6f 72 3b 0a 2b 20 09 | 7d 0a 2b 20 09 61 63 64 |ror;.+ .|}.+ .acd|
|00003290| 2d 3e 66 6c 61 67 73 20 | 7c 3d 20 43 44 46 5f 4c |->flags ||= CDF_L|
|000032a0| 4f 43 4b 45 44 3b 0a 2b | 20 09 72 65 74 75 72 6e |OCKED;.+| .return|
|000032b0| 20 30 3b 0a 2b 20 7d 0a | 2b 20 0a 2b 20 2f 2a 0a | 0;.+ }.|+ .+ /*.|
|000032c0| 2b 20 20 2a 20 55 6e 6c | 6f 63 6b 20 61 6e 64 20 |+ * Unl|ock and |
|000032d0| 77 61 6b 65 20 75 70 20 | 61 6e 79 20 77 61 69 74 |wake up |any wait|
|000032e0| 65 72 73 2e 0a 2b 20 20 | 2a 2f 0a 2b 20 76 6f 69 |ers..+ |*/.+ voi|
|000032f0| 64 0a 2b 20 61 63 64 75 | 6e 6c 6f 63 6b 28 61 63 |d.+ acdu|nlock(ac|
|00003300| 64 29 0a 2b 20 09 73 74 | 72 75 63 74 20 61 63 64 |d).+ .st|ruct acd|
|00003310| 5f 73 6f 66 74 63 20 2a | 61 63 64 3b 0a 2b 20 7b |_softc *|acd;.+ {|
|00003320| 0a 2b 20 0a 2b 20 09 61 | 63 64 2d 3e 66 6c 61 67 |.+ .+ .a|cd->flag|
|00003330| 73 20 26 3d 20 7e 43 44 | 46 5f 4c 4f 43 4b 45 44 |s &= ~CD|F_LOCKED|
|00003340| 3b 0a 2b 20 09 69 66 20 | 28 28 61 63 64 2d 3e 66 |;.+ .if |((acd->f|
|00003350| 6c 61 67 73 20 26 20 43 | 44 46 5f 57 41 4e 54 45 |lags & C|DF_WANTE|
|00003360| 44 29 20 21 3d 20 30 29 | 20 7b 0a 2b 20 09 09 61 |D) != 0)| {.+ ..a|
|00003370| 63 64 2d 3e 66 6c 61 67 | 73 20 26 3d 20 7e 43 44 |cd->flag|s &= ~CD|
|00003380| 46 5f 57 41 4e 54 45 44 | 3b 0a 2b 20 09 09 77 61 |F_WANTED|;.+ ..wa|
|00003390| 6b 65 75 70 28 61 63 64 | 29 3b 0a 2b 20 09 7d 0a |keup(acd|);.+ .}.|
|000033a0| 2b 20 7d 0a 2b 20 0a 2b | 20 2f 2a 0a 2b 20 20 2a |+ }.+ .+| /*.+ *|
|000033b0| 20 6f 70 65 6e 20 74 68 | 65 20 64 65 76 69 63 65 | open th|e device|
|000033c0| 2e 20 4d 61 6b 65 20 73 | 75 72 65 20 74 68 65 20 |. Make s|ure the |
|000033d0| 70 61 72 74 69 74 69 6f | 6e 20 69 6e 66 6f 20 69 |partitio|n info i|
|000033e0| 73 20 61 20 75 70 2d 74 | 6f 2d 64 61 74 65 20 61 |s a up-t|o-date a|
|000033f0| 73 20 63 61 6e 20 62 65 | 2e 0a 2b 20 20 2a 2f 0a |s can be|..+ */.|
|00003400| 2b 20 69 6e 74 0a 2b 20 | 61 63 64 6f 70 65 6e 28 |+ int.+ |acdopen(|
|00003410| 64 65 76 2c 20 66 6c 61 | 67 2c 20 66 6d 74 29 0a |dev, fla|g, fmt).|
|00003420| 2b 20 09 64 65 76 5f 74 | 20 64 65 76 3b 0a 2b 20 |+ .dev_t| dev;.+ |
|00003430| 09 69 6e 74 20 66 6c 61 | 67 2c 20 66 6d 74 3b 0a |.int fla|g, fmt;.|
|00003440| 2b 20 7b 0a 2b 20 09 73 | 74 72 75 63 74 20 61 63 |+ {.+ .s|truct ac|
|00003450| 64 5f 73 6f 66 74 63 20 | 2a 61 63 64 3b 0a 2b 20 |d_softc |*acd;.+ |
|00003460| 09 73 74 72 75 63 74 20 | 61 74 5f 64 65 76 5f 6c |.struct |at_dev_l|
|00003470| 69 6e 6b 20 2a 61 64 5f | 6c 69 6e 6b 3b 0a 2b 20 |ink *ad_|link;.+ |
|00003480| 09 69 6e 74 20 75 6e 69 | 74 2c 20 70 61 72 74 3b |.int uni|t, part;|
|00003490| 0a 2b 20 09 69 6e 74 20 | 65 72 72 6f 72 3b 0a 2b |.+ .int |error;.+|
|000034a0| 20 0a 2b 20 23 69 66 64 | 65 66 20 41 43 44 5f 44 | .+ #ifd|ef ACD_D|
|000034b0| 45 42 55 47 0a 2b 20 09 | 70 72 69 6e 74 66 28 22 |EBUG.+ .|printf("|
|000034c0| 61 63 64 3a 20 6f 70 65 | 6e 5c 6e 22 29 3b 0a 2b |acd: ope|n\n");.+|
|000034d0| 20 23 65 6e 64 69 66 0a | 2b 20 0a 2b 20 09 75 6e | #endif.|+ .+ .un|
|000034e0| 69 74 20 3d 20 43 44 55 | 4e 49 54 28 64 65 76 29 |it = CDU|NIT(dev)|
|000034f0| 3b 0a 2b 20 09 69 66 20 | 28 75 6e 69 74 20 3e 3d |;.+ .if |(unit >=|
|00003500| 20 61 63 64 63 64 2e 63 | 64 5f 6e 64 65 76 73 29 | acdcd.c|d_ndevs)|
|00003510| 0a 2b 20 09 09 72 65 74 | 75 72 6e 20 45 4e 58 49 |.+ ..ret|urn ENXI|
|00003520| 4f 3b 0a 2b 20 09 61 63 | 64 20 3d 20 61 63 64 63 |O;.+ .ac|d = acdc|
|00003530| 64 2e 63 64 5f 64 65 76 | 73 5b 75 6e 69 74 5d 3b |d.cd_dev|s[unit];|
|00003540| 0a 2b 20 09 69 66 20 28 | 21 61 63 64 29 0a 2b 20 |.+ .if (|!acd).+ |
|00003550| 09 09 72 65 74 75 72 6e | 20 45 4e 58 49 4f 3b 0a |..return| ENXIO;.|
|00003560| 2b 20 0a 2b 20 09 61 64 | 5f 6c 69 6e 6b 20 3d 20 |+ .+ .ad|_link = |
|00003570| 61 63 64 2d 3e 61 64 5f | 6c 69 6e 6b 3b 0a 2b 20 |acd->ad_|link;.+ |
|00003580| 0a 2b 20 09 69 66 20 28 | 28 65 72 72 6f 72 20 3d |.+ .if (|(error =|
|00003590| 20 61 74 61 70 69 5f 74 | 65 73 74 5f 75 6e 69 74 | atapi_t|est_unit|
|000035a0| 5f 72 65 61 64 79 28 61 | 64 5f 6c 69 6e 6b 2c 30 |_ready(a|d_link,0|
|000035b0| 29 29 20 21 3d 20 30 29 | 20 7b 0a 2b 20 09 09 69 |)) != 0)| {.+ ..i|
|000035c0| 66 20 28 65 72 72 6f 72 | 20 21 3d 20 55 4e 49 54 |f (error| != UNIT|
|000035d0| 5f 41 54 54 45 4e 54 49 | 4f 4e 29 20 72 65 74 75 |_ATTENTI|ON) retu|
|000035e0| 72 6e 20 45 49 4f 3b 0a | 2b 20 09 09 69 66 20 28 |rn EIO;.|+ ..if (|
|000035f0| 28 61 64 5f 6c 69 6e 6b | 2d 3e 66 6c 61 67 73 20 |(ad_link|->flags |
|00003600| 26 20 41 44 45 56 5f 4f | 50 45 4e 29 20 21 3d 20 |& ADEV_O|PEN) != |
|00003610| 30 20 29 20 72 65 74 75 | 72 6e 20 45 49 4f 3b 0a |0 ) retu|rn EIO;.|
|00003620| 2b 20 09 7d 0a 2b 20 0a | 2b 20 09 69 66 20 28 65 |+ .}.+ .|+ .if (e|
|00003630| 72 72 6f 72 20 3d 20 61 | 63 64 6c 6f 63 6b 28 61 |rror = a|cdlock(a|
|00003640| 63 64 29 29 0a 2b 20 09 | 09 72 65 74 75 72 6e 20 |cd)).+ .|.return |
|00003650| 65 72 72 6f 72 3b 0a 2b | 20 0a 2b 20 09 69 66 20 |error;.+| .+ .if |
|00003660| 28 61 63 64 2d 3e 73 63 | 5f 64 6b 2e 64 6b 5f 6f |(acd->sc|_dk.dk_o|
|00003670| 70 65 6e 6d 61 73 6b 20 | 21 3d 20 30 29 20 7b 0a |penmask |!= 0) {.|
|00003680| 2b 20 09 09 2f 2a 0a 2b | 20 09 09 20 2a 20 49 66 |+ ../*.+| .. * If|
|00003690| 20 61 6e 79 20 70 61 72 | 74 69 74 69 6f 6e 20 69 | any par|tition i|
|000036a0| 73 20 6f 70 65 6e 2c 20 | 62 75 74 20 74 68 65 20 |s open, |but the |
|000036b0| 64 69 73 6b 20 68 61 73 | 20 62 65 65 6e 20 69 6e |disk has| been in|
|000036c0| 76 61 6c 69 64 61 74 65 | 64 2c 0a 2b 20 09 09 20 |validate|d,.+ .. |
|000036d0| 2a 20 64 69 73 61 6c 6c | 6f 77 20 66 75 72 74 68 |* disall|ow furth|
|000036e0| 65 72 20 6f 70 65 6e 73 | 2e 0a 2b 20 09 09 20 2a |er opens|..+ .. *|
|000036f0| 2f 0a 2b 20 09 09 69 66 | 20 28 28 61 64 5f 6c 69 |/.+ ..if| ((ad_li|
|00003700| 6e 6b 2d 3e 66 6c 61 67 | 73 20 26 20 41 44 45 56 |nk->flag|s & ADEV|
|00003710| 5f 4d 45 44 49 41 5f 4c | 4f 41 44 45 44 29 20 3d |_MEDIA_L|OADED) =|
|00003720| 3d 20 30 29 20 7b 0a 2b | 20 09 09 09 65 72 72 6f |= 0) {.+| ...erro|
|00003730| 72 20 3d 20 45 49 4f 3b | 0a 2b 20 09 09 09 67 6f |r = EIO;|.+ ...go|
|00003740| 74 6f 20 62 61 64 33 3b | 0a 2b 20 09 09 7d 0a 2b |to bad3;|.+ ..}.+|
|00003750| 20 09 7d 20 65 6c 73 65 | 20 7b 0a 2b 20 09 09 61 | .} else| {.+ ..a|
|00003760| 64 5f 6c 69 6e 6b 2d 3e | 66 6c 61 67 73 20 7c 3d |d_link->|flags |=|
|00003770| 20 41 44 45 56 5f 4f 50 | 45 4e 3b 0a 2b 20 0a 2b | ADEV_OP|EN;.+ .+|
|00003780| 20 09 09 2f 2a 20 4c 6f | 63 6b 20 74 68 65 20 70 | ../* Lo|ck the p|
|00003790| 61 63 6b 20 69 6e 2e 20 | 2a 2f 0a 2b 20 09 09 69 |ack in. |*/.+ ..i|
|000037a0| 66 20 28 65 72 72 6f 72 | 20 3d 20 61 74 61 70 69 |f (error| = atapi|
|000037b0| 5f 70 72 65 76 65 6e 74 | 28 61 64 5f 6c 69 6e 6b |_prevent|(ad_link|
|000037c0| 2c 20 50 52 5f 50 52 45 | 56 45 4e 54 29 29 0a 2b |, PR_PRE|VENT)).+|
|000037d0| 20 09 09 09 67 6f 74 6f | 20 62 61 64 3b 0a 2b 20 | ...goto| bad;.+ |
|000037e0| 0a 2b 20 09 09 69 66 20 | 28 28 61 64 5f 6c 69 6e |.+ ..if |((ad_lin|
|000037f0| 6b 2d 3e 66 6c 61 67 73 | 20 26 20 41 44 45 56 5f |k->flags| & ADEV_|
|00003800| 4d 45 44 49 41 5f 4c 4f | 41 44 45 44 29 20 3d 3d |MEDIA_LO|ADED) ==|
|00003810| 20 30 29 20 7b 0a 2b 20 | 09 09 09 61 64 5f 6c 69 | 0) {.+ |...ad_li|
|00003820| 6e 6b 2d 3e 66 6c 61 67 | 73 20 7c 3d 20 41 44 45 |nk->flag|s |= ADE|
|00003830| 56 5f 4d 45 44 49 41 5f | 4c 4f 41 44 45 44 3b 0a |V_MEDIA_|LOADED;.|
|00003840| 2b 20 0a 2b 20 09 09 09 | 2f 2a 20 4c 6f 61 64 20 |+ .+ ...|/* Load |
|00003850| 74 68 65 20 70 68 79 73 | 69 63 61 6c 20 64 65 76 |the phys|ical dev|
|00003860| 69 63 65 20 70 61 72 61 | 6d 65 74 65 72 73 2e 20 |ice para|meters. |
|00003870| 2a 2f 0a 2b 20 09 09 09 | 69 66 20 28 61 63 64 5f |*/.+ ...|if (acd_|
|00003880| 67 65 74 5f 70 61 72 6d | 73 28 61 63 64 2c 20 30 |get_parm|s(acd, 0|
|00003890| 29 20 21 3d 20 30 29 20 | 7b 0a 2b 20 09 09 09 09 |) != 0) |{.+ ....|
|000038a0| 65 72 72 6f 72 20 3d 20 | 45 4e 58 49 4f 3b 0a 2b |error = |ENXIO;.+|
|000038b0| 20 09 09 09 09 67 6f 74 | 6f 20 62 61 64 32 3b 0a | ....got|o bad2;.|
|000038c0| 2b 20 09 09 09 7d 0a 2b | 20 0a 2b 20 09 09 09 2f |+ ...}.+| .+ .../|
|000038d0| 2a 20 46 61 62 72 69 63 | 61 74 65 20 61 20 64 69 |* Fabric|ate a di|
|000038e0| 73 6b 20 6c 61 62 65 6c | 2e 20 2a 2f 0a 2b 20 09 |sk label|. */.+ .|
|000038f0| 09 09 61 63 64 67 65 74 | 64 69 73 6b 6c 61 62 65 |..acdget|disklabe|
|00003900| 6c 28 61 63 64 29 3b 0a | 2b 20 09 09 7d 0a 2b 20 |l(acd);.|+ ..}.+ |
|00003910| 09 7d 0a 2b 20 0a 2b 20 | 09 70 61 72 74 20 3d 20 |.}.+ .+ |.part = |
|00003920| 43 44 50 41 52 54 28 64 | 65 76 29 3b 0a 2b 20 0a |CDPART(d|ev);.+ .|
|00003930| 2b 20 09 2f 2a 20 43 68 | 65 63 6b 20 74 68 61 74 |+ ./* Ch|eck that|
|00003940| 20 74 68 65 20 70 61 72 | 74 69 74 69 6f 6e 20 65 | the par|tition e|
|00003950| 78 69 73 74 73 2e 20 2a | 2f 0a 2b 20 09 69 66 20 |xists. *|/.+ .if |
|00003960| 28 70 61 72 74 20 21 3d | 20 52 41 57 5f 50 41 52 |(part !=| RAW_PAR|
|00003970| 54 20 26 26 0a 2b 20 09 | 20 20 20 20 28 70 61 72 |T &&.+ .| (par|
|00003980| 74 20 3e 3d 20 61 63 64 | 2d 3e 73 63 5f 64 6b 2e |t >= acd|->sc_dk.|
|00003990| 64 6b 5f 6c 61 62 65 6c | 2e 64 5f 6e 70 61 72 74 |dk_label|.d_npart|
|000039a0| 69 74 69 6f 6e 73 20 7c | 7c 0a 2b 20 09 20 20 20 |itions |||.+ . |
|000039b0| 20 20 61 63 64 2d 3e 73 | 63 5f 64 6b 2e 64 6b 5f | acd->s|c_dk.dk_|
|000039c0| 6c 61 62 65 6c 2e 64 5f | 70 61 72 74 69 74 69 6f |label.d_|partitio|
|000039d0| 6e 73 5b 70 61 72 74 5d | 2e 70 5f 66 73 74 79 70 |ns[part]|.p_fstyp|
|000039e0| 65 20 3d 3d 20 46 53 5f | 55 4e 55 53 45 44 29 29 |e == FS_|UNUSED))|
|000039f0| 20 7b 0a 2b 20 09 09 65 | 72 72 6f 72 20 3d 20 45 | {.+ ..e|rror = E|
|00003a00| 4e 58 49 4f 3b 0a 2b 20 | 09 09 67 6f 74 6f 20 62 |NXIO;.+ |..goto b|
|00003a10| 61 64 3b 0a 2b 20 09 7d | 0a 2b 20 0a 2b 20 09 2f |ad;.+ .}|.+ .+ ./|
|00003a20| 2a 20 49 6e 73 75 72 65 | 20 6f 6e 6c 79 20 6f 6e |* Insure| only on|
|00003a30| 65 20 6f 70 65 6e 20 61 | 74 20 61 20 74 69 6d 65 |e open a|t a time|
|00003a40| 2e 20 2a 2f 0a 2b 20 09 | 73 77 69 74 63 68 20 28 |. */.+ .|switch (|
|00003a50| 66 6d 74 29 20 7b 0a 2b | 20 09 63 61 73 65 20 53 |fmt) {.+| .case S|
|00003a60| 5f 49 46 43 48 52 3a 0a | 2b 20 09 09 61 63 64 2d |_IFCHR:.|+ ..acd-|
|00003a70| 3e 73 63 5f 64 6b 2e 64 | 6b 5f 63 6f 70 65 6e 6d |>sc_dk.d|k_copenm|
|00003a80| 61 73 6b 20 7c 3d 20 28 | 31 20 3c 3c 20 70 61 72 |ask |= (|1 << par|
|00003a90| 74 29 3b 0a 2b 20 09 09 | 62 72 65 61 6b 3b 0a 2b |t);.+ ..|break;.+|
|00003aa0| 20 09 63 61 73 65 20 53 | 5f 49 46 42 4c 4b 3a 0a | .case S|_IFBLK:.|
|00003ab0| 2b 20 09 09 61 63 64 2d | 3e 73 63 5f 64 6b 2e 64 |+ ..acd-|>sc_dk.d|
|00003ac0| 6b 5f 62 6f 70 65 6e 6d | 61 73 6b 20 7c 3d 20 28 |k_bopenm|ask |= (|
|00003ad0| 31 20 3c 3c 20 70 61 72 | 74 29 3b 0a 2b 20 09 09 |1 << par|t);.+ ..|
|00003ae0| 62 72 65 61 6b 3b 0a 2b | 20 09 7d 0a 2b 20 09 61 |break;.+| .}.+ .a|
|00003af0| 63 64 2d 3e 73 63 5f 64 | 6b 2e 64 6b 5f 6f 70 65 |cd->sc_d|k.dk_ope|
|00003b00| 6e 6d 61 73 6b 20 3d 20 | 61 63 64 2d 3e 73 63 5f |nmask = |acd->sc_|
|00003b10| 64 6b 2e 64 6b 5f 63 6f | 70 65 6e 6d 61 73 6b 20 |dk.dk_co|penmask |
|00003b20| 7c 20 61 63 64 2d 3e 73 | 63 5f 64 6b 2e 64 6b 5f || acd->s|c_dk.dk_|
|00003b30| 62 6f 70 65 6e 6d 61 73 | 6b 3b 0a 2b 20 23 69 66 |bopenmas|k;.+ #if|
|00003b40| 64 65 66 20 41 43 44 5f | 44 45 42 55 47 0a 2b 20 |def ACD_|DEBUG.+ |
|00003b50| 09 70 72 69 6e 74 66 28 | 22 6f 70 65 6e 20 63 6f |.printf(|"open co|
|00003b60| 6d 70 6c 65 74 65 5c 6e | 22 29 3b 0a 2b 20 23 65 |mplete\n|");.+ #e|
|00003b70| 6e 64 69 66 0a 2b 20 09 | 61 63 64 75 6e 6c 6f 63 |ndif.+ .|acdunloc|
|00003b80| 6b 28 61 63 64 29 3b 0a | 2b 20 09 72 65 74 75 72 |k(acd);.|+ .retur|
|00003b90| 6e 20 30 3b 0a 2b 20 0a | 2b 20 62 61 64 32 3a 0a |n 0;.+ .|+ bad2:.|
|00003ba0| 2b 20 09 61 64 5f 6c 69 | 6e 6b 2d 3e 66 6c 61 67 |+ .ad_li|nk->flag|
|00003bb0| 73 20 26 3d 20 7e 41 44 | 45 56 5f 4d 45 44 49 41 |s &= ~AD|EV_MEDIA|
|00003bc0| 5f 4c 4f 41 44 45 44 3b | 0a 2b 20 0a 2b 20 62 61 |_LOADED;|.+ .+ ba|
|00003bd0| 64 3a 0a 2b 20 09 69 66 | 20 28 61 63 64 2d 3e 73 |d:.+ .if| (acd->s|
|00003be0| 63 5f 64 6b 2e 64 6b 5f | 6f 70 65 6e 6d 61 73 6b |c_dk.dk_|openmask|
|00003bf0| 20 3d 3d 20 30 29 20 7b | 0a 2b 20 09 09 61 74 61 | == 0) {|.+ ..ata|
|00003c00| 70 69 5f 70 72 65 76 65 | 6e 74 28 61 64 5f 6c 69 |pi_preve|nt(ad_li|
|00003c10| 6e 6b 2c 20 50 52 5f 41 | 4c 4c 4f 57 29 3b 0a 2b |nk, PR_A|LLOW);.+|
|00003c20| 20 09 09 61 64 5f 6c 69 | 6e 6b 2d 3e 66 6c 61 67 | ..ad_li|nk->flag|
|00003c30| 73 20 26 3d 20 7e 41 44 | 45 56 5f 4f 50 45 4e 3b |s &= ~AD|EV_OPEN;|
|00003c40| 0a 2b 20 09 7d 0a 2b 20 | 0a 2b 20 62 61 64 33 3a |.+ .}.+ |.+ bad3:|
|00003c50| 0a 2b 20 09 61 63 64 75 | 6e 6c 6f 63 6b 28 61 63 |.+ .acdu|nlock(ac|
|00003c60| 64 29 3b 0a 2b 20 09 72 | 65 74 75 72 6e 20 65 72 |d);.+ .r|eturn er|
|00003c70| 72 6f 72 3b 0a 2b 20 7d | 0a 2b 20 0a 2b 20 2f 2a |ror;.+ }|.+ .+ /*|
|00003c80| 0a 2b 20 20 2a 20 63 6c | 6f 73 65 20 74 68 65 20 |.+ * cl|ose the |
|00003c90| 64 65 76 69 63 65 2e 2e | 20 6f 6e 6c 79 20 63 61 |device..| only ca|
|00003ca0| 6c 6c 65 64 20 69 66 20 | 77 65 20 61 72 65 20 74 |lled if |we are t|
|00003cb0| 68 65 20 4c 41 53 54 0a | 2b 20 20 2a 20 6f 63 63 |he LAST.|+ * occ|
|00003cc0| 75 72 65 6e 63 65 20 6f | 66 20 61 6e 20 6f 70 65 |urence o|f an ope|
|00003cd0| 6e 20 64 65 76 69 63 65 | 0a 2b 20 20 2a 2f 0a 2b |n device|.+ */.+|
|00003ce0| 20 69 6e 74 0a 2b 20 61 | 63 64 63 6c 6f 73 65 28 | int.+ a|cdclose(|
|00003cf0| 64 65 76 2c 20 66 6c 61 | 67 2c 20 66 6d 74 29 0a |dev, fla|g, fmt).|
|00003d00| 2b 20 09 64 65 76 5f 74 | 20 64 65 76 3b 0a 2b 20 |+ .dev_t| dev;.+ |
|00003d10| 09 69 6e 74 20 66 6c 61 | 67 2c 20 66 6d 74 3b 0a |.int fla|g, fmt;.|
|00003d20| 2b 20 7b 0a 2b 20 09 73 | 74 72 75 63 74 20 61 63 |+ {.+ .s|truct ac|
|00003d30| 64 5f 73 6f 66 74 63 20 | 2a 61 63 64 20 3d 20 61 |d_softc |*acd = a|
|00003d40| 63 64 63 64 2e 63 64 5f | 64 65 76 73 5b 43 44 55 |cdcd.cd_|devs[CDU|
|00003d50| 4e 49 54 28 64 65 76 29 | 5d 3b 0a 2b 20 09 69 6e |NIT(dev)|];.+ .in|
|00003d60| 74 20 70 61 72 74 20 3d | 20 43 44 50 41 52 54 28 |t part =| CDPART(|
|00003d70| 64 65 76 29 3b 0a 2b 20 | 09 69 6e 74 20 65 72 72 |dev);.+ |.int err|
|00003d80| 6f 72 3b 0a 2b 20 0a 2b | 20 09 69 66 20 28 65 72 |or;.+ .+| .if (er|
|00003d90| 72 6f 72 20 3d 20 61 63 | 64 6c 6f 63 6b 28 61 63 |ror = ac|dlock(ac|
|00003da0| 64 29 29 0a 2b 20 09 09 | 72 65 74 75 72 6e 20 65 |d)).+ ..|return e|
|00003db0| 72 72 6f 72 3b 0a 2b 20 | 0a 2b 20 09 73 77 69 74 |rror;.+ |.+ .swit|
|00003dc0| 63 68 20 28 66 6d 74 29 | 20 7b 0a 2b 20 09 63 61 |ch (fmt)| {.+ .ca|
|00003dd0| 73 65 20 53 5f 49 46 43 | 48 52 3a 0a 2b 20 09 09 |se S_IFC|HR:.+ ..|
|00003de0| 61 63 64 2d 3e 73 63 5f | 64 6b 2e 64 6b 5f 63 6f |acd->sc_|dk.dk_co|
|00003df0| 70 65 6e 6d 61 73 6b 20 | 26 3d 20 7e 28 31 20 3c |penmask |&= ~(1 <|
|00003e00| 3c 20 70 61 72 74 29 3b | 0a 2b 20 09 09 62 72 65 |< part);|.+ ..bre|
|00003e10| 61 6b 3b 0a 2b 20 09 63 | 61 73 65 20 53 5f 49 46 |ak;.+ .c|ase S_IF|
|00003e20| 42 4c 4b 3a 0a 2b 20 09 | 09 61 63 64 2d 3e 73 63 |BLK:.+ .|.acd->sc|
|00003e30| 5f 64 6b 2e 64 6b 5f 62 | 6f 70 65 6e 6d 61 73 6b |_dk.dk_b|openmask|
|00003e40| 20 26 3d 20 7e 28 31 20 | 3c 3c 20 70 61 72 74 29 | &= ~(1 |<< part)|
|00003e50| 3b 0a 2b 20 09 09 62 72 | 65 61 6b 3b 0a 2b 20 09 |;.+ ..br|eak;.+ .|
|00003e60| 7d 0a 2b 20 09 61 63 64 | 2d 3e 73 63 5f 64 6b 2e |}.+ .acd|->sc_dk.|
|00003e70| 64 6b 5f 6f 70 65 6e 6d | 61 73 6b 20 3d 20 61 63 |dk_openm|ask = ac|
|00003e80| 64 2d 3e 73 63 5f 64 6b | 2e 64 6b 5f 63 6f 70 65 |d->sc_dk|.dk_cope|
|00003e90| 6e 6d 61 73 6b 20 7c 20 | 61 63 64 2d 3e 73 63 5f |nmask | |acd->sc_|
|00003ea0| 64 6b 2e 64 6b 5f 62 6f | 70 65 6e 6d 61 73 6b 3b |dk.dk_bo|penmask;|
|00003eb0| 0a 2b 20 0a 2b 20 09 69 | 66 20 28 61 63 64 2d 3e |.+ .+ .i|f (acd->|
|00003ec0| 73 63 5f 64 6b 2e 64 6b | 5f 6f 70 65 6e 6d 61 73 |sc_dk.dk|_openmas|
|00003ed0| 6b 20 3d 3d 20 30 29 20 | 7b 0a 2b 20 09 09 2f 2a |k == 0) |{.+ ../*|
|00003ee0| 20 58 58 58 58 20 4d 75 | 73 74 20 77 61 69 74 20 | XXXX Mu|st wait |
|00003ef0| 66 6f 72 20 49 2f 4f 20 | 74 6f 20 63 6f 6d 70 6c |for I/O |to compl|
|00003f00| 65 74 65 21 20 2a 2f 0a | 2b 20 0a 2b 20 09 09 61 |ete! */.|+ .+ ..a|
|00003f10| 74 61 70 69 5f 70 72 65 | 76 65 6e 74 28 61 63 64 |tapi_pre|vent(acd|
|00003f20| 2d 3e 61 64 5f 6c 69 6e | 6b 2c 20 50 52 5f 41 4c |->ad_lin|k, PR_AL|
|00003f30| 4c 4f 57 29 3b 0a 2b 20 | 09 09 61 63 64 2d 3e 61 |LOW);.+ |..acd->a|
|00003f40| 64 5f 6c 69 6e 6b 2d 3e | 66 6c 61 67 73 20 26 3d |d_link->|flags &=|
|00003f50| 20 7e 41 44 45 56 5f 4f | 50 45 4e 3b 0a 2b 20 09 | ~ADEV_O|PEN;.+ .|
|00003f60| 7d 0a 2b 20 0a 2b 20 09 | 61 63 64 75 6e 6c 6f 63 |}.+ .+ .|acdunloc|
|00003f70| 6b 28 61 63 64 29 3b 0a | 2b 20 09 72 65 74 75 72 |k(acd);.|+ .retur|
|00003f80| 6e 20 30 3b 0a 2b 20 7d | 0a 2b 20 0a 2b 20 2f 2a |n 0;.+ }|.+ .+ /*|
|00003f90| 0a 2b 20 20 2a 20 41 63 | 74 75 61 6c 6c 79 20 74 |.+ * Ac|tually t|
|00003fa0| 72 61 6e 73 6c 61 74 65 | 20 74 68 65 20 72 65 71 |ranslate| the req|
|00003fb0| 75 65 73 74 65 64 20 74 | 72 61 6e 73 66 65 72 20 |uested t|ransfer |
|00003fc0| 69 6e 74 6f 20 6f 6e 65 | 20 74 68 65 20 70 68 79 |into one| the phy|
|00003fd0| 73 69 63 61 6c 20 64 72 | 69 76 65 72 20 63 61 6e |sical dr|iver can|
|00003fe0| 0a 2b 20 20 2a 20 75 6e | 64 65 72 73 74 61 6e 64 |.+ * un|derstand|
|00003ff0| 2e 20 20 54 68 65 20 74 | 72 61 6e 73 66 65 72 20 |. The t|ransfer |
|00004000| 69 73 20 64 65 73 63 72 | 69 62 65 64 20 62 79 20 |is descr|ibed by |
|00004010| 61 20 62 75 66 20 61 6e | 64 20 77 69 6c 6c 20 69 |a buf an|d will i|
|00004020| 6e 63 6c 75 64 65 20 6f | 6e 6c 79 20 6f 6e 65 0a |nclude o|nly one.|
|00004030| 2b 20 20 2a 20 70 68 79 | 73 69 63 61 6c 20 74 72 |+ * phy|sical tr|
|00004040| 61 6e 73 66 65 72 2e 0a | 2b 20 20 2a 2f 0a 2b 20 |ansfer..|+ */.+ |
|00004050| 76 6f 69 64 0a 2b 20 61 | 63 64 73 74 72 61 74 65 |void.+ a|cdstrate|
|00004060| 67 79 28 62 70 29 0a 2b | 20 09 73 74 72 75 63 74 |gy(bp).+| .struct|
|00004070| 20 62 75 66 20 2a 62 70 | 3b 0a 2b 20 7b 0a 2b 20 | buf *bp|;.+ {.+ |
|00004080| 09 73 74 72 75 63 74 20 | 61 63 64 5f 73 6f 66 74 |.struct |acd_soft|
|00004090| 63 20 2a 61 63 64 20 3d | 20 61 63 64 63 64 2e 63 |c *acd =| acdcd.c|
|000040a0| 64 5f 64 65 76 73 5b 43 | 44 55 4e 49 54 28 62 70 |d_devs[C|DUNIT(bp|
|000040b0| 2d 3e 62 5f 64 65 76 29 | 5d 3b 0a 2b 20 09 69 6e |->b_dev)|];.+ .in|
|000040c0| 74 20 6f 70 72 69 3b 0a | 2b 20 0a 2b 20 23 69 66 |t opri;.|+ .+ #if|
|000040d0| 64 65 66 20 41 43 44 5f | 44 45 42 55 47 0a 2b 20 |def ACD_|DEBUG.+ |
|000040e0| 09 70 72 69 6e 74 66 28 | 22 61 63 64 73 74 72 61 |.printf(|"acdstra|
|000040f0| 74 65 67 79 5c 6e 22 29 | 3b 0a 2b 20 23 65 6e 64 |tegy\n")|;.+ #end|
|00004100| 69 66 0a 2b 20 0a 2b 20 | 09 2f 2a 0a 2b 20 09 20 |if.+ .+ |./*.+ . |
|00004110| 2a 20 54 68 65 20 74 72 | 61 6e 73 66 65 72 20 6d |* The tr|ansfer m|
|00004120| 75 73 74 20 62 65 20 61 | 20 77 68 6f 6c 65 20 6e |ust be a| whole n|
|00004130| 75 6d 62 65 72 20 6f 66 | 20 62 6c 6f 63 6b 73 2e |umber of| blocks.|
|00004140| 0a 2b 20 09 20 2a 2f 0a | 2b 20 09 69 66 20 28 28 |.+ . */.|+ .if ((|
|00004150| 62 70 2d 3e 62 5f 62 63 | 6f 75 6e 74 20 25 20 61 |bp->b_bc|ount % a|
|00004160| 63 64 2d 3e 73 63 5f 64 | 6b 2e 64 6b 5f 6c 61 62 |cd->sc_d|k.dk_lab|
|00004170| 65 6c 2e 64 5f 73 65 63 | 73 69 7a 65 29 20 21 3d |el.d_sec|size) !=|
|00004180| 20 30 29 20 7b 0a 2b 20 | 09 09 62 70 2d 3e 62 5f | 0) {.+ |..bp->b_|
|00004190| 65 72 72 6f 72 20 3d 20 | 45 49 4e 56 41 4c 3b 0a |error = |EINVAL;.|
|000041a0| 2b 20 09 09 67 6f 74 6f | 20 62 61 64 3b 0a 2b 20 |+ ..goto| bad;.+ |
|000041b0| 09 7d 0a 2b 20 09 69 66 | 20 28 28 62 70 2d 3e 62 |.}.+ .if| ((bp->b|
|000041c0| 5f 66 6c 61 67 73 20 26 | 20 28 42 5f 52 45 41 44 |_flags &| (B_READ|
|000041d0| 7c 42 5f 57 52 49 54 45 | 29 29 20 3d 3d 20 42 5f ||B_WRITE|)) == B_|
|000041e0| 57 52 49 54 45 29 20 7b | 0a 2b 20 09 09 62 70 2d |WRITE) {|.+ ..bp-|
|000041f0| 3e 62 5f 65 72 72 6f 72 | 20 3d 20 45 52 4f 46 53 |>b_error| = EROFS|
|00004200| 3b 0a 2b 20 09 09 67 6f | 74 6f 20 62 61 64 3b 0a |;.+ ..go|to bad;.|
|00004210| 2b 20 09 7d 0a 2b 20 09 | 2f 2a 0a 2b 20 09 20 2a |+ .}.+ .|/*.+ . *|
|00004220| 20 49 66 20 74 68 65 20 | 64 65 76 69 63 65 20 68 | If the |device h|
|00004230| 61 73 20 62 65 65 6e 20 | 6d 61 64 65 20 69 6e 76 |as been |made inv|
|00004240| 61 6c 69 64 2c 20 65 72 | 72 6f 72 20 6f 75 74 0a |alid, er|ror out.|
|00004250| 2b 20 09 20 2a 20 6d 61 | 79 62 65 20 74 68 65 20 |+ . * ma|ybe the |
|00004260| 6d 65 64 69 61 20 63 68 | 61 6e 67 65 64 0a 2b 20 |media ch|anged.+ |
|00004270| 09 20 2a 2f 0a 2b 20 09 | 69 66 20 28 28 61 63 64 |. */.+ .|if ((acd|
|00004280| 2d 3e 61 64 5f 6c 69 6e | 6b 2d 3e 66 6c 61 67 73 |->ad_lin|k->flags|
|00004290| 20 26 20 41 44 45 56 5f | 4d 45 44 49 41 5f 4c 4f | & ADEV_|MEDIA_LO|
|000042a0| 41 44 45 44 29 20 3d 3d | 20 30 29 20 7b 0a 2b 20 |ADED) ==| 0) {.+ |
|000042b0| 09 09 62 70 2d 3e 62 5f | 65 72 72 6f 72 20 3d 20 |..bp->b_|error = |
|000042c0| 45 49 4f 3b 0a 2b 20 09 | 09 67 6f 74 6f 20 62 61 |EIO;.+ .|.goto ba|
|000042d0| 64 3b 0a 2b 20 09 7d 0a | 2b 20 09 2f 2a 0a 2b 20 |d;.+ .}.|+ ./*.+ |
|000042e0| 09 20 2a 20 49 66 20 69 | 74 27 73 20 61 20 6e 75 |. * If i|t's a nu|
|000042f0| 6c 6c 20 74 72 61 6e 73 | 66 65 72 2c 20 72 65 74 |ll trans|fer, ret|
|00004300| 75 72 6e 20 69 6d 6d 65 | 64 69 61 74 65 6c 79 0a |urn imme|diately.|
|00004310| 2b 20 09 20 2a 2f 0a 2b | 20 09 69 66 20 28 62 70 |+ . */.+| .if (bp|
|00004320| 2d 3e 62 5f 62 63 6f 75 | 6e 74 20 3d 3d 20 30 29 |->b_bcou|nt == 0)|
|00004330| 0a 2b 20 09 09 67 6f 74 | 6f 20 64 6f 6e 65 3b 0a |.+ ..got|o done;.|
|00004340| 2b 20 0a 2b 20 09 2f 2a | 0a 2b 20 09 20 2a 20 44 |+ .+ ./*|.+ . * D|
|00004350| 6f 20 62 6f 75 6e 64 73 | 20 63 68 65 63 6b 69 6e |o bounds| checkin|
|00004360| 67 2c 20 61 64 6a 75 73 | 74 20 74 72 61 6e 73 66 |g, adjus|t transf|
|00004370| 65 72 2e 20 69 66 20 65 | 72 72 6f 72 2c 20 70 72 |er. if e|rror, pr|
|00004380| 6f 63 65 73 73 2e 0a 2b | 20 09 20 2a 20 49 66 20 |ocess..+| . * If |
|00004390| 65 6e 64 20 6f 66 20 70 | 61 72 74 69 74 69 6f 6e |end of p|artition|
|000043a0| 2c 20 6a 75 73 74 20 72 | 65 74 75 72 6e 2e 0a 2b |, just r|eturn..+|
|000043b0| 20 09 20 2a 2f 0a 2b 20 | 09 69 66 20 28 43 44 50 | . */.+ |.if (CDP|
|000043c0| 41 52 54 28 62 70 2d 3e | 62 5f 64 65 76 29 20 21 |ART(bp->|b_dev) !|
|000043d0| 3d 20 52 41 57 5f 50 41 | 52 54 20 26 26 0a 2b 20 |= RAW_PA|RT &&.+ |
|000043e0| 09 20 20 20 20 62 6f 75 | 6e 64 73 5f 63 68 65 63 |. bou|nds_chec|
|000043f0| 6b 5f 77 69 74 68 5f 6c | 61 62 65 6c 28 62 70 2c |k_with_l|abel(bp,|
|00004400| 20 26 61 63 64 2d 3e 73 | 63 5f 64 6b 2e 64 6b 5f | &acd->s|c_dk.dk_|
|00004410| 6c 61 62 65 6c 2c 0a 2b | 20 09 20 20 20 20 28 61 |label,.+| . (a|
|00004420| 63 64 2d 3e 66 6c 61 67 | 73 20 26 20 28 43 44 46 |cd->flag|s & (CDF|
|00004430| 5f 57 4c 41 42 45 4c 7c | 43 44 46 5f 4c 41 42 45 |_WLABEL||CDF_LABE|
|00004440| 4c 4c 49 4e 47 29 29 20 | 21 3d 20 30 29 20 3c 3d |LLING)) |!= 0) <=|
|00004450| 20 30 29 0a 2b 20 09 09 | 67 6f 74 6f 20 64 6f 6e | 0).+ ..|goto don|
|00004460| 65 3b 0a 2b 20 0a 2b 20 | 09 6f 70 72 69 20 3d 20 |e;.+ .+ |.opri = |
|00004470| 73 70 6c 62 69 6f 28 29 | 3b 0a 2b 20 0a 2b 20 09 |splbio()|;.+ .+ .|
|00004480| 2f 2a 0a 2b 20 09 20 2a | 20 50 6c 61 63 65 20 69 |/*.+ . *| Place i|
|00004490| 74 20 69 6e 20 74 68 65 | 20 71 75 65 75 65 20 6f |t in the| queue o|
|000044a0| 66 20 64 69 73 6b 20 61 | 63 74 69 76 69 74 69 65 |f disk a|ctivitie|
|000044b0| 73 20 66 6f 72 20 74 68 | 69 73 20 64 69 73 6b 0a |s for th|is disk.|
|000044c0| 2b 20 09 20 2a 2f 0a 2b | 20 09 64 69 73 6b 73 6f |+ . */.+| .diskso|
|000044d0| 72 74 28 26 61 63 64 2d | 3e 62 75 66 5f 71 75 65 |rt(&acd-|>buf_que|
|000044e0| 75 65 2c 20 62 70 29 3b | 0a 2b 20 0a 2b 20 09 2f |ue, bp);|.+ .+ ./|
|000044f0| 2a 0a 2b 20 09 20 2a 20 | 54 65 6c 6c 20 74 68 65 |*.+ . * |Tell the|
|00004500| 20 64 65 76 69 63 65 20 | 74 6f 20 67 65 74 20 67 | device |to get g|
|00004510| 6f 69 6e 67 20 6f 6e 20 | 74 68 65 20 74 72 61 6e |oing on |the tran|
|00004520| 73 66 65 72 20 69 66 20 | 69 74 27 73 0a 2b 20 09 |sfer if |it's.+ .|
|00004530| 20 2a 20 6e 6f 74 20 64 | 6f 69 6e 67 20 61 6e 79 | * not d|oing any|
|00004540| 74 68 69 6e 67 2c 20 6f | 74 68 65 72 77 69 73 65 |thing, o|therwise|
|00004550| 20 6a 75 73 74 20 77 61 | 69 74 20 66 6f 72 20 63 | just wa|it for c|
|00004560| 6f 6d 70 6c 65 74 69 6f | 6e 0a 2b 20 09 20 2a 2f |ompletio|n.+ . */|
|00004570| 0a 2b 20 09 61 63 64 73 | 74 61 72 74 28 61 63 64 |.+ .acds|tart(acd|
|00004580| 29 3b 0a 2b 20 0a 2b 20 | 09 73 70 6c 78 28 6f 70 |);.+ .+ |.splx(op|
|00004590| 72 69 29 3b 0a 2b 20 09 | 72 65 74 75 72 6e 3b 0a |ri);.+ .|return;.|
|000045a0| 2b 20 0a 2b 20 62 61 64 | 3a 0a 2b 20 09 62 70 2d |+ .+ bad|:.+ .bp-|
|000045b0| 3e 62 5f 66 6c 61 67 73 | 20 7c 3d 20 42 5f 45 52 |>b_flags| |= B_ER|
|000045c0| 52 4f 52 3b 0a 2b 20 64 | 6f 6e 65 3a 0a 2b 20 09 |ROR;.+ d|one:.+ .|
|000045d0| 2f 2a 0a 2b 20 09 20 2a | 20 43 6f 72 72 65 63 74 |/*.+ . *| Correct|
|000045e0| 6c 79 20 73 65 74 20 74 | 68 65 20 62 75 66 20 74 |ly set t|he buf t|
|000045f0| 6f 20 69 6e 64 69 63 61 | 74 65 20 61 20 63 6f 6d |o indica|te a com|
|00004600| 70 6c 65 74 65 64 20 78 | 66 65 72 0a 2b 20 09 20 |pleted x|fer.+ . |
|00004610| 2a 2f 0a 2b 20 09 62 70 | 2d 3e 62 5f 72 65 73 69 |*/.+ .bp|->b_resi|
|00004620| 64 20 3d 20 62 70 2d 3e | 62 5f 62 63 6f 75 6e 74 |d = bp->|b_bcount|
|00004630| 3b 0a 2b 20 09 62 69 6f | 64 6f 6e 65 28 62 70 29 |;.+ .bio|done(bp)|
|00004640| 3b 0a 2b 20 7d 0a 2b 20 | 0a 2b 20 2f 2a 0a 2b 20 |;.+ }.+ |.+ /*.+ |
|00004650| 20 2a 20 61 63 64 73 74 | 61 72 74 20 6c 6f 6f 6b | * acdst|art look|
|00004660| 73 20 74 6f 20 73 65 65 | 20 69 66 20 74 68 65 72 |s to see| if ther|
|00004670| 65 20 69 73 20 61 20 62 | 75 66 20 77 61 69 74 69 |e is a b|uf waiti|
|00004680| 6e 67 20 66 6f 72 20 74 | 68 65 20 64 65 76 69 63 |ng for t|he devic|
|00004690| 65 0a 2b 20 20 2a 20 61 | 6e 64 20 74 68 61 74 20 |e.+ * a|nd that |
|000046a0| 74 68 65 20 64 65 76 69 | 63 65 20 69 73 20 6e 6f |the devi|ce is no|
|000046b0| 74 20 61 6c 72 65 61 64 | 79 20 62 75 73 79 2e 20 |t alread|y busy. |
|000046c0| 49 66 20 62 6f 74 68 20 | 61 72 65 20 74 72 75 65 |If both |are true|
|000046d0| 2c 0a 2b 20 20 2a 20 49 | 74 20 64 65 71 75 65 73 |,.+ * I|t deques|
|000046e0| 20 74 68 65 20 62 75 66 | 20 61 6e 64 20 63 72 65 | the buf| and cre|
|000046f0| 61 74 65 73 20 61 20 61 | 74 61 70 69 20 63 6f 6d |ates a a|tapi com|
|00004700| 6d 61 6e 64 20 74 6f 20 | 70 65 72 66 6f 72 6d 20 |mand to |perform |
|00004710| 74 68 65 0a 2b 20 20 2a | 20 74 72 61 6e 73 66 65 |the.+ *| transfe|
|00004720| 72 20 69 6e 20 74 68 65 | 20 62 75 66 2e 20 54 68 |r in the| buf. Th|
|00004730| 65 20 74 72 61 6e 73 66 | 65 72 20 72 65 71 75 65 |e transf|er reque|
|00004740| 73 74 20 77 69 6c 6c 20 | 63 61 6c 6c 20 61 74 61 |st will |call ata|
|00004750| 70 69 5f 64 6f 6e 65 0a | 2b 20 20 2a 20 6f 6e 20 |pi_done.|+ * on |
|00004760| 63 6f 6d 70 6c 65 74 69 | 6f 6e 2c 20 77 68 69 63 |completi|on, whic|
|00004770| 68 20 77 69 6c 6c 20 69 | 6e 20 74 75 72 6e 20 63 |h will i|n turn c|
|00004780| 61 6c 6c 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |all this| routine|
|00004790| 20 61 67 61 69 6e 0a 2b | 20 20 2a 20 73 6f 20 74 | again.+| * so t|
|000047a0| 68 61 74 20 74 68 65 20 | 6e 65 78 74 20 71 75 65 |hat the |next que|
|000047b0| 75 65 64 20 74 72 61 6e | 73 66 65 72 20 69 73 20 |ued tran|sfer is |
|000047c0| 70 65 72 66 6f 72 6d 65 | 64 2e 0a 2b 20 20 2a 20 |performe|d..+ * |
|000047d0| 54 68 65 20 62 75 66 73 | 20 61 72 65 20 71 75 65 |The bufs| are que|
|000047e0| 75 65 64 20 62 79 20 74 | 68 65 20 73 74 72 61 74 |ued by t|he strat|
|000047f0| 65 67 79 20 72 6f 75 74 | 69 6e 65 20 28 63 64 73 |egy rout|ine (cds|
|00004800| 74 72 61 74 65 67 79 29 | 0a 2b 20 20 2a 0a 2b 20 |trategy)|.+ *.+ |
|00004810| 20 2a 20 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 | * This |routine |
|00004820| 69 73 20 61 6c 73 6f 20 | 63 61 6c 6c 65 64 20 61 |is also |called a|
|00004830| 66 74 65 72 20 6f 74 68 | 65 72 20 6e 6f 6e 2d 71 |fter oth|er non-q|
|00004840| 75 65 75 65 64 20 72 65 | 71 75 65 73 74 73 0a 2b |ueued re|quests.+|
|00004850| 20 20 2a 20 68 61 76 65 | 20 62 65 65 6e 20 6d 61 | * have| been ma|
|00004860| 64 65 20 6f 66 20 74 68 | 65 20 61 74 61 70 69 20 |de of th|e atapi |
|00004870| 64 72 69 76 65 72 2c 20 | 74 6f 20 65 6e 73 75 72 |driver, |to ensur|
|00004880| 65 20 74 68 61 74 20 74 | 68 65 20 71 75 65 75 65 |e that t|he queue|
|00004890| 0a 2b 20 20 2a 20 63 6f | 6e 74 69 6e 75 65 73 20 |.+ * co|ntinues |
|000048a0| 74 6f 20 62 65 20 64 72 | 61 69 6e 65 64 2e 0a 2b |to be dr|ained..+|
|000048b0| 20 20 2a 0a 2b 20 20 2a | 20 6d 75 73 74 20 62 65 | *.+ *| must be|
|000048c0| 20 63 61 6c 6c 65 64 20 | 61 74 20 74 68 65 20 63 | called |at the c|
|000048d0| 6f 72 72 65 63 74 20 28 | 68 69 67 68 69 73 68 29 |orrect (|highish)|
|000048e0| 20 73 70 6c 20 6c 65 76 | 65 6c 0a 2b 20 20 2a 20 | spl lev|el.+ * |
|000048f0| 63 64 73 74 61 72 74 28 | 29 20 69 73 20 63 61 6c |cdstart(|) is cal|
|00004900| 6c 65 64 20 61 74 20 73 | 70 6c 62 69 6f 20 66 72 |led at s|plbio fr|
|00004910| 6f 6d 20 63 64 73 74 72 | 61 74 65 67 79 20 61 6e |om cdstr|ategy an|
|00004920| 64 20 61 74 61 70 69 5f | 64 6f 6e 65 0a 2b 20 20 |d atapi_|done.+ |
|00004930| 2a 2f 0a 2b 20 76 6f 69 | 64 0a 2b 20 61 63 64 73 |*/.+ voi|d.+ acds|
|00004940| 74 61 72 74 28 61 63 64 | 29 0a 2b 20 09 73 74 72 |tart(acd|).+ .str|
|00004950| 75 63 74 20 61 63 64 5f | 73 6f 66 74 63 20 2a 61 |uct acd_|softc *a|
|00004960| 63 64 3b 0a 2b 20 7b 0a | 2b 20 09 73 74 72 75 63 |cd;.+ {.|+ .struc|
|00004970| 74 20 61 74 5f 64 65 76 | 5f 6c 69 6e 6b 20 2a 61 |t at_dev|_link *a|
|00004980| 64 5f 6c 69 6e 6b 3b 0a | 2b 20 09 73 74 72 75 63 |d_link;.|+ .struc|
|00004990| 74 20 62 75 66 20 2a 62 | 70 20 3d 20 30 3b 0a 2b |t buf *b|p = 0;.+|
|000049a0| 20 09 73 74 72 75 63 74 | 20 62 75 66 20 2a 64 70 | .struct| buf *dp|
|000049b0| 3b 0a 2b 20 09 73 74 72 | 75 63 74 20 72 65 61 64 |;.+ .str|uct read|
|000049c0| 20 63 6d 64 3b 0a 2b 20 | 09 75 5f 69 6e 74 33 32 | cmd;.+ |.u_int32|
|000049d0| 5f 74 20 62 6c 6b 6e 6f | 2c 20 6e 62 6c 6b 73 3b |_t blkno|, nblks;|
|000049e0| 0a 2b 20 09 73 74 72 75 | 63 74 20 70 61 72 74 69 |.+ .stru|ct parti|
|000049f0| 74 69 6f 6e 20 2a 70 3b | 0a 2b 20 0a 2b 20 23 69 |tion *p;|.+ .+ #i|
|00004a00| 66 64 65 66 20 41 43 44 | 5f 44 45 42 55 47 0a 2b |fdef ACD|_DEBUG.+|
|00004a10| 20 09 70 72 69 6e 74 66 | 28 22 61 63 64 3a 20 61 | .printf|("acd: a|
|00004a20| 63 64 73 74 61 72 74 5c | 6e 22 29 3b 0a 2b 20 09 |cdstart\|n");.+ .|
|00004a30| 69 66 20 28 61 63 64 20 | 3d 3d 20 4e 55 4c 4c 29 |if (acd |== NULL)|
|00004a40| 20 7b 0a 2b 20 09 09 70 | 72 69 6e 74 66 28 22 61 | {.+ ..p|rintf("a|
|00004a50| 63 64 73 74 61 72 74 3a | 20 6e 75 6c 6c 20 61 63 |cdstart:| null ac|
|00004a60| 64 5c 6e 22 29 3b 0a 2b | 20 09 09 72 65 74 75 72 |d\n");.+| ..retur|
|00004a70| 6e 3b 0a 2b 20 09 7d 0a | 2b 20 23 65 6e 64 69 66 |n;.+ .}.|+ #endif|
|00004a80| 0a 2b 20 09 09 0a 2b 20 | 09 61 64 5f 6c 69 6e 6b |.+ ...+ |.ad_link|
|00004a90| 20 3d 20 61 63 64 2d 3e | 61 64 5f 6c 69 6e 6b 3b | = acd->|ad_link;|
|00004aa0| 0a 2b 20 23 69 66 64 65 | 66 20 41 43 44 5f 44 45 |.+ #ifde|f ACD_DE|
|00004ab0| 42 55 47 0a 2b 20 09 69 | 66 20 28 61 64 5f 6c 69 |BUG.+ .i|f (ad_li|
|00004ac0| 6e 6b 20 3d 3d 20 4e 55 | 4c 4c 29 20 7b 0a 2b 20 |nk == NU|LL) {.+ |
|00004ad0| 09 09 70 72 69 6e 74 66 | 28 22 61 63 64 73 74 61 |..printf|("acdsta|
|00004ae0| 72 74 3a 20 6e 75 6c 6c | 20 61 64 5f 6c 69 6e 6b |rt: null| ad_link|
|00004af0| 5c 6e 22 29 3b 0a 2b 20 | 09 09 72 65 74 75 72 6e |\n");.+ |..return|
|00004b00| 3b 0a 2b 20 09 7d 0a 2b | 20 23 65 6e 64 69 66 0a |;.+ .}.+| #endif.|
|00004b10| 2b 20 09 2f 2a 0a 2b 20 | 09 20 2a 20 43 68 65 63 |+ ./*.+ |. * Chec|
|00004b20| 6b 20 69 66 20 74 68 65 | 20 64 65 76 69 63 65 20 |k if the| device |
|00004b30| 68 61 73 20 72 6f 6f 6d | 20 66 6f 72 20 61 6e 6f |has room| for ano|
|00004b40| 74 68 65 72 20 63 6f 6d | 6d 61 6e 64 0a 2b 20 09 |ther com|mand.+ .|
|00004b50| 20 2a 2f 0a 2b 20 09 77 | 68 69 6c 65 20 28 61 64 | */.+ .w|hile (ad|
|00004b60| 5f 6c 69 6e 6b 2d 3e 6f | 70 65 6e 69 6e 67 73 20 |_link->o|penings |
|00004b70| 3e 30 20 29 20 7b 0a 2b | 20 09 09 2f 2a 0a 2b 20 |>0 ) {.+| ../*.+ |
|00004b80| 09 09 20 2a 20 74 68 65 | 72 65 20 69 73 20 65 78 |.. * the|re is ex|
|00004b90| 63 65 73 73 20 63 61 70 | 61 63 69 74 79 2c 20 62 |cess cap|acity, b|
|00004ba0| 75 74 20 61 20 73 70 65 | 63 69 61 6c 20 77 61 69 |ut a spe|cial wai|
|00004bb0| 74 73 0a 2b 20 09 09 20 | 2a 20 49 74 27 6c 6c 20 |ts.+ .. |* It'll |
|00004bc0| 6e 65 65 64 20 74 68 65 | 20 61 64 61 70 74 65 72 |need the| adapter|
|00004bd0| 20 61 73 20 73 6f 6f 6e | 20 61 73 20 77 65 20 63 | as soon| as we c|
|00004be0| 6c 65 61 72 20 6f 75 74 | 20 6f 66 20 74 68 65 0a |lear out| of the.|
|00004bf0| 2b 20 09 09 20 2a 20 77 | 61 79 20 61 6e 64 20 6c |+ .. * w|ay and l|
|00004c00| 65 74 20 69 74 20 72 75 | 6e 20 28 75 73 65 72 20 |et it ru|n (user |
|00004c10| 6c 65 76 65 6c 20 77 61 | 69 74 29 2e 0a 2b 20 09 |level wa|it)..+ .|
|00004c20| 09 20 2a 2f 0a 2b 20 09 | 09 69 66 20 28 61 64 5f |. */.+ .|.if (ad_|
|00004c30| 6c 69 6e 6b 2d 3e 66 6c | 61 67 73 20 26 20 41 44 |link->fl|ags & AD|
|00004c40| 45 56 5f 57 41 49 54 49 | 4e 47 29 20 7b 0a 2b 20 |EV_WAITI|NG) {.+ |
|00004c50| 23 69 66 64 65 66 20 41 | 54 41 50 49 5f 44 45 42 |#ifdef A|TAPI_DEB|
|00004c60| 55 47 0a 2b 20 09 09 09 | 70 72 69 6e 74 66 28 22 |UG.+ ...|printf("|
|00004c70| 61 63 64 73 74 61 72 74 | 3a 20 77 61 6b 69 6e 67 |acdstart|: waking|
|00004c80| 20 75 70 5c 6e 22 29 3b | 0a 2b 20 23 65 6e 64 69 | up\n");|.+ #endi|
|00004c90| 66 0a 2b 20 09 09 09 61 | 64 5f 6c 69 6e 6b 2d 3e |f.+ ...a|d_link->|
|00004ca0| 66 6c 61 67 73 20 26 3d | 20 7e 41 44 45 56 5f 57 |flags &=| ~ADEV_W|
|00004cb0| 41 49 54 49 4e 47 3b 0a | 2b 20 09 09 09 77 61 6b |AITING;.|+ ...wak|
|00004cc0| 65 75 70 28 28 63 61 64 | 64 72 5f 74 29 61 64 5f |eup((cad|dr_t)ad_|
|00004cd0| 6c 69 6e 6b 29 3b 0a 2b | 20 09 09 09 72 65 74 75 |link);.+| ...retu|
|00004ce0| 72 6e 3b 0a 2b 20 09 09 | 7d 0a 2b 20 09 09 0a 2b |rn;.+ ..|}.+ ...+|
|00004cf0| 20 09 09 2f 2a 0a 2b 20 | 09 09 20 2a 20 53 65 65 | ../*.+ |.. * See|
|00004d00| 20 69 66 20 74 68 65 72 | 65 20 69 73 20 61 20 62 | if ther|e is a b|
|00004d10| 75 66 20 77 69 74 68 20 | 77 6f 72 6b 20 66 6f 72 |uf with |work for|
|00004d20| 20 75 73 20 74 6f 20 64 | 6f 2e 2e 0a 2b 20 09 09 | us to d|o...+ ..|
|00004d30| 20 2a 2f 0a 2b 20 09 09 | 64 70 20 3d 20 26 61 63 | */.+ ..|dp = &ac|
|00004d40| 64 2d 3e 62 75 66 5f 71 | 75 65 75 65 3b 0a 2b 20 |d->buf_q|ueue;.+ |
|00004d50| 23 69 66 64 65 66 20 41 | 43 44 5f 44 45 42 55 47 |#ifdef A|CD_DEBUG|
|00004d60| 0a 2b 20 09 09 69 66 20 | 28 64 70 20 3d 3d 20 4e |.+ ..if |(dp == N|
|00004d70| 55 4c 4c 29 20 7b 0a 2b | 20 09 09 09 70 72 69 6e |ULL) {.+| ...prin|
|00004d80| 74 66 28 22 61 63 64 73 | 74 61 72 74 3a 20 6e 75 |tf("acds|tart: nu|
|00004d90| 6c 6c 20 64 70 5c 6e 22 | 29 3b 0a 2b 20 09 09 09 |ll dp\n"|);.+ ...|
|00004da0| 72 65 74 75 72 6e 3b 0a | 2b 20 09 09 7d 0a 2b 20 |return;.|+ ..}.+ |
|00004db0| 23 65 6e 64 69 66 0a 2b | 20 09 09 69 66 20 28 28 |#endif.+| ..if ((|
|00004dc0| 62 70 20 3d 20 64 70 2d | 3e 62 5f 61 63 74 66 29 |bp = dp-|>b_actf)|
|00004dd0| 20 3d 3d 20 4e 55 4c 4c | 29 09 2f 2a 20 79 65 73 | == NULL|)./* yes|
|00004de0| 2c 20 61 6e 20 61 73 73 | 69 67 6e 20 2a 2f 0a 2b |, an ass|ign */.+|
|00004df0| 20 09 09 09 72 65 74 75 | 72 6e 3b 0a 2b 20 23 69 | ...retu|rn;.+ #i|
|00004e00| 66 64 65 66 20 41 43 44 | 5f 44 45 42 55 47 0a 2b |fdef ACD|_DEBUG.+|
|00004e10| 20 09 09 70 72 69 6e 74 | 66 28 22 61 63 64 73 74 | ..print|f("acdst|
|00004e20| 61 72 74 3a 20 61 20 62 | 75 66 5c 6e 22 29 3b 0a |art: a b|uf\n");.|
|00004e30| 2b 20 23 65 6e 64 69 66 | 0a 2b 20 09 09 64 70 2d |+ #endif|.+ ..dp-|
|00004e40| 3e 62 5f 61 63 74 66 20 | 3d 20 62 70 2d 3e 62 5f |>b_actf |= bp->b_|
|00004e50| 61 63 74 66 3b 0a 2b 20 | 0a 2b 20 09 09 2f 2a 0a |actf;.+ |.+ ../*.|
|00004e60| 2b 20 09 09 20 2a 20 49 | 66 20 74 68 65 20 64 65 |+ .. * I|f the de|
|00004e70| 76 69 63 65 20 68 61 73 | 20 62 65 63 6f 6d 65 20 |vice has| become |
|00004e80| 69 6e 76 61 6c 69 64 2c | 20 61 62 6f 72 74 20 61 |invalid,| abort a|
|00004e90| 6c 6c 20 74 68 65 0a 2b | 20 09 09 20 2a 20 72 65 |ll the.+| .. * re|
|00004ea0| 61 64 73 20 61 6e 64 20 | 77 72 69 74 65 73 20 75 |ads and |writes u|
|00004eb0| 6e 74 69 6c 20 61 6c 6c | 20 66 69 6c 65 73 20 68 |ntil all| files h|
|00004ec0| 61 76 65 20 62 65 65 6e | 20 63 6c 6f 73 65 64 20 |ave been| closed |
|00004ed0| 61 6e 64 0a 2b 20 09 09 | 20 2a 20 72 65 2d 6f 70 |and.+ ..| * re-op|
|00004ee0| 65 6e 65 64 0a 2b 20 09 | 09 20 2a 2f 0a 2b 20 09 |ened.+ .|. */.+ .|
|00004ef0| 09 69 66 20 28 28 61 64 | 5f 6c 69 6e 6b 2d 3e 66 |.if ((ad|_link->f|
|00004f00| 6c 61 67 73 20 26 20 41 | 44 45 56 5f 4d 45 44 49 |lags & A|DEV_MEDI|
|00004f10| 41 5f 4c 4f 41 44 45 44 | 29 20 3d 3d 20 30 29 20 |A_LOADED|) == 0) |
|00004f20| 7b 0a 2b 20 09 09 09 62 | 70 2d 3e 62 5f 65 72 72 |{.+ ...b|p->b_err|
|00004f30| 6f 72 20 3d 20 45 49 4f | 3b 0a 2b 20 09 09 09 62 |or = EIO|;.+ ...b|
|00004f40| 70 2d 3e 62 5f 66 6c 61 | 67 73 20 7c 3d 20 42 5f |p->b_fla|gs |= B_|
|00004f50| 45 52 52 4f 52 3b 0a 2b | 20 09 09 09 62 69 6f 64 |ERROR;.+| ...biod|
|00004f60| 6f 6e 65 28 62 70 29 3b | 0a 2b 20 09 09 09 63 6f |one(bp);|.+ ...co|
|00004f70| 6e 74 69 6e 75 65 3b 0a | 2b 20 09 09 7d 0a 2b 20 |ntinue;.|+ ..}.+ |
|00004f80| 0a 2b 20 09 09 2f 2a 0a | 2b 20 09 09 20 2a 0a 2b |.+ ../*.|+ .. *.+|
|00004f90| 20 09 09 20 2a 20 46 69 | 72 73 74 2c 20 74 72 61 | .. * Fi|rst, tra|
|00004fa0| 6e 73 6c 61 74 65 20 74 | 68 65 20 62 6c 6f 63 6b |nslate t|he block|
|00004fb0| 20 74 6f 20 61 62 73 6f | 6c 75 74 65 20 61 6e 64 | to abso|lute and|
|00004fc0| 20 70 75 74 20 69 74 20 | 69 6e 20 74 65 72 6d 73 | put it |in terms|
|00004fd0| 0a 2b 20 09 09 20 2a 20 | 6f 66 20 74 68 65 20 6c |.+ .. * |of the l|
|00004fe0| 6f 67 69 63 61 6c 20 62 | 6c 6f 63 6b 73 69 7a 65 |ogical b|locksize|
|00004ff0| 20 6f 66 20 74 68 65 20 | 64 65 76 69 63 65 2e 0a | of the |device..|
|00005000| 2b 20 09 09 20 2a 2f 0a | 2b 20 09 09 62 6c 6b 6e |+ .. */.|+ ..blkn|
|00005010| 6f 20 3d 0a 2b 20 09 09 | 20 20 20 20 62 70 2d 3e |o =.+ ..| bp->|
|00005020| 62 5f 62 6c 6b 6e 6f 20 | 2f 20 28 61 63 64 2d 3e |b_blkno |/ (acd->|
|00005030| 73 63 5f 64 6b 2e 64 6b | 5f 6c 61 62 65 6c 2e 64 |sc_dk.dk|_label.d|
|00005040| 5f 73 65 63 73 69 7a 65 | 20 2f 20 44 45 56 5f 42 |_secsize| / DEV_B|
|00005050| 53 49 5a 45 29 3b 0a 2b | 20 09 09 69 66 20 28 43 |SIZE);.+| ..if (C|
|00005060| 44 50 41 52 54 28 62 70 | 2d 3e 62 5f 64 65 76 29 |DPART(bp|->b_dev)|
|00005070| 20 21 3d 20 52 41 57 5f | 50 41 52 54 29 20 7b 0a | != RAW_|PART) {.|
|00005080| 2b 20 09 09 09 70 20 3d | 20 26 61 63 64 2d 3e 73 |+ ...p =| &acd->s|
|00005090| 63 5f 64 6b 2e 64 6b 5f | 6c 61 62 65 6c 2e 64 5f |c_dk.dk_|label.d_|
|000050a0| 70 61 72 74 69 74 69 6f | 6e 73 5b 43 44 50 41 52 |partitio|ns[CDPAR|
|000050b0| 54 28 62 70 2d 3e 62 5f | 64 65 76 29 5d 3b 0a 2b |T(bp->b_|dev)];.+|
|000050c0| 20 09 09 09 62 6c 6b 6e | 6f 20 2b 3d 20 70 2d 3e | ...blkn|o += p->|
|000050d0| 70 5f 6f 66 66 73 65 74 | 3b 0a 2b 20 09 09 7d 0a |p_offset|;.+ ..}.|
|000050e0| 2b 20 09 09 6e 62 6c 6b | 73 20 3d 20 68 6f 77 6d |+ ..nblk|s = howm|
|000050f0| 61 6e 79 28 62 70 2d 3e | 62 5f 62 63 6f 75 6e 74 |any(bp->|b_bcount|
|00005100| 2c 20 61 63 64 2d 3e 73 | 63 5f 64 6b 2e 64 6b 5f |, acd->s|c_dk.dk_|
|00005110| 6c 61 62 65 6c 2e 64 5f | 73 65 63 73 69 7a 65 29 |label.d_|secsize)|
|00005120| 3b 0a 2b 20 23 69 66 64 | 65 66 20 41 43 44 5f 44 |;.+ #ifd|ef ACD_D|
|00005130| 45 42 55 47 0a 2b 20 09 | 09 70 72 69 6e 74 66 28 |EBUG.+ .|.printf(|
|00005140| 22 61 63 64 73 74 61 72 | 74 3a 20 62 6c 6b 6e 6f |"acdstar|t: blkno|
|00005150| 20 25 64 20 6e 62 6c 6b | 20 25 64 5c 6e 22 2c 62 | %d nblk| %d\n",b|
|00005160| 6c 6b 6e 6f 2c 20 6e 62 | 6c 6b 73 29 3b 0a 2b 20 |lkno, nb|lks);.+ |
|00005170| 23 65 6e 64 69 66 0a 2b | 20 0a 2b 20 09 09 2f 2a |#endif.+| .+ ../*|
|00005180| 0a 2b 20 09 09 20 2a 20 | 20 46 69 6c 6c 20 6f 75 |.+ .. * | Fill ou|
|00005190| 74 20 74 68 65 20 61 74 | 61 70 69 20 63 6f 6d 6d |t the at|api comm|
|000051a0| 61 6e 64 0a 2b 20 09 09 | 20 2a 2f 0a 2b 20 09 09 |and.+ ..| */.+ ..|
|000051b0| 62 7a 65 72 6f 28 26 63 | 6d 64 2c 20 73 69 7a 65 |bzero(&c|md, size|
|000051c0| 6f 66 28 63 6d 64 29 29 | 3b 0a 2b 20 09 09 63 6d |of(cmd))|;.+ ..cm|
|000051d0| 64 2e 6f 70 65 72 61 74 | 69 6f 6e 5f 63 6f 64 65 |d.operat|ion_code|
|000051e0| 20 3d 20 41 54 41 50 49 | 5f 52 45 41 44 3b 0a 2b | = ATAPI|_READ;.+|
|000051f0| 20 09 09 63 6d 64 2e 6c | 62 61 5b 30 5d 20 3d 20 | ..cmd.l|ba[0] = |
|00005200| 28 62 6c 6b 6e 6f 20 3e | 3e 20 32 34 29 20 26 20 |(blkno >|> 24) & |
|00005210| 30 78 66 66 3b 0a 2b 20 | 09 09 63 6d 64 2e 6c 62 |0xff;.+ |..cmd.lb|
|00005220| 61 5b 31 5d 20 3d 20 28 | 62 6c 6b 6e 6f 20 3e 3e |a[1] = (|blkno >>|
|00005230| 20 31 36 29 20 26 20 30 | 78 66 66 3b 0a 2b 20 09 | 16) & 0|xff;.+ .|
|00005240| 09 63 6d 64 2e 6c 62 61 | 5b 32 5d 20 3d 20 28 62 |.cmd.lba|[2] = (b|
|00005250| 6c 6b 6e 6f 20 3e 3e 20 | 38 29 20 26 20 30 78 66 |lkno >> |8) & 0xf|
|00005260| 66 3b 0a 2b 20 09 09 63 | 6d 64 2e 6c 62 61 5b 33 |f;.+ ..c|md.lba[3|
|00005270| 5d 20 3d 20 62 6c 6b 6e | 6f 20 26 20 30 78 66 66 |] = blkn|o & 0xff|
|00005280| 3b 0a 2b 20 09 09 63 6d | 64 2e 6c 65 6e 67 74 68 |;.+ ..cm|d.length|
|00005290| 5b 30 5d 20 3d 20 28 6e | 62 6c 6b 73 20 3e 3e 20 |[0] = (n|blks >> |
|000052a0| 38 29 20 26 20 30 78 66 | 66 3b 0a 2b 20 09 09 63 |8) & 0xf|f;.+ ..c|
|000052b0| 6d 64 2e 6c 65 6e 67 74 | 68 5b 31 5d 20 3d 20 6e |md.lengt|h[1] = n|
|000052c0| 62 6c 6b 73 20 26 20 30 | 78 66 66 3b 0a 2b 20 0a |blks & 0|xff;.+ .|
|000052d0| 2b 20 09 09 2f 2a 0a 2b | 20 09 09 20 2a 20 43 61 |+ ../*.+| .. * Ca|
|000052e0| 6c 6c 20 74 68 65 20 72 | 6f 75 74 69 6e 65 20 74 |ll the r|outine t|
|000052f0| 68 61 74 20 63 68 61 74 | 73 20 77 69 74 68 20 74 |hat chat|s with t|
|00005300| 68 65 20 61 64 61 70 74 | 65 72 2e 0a 2b 20 09 09 |he adapt|er..+ ..|
|00005310| 20 2a 20 4e 6f 74 65 3a | 20 77 65 20 63 61 6e 6e | * Note:| we cann|
|00005320| 6f 74 20 73 6c 65 65 70 | 20 61 73 20 77 65 20 6d |ot sleep| as we m|
|00005330| 61 79 20 62 65 20 61 6e | 20 69 6e 74 65 72 72 75 |ay be an| interru|
|00005340| 70 74 0a 2b 20 09 09 20 | 2a 2f 0a 2b 20 0a 2b 20 |pt.+ .. |*/.+ .+ |
|00005350| 09 09 20 69 66 20 28 61 | 74 61 70 69 5f 65 78 65 |.. if (a|tapi_exe|
|00005360| 63 5f 69 6f 28 61 64 5f | 6c 69 6e 6b 2c 20 26 63 |c_io(ad_|link, &c|
|00005370| 6d 64 2c 20 73 69 7a 65 | 6f 66 28 63 6d 64 29 2c |md, size|of(cmd),|
|00005380| 20 62 70 2c 20 41 5f 4e | 4f 53 4c 45 45 50 29 29 | bp, A_N|OSLEEP))|
|00005390| 0a 2b 20 09 09 09 70 72 | 69 6e 74 66 28 22 25 73 |.+ ...pr|intf("%s|
|000053a0| 3a 20 6e 6f 74 20 71 75 | 65 75 65 64 22 2c 20 61 |: not qu|eued", a|
|000053b0| 63 64 2d 3e 73 63 5f 64 | 65 76 2e 64 76 5f 78 6e |cd->sc_d|ev.dv_xn|
|000053c0| 61 6d 65 29 3b 0a 2b 20 | 09 7d 0a 2b 20 7d 0a 2b |ame);.+ |.}.+ }.+|
|000053d0| 20 0a 2b 20 69 6e 74 0a | 2b 20 61 63 64 72 65 61 | .+ int.|+ acdrea|
|000053e0| 64 28 64 65 76 2c 20 75 | 69 6f 29 0a 2b 20 09 64 |d(dev, u|io).+ .d|
|000053f0| 65 76 5f 74 20 64 65 76 | 3b 0a 2b 20 09 73 74 72 |ev_t dev|;.+ .str|
|00005400| 75 63 74 20 75 69 6f 20 | 2a 75 69 6f 3b 0a 2b 20 |uct uio |*uio;.+ |
|00005410| 7b 0a 2b 20 0a 2b 20 09 | 72 65 74 75 72 6e 20 28 |{.+ .+ .|return (|
|00005420| 70 68 79 73 69 6f 28 61 | 63 64 73 74 72 61 74 65 |physio(a|cdstrate|
|00005430| 67 79 2c 20 4e 55 4c 4c | 2c 20 64 65 76 2c 20 42 |gy, NULL|, dev, B|
|00005440| 5f 52 45 41 44 2c 0a 2b | 20 09 09 20 20 20 20 20 |_READ,.+| .. |
|00005450| 20 20 61 63 64 6d 69 6e | 70 68 79 73 2c 20 75 69 | acdmin|phys, ui|
|00005460| 6f 29 29 3b 0a 2b 20 7d | 0a 2b 20 0a 2b 20 69 6e |o));.+ }|.+ .+ in|
|00005470| 74 0a 2b 20 61 63 64 77 | 72 69 74 65 28 64 65 76 |t.+ acdw|rite(dev|
|00005480| 2c 20 75 69 6f 29 0a 2b | 20 09 64 65 76 5f 74 20 |, uio).+| .dev_t |
|00005490| 64 65 76 3b 0a 2b 20 09 | 73 74 72 75 63 74 20 75 |dev;.+ .|struct u|
|000054a0| 69 6f 20 2a 75 69 6f 3b | 0a 2b 20 7b 0a 2b 20 0a |io *uio;|.+ {.+ .|
|000054b0| 2b 20 09 72 65 74 75 72 | 6e 20 28 70 68 79 73 69 |+ .retur|n (physi|
|000054c0| 6f 28 61 63 64 73 74 72 | 61 74 65 67 79 2c 20 4e |o(acdstr|ategy, N|
|000054d0| 55 4c 4c 2c 20 64 65 76 | 2c 20 42 5f 57 52 49 54 |ULL, dev|, B_WRIT|
|000054e0| 45 2c 0a 2b 20 09 09 20 | 20 20 20 20 20 20 61 63 |E,.+ .. | ac|
|000054f0| 64 6d 69 6e 70 68 79 73 | 2c 20 75 69 6f 29 29 3b |dminphys|, uio));|
|00005500| 0a 2b 20 7d 0a 2b 20 0a | 2b 20 2f 2a 0a 2b 20 20 |.+ }.+ .|+ /*.+ |
|00005510| 2a 20 50 65 72 66 6f 72 | 6d 20 73 70 65 63 69 61 |* Perfor|m specia|
|00005520| 6c 20 61 63 74 69 6f 6e | 20 6f 6e 20 62 65 68 61 |l action| on beha|
|00005530| 6c 66 20 6f 66 20 74 68 | 65 20 75 73 65 72 2e 0a |lf of th|e user..|
|00005540| 2b 20 20 2a 20 4b 6e 6f | 77 73 20 61 62 6f 75 74 |+ * Kno|ws about|
|00005550| 20 74 68 65 20 69 6e 74 | 65 72 6e 61 6c 73 20 6f | the int|ernals o|
|00005560| 66 20 74 68 69 73 20 64 | 65 76 69 63 65 0a 2b 20 |f this d|evice.+ |
|00005570| 20 2a 2f 0a 2b 20 69 6e | 74 0a 2b 20 61 63 64 69 | */.+ in|t.+ acdi|
|00005580| 6f 63 74 6c 28 64 65 76 | 2c 20 63 6d 64 2c 20 61 |octl(dev|, cmd, a|
|00005590| 64 64 72 2c 20 66 6c 61 | 67 2c 20 70 29 0a 2b 20 |ddr, fla|g, p).+ |
|000055a0| 09 64 65 76 5f 74 20 64 | 65 76 3b 0a 2b 20 09 75 |.dev_t d|ev;.+ .u|
|000055b0| 5f 6c 6f 6e 67 20 63 6d | 64 3b 0a 2b 20 09 63 61 |_long cm|d;.+ .ca|
|000055c0| 64 64 72 5f 74 20 61 64 | 64 72 3b 0a 2b 20 09 69 |ddr_t ad|dr;.+ .i|
|000055d0| 6e 74 20 66 6c 61 67 3b | 0a 2b 20 09 73 74 72 75 |nt flag;|.+ .stru|
|000055e0| 63 74 20 70 72 6f 63 20 | 2a 70 3b 0a 2b 20 7b 0a |ct proc |*p;.+ {.|
|000055f0| 2b 20 09 73 74 72 75 63 | 74 20 61 63 64 5f 73 6f |+ .struc|t acd_so|
|00005600| 66 74 63 20 2a 61 63 64 | 20 3d 20 61 63 64 63 64 |ftc *acd| = acdcd|
|00005610| 2e 63 64 5f 64 65 76 73 | 5b 43 44 55 4e 49 54 28 |.cd_devs|[CDUNIT(|
|00005620| 64 65 76 29 5d 3b 0a 2b | 20 09 69 6e 74 20 65 72 |dev)];.+| .int er|
|00005630| 72 6f 72 3b 0a 2b 20 0a | 2b 20 09 2f 2a 0a 2b 20 |ror;.+ .|+ ./*.+ |
|00005640| 09 20 2a 20 49 66 20 74 | 68 65 20 64 65 76 69 63 |. * If t|he devic|
|00005650| 65 20 69 73 20 6e 6f 74 | 20 76 61 6c 69 64 2e 2e |e is not| valid..|
|00005660| 20 61 62 61 6e 64 6f 6e | 20 73 68 69 70 0a 2b 20 | abandon| ship.+ |
|00005670| 09 20 2a 2f 0a 2b 20 09 | 69 66 20 28 28 61 63 64 |. */.+ .|if ((acd|
|00005680| 2d 3e 61 64 5f 6c 69 6e | 6b 2d 3e 66 6c 61 67 73 |->ad_lin|k->flags|
|00005690| 20 26 20 41 44 45 56 5f | 4d 45 44 49 41 5f 4c 4f | & ADEV_|MEDIA_LO|
|000056a0| 41 44 45 44 29 20 3d 3d | 20 30 29 0a 2b 20 09 09 |ADED) ==| 0).+ ..|
|000056b0| 72 65 74 75 72 6e 20 45 | 49 4f 3b 0a 2b 20 0a 2b |return E|IO;.+ .+|
|000056c0| 20 09 73 77 69 74 63 68 | 20 28 63 6d 64 29 20 7b | .switch| (cmd) {|
|000056d0| 0a 2b 20 09 63 61 73 65 | 20 44 49 4f 43 47 44 49 |.+ .case| DIOCGDI|
|000056e0| 4e 46 4f 3a 0a 2b 20 09 | 09 2a 28 73 74 72 75 63 |NFO:.+ .|.*(struc|
|000056f0| 74 20 64 69 73 6b 6c 61 | 62 65 6c 20 2a 29 61 64 |t diskla|bel *)ad|
|00005700| 64 72 20 3d 20 61 63 64 | 2d 3e 73 63 5f 64 6b 2e |dr = acd|->sc_dk.|
|00005710| 64 6b 5f 6c 61 62 65 6c | 3b 0a 2b 20 09 09 72 65 |dk_label|;.+ ..re|
|00005720| 74 75 72 6e 20 30 3b 0a | 2b 20 0a 2b 20 09 63 61 |turn 0;.|+ .+ .ca|
|00005730| 73 65 20 44 49 4f 43 47 | 50 41 52 54 3a 0a 2b 20 |se DIOCG|PART:.+ |
|00005740| 09 09 28 28 73 74 72 75 | 63 74 20 70 61 72 74 69 |..((stru|ct parti|
|00005750| 6e 66 6f 20 2a 29 61 64 | 64 72 29 2d 3e 64 69 73 |nfo *)ad|dr)->dis|
|00005760| 6b 6c 61 62 20 3d 20 26 | 61 63 64 2d 3e 73 63 5f |klab = &|acd->sc_|
|00005770| 64 6b 2e 64 6b 5f 6c 61 | 62 65 6c 3b 0a 2b 20 09 |dk.dk_la|bel;.+ .|
|00005780| 09 28 28 73 74 72 75 63 | 74 20 70 61 72 74 69 6e |.((struc|t partin|
|00005790| 66 6f 20 2a 29 61 64 64 | 72 29 2d 3e 70 61 72 74 |fo *)add|r)->part|
|000057a0| 20 3d 0a 2b 20 09 09 20 | 20 20 20 26 61 63 64 2d | =.+ .. | &acd-|
|000057b0| 3e 73 63 5f 64 6b 2e 64 | 6b 5f 6c 61 62 65 6c 2e |>sc_dk.d|k_label.|
|000057c0| 64 5f 70 61 72 74 69 74 | 69 6f 6e 73 5b 43 44 50 |d_partit|ions[CDP|
|000057d0| 41 52 54 28 64 65 76 29 | 5d 3b 0a 2b 20 09 09 72 |ART(dev)|];.+ ..r|
|000057e0| 65 74 75 72 6e 20 30 3b | 0a 2b 20 0a 2b 20 09 63 |eturn 0;|.+ .+ .c|
|000057f0| 61 73 65 20 44 49 4f 43 | 57 44 49 4e 46 4f 3a 0a |ase DIOC|WDINFO:.|
|00005800| 2b 20 09 63 61 73 65 20 | 44 49 4f 43 53 44 49 4e |+ .case |DIOCSDIN|
|00005810| 46 4f 3a 0a 2b 20 09 09 | 69 66 20 28 28 66 6c 61 |FO:.+ ..|if ((fla|
|00005820| 67 20 26 20 46 57 52 49 | 54 45 29 20 3d 3d 20 30 |g & FWRI|TE) == 0|
|00005830| 29 0a 2b 20 09 09 09 72 | 65 74 75 72 6e 20 45 42 |).+ ...r|eturn EB|
|00005840| 41 44 46 3b 0a 2b 20 0a | 2b 20 09 09 69 66 20 28 |ADF;.+ .|+ ..if (|
|00005850| 65 72 72 6f 72 20 3d 20 | 61 63 64 6c 6f 63 6b 28 |error = |acdlock(|
|00005860| 61 63 64 29 29 0a 2b 20 | 09 09 09 72 65 74 75 72 |acd)).+ |...retur|
|00005870| 6e 20 65 72 72 6f 72 3b | 0a 2b 20 09 09 61 63 64 |n error;|.+ ..acd|
|00005880| 2d 3e 66 6c 61 67 73 20 | 7c 3d 20 43 44 46 5f 4c |->flags ||= CDF_L|
|00005890| 41 42 45 4c 4c 49 4e 47 | 3b 0a 2b 20 0a 2b 20 09 |ABELLING|;.+ .+ .|
|000058a0| 09 65 72 72 6f 72 20 3d | 20 73 65 74 64 69 73 6b |.error =| setdisk|
|000058b0| 6c 61 62 65 6c 28 26 61 | 63 64 2d 3e 73 63 5f 64 |label(&a|cd->sc_d|
|000058c0| 6b 2e 64 6b 5f 6c 61 62 | 65 6c 2c 0a 2b 20 09 09 |k.dk_lab|el,.+ ..|
|000058d0| 20 20 20 20 28 73 74 72 | 75 63 74 20 64 69 73 6b | (str|uct disk|
|000058e0| 6c 61 62 65 6c 20 2a 29 | 61 64 64 72 2c 20 2f 2a |label *)|addr, /*|
|000058f0| 61 63 64 2d 3e 73 63 5f | 64 6b 2e 64 6b 5f 6f 70 |acd->sc_|dk.dk_op|
|00005900| 65 6e 6d 61 73 6b 20 3a | 20 2a 2f 30 2c 0a 2b 20 |enmask :| */0,.+ |
|00005910| 09 09 20 20 20 20 26 61 | 63 64 2d 3e 73 63 5f 64 |.. &a|cd->sc_d|
|00005920| 6b 2e 64 6b 5f 63 70 75 | 6c 61 62 65 6c 29 3b 0a |k.dk_cpu|label);.|
|00005930| 2b 20 09 09 69 66 20 28 | 65 72 72 6f 72 20 3d 3d |+ ..if (|error ==|
|00005940| 20 30 29 20 7b 0a 2b 20 | 09 09 7d 0a 2b 20 0a 2b | 0) {.+ |..}.+ .+|
|00005950| 20 09 09 61 63 64 2d 3e | 66 6c 61 67 73 20 26 3d | ..acd->|flags &=|
|00005960| 20 7e 43 44 46 5f 4c 41 | 42 45 4c 4c 49 4e 47 3b | ~CDF_LA|BELLING;|
|00005970| 0a 2b 20 09 09 61 63 64 | 75 6e 6c 6f 63 6b 28 61 |.+ ..acd|unlock(a|
|00005980| 63 64 29 3b 0a 2b 20 09 | 09 72 65 74 75 72 6e 20 |cd);.+ .|.return |
|00005990| 65 72 72 6f 72 3b 0a 2b | 20 0a 2b 20 09 63 61 73 |error;.+| .+ .cas|
|000059a0| 65 20 44 49 4f 43 57 4c | 41 42 45 4c 3a 0a 2b 20 |e DIOCWL|ABEL:.+ |
|000059b0| 09 09 72 65 74 75 72 6e | 20 45 42 41 44 46 3b 0a |..return| EBADF;.|
|000059c0| 2b 20 0a 2b 20 09 63 61 | 73 65 20 43 44 49 4f 43 |+ .+ .ca|se CDIOC|
|000059d0| 50 4c 41 59 54 52 41 43 | 4b 53 3a 0a 2b 20 23 69 |PLAYTRAC|KS:.+ #i|
|000059e0| 66 64 65 66 20 6e 6f 74 | 79 65 74 0a 2b 20 09 09 |fdef not|yet.+ ..|
|000059f0| 7b 0a 2b 20 09 09 73 74 | 72 75 63 74 20 69 6f 63 |{.+ ..st|ruct ioc|
|00005a00| 5f 70 6c 61 79 5f 74 72 | 61 63 6b 20 2a 61 72 67 |_play_tr|ack *arg|
|00005a10| 73 20 3d 20 28 73 74 72 | 75 63 74 20 69 6f 63 5f |s = (str|uct ioc_|
|00005a20| 70 6c 61 79 5f 74 72 61 | 63 6b 20 2a 29 61 64 64 |play_tra|ck *)add|
|00005a30| 72 3b 0a 2b 20 09 09 73 | 74 72 75 63 74 20 61 63 |r;.+ ..s|truct ac|
|00005a40| 64 5f 6d 6f 64 65 5f 64 | 61 74 61 20 64 61 74 61 |d_mode_d|ata data|
|00005a50| 3b 0a 2b 20 09 09 69 66 | 20 28 65 72 72 6f 72 20 |;.+ ..if| (error |
|00005a60| 3d 20 61 63 64 5f 67 65 | 74 5f 6d 6f 64 65 28 61 |= acd_ge|t_mode(a|
|00005a70| 63 64 2c 20 26 64 61 74 | 61 2c 20 41 55 44 49 4f |cd, &dat|a, AUDIO|
|00005a80| 5f 50 41 47 45 29 29 0a | 2b 20 09 09 09 72 65 74 |_PAGE)).|+ ...ret|
|00005a90| 75 72 6e 20 65 72 72 6f | 72 3b 0a 2b 20 09 09 64 |urn erro|r;.+ ..d|
|00005aa0| 61 74 61 2e 70 61 67 65 | 2e 61 75 64 69 6f 2e 66 |ata.page|.audio.f|
|00005ab0| 6c 61 67 73 20 26 3d 20 | 7e 43 44 5f 50 41 5f 53 |lags &= |~CD_PA_S|
|00005ac0| 4f 54 43 3b 0a 2b 20 09 | 09 64 61 74 61 2e 70 61 |OTC;.+ .|.data.pa|
|00005ad0| 67 65 2e 61 75 64 69 6f | 2e 66 6c 61 67 73 20 7c |ge.audio|.flags ||
|00005ae0| 3d 20 43 44 5f 50 41 5f | 49 4d 4d 45 44 3b 0a 2b |= CD_PA_|IMMED;.+|
|00005af0| 20 09 09 69 66 20 28 65 | 72 72 6f 72 20 3d 20 61 | ..if (e|rror = a|
|00005b00| 63 64 5f 73 65 74 5f 6d | 6f 64 65 28 61 63 64 2c |cd_set_m|ode(acd,|
|00005b10| 20 26 64 61 74 61 29 29 | 0a 2b 20 09 09 09 72 65 | &data))|.+ ...re|
|00005b20| 74 75 72 6e 20 65 72 72 | 6f 72 3b 0a 2b 20 09 09 |turn err|or;.+ ..|
|00005b30| 72 65 74 75 72 6e 20 61 | 63 64 5f 70 6c 61 79 5f |return a|cd_play_|
|00005b40| 74 72 61 63 6b 73 28 61 | 63 64 2c 20 61 72 67 73 |tracks(a|cd, args|
|00005b50| 2d 3e 73 74 61 72 74 5f | 74 72 61 63 6b 2c 20 61 |->start_|track, a|
|00005b60| 72 67 73 2d 3e 73 74 61 | 72 74 5f 69 6e 64 65 78 |rgs->sta|rt_index|
|00005b70| 2c 0a 2b 20 09 09 20 20 | 20 20 61 72 67 73 2d 3e |,.+ .. | args->|
|00005b80| 65 6e 64 5f 74 72 61 63 | 6b 2c 20 61 72 67 73 2d |end_trac|k, args-|
|00005b90| 3e 65 6e 64 5f 69 6e 64 | 65 78 29 3b 0a 2b 20 09 |>end_ind|ex);.+ .|
|00005ba0| 7d 0a 2b 20 23 65 6c 73 | 65 0a 2b 20 09 72 65 74 |}.+ #els|e.+ .ret|
|00005bb0| 75 72 6e 20 45 4e 4f 54 | 54 59 3b 0a 2b 20 23 65 |urn ENOT|TY;.+ #e|
|00005bc0| 6e 64 69 66 0a 2b 20 09 | 63 61 73 65 20 43 44 49 |ndif.+ .|case CDI|
|00005bd0| 4f 43 50 4c 41 59 4d 53 | 46 3a 0a 2b 20 23 69 66 |OCPLAYMS|F:.+ #if|
|00005be0| 64 65 66 20 6e 6f 74 79 | 65 74 0a 2b 20 09 09 7b |def noty|et.+ ..{|
|00005bf0| 0a 2b 20 09 09 73 74 72 | 75 63 74 20 69 6f 63 5f |.+ ..str|uct ioc_|
|00005c00| 70 6c 61 79 5f 6d 73 66 | 20 2a 61 72 67 73 0a 2b |play_msf| *args.+|
|00005c10| 20 09 09 3d 20 28 73 74 | 72 75 63 74 20 69 6f 63 | ..= (st|ruct ioc|
|00005c20| 5f 70 6c 61 79 5f 6d 73 | 66 20 2a 29 61 64 64 72 |_play_ms|f *)addr|
|00005c30| 3b 0a 2b 20 09 09 73 74 | 72 75 63 74 20 63 64 5f |;.+ ..st|ruct cd_|
|00005c40| 6d 6f 64 65 5f 64 61 74 | 61 20 64 61 74 61 3b 0a |mode_dat|a data;.|
|00005c50| 2b 20 09 09 69 66 20 28 | 65 72 72 6f 72 20 3d 20 |+ ..if (|error = |
|00005c60| 63 64 5f 67 65 74 5f 6d | 6f 64 65 28 63 64 2c 20 |cd_get_m|ode(cd, |
|00005c70| 26 64 61 74 61 2c 20 41 | 55 44 49 4f 5f 50 41 47 |&data, A|UDIO_PAG|
|00005c80| 45 29 29 0a 2b 20 09 09 | 09 72 65 74 75 72 6e 20 |E)).+ ..|.return |
|00005c90| 65 72 72 6f 72 3b 0a 2b | 20 09 09 64 61 74 61 2e |error;.+| ..data.|
|00005ca0| 70 61 67 65 2e 61 75 64 | 69 6f 2e 66 6c 61 67 73 |page.aud|io.flags|
|00005cb0| 20 26 3d 20 7e 43 44 5f | 50 41 5f 53 4f 54 43 3b | &= ~CD_|PA_SOTC;|
|00005cc0| 0a 2b 20 09 09 64 61 74 | 61 2e 70 61 67 65 2e 61 |.+ ..dat|a.page.a|
|00005cd0| 75 64 69 6f 2e 66 6c 61 | 67 73 20 7c 3d 20 43 44 |udio.fla|gs |= CD|
|00005ce0| 5f 50 41 5f 49 4d 4d 45 | 44 3b 0a 2b 20 09 09 69 |_PA_IMME|D;.+ ..i|
|00005cf0| 66 20 28 65 72 72 6f 72 | 20 3d 20 63 64 5f 73 65 |f (error| = cd_se|
|00005d00| 74 5f 6d 6f 64 65 28 63 | 64 2c 20 26 64 61 74 61 |t_mode(c|d, &data|
|00005d10| 29 29 0a 2b 20 09 09 09 | 72 65 74 75 72 6e 20 65 |)).+ ...|return e|
|00005d20| 72 72 6f 72 3b 0a 2b 20 | 09 09 72 65 74 75 72 6e |rror;.+ |..return|
|00005d30| 20 63 64 5f 70 6c 61 79 | 5f 6d 73 66 28 63 64 2c | cd_play|_msf(cd,|
|00005d40| 20 61 72 67 73 2d 3e 73 | 74 61 72 74 5f 6d 2c 20 | args->s|tart_m, |
|00005d50| 61 72 67 73 2d 3e 73 74 | 61 72 74 5f 73 2c 0a 2b |args->st|art_s,.+|
|00005d60| 20 09 09 20 20 20 20 61 | 72 67 73 2d 3e 73 74 61 | .. a|rgs->sta|
|00005d70| 72 74 5f 66 2c 20 61 72 | 67 73 2d 3e 65 6e 64 5f |rt_f, ar|gs->end_|
|00005d80| 6d 2c 20 61 72 67 73 2d | 3e 65 6e 64 5f 73 2c 20 |m, args-|>end_s, |
|00005d90| 61 72 67 73 2d 3e 65 6e | 64 5f 66 29 3b 0a 2b 20 |args->en|d_f);.+ |
|00005da0| 09 7d 0a 2b 20 23 65 6c | 73 65 0a 2b 20 20 20 20 |.}.+ #el|se.+ |
|00005db0| 20 72 65 74 75 72 6e 20 | 45 4e 4f 54 54 59 3b 20 | return |ENOTTY; |
|00005dc0| 0a 2b 20 23 65 6e 64 69 | 66 0a 2b 20 09 63 61 73 |.+ #endi|f.+ .cas|
|00005dd0| 65 20 43 44 49 4f 43 50 | 4c 41 59 42 4c 4f 43 4b |e CDIOCP|LAYBLOCK|
|00005de0| 53 3a 0a 2b 20 23 69 66 | 64 65 66 20 6e 6f 74 79 |S:.+ #if|def noty|
|00005df0| 65 74 0a 2b 20 09 7b 0a | 2b 20 09 09 73 74 72 75 |et.+ .{.|+ ..stru|
|00005e00| 63 74 20 69 6f 63 5f 70 | 6c 61 79 5f 62 6c 6f 63 |ct ioc_p|lay_bloc|
|00005e10| 6b 73 20 2a 61 72 67 73 | 0a 2b 20 09 09 3d 20 28 |ks *args|.+ ..= (|
|00005e20| 73 74 72 75 63 74 20 69 | 6f 63 5f 70 6c 61 79 5f |struct i|oc_play_|
|00005e30| 62 6c 6f 63 6b 73 20 2a | 29 61 64 64 72 3b 0a 2b |blocks *|)addr;.+|
|00005e40| 20 09 09 73 74 72 75 63 | 74 20 63 64 5f 6d 6f 64 | ..struc|t cd_mod|
|00005e50| 65 5f 64 61 74 61 20 64 | 61 74 61 3b 0a 2b 20 09 |e_data d|ata;.+ .|
|00005e60| 09 69 66 20 28 65 72 72 | 6f 72 20 3d 20 63 64 5f |.if (err|or = cd_|
|00005e70| 67 65 74 5f 6d 6f 64 65 | 28 63 64 2c 20 26 64 61 |get_mode|(cd, &da|
|00005e80| 74 61 2c 20 41 55 44 49 | 4f 5f 50 41 47 45 29 29 |ta, AUDI|O_PAGE))|
|00005e90| 0a 2b 20 09 09 09 72 65 | 74 75 72 6e 20 65 72 72 |.+ ...re|turn err|
|00005ea0| 6f 72 3b 0a 2b 20 09 09 | 64 61 74 61 2e 70 61 67 |or;.+ ..|data.pag|
|00005eb0| 65 2e 61 75 64 69 6f 2e | 66 6c 61 67 73 20 26 3d |e.audio.|flags &=|
|00005ec0| 20 7e 43 44 5f 50 41 5f | 53 4f 54 43 3b 0a 2b 20 | ~CD_PA_|SOTC;.+ |
|00005ed0| 09 09 64 61 74 61 2e 70 | 61 67 65 2e 61 75 64 69 |..data.p|age.audi|
|00005ee0| 6f 2e 66 6c 61 67 73 20 | 7c 3d 20 43 44 5f 50 41 |o.flags ||= CD_PA|
|00005ef0| 5f 49 4d 4d 45 44 3b 0a | 2b 20 09 09 69 66 20 28 |_IMMED;.|+ ..if (|
|00005f00| 65 72 72 6f 72 20 3d 20 | 63 64 5f 73 65 74 5f 6d |error = |cd_set_m|
|00005f10| 6f 64 65 28 63 64 2c 20 | 26 64 61 74 61 29 29 0a |ode(cd, |&data)).|
|00005f20| 2b 20 09 09 09 72 65 74 | 75 72 6e 20 65 72 72 6f |+ ...ret|urn erro|
|00005f30| 72 3b 0a 2b 20 09 09 72 | 65 74 75 72 6e 20 63 64 |r;.+ ..r|eturn cd|
|00005f40| 5f 70 6c 61 79 28 63 64 | 2c 20 61 72 67 73 2d 3e |_play(cd|, args->|
|00005f50| 62 6c 6b 2c 20 61 72 67 | 73 2d 3e 6c 65 6e 29 3b |blk, arg|s->len);|
|00005f60| 0a 2b 20 09 7d 0a 2b 20 | 23 65 6c 73 65 0a 2b 20 |.+ .}.+ |#else.+ |
|00005f70| 20 20 20 20 72 65 74 75 | 72 6e 20 45 4e 4f 54 54 | retu|rn ENOTT|
|00005f80| 59 3b 20 0a 2b 20 23 65 | 6e 64 69 66 0a 2b 20 09 |Y; .+ #e|ndif.+ .|
|00005f90| 63 61 73 65 20 43 44 49 | 4f 43 52 45 41 44 53 55 |case CDI|OCREADSU|
|00005fa0| 42 43 48 41 4e 4e 45 4c | 3a 0a 2b 20 23 69 66 64 |BCHANNEL|:.+ #ifd|
|00005fb0| 65 66 20 6e 6f 74 79 65 | 74 20 0a 2b 20 09 7b 0a |ef notye|t .+ .{.|
|00005fc0| 2b 20 09 09 73 74 72 75 | 63 74 20 69 6f 63 5f 72 |+ ..stru|ct ioc_r|
|00005fd0| 65 61 64 5f 73 75 62 63 | 68 61 6e 6e 65 6c 20 2a |ead_subc|hannel *|
|00005fe0| 61 72 67 73 0a 2b 20 09 | 09 3d 20 28 73 74 72 75 |args.+ .|.= (stru|
|00005ff0| 63 74 20 69 6f 63 5f 72 | 65 61 64 5f 73 75 62 63 |ct ioc_r|ead_subc|
|00006000| 68 61 6e 6e 65 6c 20 2a | 29 61 64 64 72 3b 0a 2b |hannel *|)addr;.+|
|00006010| 20 09 09 73 74 72 75 63 | 74 20 63 64 5f 73 75 62 | ..struc|t cd_sub|
|00006020| 5f 63 68 61 6e 6e 65 6c | 5f 69 6e 66 6f 20 64 61 |_channel|_info da|
|00006030| 74 61 3b 0a 2b 20 09 09 | 69 6e 74 20 6c 65 6e 20 |ta;.+ ..|int len |
|00006040| 3d 20 61 72 67 73 2d 3e | 64 61 74 61 5f 6c 65 6e |= args->|data_len|
|00006050| 3b 0a 2b 20 09 09 69 66 | 20 28 6c 65 6e 20 3e 20 |;.+ ..if| (len > |
|00006060| 73 69 7a 65 6f 66 28 64 | 61 74 61 29 20 7c 7c 0a |sizeof(d|ata) ||.|
|00006070| 2b 20 09 09 20 20 20 20 | 6c 65 6e 20 3c 20 73 69 |+ .. |len < si|
|00006080| 7a 65 6f 66 28 73 74 72 | 75 63 74 20 63 64 5f 73 |zeof(str|uct cd_s|
|00006090| 75 62 5f 63 68 61 6e 6e | 65 6c 5f 68 65 61 64 65 |ub_chann|el_heade|
|000060a0| 72 29 29 0a 2b 20 09 09 | 09 72 65 74 75 72 6e 20 |r)).+ ..|.return |
|000060b0| 45 49 4e 56 41 4c 3b 0a | 2b 20 09 09 69 66 20 28 |EINVAL;.|+ ..if (|
|000060c0| 65 72 72 6f 72 20 3d 20 | 63 64 5f 72 65 61 64 5f |error = |cd_read_|
|000060d0| 73 75 62 63 68 61 6e 6e | 65 6c 28 63 64 2c 20 61 |subchann|el(cd, a|
|000060e0| 72 67 73 2d 3e 61 64 64 | 72 65 73 73 5f 66 6f 72 |rgs->add|ress_for|
|000060f0| 6d 61 74 2c 0a 2b 20 09 | 09 20 20 20 20 61 72 67 |mat,.+ .|. arg|
|00006100| 73 2d 3e 64 61 74 61 5f | 66 6f 72 6d 61 74 2c 20 |s->data_|format, |
|00006110| 61 72 67 73 2d 3e 74 72 | 61 63 6b 2c 20 26 64 61 |args->tr|ack, &da|
|00006120| 74 61 2c 20 6c 65 6e 29 | 29 0a 2b 20 09 09 09 72 |ta, len)|).+ ...r|
|00006130| 65 74 75 72 6e 20 65 72 | 72 6f 72 3b 0a 2b 20 09 |eturn er|ror;.+ .|
|00006140| 09 6c 65 6e 20 3d 20 6d | 69 6e 28 6c 65 6e 2c 20 |.len = m|in(len, |
|00006150| 28 28 64 61 74 61 2e 68 | 65 61 64 65 72 2e 64 61 |((data.h|eader.da|
|00006160| 74 61 5f 6c 65 6e 5b 30 | 5d 20 3c 3c 20 38 29 20 |ta_len[0|] << 8) |
|00006170| 2b 0a 2b 20 09 09 20 20 | 20 20 64 61 74 61 2e 68 |+.+ .. | data.h|
|00006180| 65 61 64 65 72 2e 64 61 | 74 61 5f 6c 65 6e 5b 31 |eader.da|ta_len[1|
|00006190| 5d 20 2b 0a 2b 20 09 09 | 20 20 20 20 73 69 7a 65 |] +.+ ..| size|
|000061a0| 6f 66 28 73 74 72 75 63 | 74 20 63 64 5f 73 75 62 |of(struc|t cd_sub|
|000061b0| 5f 63 68 61 6e 6e 65 6c | 5f 68 65 61 64 65 72 29 |_channel|_header)|
|000061c0| 29 29 3b 0a 2b 20 09 09 | 72 65 74 75 72 6e 20 63 |));.+ ..|return c|
|000061d0| 6f 70 79 6f 75 74 28 26 | 64 61 74 61 2c 20 61 72 |opyout(&|data, ar|
|000061e0| 67 73 2d 3e 64 61 74 61 | 2c 20 6c 65 6e 29 3b 0a |gs->data|, len);.|
|000061f0| 2b 20 09 7d 0a 2b 20 23 | 65 6c 73 65 0a 2b 20 20 |+ .}.+ #|else.+ |
|00006200| 20 20 20 72 65 74 75 72 | 6e 20 45 4e 4f 54 54 59 | retur|n ENOTTY|
|00006210| 3b 20 0a 2b 20 23 65 6e | 64 69 66 0a 2b 20 09 63 |; .+ #en|dif.+ .c|
|00006220| 61 73 65 20 43 44 49 4f | 52 45 41 44 54 4f 43 48 |ase CDIO|READTOCH|
|00006230| 45 41 44 45 52 3a 0a 2b | 20 23 69 66 64 65 66 20 |EADER:.+| #ifdef |
|00006240| 6e 6f 74 79 65 74 0a 2b | 20 09 7b 0a 2b 20 09 09 |notyet.+| .{.+ ..|
|00006250| 73 74 72 75 63 74 20 69 | 6f 63 5f 74 6f 63 5f 68 |struct i|oc_toc_h|
|00006260| 65 61 64 65 72 20 74 68 | 3b 0a 2b 20 09 09 69 66 |eader th|;.+ ..if|
|00006270| 20 28 65 72 72 6f 72 20 | 3d 20 63 64 5f 72 65 61 | (error |= cd_rea|
|00006280| 64 5f 74 6f 63 28 63 64 | 2c 20 30 2c 20 30 2c 20 |d_toc(cd|, 0, 0, |
|00006290| 26 74 68 2c 20 73 69 7a | 65 6f 66 28 74 68 29 29 |&th, siz|eof(th))|
|000062a0| 29 0a 2b 20 09 09 09 72 | 65 74 75 72 6e 20 65 72 |).+ ...r|eturn er|
|000062b0| 72 6f 72 3b 0a 2b 20 09 | 09 74 68 2e 6c 65 6e 20 |ror;.+ .|.th.len |
|000062c0| 3d 20 6e 74 6f 68 73 28 | 74 68 2e 6c 65 6e 29 3b |= ntohs(|th.len);|
|000062d0| 0a 2b 20 09 09 62 63 6f | 70 79 28 26 74 68 2c 20 |.+ ..bco|py(&th, |
|000062e0| 61 64 64 72 2c 20 73 69 | 7a 65 6f 66 28 74 68 29 |addr, si|zeof(th)|
|000062f0| 29 3b 0a 2b 20 09 09 72 | 65 74 75 72 6e 20 30 3b |);.+ ..r|eturn 0;|
|00006300| 0a 2b 20 09 7d 0a 2b 20 | 23 65 6c 73 65 0a 2b 20 |.+ .}.+ |#else.+ |
|00006310| 20 20 20 20 72 65 74 75 | 72 6e 20 45 4e 4f 54 54 | retu|rn ENOTT|
|00006320| 59 3b 20 0a 2b 20 23 65 | 6e 64 69 66 0a 2b 20 09 |Y; .+ #e|ndif.+ .|
|00006330| 63 61 73 65 20 43 44 49 | 4f 52 45 41 44 54 4f 43 |case CDI|OREADTOC|
|00006340| 45 4e 54 52 59 53 3a 0a | 2b 20 23 69 66 64 65 66 |ENTRYS:.|+ #ifdef|
|00006350| 20 6e 6f 74 79 65 74 0a | 2b 20 09 7b 0a 2b 20 09 | notyet.|+ .{.+ .|
|00006360| 09 73 74 72 75 63 74 20 | 63 64 5f 74 6f 63 20 7b |.struct |cd_toc {|
|00006370| 0a 2b 20 09 09 09 73 74 | 72 75 63 74 20 69 6f 63 |.+ ...st|ruct ioc|
|00006380| 5f 74 6f 63 5f 68 65 61 | 64 65 72 20 68 65 61 64 |_toc_hea|der head|
|00006390| 65 72 3b 0a 2b 20 09 09 | 09 73 74 72 75 63 74 20 |er;.+ ..|.struct |
|000063a0| 63 64 5f 74 6f 63 5f 65 | 6e 74 72 79 20 65 6e 74 |cd_toc_e|ntry ent|
|000063b0| 72 69 65 73 5b 36 35 5d | 3b 0a 2b 20 09 09 7d 20 |ries[65]|;.+ ..} |
|000063c0| 64 61 74 61 3b 0a 2b 20 | 09 09 73 74 72 75 63 74 |data;.+ |..struct|
|000063d0| 20 69 6f 63 5f 72 65 61 | 64 5f 74 6f 63 5f 65 6e | ioc_rea|d_toc_en|
|000063e0| 74 72 79 20 2a 74 65 20 | 3d 0a 2b 20 09 09 28 73 |try *te |=.+ ..(s|
|000063f0| 74 72 75 63 74 20 69 6f | 63 5f 72 65 61 64 5f 74 |truct io|c_read_t|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.