Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Enoch_Modules/i386/include/IOKit/scsi/IOBlockStorageServices.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_BLOCK_STORAGE_SERVICES_H_
26#define _IOKIT_IO_BLOCK_STORAGE_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/IOBlockStorageDevice.h>
40
41// SCSI Architecture Model Family includes
42#include <IOKit/scsi/IOSCSIBlockCommandsDevice.h>
43
44
45//-----------------------------------------------------------------------------
46//Class Declaration
47//-----------------------------------------------------------------------------
48
49class IOBlockStorageServices : public IOBlockStorageDevice
50{
51
52OSDeclareDefaultStructors ( IOBlockStorageServices )
53
54private:
55
56boolfMediaChanged; /* DEPRECATED */
57boolfMediaPresent;
58
59protected:
60
61 IOSCSIBlockCommandsDevice * fProvider;
62
63UInt64fMaxReadBlocks;
64UInt64fMaxWriteBlocks;
65
66virtual boolattach ( IOService * provider );
67virtual voiddetach ( IOService * provider );
68 virtual IOReturnnewUserClient (
69 task_towningTask,
70 void *securityID,
71 UInt32type,
72 OSDictionary * properties,
73 IOUserClient **handler );
74
75 // Reserve space for future expansion.
76 struct IOBlockStorageServicesExpansionData { };
77 IOBlockStorageServicesExpansionData * fIOBlockStorageServicesReserved;
78
79public:
80
81virtual IOReturn message ( UInt32 type, IOService * provider, void * argument );
82
83static void AsyncReadWriteComplete ( void * clientData,
84 IOReturnstatus,
85 UInt64 actualByteCount );
86
87// Deprecated
88virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
89UInt32block,
90UInt32nblks,
91IOStorageCompletioncompletion );
92
93virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
94UInt64block,
95UInt64nblks,
96IOStorageCompletion completion );
97
98virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor *buffer,
99UInt64block,
100UInt64nblks,
101IOStorageAttributes * attributes,
102IOStorageCompletion *completion );
103
104 virtual IOReturndoEjectMedia ( void );
105
106 virtual IOReturndoFormatMedia ( UInt64 byteCapacity );
107
108 virtual UInt32doGetFormatCapacities ( UInt64 *capacities,
109 UInt32capacitiesMaxCount ) const;
110
111 virtual IOReturndoLockUnlockMedia ( bool doLock );
112
113 virtual IOReturndoSynchronizeCache ( void );
114
115 virtual char *getVendorString ( void );
116
117 virtual char *getProductString ( void );
118
119 virtual char *getRevisionString ( void );
120
121 virtual char *getAdditionalDeviceInfoString ( void );
122
123 virtual IOReturnreportBlockSize ( UInt64 * blockSize );
124
125 virtual IOReturnreportEjectability ( bool * isEjectable );
126
127 virtual IOReturnreportLockability ( bool * isLockable );
128
129 virtual IOReturnreportMediaState ( bool * mediaPresent, bool * changed );
130
131 virtual IOReturnreportPollRequirements ( bool * pollIsRequired,
132 bool * pollIsExpensive );
133
134 virtual IOReturnreportMaxValidBlock ( UInt64 * maxBlock );
135
136 virtual IOReturnreportRemovability ( bool * isRemovable );
137
138 virtual IOReturnreportWriteProtection ( bool * isWriteProtected );
139
140virtual IOReturngetWriteCacheState ( bool * enabled );
141
142virtual IOReturnsetWriteCacheState ( bool enabled );
143
144// Space reserved for future expansion.
145 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 1 );
146 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 2 );
147 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 3 );
148 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 4 );
149 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 5 );
150 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 6 );
151 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 7 );
152 OSMetaClassDeclareReservedUnused ( IOBlockStorageServices, 8 );
153
154};
155
156#endif/* defined(KERNEL) && defined(__cplusplus) */
157
158#endif/* _IOKIT_IO_BLOCK_STORAGE_SERVICES_H_ */
159

Archive Download this file

Revision: 2238