Chameleon

Chameleon Svn Source Tree

Root/branches/slice/trunkM/i386/include/IOKit/scsi/IODVDServices.h

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
45class 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
55class IODVDServices : public IODVDBlockStorageDevice
56{
57
58OSDeclareDefaultStructors ( IODVDServices )
59
60#if (_DVD_USE_DATA_CACHING_)
61// Data Cache members
62boolfUseDataCache;// 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.
66UInt8 *fDataCacheStorage;// Storage space for the cache
67UInt32fDataCacheStartBlock;// Starting block of the data in the cache.
68UInt32fDataCacheBlockCount;// 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
73IOSimpleLock *fDataCacheLock; // This is the lock for preventing multiple access
74// while manipulating the data cache.
75#endif
76
77protected:
78
79OSSet *fClients;
80IOSCSIPeripheralDeviceType05 *fProvider;
81
82virtual voidfree ( void );
83
84 // Reserve space for future expansion.
85 struct IODVDServicesExpansionData { };
86 IODVDServicesExpansionData * fIODVDServicesReserved;
87
88public:
89
90static voidAsyncReadWriteComplete ( void * clientData,
91 IOReturnstatus,
92 UInt64 actualByteCount );
93
94// Deprecated
95virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
96UInt32block,
97UInt32nblks,
98IOStorageCompletioncompletion );
99
100virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
101UInt64block,
102UInt64nblks,
103IOStorageCompletioncompletion );
104
105virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
106UInt64block,
107UInt64nblks,
108IOStorageAttributes * attributes,
109IOStorageCompletion *completion );
110
111 virtual IOReturndoEjectMedia ( void );
112
113 virtual IOReturndoFormatMedia ( UInt64 byteCapacity );
114
115 virtual UInt32doGetFormatCapacities ( UInt64 *capacities,
116 UInt32capacitiesMaxCount ) const;
117
118 virtual IOReturndoLockUnlockMedia ( bool doLock );
119
120 virtual IOReturndoSynchronizeCache ( void );
121
122virtual IOReturngetWriteCacheState ( bool * enabled );
123
124virtual IOReturnsetWriteCacheState ( 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 IOReturnreportBlockSize ( UInt64 * blockSize );
135
136 virtual IOReturnreportEjectability ( bool * isEjectable );
137
138 virtual IOReturnreportLockability ( bool * isLockable );
139
140 virtual IOReturnreportMediaState ( bool * mediaPresent, bool * changed );
141
142 virtual IOReturnreportPollRequirements ( bool * pollIsRequired,
143 bool * pollIsExpensive );
144
145 virtual IOReturnreportMaxValidBlock ( UInt64 * maxBlock );
146
147 virtual IOReturnreportRemovability ( bool * isRemovable );
148
149 virtual IOReturnreportWriteProtection ( bool * isWriteProtected );
150
151/* CD Specific */
152virtual IOReturndoAsyncReadCD ( IOMemoryDescriptor * buffer,
153UInt32 block,
154UInt32 nblks,
155CDSectorArea sectorArea,
156CDSectorType sectorType,
157IOStorageCompletion completion );
158
159virtual IOReturnreadISRC ( UInt8 track, CDISRC isrc );
160
161virtual IOReturnreadMCN ( CDMCN mcn);
162
163virtual IOReturnreadTOC ( IOMemoryDescriptor * buffer );
164
165virtual IOReturnaudioPause ( bool pause );
166
167virtual IOReturnaudioPlay ( CDMSF timeStart, CDMSF timeStop );
168
169virtual IOReturnaudioScan ( CDMSF timeStart, bool reverse );
170
171virtual IOReturnaudioStop ( void );
172
173virtual IOReturngetAudioStatus ( CDAudioStatus * status );
174
175virtual IOReturngetAudioVolume ( UInt8 * leftVolume, UInt8 * rightVolume );
176
177virtual IOReturnsetAudioVolume ( UInt8 leftVolume, UInt8 rightVolume );
178
179virtual IOReturngetSpeed ( UInt16 * kilobytesPerSecond );
180
181virtual IOReturnsetSpeed ( UInt16 kilobytesPerSecond );
182
183/* DVD Specific */
184virtual UInt32getMediaType( void );
185
186virtual IOReturnreportKey( IOMemoryDescriptor * buffer,
187 const DVDKeyClass keyClass,
188 const UInt32 lba,
189 const UInt8 agid,
190 const DVDKeyFormat keyFormat );
191
192virtual IOReturnsendKey( IOMemoryDescriptor * buffer,
193 const DVDKeyClass keyClass,
194 const UInt8 agid,
195 const DVDKeyFormat keyFormat );
196
197virtual IOReturnreadDVDStructure ( IOMemoryDescriptor * buffer,
198const UInt8structureFormat,
199const UInt32logicalBlockAddress,
200const UInt8layer,
201const UInt8 agid );
202
203/* 10.6.0 */
204 virtual IOReturnrequestIdle ( void );
205
206/* System Specific */
207virtual IOReturn message ( UInt32 type, IOService * provider, void * argument );
208 virtual IOReturnsetProperties ( OSObject * properties );
209
210/* User Client Specific */
211virtual bool start ( IOService * provider );
212virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access );
213
214virtual bool handleOpen( IOService * client, IOOptionBits options, void * access );
215virtual void handleClose ( IOService * client, IOOptionBits options );
216virtual bool handleIsOpen ( const IOService * client ) const;
217
218/* Added with 10.1.3 */
219virtual IOReturnreadTOC (IOMemoryDescriptor *buffer,
220CDTOCFormatformat,
221UInt8msf,
222UInt8trackSessionNumber,
223UInt16 *actualByteCount );
224
225/* Added with 10.1.3 */
226virtual IOReturnreadDiscInfo (IOMemoryDescriptor *buffer,
227UInt16 *actualByteCount );
228
229/* Added with 10.1.3 */
230virtual IOReturnreadTrackInfo (IOMemoryDescriptor *buffer,
231UInt32address,
232CDTrackInfoAddressTypeaddressType,
233UInt16 *actualByteCount );
234
235private:
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

Archive Download this file

Revision: 1171