Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Modules/i386/include/IOKit/usb/IOUFIStorageServices.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_UFI_STORAGE_SERVICES_H_
26#define _IOKIT_UFI_STORAGE_SERVICES_H_
27
28#if defined(KERNEL) && defined(__cplusplus)
29
30#include <IOKit/IOTypes.h>
31#include <IOKit/storage/IOBlockStorageDevice.h>
32#include <IOKit/usb/IOUSBMassStorageUFISubclass.h>
33
34
35class IOUFIStorageServices : public IOBlockStorageDevice
36{
37
38OSDeclareDefaultStructors ( IOUFIStorageServices )
39
40private:
41boolfMediaChanged;
42boolfMediaPresent;
43
44protected:
45
46 IOUSBMassStorageUFIDevice *fProvider;
47
48UInt64fMaxReadBlocks;
49UInt64fMaxWriteBlocks;
50
51virtual boolattach ( IOService * provider );
52virtual voiddetach ( IOService * provider );
53
54 // Reserve space for future expansion.
55 struct IOUFIStorageServicesExpansionData { };
56 IOUFIStorageServicesExpansionData *fIOUFIStorageServicesReserved;
57
58public:
59
60virtual IOReturn message ( UInt32 type, IOService * provider, void * argument );
61
62static void AsyncReadWriteComplete ( void * clientData,
63 IOReturnstatus,
64 UInt64 actualByteCount );
65
66 // Deprecated
67 virtual IOReturn doAsyncReadWrite (IOMemoryDescriptor *buffer,
68UInt32block,
69UInt32nblks,
70IOStorageCompletioncompletion );
71
72virtual IOReturndoAsyncReadWrite ( IOMemoryDescriptor * buffer,
73 UInt64 block,
74 UInt64 nblks,
75 IOStorageAttributes * attributes,
76 IOStorageCompletion * completion );
77
78virtual IOReturndoSyncReadWrite ( IOMemoryDescriptor *buffer,
79UInt32block,
80UInt32nblks );
81
82 virtual IOReturndoEjectMedia ( void );
83
84 virtual IOReturndoFormatMedia ( UInt64 byteCapacity );
85
86 virtual UInt32doGetFormatCapacities ( UInt64 *capacities,
87 UInt32capacitiesMaxCount ) const;
88
89 virtual IOReturndoLockUnlockMedia ( bool doLock );
90
91 virtual IOReturndoSynchronizeCache ( void );
92
93 virtual char *getVendorString ( void );
94
95 virtual char *getProductString ( void );
96
97 virtual char *getRevisionString ( void );
98
99 virtual char *getAdditionalDeviceInfoString ( void );
100
101 virtual IOReturnreportBlockSize ( UInt64 * blockSize );
102
103 virtual IOReturnreportEjectability ( bool * isEjectable );
104
105 virtual IOReturnreportLockability ( bool * isLockable );
106
107 virtual IOReturnreportMediaState ( bool * mediaPresent, bool * changed );
108
109 virtual IOReturnreportPollRequirements ( bool * pollIsRequired,
110 bool * pollIsExpensive );
111
112 virtual IOReturnreportMaxValidBlock ( UInt64 * maxBlock );
113
114 virtual IOReturnreportRemovability ( bool * isRemovable );
115
116 virtual IOReturnreportWriteProtection ( bool * isWriteProtected );
117
118 virtual IOReturngetWriteCacheState ( bool * enabled );
119
120virtual IOReturnsetWriteCacheState ( bool enabled );
121
122// Space reserved for future expansion.
123 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 1 );
124 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 2 );
125 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 3 );
126 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 4 );
127 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 5 );
128 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 6 );
129 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 7 );
130 OSMetaClassDeclareReservedUnused( IOUFIStorageServices, 8 );
131
132};
133
134#endif/* defined(KERNEL) && defined(__cplusplus) */
135
136#endif/* _IOKIT_UFI_STORAGE_SERVICES_H_ */
137

Archive Download this file

Revision: 1621