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_COMPACT_DISC_SERVICES_H_␊ |
26 | #define _IOKIT_IO_COMPACT_DISC_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/IOCDTypes.h>␊ |
40 | #include <IOKit/storage/IOCDBlockStorageDevice.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 _USE_DATA_CACHING_␉␉1␊ |
49 | ␊ |
50 | ␊ |
51 | //-----------------------------------------------------------------------------␊ |
52 | //␉Class Declaration␊ |
53 | //-----------------------------------------------------------------------------␊ |
54 | ␊ |
55 | class IOCompactDiscServices : public IOCDBlockStorageDevice␊ |
56 | {␊ |
57 | ␉␊ |
58 | ␉OSDeclareDefaultStructors ( IOCompactDiscServices )␊ |
59 | ␉␊ |
60 | #if (_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 IOCompactDiscServicesExpansionData { };␊ |
86 | IOCompactDiscServicesExpansionData * fIOCompactDiscServicesReserved;␊ |
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 UInt32␉␉getMediaType ( void );␊ |
180 | ␉␊ |
181 | ␉virtual IOReturn␉getSpeed ( UInt16 * kilobytesPerSecond );␊ |
182 | ␉␊ |
183 | ␉virtual IOReturn␉setSpeed ( UInt16 kilobytesPerSecond );␊ |
184 | ␉␉␉␊ |
185 | ␉/* System Specific */␊ |
186 | ␉virtual IOReturn message ( UInt32 type, IOService * provider, void * argument );␊ |
187 | virtual IOReturn setProperties ( OSObject * properties );␊ |
188 | ␉␊ |
189 | ␉/* User Client Specific */␊ |
190 | ␉virtual bool start ( IOService * provider );␊ |
191 | ␉virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access );␊ |
192 | ␉␊ |
193 | ␉virtual bool handleOpen␉( IOService * client, IOOptionBits options, void * access );␊ |
194 | ␉virtual void handleClose ( IOService * client, IOOptionBits options );␊ |
195 | ␉virtual bool handleIsOpen ( const IOService * client ) const;␊ |
196 | ␉␊ |
197 | ␉/* Added with 10.1.3 */␊ |
198 | ␉virtual IOReturn␉readTOC (␉IOMemoryDescriptor *␉buffer,␊ |
199 | ␉␉␉␉␉␉␉␉␉CDTOCFormat␉␉␉␉format,␊ |
200 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉msf,␊ |
201 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉trackSessionNumber,␊ |
202 | ␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount ); ␊ |
203 | ␉␊ |
204 | ␉/* Added with 10.1.3 */␊ |
205 | ␉virtual IOReturn␉readDiscInfo (␉IOMemoryDescriptor *␉buffer,␊ |
206 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
207 | ␉␊ |
208 | ␉/* Added with 10.1.3 */␊ |
209 | ␉virtual IOReturn␉readTrackInfo (␉IOMemoryDescriptor *␉buffer,␊ |
210 | ␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉address,␊ |
211 | ␉␉␉␉␉␉␉␉␉␉CDTrackInfoAddressType␉addressType,␊ |
212 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
213 | ␊ |
214 | private:␊ |
215 | ␉␊ |
216 | ␉// Space reserved for future expansion.␊ |
217 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 1 );␊ |
218 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 2 );␊ |
219 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 3 );␊ |
220 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 4 );␊ |
221 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 5 );␊ |
222 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 6 );␊ |
223 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 7 );␊ |
224 | OSMetaClassDeclareReservedUnused ( IOCompactDiscServices, 8 );␊ |
225 | ␉␊ |
226 | };␊ |
227 | ␊ |
228 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
229 | ␊ |
230 | #endif /* _IOKIT_IO_COMPACT_DISC_SERVICES_H_ */␊ |
231 |