Root/
Source at commit 1319 created 12 years 11 months ago. By meklort, Makefile update | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2006-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_BD_SERVICES_H_␊ |
26 | #define _IOKIT_IO_BD_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/IOBDTypes.h>␊ |
40 | #include <IOKit/storage/IOBDBlockStorageDevice.h>␊ |
41 | ␊ |
42 | // SCSI Architecture Model Family includes␊ |
43 | #include <IOKit/scsi/IOSCSIPeripheralDeviceType05.h>␊ |
44 | ␊ |
45 | class IOMemoryDescriptor;␊ |
46 | ␊ |
47 | //-----------------------------------------------------------------------------␊ |
48 | //␉Class Declaration␊ |
49 | //-----------------------------------------------------------------------------␊ |
50 | ␊ |
51 | class IOBDServices : public IOBDBlockStorageDevice␊ |
52 | {␊ |
53 | ␉␊ |
54 | ␉OSDeclareDefaultStructors ( IOBDServices )␊ |
55 | ␉␉␊ |
56 | protected:␊ |
57 | ␉␊ |
58 | ␉OSSet *␉␉␉␉␉␉␉␉fClients;␊ |
59 | ␉IOSCSIPeripheralDeviceType05 *␉␉fProvider;␊ |
60 | ␉␊ |
61 | ␉virtual void␉free ( void );␉␉␉␊ |
62 | ␉␊ |
63 | // Reserve space for future expansion.␊ |
64 | struct IOBDServicesExpansionData { };␊ |
65 | IOBDServicesExpansionData *␉␉fIOBDServicesReserved;␊ |
66 | ␉␊ |
67 | public:␊ |
68 | ␉␊ |
69 | ␉static void␉␉␉AsyncReadWriteComplete ( void * ␉␉clientData,␊ |
70 | ␉␉ ␉␉␉␉ IOReturn␉␉status,␊ |
71 | ␉␉ ␉␉␉␉␉ UInt64 ␉␉actualByteCount );␊ |
72 | ␉␊ |
73 | ␉// Deprecated␊ |
74 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
75 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉block,␊ |
76 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉nblks,␊ |
77 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion␉␉completion );␊ |
78 | ␊ |
79 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
80 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉block,␊ |
81 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉nblks,␊ |
82 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion␉␉completion );␊ |
83 | ␉␉␉␉␉␉␉␉␉␉␉␊ |
84 | ␉virtual IOReturn␉doAsyncReadWrite ( ␉IOMemoryDescriptor *␉buffer,␊ |
85 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉block,␊ |
86 | ␉␉␉␉␉␉␉␉␉␉␉UInt64␉␉␉␉␉nblks,␊ |
87 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageAttributes * attributes,␊ |
88 | ␉␉␉␉␉␉␉␉␉␉␉IOStorageCompletion *␉completion );␊ |
89 | ␊ |
90 | virtual IOReturn␉doEjectMedia ( void );␊ |
91 | ␊ |
92 | virtual IOReturn␉doFormatMedia ( UInt64 byteCapacity );␊ |
93 | ␊ |
94 | virtual UInt32␉␉doGetFormatCapacities ( UInt64 *␉capacities,␊ |
95 | ␉␉␉␉␉␉␉␉␉␉␉UInt32␉␉capacitiesMaxCount ) const;␊ |
96 | ␊ |
97 | virtual IOReturn␉doLockUnlockMedia ( bool doLock );␊ |
98 | ␊ |
99 | virtual IOReturn␉doSynchronizeCache ( void );␊ |
100 | ␉␊ |
101 | ␉virtual IOReturn␉getWriteCacheState ( bool * enabled );␊ |
102 | ␉␊ |
103 | ␉virtual IOReturn␉setWriteCacheState ( bool enabled );␊ |
104 | ␊ |
105 | virtual char *␉␉getVendorString ( void );␊ |
106 | ␊ |
107 | virtual char *␉␉getProductString ( void );␊ |
108 | ␊ |
109 | virtual char *␉␉getRevisionString ( void );␊ |
110 | ␊ |
111 | virtual char *␉␉getAdditionalDeviceInfoString ( void );␊ |
112 | ␊ |
113 | virtual IOReturn␉reportBlockSize ( UInt64 * blockSize );␊ |
114 | ␊ |
115 | virtual IOReturn␉reportEjectability ( bool * isEjectable );␊ |
116 | ␊ |
117 | virtual IOReturn␉reportLockability ( bool * isLockable );␊ |
118 | ␊ |
119 | virtual IOReturn␉reportMediaState ( bool * mediaPresent, bool * changed );␊ |
120 | ␊ |
121 | virtual IOReturn␉reportPollRequirements ( ␉bool * pollIsRequired,␊ |
122 | ␉␉␉␉␉␉␉␉␉␉␉␉bool * pollIsExpensive );␊ |
123 | ␊ |
124 | virtual IOReturn␉reportMaxValidBlock ( UInt64 * maxBlock );␊ |
125 | ␊ |
126 | virtual IOReturn␉reportRemovability ( bool * isRemovable );␊ |
127 | ␊ |
128 | virtual IOReturn␉reportWriteProtection ( bool * isWriteProtected );␊ |
129 | ␊ |
130 | ␉/* CD Specific */␊ |
131 | ␉virtual IOReturn␉doAsyncReadCD ( IOMemoryDescriptor * buffer,␊ |
132 | ␉␉␉␉␉␉␉␉␉␉UInt32 block,␊ |
133 | ␉␉␉␉␉␉␉␉␉␉UInt32 nblks,␊ |
134 | ␉␉␉␉␉␉␉␉␉␉CDSectorArea sectorArea,␊ |
135 | ␉␉␉␉␉␉␉␉␉␉CDSectorType sectorType,␊ |
136 | ␉␉␉␉␉␉␉␉␉␉IOStorageCompletion completion );␊ |
137 | ␉␊ |
138 | ␉virtual IOReturn␉readISRC ( UInt8 track, CDISRC isrc );␊ |
139 | ␉␊ |
140 | ␉virtual IOReturn␉readMCN ( CDMCN mcn);␊ |
141 | ␉␊ |
142 | ␉virtual IOReturn␉readTOC ( IOMemoryDescriptor * buffer );␊ |
143 | ␉␊ |
144 | ␉virtual IOReturn␉audioPause ( bool pause );␊ |
145 | ␉␊ |
146 | ␉virtual IOReturn␉audioPlay ( CDMSF timeStart, CDMSF timeStop );␊ |
147 | ␉␊ |
148 | ␉virtual IOReturn␉audioScan ( CDMSF timeStart, bool reverse );␊ |
149 | ␉␊ |
150 | ␉virtual IOReturn␉audioStop ( void );␊ |
151 | ␉␊ |
152 | ␉virtual IOReturn␉getAudioStatus ( CDAudioStatus * status );␊ |
153 | ␉␊ |
154 | ␉virtual IOReturn␉getAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume );␊ |
155 | ␉␊ |
156 | ␉virtual IOReturn␉setAudioVolume ( UInt8 leftVolume, UInt8 rightVolume );␊ |
157 | ␊ |
158 | ␉virtual IOReturn␉getSpeed ( UInt16 * kilobytesPerSecond );␊ |
159 | ␉␊ |
160 | ␉virtual IOReturn␉setSpeed ( UInt16 kilobytesPerSecond );␊ |
161 | ␉␊ |
162 | ␉/* DVD Specific */␊ |
163 | ␉virtual UInt32␉␉␉getMediaType␉␉( void );␊ |
164 | ␊ |
165 | ␉virtual IOReturn␉␉reportKey␉␉␉( IOMemoryDescriptor * buffer,␊ |
166 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyClass keyClass,␊ |
167 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt32 lba,␊ |
168 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt8 agid,␊ |
169 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyFormat keyFormat );␊ |
170 | ␉␉␉␉␉␉␉␉␉␉␉␉ ␊ |
171 | ␉virtual IOReturn␉␉sendKey␉␉␉␉( IOMemoryDescriptor * buffer,␊ |
172 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyClass keyClass,␊ |
173 | ␉␉␉␉␉␉␉␉␉␉␉␉ const UInt8 agid,␊ |
174 | ␉␉␉␉␉␉␉␉␉␉␉␉ const DVDKeyFormat keyFormat );␊ |
175 | ␊ |
176 | ␉virtual IOReturn␉␉readDVDStructure ␉( ␉IOMemoryDescriptor * ␉␉buffer,␊ |
177 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8␉␉␉␉␉structureFormat,␊ |
178 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt32␉␉␉␉logicalBlockAddress,␊ |
179 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8␉␉␉␉␉layer,␊ |
180 | ␉␉␉␉␉␉␉␉␉␉␉␉␉const UInt8 ␉␉␉␉agid );␊ |
181 | ␊ |
182 | ␉/* BD Specific */␊ |
183 | virtual IOReturn␉␉readDiscStructure␉(␉IOMemoryDescriptor * buffer,␊ |
184 | ␉␉␉␉␉␉␉␉␉␉␉␉␉UInt8 structureFormat,␊ |
185 | ␉␉␉␉␉␉␉␉␉␉␉␉␉UInt32 logicalBlockAddress,␊ |
186 | ␉␉␉␉␉␉␉␉␉␉␉␉␉UInt8 layer,␊ |
187 | ␉␉␉␉␉␉␉␉␉␉␉␉␉UInt8 agid,␊ |
188 | ␉␉␉␉␉␉␉␉␉␉␉␉␉UInt8 mediaType );␊ |
189 | ␊ |
190 | ␉/* 10.6.0 */␊ |
191 | virtual IOReturn␉␉requestIdle ( void );␊ |
192 | ␉␊ |
193 | ␉/* System Specific */␊ |
194 | ␉virtual IOReturn ␉message ( UInt32 type, IOService * provider, void * argument );␊ |
195 | virtual IOReturn␉setProperties ( OSObject * properties );␊ |
196 | ␊ |
197 | ␉/* User Client Specific */␊ |
198 | ␉virtual bool start ( IOService * provider );␊ |
199 | ␉virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access );␊ |
200 | ␉␊ |
201 | ␉virtual bool handleOpen␉( IOService * client, IOOptionBits options, void * access );␊ |
202 | ␉virtual void handleClose ( IOService * client, IOOptionBits options );␊ |
203 | ␉virtual bool handleIsOpen ( const IOService * client ) const;␊ |
204 | ␊ |
205 | ␉/* Added with 10.1.3 */␊ |
206 | ␉virtual IOReturn␉readTOC (␉IOMemoryDescriptor *␉buffer,␊ |
207 | ␉␉␉␉␉␉␉␉␉CDTOCFormat␉␉␉␉format,␊ |
208 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉msf,␊ |
209 | ␉␉␉␉␉␉␉␉␉UInt8␉␉␉␉␉trackSessionNumber,␊ |
210 | ␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount ); ␊ |
211 | ␉␊ |
212 | ␉/* Added with 10.1.3 */␊ |
213 | ␉virtual IOReturn␉readDiscInfo (␉IOMemoryDescriptor *␉buffer,␊ |
214 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
215 | ␉␊ |
216 | ␉/* Added with 10.1.3 */␊ |
217 | ␉virtual IOReturn␉readTrackInfo (␉IOMemoryDescriptor *␉buffer,␊ |
218 | ␉␉␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉address,␊ |
219 | ␉␉␉␉␉␉␉␉␉␉CDTrackInfoAddressType␉addressType,␊ |
220 | ␉␉␉␉␉␉␉␉␉␉UInt16 *␉␉␉␉actualByteCount );␊ |
221 | ␉␊ |
222 | ␉/* Added with 10.5 */␊ |
223 | ␉virtual IOReturn␉splitTrack ( UInt32 address );␊ |
224 | ␉␊ |
225 | private:␊ |
226 | ␉␊ |
227 | ␉// Space reserved for future expansion.␊ |
228 | OSMetaClassDeclareReservedUnused ( IOBDServices, 1 );␊ |
229 | OSMetaClassDeclareReservedUnused ( IOBDServices, 2 );␊ |
230 | OSMetaClassDeclareReservedUnused ( IOBDServices, 3 );␊ |
231 | OSMetaClassDeclareReservedUnused ( IOBDServices, 4 );␊ |
232 | OSMetaClassDeclareReservedUnused ( IOBDServices, 5 );␊ |
233 | OSMetaClassDeclareReservedUnused ( IOBDServices, 6 );␊ |
234 | OSMetaClassDeclareReservedUnused ( IOBDServices, 7 );␊ |
235 | OSMetaClassDeclareReservedUnused ( IOBDServices, 8 );␊ |
236 | ␉␊ |
237 | };␊ |
238 | ␊ |
239 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
240 | ␊ |
241 | #endif /* _IOKIT_IO_BD_SERVICES_H_ */␊ |
242 |