Chameleon

Chameleon Svn Source Tree

Root/branches/JrCs/i386/include/IOKit/scsi/IOCompactDiscServices.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_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
45class 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
55class IOCompactDiscServices : public IOCDBlockStorageDevice
56{
57
58OSDeclareDefaultStructors ( IOCompactDiscServices )
59
60#if (_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 IOCompactDiscServicesExpansionData { };
86 IOCompactDiscServicesExpansionData * fIOCompactDiscServicesReserved;
87
88public:
89
90static void AsyncReadWriteComplete ( 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 UInt32getMediaType ( void );
180
181virtual IOReturngetSpeed ( UInt16 * kilobytesPerSecond );
182
183virtual IOReturnsetSpeed ( UInt16 kilobytesPerSecond );
184
185/* System Specific */
186virtual IOReturn message ( UInt32 type, IOService * provider, void * argument );
187 virtual IOReturn setProperties ( OSObject * properties );
188
189/* User Client Specific */
190virtual bool start ( IOService * provider );
191virtual bool open ( IOService * client, IOOptionBits options, IOStorageAccess access );
192
193virtual bool handleOpen( IOService * client, IOOptionBits options, void * access );
194virtual void handleClose ( IOService * client, IOOptionBits options );
195virtual bool handleIsOpen ( const IOService * client ) const;
196
197/* Added with 10.1.3 */
198virtual IOReturnreadTOC (IOMemoryDescriptor *buffer,
199CDTOCFormatformat,
200UInt8msf,
201UInt8trackSessionNumber,
202UInt16 *actualByteCount );
203
204/* Added with 10.1.3 */
205virtual IOReturnreadDiscInfo (IOMemoryDescriptor *buffer,
206UInt16 *actualByteCount );
207
208/* Added with 10.1.3 */
209virtual IOReturnreadTrackInfo (IOMemoryDescriptor *buffer,
210UInt32address,
211CDTrackInfoAddressTypeaddressType,
212UInt16 *actualByteCount );
213
214private:
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

Archive Download this file

Revision: 1466