Root/
Source at commit 2744 created 8 years 11 months ago. By ifabio, Removing old RLE/Clut data | |
---|---|
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_SCSI_PERIPHERAL_DEVICE_NUB_H_␊ |
26 | #define _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_␊ |
27 | ␊ |
28 | ␊ |
29 | //-----------------------------------------------------------------------------␊ |
30 | //␉Constants␊ |
31 | //-----------------------------------------------------------------------------␊ |
32 | ␊ |
33 | // Probe score values␊ |
34 | enum␊ |
35 | {␊ |
36 | ␉kPeripheralDeviceTypeNoMatch ␉= 0,␊ |
37 | ␉kDefaultProbeRanking ␉␉␉= 5000,␊ |
38 | ␉kFirstOrderRanking ␉␉␉␉= 10000,␊ |
39 | ␉kSecondOrderRanking ␉␉␉= 15000,␊ |
40 | ␉kThirdOrderRanking ␉␉␉␉= 20000␊ |
41 | };␊ |
42 | ␊ |
43 | ␊ |
44 | #if defined(KERNEL) && defined(__cplusplus)␊ |
45 | ␊ |
46 | ␊ |
47 | //-----------------------------------------------------------------------------␊ |
48 | //␉Includes␊ |
49 | //-----------------------------------------------------------------------------␊ |
50 | ␊ |
51 | // General IOKit headers␊ |
52 | #include <IOKit/IOLib.h>␊ |
53 | #include <IOKit/IOService.h>␊ |
54 | #include <IOKit/IOSyncer.h>␊ |
55 | ␊ |
56 | // SCSI Architecture Model Family includes␊ |
57 | #include <IOKit/scsi/IOSCSIProtocolServices.h>␊ |
58 | ␊ |
59 | ␊ |
60 | // Forward definitions for internal use only classes.␊ |
61 | class SCSIPrimaryCommands;␊ |
62 | ␊ |
63 | //-----------------------------------------------------------------------------␊ |
64 | //␉Class Declarations␊ |
65 | //-----------------------------------------------------------------------------␊ |
66 | ␊ |
67 | class IOSCSIPeripheralDeviceNub : public IOSCSIProtocolServices␊ |
68 | {␊ |
69 | ␉␊ |
70 | ␉OSDeclareDefaultStructors ( IOSCSIPeripheralDeviceNub )␊ |
71 | ␉␊ |
72 | private:␊ |
73 | ␉␊ |
74 | ␉static bool␉␉sCompareIOProperty (␊ |
75 | ␉␉␉␉␉␉␉␉␉␉IOService *␉␉object,␊ |
76 | ␉␉␉␉␉␉␉␉␉␉OSDictionary *␉table,␊ |
77 | ␉␉␉␉␉␉␉␉␉␉char *␉␉␉propertyKeyName,␊ |
78 | ␉␉␉␉␉␉␉␉␉␉bool *␉␉␉matches );␊ |
79 | ␉␊ |
80 | ␉static void␉␉TaskCallback ( SCSITaskIdentifier completedTask );␊ |
81 | ␉void␉␉␉TaskCompletion ( SCSITaskIdentifier completedTask );␊ |
82 | ␉␊ |
83 | ␉static IOReturn␉sWaitForTask ( void * object, SCSITask * request );␊ |
84 | ␉IOReturn␉␉GatedWaitForTask ( SCSITask * request );␊ |
85 | ␉␊ |
86 | protected:␊ |
87 | ␊ |
88 | ␉SCSIServiceResponse SendTask ( SCSITask * request );␊ |
89 | ␉␊ |
90 | ␉bool␉␉␉InterrogateDevice ( void );␉␉␉␉␉␉␉␉␉␉␊ |
91 | ␊ |
92 | ␉// Reserve space for future expansion.␊ |
93 | ␉struct IOSCSIPeripheralDeviceNubExpansionData { };␊ |
94 | ␉IOSCSIPeripheralDeviceNubExpansionData * fIOSCSIPeripheralDeviceNubReserved;␊ |
95 | ␉␊ |
96 | ␉IOSCSIProtocolInterface *␉␉fProvider;␊ |
97 | #ifndef __LP64__␊ |
98 | ␉SCSIPrimaryCommands *␉␉␉fSCSIPrimaryCommandObject;␊ |
99 | #endif␊ |
100 | ␉UInt8␉␉␉␉␉␉␉fDefaultInquiryCount;␊ |
101 | ␉␊ |
102 | ␉virtual bool␉␉SendSCSICommand ( ␉SCSITaskIdentifier ␉␉request, ␊ |
103 | ␉␉␉␉␉␉␉␉␉␉␉SCSIServiceResponse * ␉serviceResponse,␊ |
104 | ␉␉␉␉␉␉␉␉␉␉␉SCSITaskStatus * ␉␉taskStatus );␊ |
105 | ␉␊ |
106 | ␉virtual SCSIServiceResponse␉AbortSCSICommand ( SCSITaskIdentifier request );␊ |
107 | ␉␊ |
108 | ␉// The IsProtocolServiceSupported will return true if the specified␊ |
109 | ␉// feature is supported by the protocol layer. If the service has a value that must be␊ |
110 | ␉// returned, it will be returned in the serviceValue output parameter.␊ |
111 | ␉virtual bool␉IsProtocolServiceSupported ( SCSIProtocolFeature feature, void * serviceValue );␊ |
112 | ␉␊ |
113 | ␉virtual bool␉HandleProtocolServiceFeature ( SCSIProtocolFeature feature, void * serviceValue );␊ |
114 | ␉␊ |
115 | ␉// We override this method in order to NOT do power management␊ |
116 | ␉virtual void␉InitializePowerManagement ( IOService * provider );␊ |
117 | ␉␊ |
118 | public:␊ |
119 | ␉␊ |
120 | ␉bool␉␉␉␉init␉( OSDictionary * propTable );␊ |
121 | ␉virtual bool␉␉start␉( IOService * provider );␊ |
122 | ␉virtual void␉␉free␉( void );␊ |
123 | ␉␊ |
124 | ␉virtual IOReturn␉message ( UInt32 type, IOService * nub, void * arg );␊ |
125 | ␉␉␉␉␉␉␉␉␉␉␊ |
126 | ␉virtual bool␉␉matchPropertyTable ( OSDictionary * table,␊ |
127 | ␉␉␉␉␉␉␉␉␉␉␉ SInt32 * score );␊ |
128 | ␉␊ |
129 | ␉// The ExecuteCommand method will take a SCSITask object and transport␊ |
130 | ␉// it across the physical wires to the device␊ |
131 | ␉virtual␉void␉␉ExecuteCommand ( SCSITaskIdentifier␉request );␊ |
132 | ␉␊ |
133 | ␉// The Task Management function to allow the SCSI Application Layer client to request␊ |
134 | ␉// that a specific task be aborted.␊ |
135 | ␉virtual SCSIServiceResponse␉␉AbortTask ( UInt8 theLogicalUnit, SCSITaggedTaskIdentifier theTag );␊ |
136 | ␊ |
137 | ␉// The Task Management function to allow the SCSI Application Layer client to request␊ |
138 | ␉// that a all tasks curerntly in the task set be aborted.␊ |
139 | ␉virtual SCSIServiceResponse␉␉AbortTaskSet ( UInt8 theLogicalUnit );␊ |
140 | ␊ |
141 | ␉virtual SCSIServiceResponse␉␉ClearACA ( UInt8 theLogicalUnit );␊ |
142 | ␊ |
143 | ␉virtual SCSIServiceResponse␉␉ClearTaskSet ( UInt8 theLogicalUnit );␊ |
144 | ␊ |
145 | ␉virtual SCSIServiceResponse␉␉LogicalUnitReset ( UInt8 theLogicalUnit );␊ |
146 | ␊ |
147 | ␉virtual SCSIServiceResponse␉␉TargetReset ( void );␊ |
148 | ␊ |
149 | // ************* Obsoleted Member Routine ****************␊ |
150 | // The AbortCommand method is replaced by the AbortTask Management function and␊ |
151 | // should no longer be called.␊ |
152 | ␉virtual SCSIServiceResponse␉␉AbortCommand ( SCSITaskIdentifier abortTask );␊ |
153 | ␉␊ |
154 | private:␊ |
155 | ␉␊ |
156 | ␉// Space reserved for future expansion.␊ |
157 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 1 );␊ |
158 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 2 );␊ |
159 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 3 );␊ |
160 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 4 );␊ |
161 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 5 );␊ |
162 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 6 );␊ |
163 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 7 );␊ |
164 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 8 );␊ |
165 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 9 );␊ |
166 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 10 );␊ |
167 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 11 );␊ |
168 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 12 );␊ |
169 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 13 );␊ |
170 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 14 );␊ |
171 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 15 );␊ |
172 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIPeripheralDeviceNub, 16 );␊ |
173 | ␉␊ |
174 | };␊ |
175 | ␊ |
176 | ␊ |
177 | ␊ |
178 | class IOSCSILogicalUnitNub : public IOSCSIPeripheralDeviceNub␊ |
179 | {␊ |
180 | ␉␊ |
181 | ␉OSDeclareDefaultStructors ( IOSCSILogicalUnitNub )␊ |
182 | ␉␊ |
183 | private:␊ |
184 | ␉␊ |
185 | ␉UInt8␉␉␉␉fLogicalUnitNumber;␊ |
186 | ␉␊ |
187 | protected:␊ |
188 | ␉␊ |
189 | ␉// Reserve space for future expansion.␊ |
190 | ␉struct IOSCSILogicalUnitNubExpansionData { };␊ |
191 | ␉IOSCSILogicalUnitNubExpansionData * fIOSCSILogicalUnitNubReserved;␊ |
192 | ␉␊ |
193 | public:␊ |
194 | ␉␊ |
195 | ␉virtual bool␉␉start␉( IOService * provider );␊ |
196 | ␉␊ |
197 | ␉virtual void␉␉SetLogicalUnitNumber ( UInt8 newLUN );␊ |
198 | ␉␊ |
199 | ␉UInt8␉␉␉␉GetLogicalUnitNumber ( void );␊ |
200 | ␉␊ |
201 | ␉// The ExecuteCommand method will take a SCSITask object and transport␊ |
202 | ␉// it across the physical wires to the device␊ |
203 | ␉virtual␉void␉␉ExecuteCommand ( SCSITaskIdentifier␉request );␊ |
204 | ␉␊ |
205 | ␉// The AbortCommand method will abort the indicated SCSI Task object,␊ |
206 | ␉// if it is possible and the SCSI Task has not already completed.␊ |
207 | ␉virtual SCSIServiceResponse␉␉AbortCommand ( SCSITaskIdentifier␉abortTask );␊ |
208 | ␉␊ |
209 | private:␊ |
210 | ␉␊ |
211 | ␉// Space reserved for future expansion.␊ |
212 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 1 );␊ |
213 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 2 );␊ |
214 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 3 );␊ |
215 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 4 );␊ |
216 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 5 );␊ |
217 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 6 );␊ |
218 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 7 );␊ |
219 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 8 );␊ |
220 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 9 );␊ |
221 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 10 );␊ |
222 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 11 );␊ |
223 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 12 );␊ |
224 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 13 );␊ |
225 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 14 );␊ |
226 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 15 );␊ |
227 | ␉OSMetaClassDeclareReservedUnused ( IOSCSILogicalUnitNub, 16 );␊ |
228 | ␉␊ |
229 | };␊ |
230 | ␊ |
231 | #endif␉/* defined(KERNEL) && defined(__cplusplus) */␊ |
232 | ␊ |
233 | #endif␉/* _IOKIT_IO_SCSI_PERIPHERAL_DEVICE_NUB_H_ */␊ |
234 |