Root/
Source at commit 1166 created 13 years 10 days ago. By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1998-2009 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. Please obtain a copy of the License at␊ |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
11 | * file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
18 | * Please see the License for the specific language governing rights and␊ |
19 | * limitations under the License.␊ |
20 | * ␊ |
21 | * @APPLE_LICENSE_HEADER_END@␊ |
22 | */␊ |
23 | ␊ |
24 | ␊ |
25 | #ifndef _IOKIT_IO_DVD_SERVICES_H_␊ |
26 | #define _IOKIT_IO_DVD_SERVICES_H_␊ |
27 | ␊ |
28 | #if defined(KERNEL) && defined(__cplusplus)␊ |
29 | ␊ |
30 | ␊ |
31 | //-----------------------------------------------------------------------------␊ |
32 | //␉Includes␊ |
33 | //-----------------------------------------------------------------------------␊ |
34 | ␊ |
35 | // IOKit includes␊ |
36 | #include <IOKit/IOTypes.h>␊ |
37 | ␊ |
38 | // Generic IOKit storage related headers␊ |
39 | #include <IOKit/storage/IODVDTypes.h>␊ |
40 | #include <IOKit/storage/IODVDBlockStorageDevice.h>␊ |
41 | ␊ |
42 | // SCSI Architecture Model Family includes␊ |
43 | #include <IOKit/scsi/IOSCSIPeripheralDeviceType05.h>␊ |
44 | ␊ |
45 | class IOMemoryDescriptor;␊ |
46 | ␊ |
47 | // Use this switch to turn off the data cache.␊ |
48 | #define _DVD_USE_DATA_CACHING_␉␉1␊ |
49 | ␊ |
50 | ␊ |
51 | //-----------------------------------------------------------------------------␊ |
52 | //␉Class Declaration␊ |
53 | //-----------------------------------------------------------------------------␊ |
54 | ␊ |
55 | class IODVDServices : public IODVDBlockStorageDevice␊ |
56 | {␊ |
57 | ␉␊ |
58 | ␉OSDeclareDefaultStructors ( IODVDServices )␊ |
59 | ␉␊ |
60 | #if (_DVD_USE_DATA_CACHING_)␊ |
61 | ␉// Data Cache members␊ |
62 | ␉bool␉␉␉␉fUseDataCache;␉␉␉// Indicates if cache should be used. This␊ |
63 | ␉␉␉␉␉␉␉␉␉␉␉␉// will be set to false if all the necessary support␊ |
64 | ␉␉␉␉␉␉␉␉␉␉␉␉// for the data cache could not be allocated or␊ |
65 | ␉␉␉␉␉␉␉␉␉␉␉␉// initialized.␊ |
66 | ␉UInt8 *␉␉␉␉fDataCacheStorage;␉␉// Storage space for the cache␊ |
67 | ␉UInt32␉␉␉␉fDataCacheStartBlock;␉// Starting block of the data in the cache.␊ |
68 | ␉UInt32␉␉␉␉fDataCacheBlockCount;␉// Number of contiguous blocks in the cache ␊ |
69 | ␉␉␉␉␉␉␉␉␉␉␉␉// starting with fDataCacheStartBlock. A value of␊ |
70 | ␉␉␉␉␉␉␉␉␉␉␉␉// zero in this member indicates that all data␊ |
71 | ␉␉␉␉␉␉␉␉␉␉␉␉// in the cache is invalid.␊ |
72 | ␉␊ |
73 | ␉IOSimpleLock *␉␉fDataCacheLock; ␉␉// This is the lock for preventing multiple access ␊ |
74 | ␉␉␉␉␉␉␉␉␉␉␉␉// while manipulating the data cache.␊ |
75 | #endif␊ |
76 | ␉␊ |
77 | protected:␊ |
78 | ␉␊ |
79 | ␉OSSet *␉␉␉␉␉␉␉␉fClients;␊ |
80 | ␉IOSCSIPeripheralDeviceType05 *␉␉fProvider;␊ |
81 | ␉␊ |
82 | ␉virtual void␉free ( void );␉␉␉␊ |
83 | ␉␊ |
84 | // Reserve space for future expansion.␊ |
85 | struct IODVDServicesExpansionData { };␊ |
86 | IODVDServicesExpansionData * fIODVDServicesReserved;␊ |
87 | ␉␊ |
88 | public:␊ |
89 | ␉␊ |
90 | ␉static void␉␉␉AsyncReadWriteComplete ( void * ␉␉clientData,␊ |
91 | ␉␉ ␉␉␉␉ IOReturn␉␉status,␊ |
92 | ␉␉ ␉␉␉␉␉ UInt64 ␉␉actualByteCount );␊ |
93 | ␉␊ |
94 | ␉// Deprecated␊ |
95 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
96 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉block,␊ |
97 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉nblks,␊ |
98 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion␉␉completion );␊ |
99 | ␊ |
100 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
101 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉block,␊ |
102 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉nblks,␊ |
103 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion␉␉completion );␊ |
104 | ␉␉␉␉␉␉␉␉␉␉␉␊ |
105 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
106 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉block,␊ |
107 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉nblks,␊ |
108 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageAttributes * attributes,␊ |
109 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion *␉completion );␊ |
110 | ␊ |
111 | virtual IOReturn␉doEjectMedia ( void );␊ |
112 | ␊ |
113 | virtual IOReturn␉doFormatMedia ( UInt64 byteCapacity );␊ |
114 | ␊ |
115 | virtual UInt32␉␉doGetFormatCapacities ( UInt64 *␉capacities,␊ |
116 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉capacitiesMaxCount ) const;␊ |
117 | ␊ |
118 | virtual IOReturn␉doLockUnlockMedia ( bool doLock );␊ |
119 | ␊ |
120 | virtual IOReturn␉doSynchronizeCache ( void );␊ |
121 | ␉␊ |
122 | ␉virtual IOReturn␉getWriteCacheState ( bool * enabled );␊ |
123 | ␉␊ |
124 | ␉virtual IOReturn␉setWriteCacheState ( bool enabled );␊ |
125 | ␊ |
126 | virtual char *␉␉getVendorString ( void );␊ |
127 | ␊ |
128 | virtual char *␉␉getProductString ( void );␊ |
129 | ␊ |
130 | virtual char *␉␉getRevisionString ( void );␊ |
131 | ␊ |
132 | virtual char *␉␉getAdditionalDeviceInfoString ( void );␊ |
133 | ␊ |
134 | virtual IOReturn␉reportBlockSize ( UInt64 * blockSize );␊ |
135 | ␊ |
136 | virtual IOReturn␉reportEjectability ( bool * isEjectable );␊ |
137 | ␊ |
138 | virtual IOReturn␉reportLockability ( bool * isLockable );␊ |
139 | ␊ |
140 | virtual IOReturn␉reportMediaState ( bool * mediaPresent, bool * changed );␊ |
141 | ␊ |
142 | virtual IOReturn␉reportPollRequirements ( ␉bool * pollIsRequired,␊ |
143 | ␉␉␉␉␉␉␉␉␉␉␉␉bool * pollIsExpensive );␊ |
144 | ␊ |
145 | virtual IOReturn␉reportMaxValidBlock ( UInt64 * maxBlock );␊ |
146 | ␊ |
147 | virtual IOReturn␉reportRemovability ( bool * isRemovable );␊ |
148 | ␊ |
149 | virtual IOReturn␉reportWriteProtection ( bool * isWriteProtected );␊ |
150 | ␊ |
151 | ␉/* CD Specific */␊ |
152 | ␉virtual IOReturn␉doAsyncReadCD ( IOMemoryDescriptor * buffer,␊ |
153 | ␉␉␉␉␉␉␉␉␉␉UInt32 block,␊ |
154 | ␉␉␉␉␉␉␉␉␉␉UInt32 nblks,␊ |
155 | ␉␉␉␉␉␉␉␉␉␉CDSectorArea sectorArea,␊ |
156 | ␉␉␉␉␉␉␉␉␉␉CDSectorType sectorType,␊ |
157 | ␉␉␉␉␉␉␉␉␉␉IOStorageCompletion completion );␊ |
158 | ␉␊ |
159 | ␉virtual IOReturn␉readISRC ( UInt8 track, CDISRC isrc );␊ |
160 | ␉␊ |
161 | ␉virtual IOReturn␉readMCN ( CDMCN mcn);␊ |
162 | ␉␊ |
163 | ␉virtual IOReturn␉readTOC ( IOMemoryDescriptor * buffer );␊ |
164 | ␉␊ |
165 | ␉virtual IOReturn␉audioPause ( bool pause );␊ |
166 | ␉␊ |
167 | ␉virtual IOReturn␉audioPlay ( CDMSF timeStart, CDMSF timeStop );␊ |
168 | ␉␊ |
169 | ␉virtual IOReturn␉audioScan ( CDMSF timeStart, bool reverse );␊ |
170 | ␉␊ |
171 | ␉virtual IOReturn␉audioStop ( void );␊ |
172 | ␉␊ |
173 | ␉virtual IOReturn␉getAudioStatus ( CDAudioStatus * status );␊ |
174 | ␉␊ |
175 | ␉virtual IOReturn␉getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume );␊ |
176 | ␉␊ |
177 | ␉virtual IOReturn␉setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume );␊ |
178 | ␊ |
179 | ␉virtual IOReturn␉getSpeed ( UInt16 * kilobytesPerSecond );␊ |
180 | ␉␊ |
181 | ␉virtual IOReturn␉setSpeed ( UInt16 kilobytesPerSecond );␊ |
182 | ␉␊ |
183 | ␉/* DVD Specific */␊ |
184 | ␉virtual UInt32␉␉␉getMediaType␉␉( void );␊ |
185 | ␊ |
186 | ␉virtual IOReturn␉␉reportKey␉␉␉( IOMemoryDescriptor * buffer,␊ |
187 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyClass keyClass,␊ |
188 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt32 lba,␊ |
189 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt8 agid,␊ |
190 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyFormat keyFormat );␊ |
191 | ␉␉␉␉␉␉␉␉␉␉␉␉ ␊ |
192 | ␉virtual IOReturn␉␉sendKey␉␉␉␉( IOMemoryDescriptor * buffer,␊ |
193 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyClass keyClass,␊ |
194 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt8 agid,␊ |
195 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyFormat keyFormat );␊ |
196 | ␊ |
197 | ␉virtual IOReturn␉␉readDVDStructure ␉( ␉IOMemoryDescriptor * ␉␉buffer,␊ |
198 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8␉␉␉␉␉structureFormat,␊ |
199 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt32␉␉␉␉logicalBlockAddress,␊ |
200 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8␉␉␉␉␉layer,␊ |
201 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8 ␉␉␉␉agid );␊ |
202 | ␊ |
203 | ␉/* 10.6.0 */␊ |
204 | virtual IOReturn␉␉requestIdle ( void );␊ |
205 | ␉␊ |
206 | ␉/* System Specific */␊ |
207 | ␉virtual IOReturn ␉message ( UInt32 type, IOService * provider, void * argument );␊ |
208 | virtual IOReturn␉setProperties ( OSObject * properties );␊ |
209 | ␊ |
210 | ␉/* User Client Specific */␊ |
211 | ␉virtual bool start ( IOService * provider );␊ |
212 | ␉virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access );␊ |
213 | ␉␊ |
214 | ␉virtual bool handleOpen␉( IOService * client, IOOptionBits options, void * access );␊ |
215 | ␉virtual void handleClose ( IOService * client, IOOptionBits options );␊ |
216 | ␉virtual bool handleIsOpen ( const IOService * client ) const;␊ |
217 | ␊ |
218 | ␉/* Added with 10.1.3 */␊ |
219 | ␉virtual IOReturn␉readTOC (␉IOMemoryDescriptor *␉buffer,␊ |
220 | ␉␉␉␉␉␉␉␉␉CDTOCFormat␉␉␉␉format,␊ |
221 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉msf,␊ |
222 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉trackSessionNumber,␊ |
223 | ␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount ); ␊ |
224 | ␉␊ |
225 | ␉/* Added with 10.1.3 */␊ |
226 | ␉virtual IOReturn␉readDiscInfo (␉IOMemoryDescriptor *␉buffer,␊ |
227 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
228 | ␉␊ |
229 | ␉/* Added with 10.1.3 */␊ |
230 | ␉virtual IOReturn␉readTrackInfo (␉IOMemoryDescriptor *␉buffer,␊ |
231 | ␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉address,␊ |
232 | ␉␉␉␉␉␉␉␉␉␉CDTrackInfoAddressType␉addressType,␊ |
233 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
234 | ␉␊ |
235 | private:␊ |
236 | ␉␊ |
237 | ␉// Space reserved for future expansion.␊ |
238 | OSMetaClassDeclareReservedUnused ( IODVDServices, 1 );␊ |
239 | OSMetaClassDeclareReservedUnused ( IODVDServices, 2 );␊ |
240 | OSMetaClassDeclareReservedUnused ( IODVDServices, 3 );␊ |
241 | OSMetaClassDeclareReservedUnused ( IODVDServices, 4 );␊ |
242 | OSMetaClassDeclareReservedUnused ( IODVDServices, 5 );␊ |
243 | OSMetaClassDeclareReservedUnused ( IODVDServices, 6 );␊ |
244 | OSMetaClassDeclareReservedUnused ( IODVDServices, 7 );␊ |
245 | OSMetaClassDeclareReservedUnused ( IODVDServices, 8 );␊ |
246 | ␉␊ |
247 | };␊ |
248 | ␊ |
249 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
250 | ␊ |
251 | #endif /* _IOKIT_IO_DVD_SERVICES_H_ */␊ |
252 |