1 | /*␊ |
2 | * Copyright (c) 2002-2008 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 | #ifndef __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__␊ |
25 | #define __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__␊ |
26 | ␊ |
27 | ␊ |
28 | /*!␊ |
29 | @header IOSCSIParallelInterfaceController␊ |
30 | ␉The IOSCSIParallelInterfaceController class and the associated HBA child␊ |
31 | ␉class is responsible for the management of all related hardware. This␊ |
32 | ␉includes the onboard HBA controller chip and the physical state of the␊ |
33 | ␉bus. These classes are not responsible for any of the management of␊ |
34 | ␉the SCSI Devices on the bus with the exception of maintaining the queue that ␊ |
35 | ␉holds the objects representing those SCSI Devices.␊ |
36 | */␊ |
37 | ␊ |
38 | ␊ |
39 | //-----------------------------------------------------------------------------␊ |
40 | //␉Includes␊ |
41 | //-----------------------------------------------------------------------------␊ |
42 | ␊ |
43 | // General IOKit includes␊ |
44 | #include <IOKit/IOService.h>␊ |
45 | #include <IOKit/IOWorkLoop.h>␊ |
46 | #include <IOKit/IOCommandGate.h>␊ |
47 | #include <IOKit/IODMACommand.h>␊ |
48 | #include <IOKit/IOInterruptEventSource.h>␊ |
49 | #include <IOKit/IOFilterInterruptEventSource.h>␊ |
50 | #include <IOKit/IOTimerEventSource.h>␊ |
51 | #include <IOKit/IOCommandPool.h>␊ |
52 | ␊ |
53 | // IOKit SCSI ArchitectureModel Family includes␊ |
54 | #include <IOKit/scsi/SCSITask.h>␊ |
55 | #include <IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h>␊ |
56 | #include <IOKit/scsi/SCSIPort.h>␊ |
57 | ␊ |
58 | //-----------------------------------------------------------------------------␊ |
59 | //␉Constants␊ |
60 | //-----------------------------------------------------------------------------␊ |
61 | ␊ |
62 | ␊ |
63 | #define kIOPropertySCSIDeviceFeaturesKey␉␉␉"SCSI Device Features"␊ |
64 | #define kIOPropertySCSI_I_T_NexusFeaturesKey␉␉"SCSI I_T Nexus Features"␊ |
65 | ␊ |
66 | // This is the alignment mask used when allocating per-task HBA data. It allows␊ |
67 | // the HBA to declare whether or not it supports 64-bit addressability and what the␊ |
68 | // minimum byte alignment is for the data. E.g. By specifying 0x0000FFFFFFFFFFFEULL,␊ |
69 | // the controller would be indicating that it supports 48-bits of addressability, but␊ |
70 | // at a minimum of being 2-byte aligned.␊ |
71 | #define kIOMinimumHBADataAlignmentMaskKey␉␉␉"HBA Data Alignment"␊ |
72 | ␊ |
73 | // The Feature Selectors used to identify features of the SCSI Parallel␊ |
74 | // Interface. These are used by the DoesHBASupportSCSIParallelFeature␊ |
75 | // to report whether the HBA supports a given SCSI Parallel Interface␊ |
76 | // feature and are used for requesting negotiation and reporting negotiation␊ |
77 | // results between the controller and the device.␊ |
78 | ␊ |
79 | // When the DoesHBASupportSCSIParallelFeature() member routine of the controller ␊ |
80 | // child class is called, it will return true if the HBA that it controls ␊ |
81 | // supports the specified SCSIParallelFeature or false if it does not.␊ |
82 | typedef enum SCSIParallelFeature␊ |
83 | {␊ |
84 | ␉// The selector for support of Wide Data Transfers. Only Wide16 is supported ␊ |
85 | ␉// as Wide32 has been obsoleted by the SPI-3 specification.␊ |
86 | ␉kSCSIParallelFeature_WideDataTransfer ␉␉␉␉␉= 0,␊ |
87 | ␉␊ |
88 | ␉// The selector for support of Synchronous Data Transfers.␊ |
89 | ␉kSCSIParallelFeature_SynchronousDataTransfer ␉␉␉= 1,␊ |
90 | ␉␊ |
91 | ␉// The selector for support of Quick Arbitration and Selection (QAS).␊ |
92 | ␉kSCSIParallelFeature_QuickArbitrationAndSelection ␉␉= 2,␊ |
93 | ␉␊ |
94 | ␉// The selector for support of Double Transition (DT) data transfers.␊ |
95 | ␉kSCSIParallelFeature_DoubleTransitionDataTransfers ␉␉= 3,␊ |
96 | ␉␊ |
97 | ␉// The selector for SPI Information Unit (IU) transfers.␊ |
98 | ␉kSCSIParallelFeature_InformationUnitTransfers ␉␉␉= 4,␊ |
99 | ␉␊ |
100 | ␉// Since the Feature selectors are zero base, this will always have the ␊ |
101 | ␉// correct total.␊ |
102 | ␉kSCSIParallelFeature_TotalFeatureCount␉␊ |
103 | } SCSIParallelFeature;␊ |
104 | ␊ |
105 | ␊ |
106 | typedef enum SCSIParallelFeatureRequest␊ |
107 | {␊ |
108 | ␉// This selector indicates that current negotiation ␊ |
109 | ␉// should be used. ␊ |
110 | ␉kSCSIParallelFeature_NoNegotiation ␉␉␉= 0,␊ |
111 | ␉␊ |
112 | ␉// This selector indicates that the controller␊ |
113 | ␉// should attempt negotiation for the feature␊ |
114 | ␉kSCSIParallelFeature_AttemptNegotiation ␉= 1,␊ |
115 | ␉␊ |
116 | ␉// This selector indicates that the controller␊ |
117 | ␉// should clear any negotiation for the feature␊ |
118 | ␉kSCSIParallelFeature_ClearNegotiation ␉␉= 2␊ |
119 | };␊ |
120 | ␉␊ |
121 | typedef enum SCSIParallelFeatureResult␊ |
122 | {␊ |
123 | ␉kSCSIParallelFeature_NegotitiationUnchanged␉= 0,␊ |
124 | ␉kSCSIParallelFeature_NegotitiationCleared␉= 1,␊ |
125 | ␉kSCSIParallelFeature_NegotitiationSuccess␉= 2␊ |
126 | };␊ |
127 | ␊ |
128 | ␊ |
129 | // The SCSI Message Codes used for MESSAGE IN and MESSAGE OUT phases.␊ |
130 | enum SCSIParallelMessages␊ |
131 | {␊ |
132 | ␉// Link Control Messages␊ |
133 | ␉kSCSIParallelMessage_TASK_COMPLETE␉␉␉␉␉␉= 0x00,␊ |
134 | ␉kSCSIParallelMessage_EXTENDED_MESSAGE␉␉␉␉␉= 0x01,␊ |
135 | ␉kSCSIParallelMessage_SAVE_DATA_POINTER␉ ␉␉␉␉= 0x02,␊ |
136 | ␉kSCSIParallelMessage_RESTORE_POINTERS␉␉␉␉␉= 0x03,␊ |
137 | ␉kSCSIParallelMessage_DISCONNECT␉␉␉␉␉␉␉= 0x04,␊ |
138 | ␉kSCSIParallelMessage_INITIATOR_DETECTED_ERROR ␉␉␉= 0x05,␊ |
139 | ␉kSCSIParallelMessage_MESSAGE_REJECT␉␉ ␉␉␉␉= 0x07,␊ |
140 | ␉kSCSIParallelMessage_NO_OPERATION␉␉ ␉␉␉␉= 0x08,␊ |
141 | ␉kSCSIParallelMessage_MESSAGE_PARITY_ERROR ␉␉␉␉= 0x09,␊ |
142 | ␉kSCSIParallelMessage_IGNORE_WIDE_RESIDUE␉␉␉␉= 0x23,␊ |
143 | ␉kSCSIParallelMessage_QAS_REQUEST␉␉ ␉␉␉␉= 0x55,␊ |
144 | ␉kSCSIParallelMessage_IDENTIFY␉␉␉␉␉␉␉= 0x80,␊ |
145 | ␉␊ |
146 | ␉// The Message Codes used in the EXTENDED_MESSAGE message.␊ |
147 | ␉kSCSIParallelMessage_MODIFY_DATA_POINTER␉␉␉␉= 0x00,␊ |
148 | ␉kSCSIParallelMessage_SYNCHONOUS_DATA_TRANSFER_REQUEST␉= 0x01,␊ |
149 | ␉// Reserved␉␉␉␉␉␉␉␉␉␉␉␉= 0x02␊ |
150 | ␉kSCSIParallelMessage_WIDE_DATA_TRANSFER_REQUEST␉␉␉= 0x03,␊ |
151 | ␉kSCSIParallelMessage_PARALLEL_PROTOCOL_REQUEST␉␉␉= 0x04,␊ |
152 | ␉// Reserved␉␉␉␉␉␉␉␉␉␉␉␉= 0x05 through 0xFF␊ |
153 | ␉␊ |
154 | ␉// Task Attribute Message Codes␊ |
155 | ␉kSCSIParallelMessage_ACA␉␉␉␉␉␉␉␉= 0x24,␊ |
156 | ␉kSCSIParallelMessage_HEAD_OF_QUEUE␉␉␉␉␉␉= 0x21,␊ |
157 | ␉kSCSIParallelMessage_LINKED_COMMAND_COMPLETE␉␉␉= 0x0A,␊ |
158 | ␉kSCSIParallelMessage_ORDERED␉␉␉␉␉␉␉= 0x22,␊ |
159 | ␉kSCSIParallelMessage_SIMPLE␉␉␉␉␉␉␉␉= 0x20,␊ |
160 | ␉␊ |
161 | ␉// Task Management Message Codes␊ |
162 | ␉kSCSIParallelMessage_ABORT_TASK␉␉␉␉␉␉␉= 0x0D,␊ |
163 | ␉kSCSIParallelMessage_ABORT_TASK_SET␉␉␉␉␉␉= 0x06,␊ |
164 | ␉kSCSIParallelMessage_CLEAR_ACA␉␉␉␉␉␉␉= 0x16,␊ |
165 | ␉kSCSIParallelMessage_CLEAR_TASK_SET␉␉␉␉␉␉= 0x0E,␊ |
166 | ␉kSCSIParallelMessage_LOGICAL_UNIT_RESET␉␉␉␉␉= 0x17,␊ |
167 | ␉kSCSIParallelMessage_TARGET_RESET␉␉␉␉␉␉= 0x0C␊ |
168 | };␊ |
169 | ␊ |
170 | enum␊ |
171 | {␊ |
172 | ␉kSCSIParallelTaskControllerIDQueueHead ␉␉= 0␊ |
173 | };␊ |
174 | ␊ |
175 | // Notifications␊ |
176 | enum␊ |
177 | {␊ |
178 | ␉kSCSIControllerNotificationBusReset␉␉␉= 0x68000000␊ |
179 | };␊ |
180 | ␊ |
181 | // Forward declaration for the internally used Parallel Device object.␊ |
182 | class IOSCSIParallelInterfaceDevice;␊ |
183 | ␊ |
184 | // This is the identifier that is used to specify a given parallel Task.␊ |
185 | typedef OSObject *␉SCSIParallelTaskIdentifier;␊ |
186 | ␊ |
187 | ␊ |
188 | //-----------------------------------------------------------------------------␊ |
189 | //␉Class Declarations␊ |
190 | //-----------------------------------------------------------------------------␊ |
191 | ␊ |
192 | /*! @class IOSCSIParallelInterfaceController␊ |
193 | ␉@abstract Class that represents a SCSI Host Bus Adapter.␊ |
194 | ␉@discussion Class that represents a SCSI Host Bus Adapter.␊ |
195 | */␊ |
196 | class IOSCSIParallelInterfaceController : public IOService␊ |
197 | {␊ |
198 | ␉␊ |
199 | ␉OSDeclareAbstractStructors ( IOSCSIParallelInterfaceController )␊ |
200 | ␉␊ |
201 | #if 0␊ |
202 | #pragma mark -␊ |
203 | #pragma mark Client API␊ |
204 | #endif␊ |
205 | ␉␊ |
206 | ␉␊ |
207 | public:␊ |
208 | ␉␊ |
209 | ␉/*!␊ |
210 | ␉␉@function GetSCSIParallelTask␊ |
211 | ␉␉@abstract Method to allow the client to get a SCSIParallelTask␊ |
212 | ␉␉@discussion Get a SCSIParallelTask from the controller so that a request␊ |
213 | ␉␉can be issued to the HBA driver.␊ |
214 | ␉␉@param blockForCommand If the blockForCommand parameter is set to false␊ |
215 | ␉␉and there are no free SCSIParallelTasks, this method will return NULL, ␊ |
216 | ␉␉otherwise it will wait for one to become available before returning.␊ |
217 | ␉␉@result If there is a SCSI Parallel Task available, a reference to it ␊ |
218 | ␉␉will be returned.␊ |
219 | ␉*/␊ |
220 | ␉␊ |
221 | ␉SCSIParallelTaskIdentifier␉GetSCSIParallelTask ( bool blockForCommand );␊ |
222 | ␉␊ |
223 | ␉/*!␊ |
224 | ␉␉@function FreeSCSIParallelTask␊ |
225 | ␉␉@abstract Method to allow the client to release a SCSIParallelTask␊ |
226 | ␉␉@discussion␉The FreeSCSIParallelTask method is called by the client when ␊ |
227 | ␉␉a SCSIParallelTask has been completed and the associated returnTask␊ |
228 | ␉␉needs to be returned to the pool.␊ |
229 | ␉␉@param returnTask is a reference to the SCSIParallelTaskIdentifier to be ␊ |
230 | ␉␉returned.␊ |
231 | ␉*/␊ |
232 | ␉␊ |
233 | ␉void FreeSCSIParallelTask ( SCSIParallelTaskIdentifier returnTask );␊ |
234 | ␉␊ |
235 | ␉/*!␊ |
236 | ␉␉@function FindTaskForAddress␊ |
237 | ␉␉@abstract Find a task for a given Task Address, if one exists.␊ |
238 | ␉␉@discussion If a valid Tagged Task Identifier is specified, this method ␊ |
239 | ␉␉will return the task specified by the Tagged Task Address if one is ␊ |
240 | ␉␉found, or else NULL will be returned. If zero is used as the Tagged ␊ |
241 | ␉␉Task Identifier, then this routine will search for an outstanding task ␊ |
242 | ␉␉based on the Untagged Task Address and return the task or else, if one ␊ |
243 | ␉␉is not found, return NULL.␊ |
244 | ␉␉@param theT is the Target component of the I_T_L or I_T_L_Q nexus.␊ |
245 | ␉␉@param theL is the Logical Unit component of the I_T_L or I_T_L_Q nexus.␊ |
246 | ␉␉@param theQ is the Queue Tag component of the I_T_L_Q nexus. If this is␊ |
247 | ␉␉an I_T_L nexus, then the kSCSIUntaggedTaskIdentifier constant should be␊ |
248 | ␉␉used for theQ.␊ |
249 | ␉␉@result returns a valid SCSIParallelTaskIdentifier or NULL if none ␊ |
250 | ␉␉found.␊ |
251 | ␉*/␊ |
252 | ␉␊ |
253 | ␉SCSIParallelTaskIdentifier␉FindTaskForAddress ( ␊ |
254 | ␉␉␉␉␉␉␉SCSIDeviceIdentifier ␉␉theT,␊ |
255 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
256 | ␉␉␉␉␉␉␉SCSITaggedTaskIdentifier␉theQ );␊ |
257 | ␉␊ |
258 | ␉␊ |
259 | ␉/*!␊ |
260 | ␉␉@function FindTaskForControllerIdentifier␊ |
261 | ␉␉@abstract Find a task for a given Target and Controller Task Identifier␊ |
262 | ␉␉@discussion Allows the controller child class to find an outstanding task␊ |
263 | ␉␉for a specified target and controller task identifier␊ |
264 | ␉␉@param theTarget is the Target that the task .␊ |
265 | ␉␉@param theIdentifier is the controller task identifier set using the SCSI␊ |
266 | ␉␉Parallel Task's SetControllerTaskIdentifier() method.␊ |
267 | ␉␉@result returns a valid SCSIParallelTaskIdentifier or NULL if none ␊ |
268 | ␉␉found.␊ |
269 | ␉*/␊ |
270 | ␉␊ |
271 | ␉SCSIParallelTaskIdentifier␉FindTaskForControllerIdentifier ( ␊ |
272 | ␉␉␉␉␉␉␉SCSIDeviceIdentifier ␉␉theTarget,␊ |
273 | ␉␉␉␉␉␉␉UInt64␉␉␉␉␉␉theIdentifier );␊ |
274 | ␉␊ |
275 | ␉␊ |
276 | ␉/*!␊ |
277 | ␉␉@function ExecuteParallelTask␊ |
278 | ␉␉@abstract Submit a SCSIParallelTask for execution.␊ |
279 | ␉␉@discussion␉The ExecuteParallelTask call is made by the client to submit ␊ |
280 | ␉␉a SCSIParallelTask for execution.␊ |
281 | ␉␉@param parallelRequest is a reference to the SCSIParallelTaskIdentifier␊ |
282 | ␉␉to be executed.␊ |
283 | ␉␉@result is an appropriate SCSIServiceResponse which are defined in the␊ |
284 | ␉␉file <IOKit/scsi/SCSITask.h>.␊ |
285 | ␉*/␊ |
286 | ␉␊ |
287 | ␉SCSIServiceResponse ExecuteParallelTask ( ␊ |
288 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier␉parallelRequest );␊ |
289 | ␉␊ |
290 | ␉// --- Public API methods provided by HBA child classes ----␊ |
291 | ␉␊ |
292 | ␉/*!␊ |
293 | ␉␉@function ReportHBAHighestLogicalUnitNumber␊ |
294 | ␉␉@abstract Gets the Highest Logical Unit Number.␊ |
295 | ␉␉@discussion␉This method is used to query the HBA child class to ␊ |
296 | ␉␉determine what the highest Logical Unit Number that the controller can ␊ |
297 | ␉␉address.␊ |
298 | ␉␉@result returns a valid 64-bit logical unit number.␊ |
299 | ␉*/␊ |
300 | ␉␊ |
301 | ␉virtual SCSILogicalUnitNumber␉ReportHBAHighestLogicalUnitNumber ( void ) = 0;␊ |
302 | ␉␊ |
303 | ␉/*!␊ |
304 | ␉␉@function DoesHBASupportSCSIParallelFeature␊ |
305 | ␉␉@abstract Queries the HBA child class to determine if it supports a ␊ |
306 | ␉␉specific SPI feature.␊ |
307 | ␉␉@discussion␉Queries the HBA child class to determine if it supports the ␊ |
308 | ␉␉specified feature as defined by the SCSI Parallel Interconnect ␊ |
309 | ␉␉specifications.␊ |
310 | ␉␉@result Returns true if requested feature is supported.␊ |
311 | ␉*/␊ |
312 | ␉␊ |
313 | ␉virtual bool␉DoesHBASupportSCSIParallelFeature ( ␊ |
314 | ␉␉␉␉␉␉␉SCSIParallelFeature ␉␉theFeature ) = 0;␊ |
315 | ␉␊ |
316 | ␉/*!␊ |
317 | ␉␉@function InitializeTargetForID␊ |
318 | ␉␉@abstract Called to initialize a target device.␊ |
319 | ␉␉@discussion␉This method will be called to initialize a target device in ␊ |
320 | ␉␉a single-threaded manner. The HBA can use this method to probe the ␊ |
321 | ␉␉target or do anything else necessary before the device object is ␊ |
322 | ␉␉registered with IOKit for matching.␊ |
323 | ␉␉@result Returns true if the target was successfully initialized.␊ |
324 | ␉*/␊ |
325 | ␉␊ |
326 | ␉virtual bool␉InitializeTargetForID ( ␊ |
327 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉targetID ) = 0;␊ |
328 | ␉␊ |
329 | ␉// The SCSI Task Management Functions as defined in the SCSI Architecture␊ |
330 | ␉// Model - 2 (SAM-2) specification. These are used by the client to request␊ |
331 | ␉// the specified function. The controller can complete these immmediately ␊ |
332 | ␉// by returning the appropriate SCSIServiceResponse, or these can be completed␊ |
333 | ␉// asyncronously by the controller returning a SCSIServiceResponse of␊ |
334 | ␉// kSCSIServiceResponse_Request_In_Process and then calling the appropriate␊ |
335 | ␉// function complete member routine listed in the child class API section.␊ |
336 | ␉␊ |
337 | ␉virtual SCSIServiceResponse␉AbortTaskRequest ( ␉␊ |
338 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
339 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
340 | ␉␉␉␉␉␉␉SCSITaggedTaskIdentifier␉theQ ) = 0;␊ |
341 | ␉␊ |
342 | ␉virtual␉SCSIServiceResponse AbortTaskSetRequest (␊ |
343 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
344 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL ) = 0;␊ |
345 | ␉␊ |
346 | ␉virtual␉SCSIServiceResponse ClearACARequest (␊ |
347 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
348 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL ) = 0;␊ |
349 | ␉␊ |
350 | ␉virtual␉SCSIServiceResponse ClearTaskSetRequest (␊ |
351 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
352 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL ) = 0;␊ |
353 | ␉␊ |
354 | ␉virtual␉SCSIServiceResponse LogicalUnitResetRequest (␊ |
355 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
356 | ␉␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL ) = 0;␊ |
357 | ␉␊ |
358 | ␉virtual␉SCSIServiceResponse TargetResetRequest (␊ |
359 | ␉␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT ) = 0;␊ |
360 | ␉␊ |
361 | ␉␊ |
362 | ␊ |
363 | ␉/*!␊ |
364 | ␉␉@function DoesHBAPerformAutoSense␊ |
365 | ␉␉@abstract Queries the HBA child class to determine if it automatically␊ |
366 | ␉␉performs AutoSense and provides AutoSense data for each I/O. If the HBA␊ |
367 | ␉␉allocates space for AutoSense in its HBA specific data region on a per␊ |
368 | ␉␉task basis, the HBA should respond true.␊ |
369 | ␉␉@discussion␉Queries the HBA child class to determine if it automatically␊ |
370 | ␉␉performs AutoSense and provides AutoSense data for each I/O. If the HBA␊ |
371 | ␉␉allocates space for AutoSense in its HBA specific data region on a per␊ |
372 | ␉␉task basis, the HBA should respond true.␊ |
373 | ␉␉@result Return true if HBA performs AutoSense into its own private data␊ |
374 | ␉␉buffer.␊ |
375 | ␉*/␊ |
376 | ␉␊ |
377 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 1 );␊ |
378 | ␉␊ |
379 | ␉virtual bool␉DoesHBAPerformAutoSense ( void );␊ |
380 | ␉␊ |
381 | ␉/*!␊ |
382 | ␉␉@function ReportHBAConstraints␊ |
383 | ␉␉@abstract Called to report the I/O constraints for this controller.␊ |
384 | ␉␉A list of valid keys includes:␊ |
385 | ␉␉␉kIOMaximumSegmentCountReadKey, (required)␊ |
386 | ␉␉␉kIOMaximumSegmentCountWriteKey, (required)␊ |
387 | ␉␉␉kIOMaximumSegmentByteCountReadKey, (required)␊ |
388 | ␉␉␉kIOMaximumSegmentByteCountWriteKey, (required)␊ |
389 | ␉␉␉kIOMinimumSegmentAlignmentByteCountKey, (required)␊ |
390 | ␉␉␉kIOMaximumSegmentAddressableBitCountKey, (required)␊ |
391 | ␉␉␉kIOMinimumHBADataAlignmentMaskKey (required).␊ |
392 | ␉␉NB: These keys and their values are described in this header and <IOKit/IOKitKeys.h>␊ |
393 | ␉␉@param constraints. An OSDictionary object used to aggregate the key/value pairs.␊ |
394 | ␉␉Subclasses must set the required keys if they override this method. If a subclass does␊ |
395 | ␉␉not provide the required keys, the system will panic.␊ |
396 | ␉*/␊ |
397 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 2 );␊ |
398 | ␉␊ |
399 | ␉virtual void␉ReportHBAConstraints ( OSDictionary * constraints );␊ |
400 | ␉␊ |
401 | ␉// Padding for the Client API␊ |
402 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 3 );␊ |
403 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 4 );␊ |
404 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 5 );␊ |
405 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 6 );␊ |
406 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 7 );␊ |
407 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 8 );␊ |
408 | ␉␊ |
409 | ␉␊ |
410 | #if 0␊ |
411 | #pragma mark -␊ |
412 | #pragma mark Child Class API␊ |
413 | #endif␊ |
414 | ␉␊ |
415 | ␉␊ |
416 | protected:␊ |
417 | ␉␊ |
418 | ␉// ---- Target Creation and Destruction methods ---␊ |
419 | ␉␊ |
420 | ␉/*!␊ |
421 | ␉␉@function CreateTargetForID␊ |
422 | ␉␉@abstract Method to perform device creation.␊ |
423 | ␉␉@discussion␉For HBA child classes that report true to the ␊ |
424 | ␉␉DoesHBAPerformDeviceManagement() method, the child class will be ␊ |
425 | ␉␉responsible for all device management by using these methods;␊ |
426 | ␉␉otherwise, the superclass will be responsible for all device management.␊ |
427 | ␉␉This method must be used to perform SCSI Parallel Device creation and ␊ |
428 | ␉␉cannot be overridden.␊ |
429 | ␉␉@param targetID SCSIDeviceIdentifier of desired targetID.␊ |
430 | ␉␉@result returns true if successful.␊ |
431 | ␉*/␊ |
432 | ␉␊ |
433 | ␉bool␉CreateTargetForID ( SCSIDeviceIdentifier targetID );␊ |
434 | ␉␊ |
435 | ␉ /*!␊ |
436 | ␉␉@function CreateTargetForID␊ |
437 | ␉␉@abstract Method to perform device creation.␊ |
438 | ␉␉@discussion␉For HBA child classes that report true to the␊ |
439 | ␉␉DoesHBAPerformDeviceManagement() method, the child class will be␊ |
440 | ␉␉responsible for all device management by using these methods;␊ |
441 | ␉␉otherwise, the superclass will be responsible for all device management.␊ |
442 | ␉␉This method must be used to perform SCSI Parallel Device creation and␊ |
443 | ␉␉cannot be overridden.␊ |
444 | ␉␉@param targetID SCSIDeviceIdentifier of desired targetID.␊ |
445 | ␉␉@param␉properties A dictionary of properties to associate with the device␊ |
446 | ␉␉␉␉upon creation. The list of valid property keys is as follows:␊ |
447 | ␉␉␉␉kIOPropertySASAddressKey,␊ |
448 | ␉␉␉␉kIOPropertyFibreChannelNodeWorldWideNameKey,␊ |
449 | ␉␉␉␉kIOPropertyFibreChannelPortWorldWideNameKey,␊ |
450 | ␉␉␉␉kIOPropertyFibreChannelAddressIdentifierKey, and␊ |
451 | ␉␉␉␉kIOPropertyFibreChannelALPAKey.␊ |
452 | ␉␉␉␉These keys are defined in␊ |
453 | ␉␉␉␉<IOKit/storage/IOStorageProtocolCharacteristics.h> and the values␊ |
454 | ␉␉␉␉associated with these keys must be of the proper type/size,␊ |
455 | ␉␉␉␉or the target creation will not succeed.␊ |
456 | ␉␉@result returns true if successful.␊ |
457 | ␉*/␊ |
458 | ␉␊ |
459 | ␉bool␉CreateTargetForID ( SCSIDeviceIdentifier ␉targetID,␊ |
460 | ␉␉␉␉␉␉␉␉OSDictionary * ␉␉␉properties );␊ |
461 | ␉␊ |
462 | ␉ /*!␊ |
463 | ␉␉@function DestroyTargetForID␊ |
464 | ␉␉@abstract Method to perform device destruction.␊ |
465 | ␉␉@discussion␉For HBA child classes that report true to the ␊ |
466 | ␉␉DoesHBAPerformDeviceManagement() method, the child class will be ␊ |
467 | ␉␉responsible for all device management by using these methods; otherwise, ␊ |
468 | ␉␉the superclass will be responsible for all device management.␊ |
469 | ␉␉This method must be used to perform SCSI Parallel Device destruction and␊ |
470 | ␉␉cannot be overridden.␊ |
471 | ␉␉@param targetID SCSIDeviceIdentifier of desired targetID.␊ |
472 | ␉*/␊ |
473 | ␉␊ |
474 | ␉void␉DestroyTargetForID ( SCSIDeviceIdentifier targetID );␊ |
475 | ␉␊ |
476 | ␉/*!␊ |
477 | ␉␉@function GetTargetForID␊ |
478 | ␉␉@abstract Accessor for getting pointer to IOSCSIParallelInterfaceDevice.␊ |
479 | ␉␉@param targetID SCSIDeviceIdentifier of desired targetID.␊ |
480 | ␉␉@result returns pointer to IOSCSIParallelInterfaceDevice or NULL if not ␊ |
481 | ␉␉found.␊ |
482 | ␉*/␊ |
483 | ␉␊ |
484 | ␉IOSCSIParallelInterfaceDevice *␉GetTargetForID ( ␊ |
485 | ␉␉␉␉␉␉␉SCSIDeviceIdentifier ␉␉targetID ); ␊ |
486 | ␉␊ |
487 | ␉/*!␊ |
488 | ␉␉@function SetTargetProperty␊ |
489 | ␉␉@abstract Accessor for setting a property for a specific target.␊ |
490 | ␉␉@param device A pointer to a valid IOSCSIParallelInterfaceDevice.␊ |
491 | ␉␉@param key A pointer to a valid OSString object which represents the key.␊ |
492 | ␉␉A list of valid keys includes:␊ |
493 | ␉␉␉kIOPropertySASAddressKey,␊ |
494 | ␉␉␉kIOPropertyFibreChannelNodeWorldWideNameKey,␊ |
495 | ␉␉␉kIOPropertyFibreChannelPortWorldWideNameKey,␊ |
496 | ␉␉␉kIOPropertyFibreChannelAddressIdentifierKey, and␊ |
497 | ␉␉␉kIOPropertyFibreChannelALPAKey.␊ |
498 | ␉␉NB: These keys and their values are described in <IOKit/storage/IOStorageProtocolCharacteristics.h>␊ |
499 | ␉␉@param value Pointer to an OSObject (one of type OSData, OSString, etc.)␊ |
500 | ␉␉which represents the value for the property. The value must be of the proper type␊ |
501 | ␉␉and size for the specified key.␊ |
502 | ␉␉@result returns true if identifier was properly set, otherwise false. ␊ |
503 | ␉*/␊ |
504 | ␉␊ |
505 | ␉bool␉SetTargetProperty ( SCSIDeviceIdentifier ␉␉targetID,␊ |
506 | ␉␉␉␉␉␉␉␉const char *␉␉ ␉␉key,␊ |
507 | ␉␉␉␉␉␉␉␉OSObject *␉␉␉␉␉value );␊ |
508 | ␊ |
509 | ␉/*!␊ |
510 | ␉␉@function RemoveTargetProperty␊ |
511 | ␉␉@abstract Accessor for removing a property from a specific target.␊ |
512 | ␉␉@param device A pointer to a valid IOSCSIParallelInterfaceDevice.␊ |
513 | ␉␉@param key A pointer to a valid OSString object which represents the key.␊ |
514 | ␉*/␊ |
515 | ␉␊ |
516 | ␉void␉RemoveTargetProperty ( SCSIDeviceIdentifier ␉␉targetID,␊ |
517 | ␉␉␉␉␉␉␉␉ const char *␉␉ ␉␉␉key );␊ |
518 | ␉␊ |
519 | ␉// ---- Methods for HBA specifics. ----␊ |
520 | ␉␊ |
521 | ␉/*!␊ |
522 | ␉␉@function SetHBAProperty␊ |
523 | ␉␉@abstract Accessor for setting a property for this object.␊ |
524 | ␉␉@param key A pointer to a valid OSString object which represents the key.␊ |
525 | ␉␉A list of valid keys includes:␊ |
526 | ␉␉␉kIOPropertyVendorNameKey,␊ |
527 | ␉␉␉kIOPropertyProductNameKey,␊ |
528 | ␉␉␉kIOPropertyProductRevisionLevelKey,␊ |
529 | ␉␉␉kIOPropertyPortDescriptionKey,␊ |
530 | ␉␉␉kIOPropertyPortSpeedKey,␊ |
531 | ␉␉␉kIOPropertyPortTopologyKey,␊ |
532 | ␉␉␉kIOPropertySCSIParallelSignalingTypeKey,␊ |
533 | ␉␉␉kIOPropertyFibreChannelCableDescriptionKey,␊ |
534 | ␉␉␉kIOPropertyFibreChannelNodeWorldWideNameKey,␊ |
535 | ␉␉␉kIOPropertyFibreChannelPortWorldWideNameKey,␊ |
536 | ␉␉␉kIOPropertyFibreChannelAddressIdentifierKey, and␊ |
537 | ␉␉␉kIOPropertyFibreChannelALPAKey.␊ |
538 | ␉␉NB: These keys and their values are described in <IOKit/storage/IOStorageDeviceCharacteristics.h>␊ |
539 | ␉␉and <IOKit/storage/IOStorageProtocolCharacteristics.h>␊ |
540 | ␉␉@param value Pointer to an OSObject (one of type OSData, OSString, etc.)␊ |
541 | ␉␉which represents the value for the property. The value must be of the proper type,␊ |
542 | ␉␉and/or size for the specified key.␊ |
543 | ␉␉@result returns true if identifier was properly set, otherwise false. ␊ |
544 | ␉*/␊ |
545 | ␉␊ |
546 | ␉bool␉SetHBAProperty ( const char *␉key,␊ |
547 | ␉␉␉␉␉␉␉ OSObject *␉ ␉value );␊ |
548 | ␊ |
549 | ␉/*!␊ |
550 | ␉␉@function RemoveHBAProperty␊ |
551 | ␉␉@abstract Accessor for removing a property for this object.␊ |
552 | ␉␉@param key A pointer to a valid OSString object which represents the key.␊ |
553 | ␉␉See the SetHBAProperty() method for a list of valid keys.␊ |
554 | ␉*/␊ |
555 | ␉␊ |
556 | ␉void␉RemoveHBAProperty ( const char * key );␊ |
557 | ␉␊ |
558 | ␉// These methods will not be called before the InitializeController() call,␊ |
559 | ␉// and will not be called after the TerminateController() call. But in the␊ |
560 | ␉// interval between those calls, they shall report the correct requested␊ |
561 | ␉// information. They are implemented as seperate pure virtual methods␊ |
562 | ␉// instead of a selector driven method because the HBA child class is␊ |
563 | ␉// required to report this information.␊ |
564 | ␉␊ |
565 | ␉/*!␊ |
566 | ␉␉@function ReportInitiatorIdentifier␊ |
567 | ␉␉@abstract Get the SCSI Device Identifier for the HBA.␊ |
568 | ␉␉@discussion This method will be called to determine the SCSI Device ␊ |
569 | ␉␉Identifier that the Initiator has assigned for this HBA.␊ |
570 | ␉␉@result returns SCSIInitiatorIdentifier.␊ |
571 | ␉*/␊ |
572 | ␉␊ |
573 | ␉virtual SCSIInitiatorIdentifier␉ReportInitiatorIdentifier ( void ) = 0;␊ |
574 | ␉␊ |
575 | ␉/*!␊ |
576 | ␉␉@function ReportHighestSupportedDeviceID␊ |
577 | ␉␉@abstract Get the highest supported SCSI Device Identifier.␊ |
578 | ␉␉@discussion This method will be called to determine the value of the ␊ |
579 | ␉␉highest SCSI Device Identifier supported by the HBA. This value will be ␊ |
580 | ␉␉used to determine the last ID to process.␊ |
581 | ␉␉@result returns highest SCSIDeviceIdentifier␊ |
582 | ␉*/␊ |
583 | ␉␊ |
584 | ␉virtual SCSIDeviceIdentifier␉ReportHighestSupportedDeviceID ( void ) = 0;␊ |
585 | ␉␊ |
586 | ␉/*!␊ |
587 | ␉␉@function ReportMaximumTaskCount␊ |
588 | ␉␉@abstract Report Maximum Task Count␊ |
589 | ␉␉@discussion This method will be called to retrieve the maximum number of␊ |
590 | ␉␉outstanding tasks the HBA can process. This number must be greater than␊ |
591 | ␉␉zero or the controller driver will fail to match and load.␊ |
592 | ␉␉@result returns maximum (non-zero) task count.␊ |
593 | ␉*/␊ |
594 | ␉␊ |
595 | ␉virtual UInt32␉␉ReportMaximumTaskCount ( void ) = 0;␊ |
596 | ␉␊ |
597 | ␉/*!␊ |
598 | ␉␉@function ReportHBASpecificTaskDataSize␊ |
599 | ␉␉@abstract Determine memory needed for HBA Task specific use.␊ |
600 | ␉␉@discussion This method is used to retrieve the amount of memory that ␊ |
601 | ␉␉will be allocated in the SCSI Parallel Task for HBA specific use.␊ |
602 | ␉␉@result returns memory required in bytes␊ |
603 | ␉*/␊ |
604 | ␉␊ |
605 | ␉virtual UInt32␉␉ReportHBASpecificTaskDataSize ( void ) = 0;␊ |
606 | ␉␊ |
607 | ␉/*!␊ |
608 | ␉␉@function ReportHBASpecificDeviceDataSize␊ |
609 | ␉␉@abstract Determine memory needed for HBA Device specific use.␊ |
610 | ␉␉@discussion This method is used to retrieve the amount of memory that ␊ |
611 | ␉␉will be allocated in the SCSI Parallel Device for HBA specific use.␊ |
612 | ␉␉@result returns memory required in bytes␊ |
613 | ␉*/␊ |
614 | ␉␊ |
615 | ␉virtual UInt32␉␉ReportHBASpecificDeviceDataSize ( void ) = 0;␊ |
616 | ␉␊ |
617 | ␉/*!␊ |
618 | ␉␉@function DoesHBAPerformDeviceManagement␊ |
619 | ␉␉@abstract Determine if HBA will manage devices.␊ |
620 | ␉␉@discussion This method is used to determine if the HBA will manage ␊ |
621 | ␉␉target device creation and destruction. ␊ |
622 | ␉␉@result return true means objects for target devices will only be ␉␊ |
623 | ␉␉created when the child class calls the CreateTargetForID method.␊ |
624 | ␉*/␊ |
625 | ␉␊ |
626 | ␉virtual bool␉␉DoesHBAPerformDeviceManagement ( void ) = 0;␊ |
627 | ␉␊ |
628 | ␉// ---- Initialize and Terminate methods for the subclass to implement -----␊ |
629 | ␉// The subclass shall not override the IOKit init and terminate methods,␊ |
630 | ␉// but shall instead rely on these methods for initialization and␊ |
631 | ␉// termination.␊ |
632 | ␉␊ |
633 | ␉// This is done to allow for this superclass to manage all IOKit specifics ␊ |
634 | ␉// and to require only a Family specific API to be implemented by the␊ |
635 | ␉// subclass drivers.␊ |
636 | ␉␊ |
637 | ␉/*!␊ |
638 | ␉␉@function InitializeController␊ |
639 | ␉␉@abstract Called to initialize the controller␊ |
640 | ␉␉@discussion It is guaranteed that the InitializeController() will only be ␊ |
641 | ␉␉called once per instantiation. The InitializeController() methods allows ␊ |
642 | ␉␉the subclass driver to do all the necessary initialization required by ␊ |
643 | ␉␉the hardware before it is able to accept requests to execute. All ␊ |
644 | ␉␉necessary allocation of resources should be made during this method ␊ |
645 | ␉␉call. This is the first method that will be called in the subclass.␊ |
646 | ␉␉@result return true means that initialization was successful.␊ |
647 | ␉*/␊ |
648 | ␉␊ |
649 | ␉virtual bool␉InitializeController ( void ) = 0;␊ |
650 | ␉␊ |
651 | ␉/*!␊ |
652 | ␉␉@function TerminateController␊ |
653 | ␉␉@abstract Called to terminate the controller␊ |
654 | ␉␉@discussion It is guaranteed that the TerminateController() will only be ␊ |
655 | ␉␉called once and only after the InitializeController() method and only if ␊ |
656 | ␉␉true was returned in response to the InitializeController() method.␊ |
657 | ␉␉The TerminateController() method allows the subclass to release all ␊ |
658 | ␉␉resources that were acquired for operation of the hardware and shutdown ␊ |
659 | ␉␉all hardware services.␊ |
660 | ␉␉This is the last method of the subclass that will be called before the ␉␉␊ |
661 | ␉␉class is destroyed.␊ |
662 | ␉*/␊ |
663 | ␉␊ |
664 | ␉virtual void␉TerminateController ( void ) = 0;␊ |
665 | ␉␊ |
666 | ␉// ---- Start and Stop methods for the subclass ----␊ |
667 | ␉␊ |
668 | ␉/*!␊ |
669 | ␉␉@function StartController␊ |
670 | ␉␉@abstract Called to start the controller␊ |
671 | ␉␉@discussion The StartController will always be called before any ␊ |
672 | ␉␉requests are sent to the driver for execution. This method is called ␊ |
673 | ␉␉after an initialize to start the services provided by the specific HBA ␊ |
674 | ␉␉driver or called after a StopController call to restart those services. ␊ |
675 | ␉␉After this call completes, all services provided by the HBA driver are ␊ |
676 | ␉␉available to the client.␊ |
677 | ␉␉@result return true means that start was successful.␊ |
678 | ␉*/␊ |
679 | ␉␊ |
680 | ␉virtual bool␉StartController ( void ) = 0;␊ |
681 | ␉␊ |
682 | ␉/*!␊ |
683 | ␉␉@function StopController␊ |
684 | ␉␉@abstract Called to stop the controller␊ |
685 | ␉␉@discussion The StopController method will be called any time that the ␊ |
686 | ␉␉system wants the card to stop accepting requests. ( See StartController ␊ |
687 | ␉␉discussion ). The subclass should disable the hardware interrupt for␊ |
688 | ␉␉the particular controller (if possible) in this method.␊ |
689 | ␉*/␊ |
690 | ␉␊ |
691 | ␉virtual void␉StopController ( void ) = 0;␊ |
692 | ␉␊ |
693 | ␉// ---- Suspend and Resume Methods for the subclass ----␊ |
694 | ␉␊ |
695 | ␉/*!␊ |
696 | ␉␉@function SuspendServices␊ |
697 | ␉␉@abstract Called to suspend controller services␊ |
698 | ␉␉@discussion Method will be called when the system wants to suspend the␊ |
699 | ␉␉services that are provided by the HBA driver. This call is not a reset␊ |
700 | ␉␉and the driver shall retain all state data between this so that if a␊ |
701 | ␉␉ResumeServices call is received, the driver can continue providing␊ |
702 | ␉␉services without a visible difference to the client. The driver may ␊ |
703 | ␉␉receive multiple SuspendServices calls without receiving a ␊ |
704 | ␉␉ResumeServices call and should ignore any after the first until a ␊ |
705 | ␉␉ResumeServices call is received.␊ |
706 | ␉*/␊ |
707 | ␉␊ |
708 | ␉virtual void␉SuspendServices ( void );␊ |
709 | ␉␊ |
710 | ␉/*!␊ |
711 | ␉␉@function ResumeServices␊ |
712 | ␉␉@abstract Called to resume controller services␊ |
713 | ␉␉@discussion Method that will be called to resume services␊ |
714 | ␉␉provided by the driver. ( See SuspendServices discussion )␊ |
715 | ␉*/␊ |
716 | ␉␊ |
717 | ␉virtual void␉ResumeServices ( void );␊ |
718 | ␉␊ |
719 | ␉/*!␊ |
720 | ␉␉@function HandleInterruptRequest␊ |
721 | ␉␉@abstract Handle Interrupt Request␊ |
722 | ␉␉@discussion The HandleInterruptRequest is used to notify an HBA ␊ |
723 | ␉␉specific subclass that an interrupt request needs to be serviced. It is ␊ |
724 | ␉␉called on the workloop (it holds the gate) at secondary interrupt level.␊ |
725 | ␉*/␊ |
726 | ␉␊ |
727 | ␉virtual void␉HandleInterruptRequest ( void ) = 0;␊ |
728 | ␉␊ |
729 | ␉/*!␊ |
730 | ␉␉@function EnableInterrupt␊ |
731 | ␉␉@abstract Enable Interrupt␊ |
732 | ␉␉@discussion Method that the HBA child class can call to enable ␊ |
733 | ␉␉the associated IOInterruptEventSource.␊ |
734 | ␉*/␊ |
735 | ␉␊ |
736 | ␉void␉EnableInterrupt ( void );␊ |
737 | ␉␊ |
738 | ␉/*!␊ |
739 | ␉␉@function DisableInterrupt␊ |
740 | ␉␉@abstract Disable Interrupt␊ |
741 | ␉␉@discussion Method that the HBA child class can call to disable ␊ |
742 | ␉␉the associated IOInterruptEventSource.␊ |
743 | ␉*/␊ |
744 | ␉␊ |
745 | ␉void␉DisableInterrupt ( void );␊ |
746 | ␉␊ |
747 | ␉/*!␊ |
748 | ␉␉@function SignalInterrupt␊ |
749 | ␉␉@abstract Signals that an interrupt has occurred.␊ |
750 | ␉␉@discussion Subclasses of IOSCSIParallelInterfaceController␊ |
751 | ␉␉should call this method in order to get the secondary interrupt␊ |
752 | ␉␉thread scheduled if and only if they will be returning false from␊ |
753 | ␉␉their overriden FilterInterruptRequest() method. See the␊ |
754 | ␉␉discussion for the FilterInterruptRequest() method for more␊ |
755 | ␉␉details.␊ |
756 | ␉␉␊ |
757 | ␉␉NOTE: This method should only be called from within the␊ |
758 | ␉␉FilterInterruptRequest() method and at no other time.␊ |
759 | ␉␉␊ |
760 | ␉␉Available in 10.3.3 or later.␊ |
761 | ␉␉␊ |
762 | ␉*/␊ |
763 | ␉␊ |
764 | ␉void␉SignalInterrupt ( void );␊ |
765 | ␉␊ |
766 | ␉/*!␊ |
767 | ␉␉@function ProcessParallelTask␊ |
768 | ␉␉@abstract Called by client to process a parallel task.␊ |
769 | ␉␉@discussion This method is called to process a parallel task (i.e. put␊ |
770 | ␉␉the command on the bus). The HBA specific sublcass must implement this ␊ |
771 | ␉␉method.␊ |
772 | ␉␉@param parallelRequest A valid SCSIParallelTaskIdentifier.␊ |
773 | ␉␉@result serviceResponse (see <IOKit/scsi/SCSITask.h>)␊ |
774 | ␉*/␊ |
775 | ␉␊ |
776 | ␉virtual SCSIServiceResponse ProcessParallelTask (␊ |
777 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier parallelRequest ) = 0;␊ |
778 | ␉␊ |
779 | ␉/*!␊ |
780 | ␉␉@function CompleteParallelTask␊ |
781 | ␉␉@abstract Parallel Task Completion␊ |
782 | ␉␉@discussion The HBA specific sublcass inherits the CompleteParallelTask() ␊ |
783 | ␉␉method which shall be called when the HBA has completed the processing ␊ |
784 | ␉␉of a parallel task.␊ |
785 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
786 | ␉␉@param completionStatus The status of the SCSI bus.␊ |
787 | ␉␉@param serviceResponse (see <IOKit/scsi/SCSITask.h>)␊ |
788 | ␉*/␊ |
789 | ␉␊ |
790 | ␉void␉CompleteParallelTask (␊ |
791 | ␉␉␉␉␉␉SCSIParallelTaskIdentifier␉parallelRequest,␊ |
792 | ␉␉␉␉␉␉SCSITaskStatus ␉␉␉␉completionStatus,␊ |
793 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
794 | ␉␊ |
795 | ␉␊ |
796 | ␉// Completion routines for the SCSI Task Management functions as described␊ |
797 | ␉// in the SCSI ArchitectureModel - 2 (SAM-2) specification. Each of these␊ |
798 | ␉// correspond to a client request for the specific Task Management functions.␊ |
799 | ␉// If the Controller Child Class completed the request by returning a ␊ |
800 | ␉// SCSIServiceResponse of anything other than kSCSIServiceResponse_Request_In_Process,␊ |
801 | ␉// then the controller class does not need to call the completion member routine.␊ |
802 | ␉// If the controller did not complete the request immediately, then it will␊ |
803 | ␉// need to call the appropriate completion member routine listed here.␊ |
804 | ␉void␉CompleteAbortTask ( ␉␊ |
805 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
806 | ␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
807 | ␉␉␉␉␉␉SCSITaggedTaskIdentifier␉theQ,␊ |
808 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
809 | ␉␊ |
810 | ␉void ␉CompleteAbortTaskSet (␊ |
811 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
812 | ␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
813 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
814 | ␉␊ |
815 | ␉void ␉CompleteClearACA (␊ |
816 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
817 | ␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
818 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
819 | ␉␊ |
820 | ␉void ␉CompleteClearTaskSet (␊ |
821 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
822 | ␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
823 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
824 | ␉␊ |
825 | ␉void ␉CompleteLogicalUnitReset (␊ |
826 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
827 | ␉␉␉␉␉␉SCSILogicalUnitNumber␉␉theL,␊ |
828 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
829 | ␉␊ |
830 | ␉void ␉CompleteTargetReset (␊ |
831 | ␉␉␉␉␉␉SCSITargetIdentifier ␉␉theT,␊ |
832 | ␉␉␉␉␉␉SCSIServiceResponse ␉␉serviceResponse );␊ |
833 | ␉␊ |
834 | ␉/*!␊ |
835 | ␉␉@function NotifyClientsOfBusReset␊ |
836 | ␉␉@abstract Method called to notify clients that a bus reset has occurred.␊ |
837 | ␉␉@discussion This method is used by the HBA child class to inform the ␊ |
838 | ␉␉parent class and any clients that a bus reset has occurred.␊ |
839 | ␉*/␊ |
840 | ␉␊ |
841 | ␉void␉NotifyClientsOfBusReset ( void );␊ |
842 | ␉␊ |
843 | ␉/*!␊ |
844 | ␉␉@function NotifyClientsOfPortStatusChange␊ |
845 | ␉␉@abstract Method called to notify clients of port status change events.␊ |
846 | ␉␉@discussion This method is used by the HBA child class to inform the ␊ |
847 | ␉␉parent class and any clients that a port has changed status.␊ |
848 | ␉*/␊ |
849 | ␉␊ |
850 | ␉void␉NotifyClientsOfPortStatusChange ( SCSIPortStatus newStatus );␊ |
851 | ␉␊ |
852 | ␉/*!␊ |
853 | ␉␉@function GetSCSIDomainIdentifier␊ |
854 | ␉␉@abstract Accessor method to get the SCSI Domain Identifier.␊ |
855 | ␉␉@discussion Accessor method to get the SCSI Domain Identifier.␊ |
856 | ␉␉@result returns SCSI Domain Identifier.␊ |
857 | ␉*/␊ |
858 | ␉␊ |
859 | ␉SInt32␉GetSCSIDomainIdentifier ( void );␊ |
860 | ␉␊ |
861 | ␉/*!␊ |
862 | ␉␉@function GetProvider␊ |
863 | ␉␉@abstract Accessor method to get the IOService which is the controller's␊ |
864 | ␉␉provider.␊ |
865 | ␉␉@discussion Accessor method to get the IOService which is the ␊ |
866 | ␉␉controller's provider.␊ |
867 | ␉␉@result returns pointer to IOService.␊ |
868 | ␉*/␊ |
869 | ␉␊ |
870 | ␉IOService *␉␉GetProvider ( void );␊ |
871 | ␉␊ |
872 | ␉/*!␊ |
873 | ␉␉@function GetWorkLoop␊ |
874 | ␉␉@abstract Accessor method to get the IOWorkLoop associated with this ␊ |
875 | ␉␉HBA.␊ |
876 | ␉␉@discussion Accessor method to get the IOWorkLoop associated with this ␊ |
877 | ␉␉HBA.␊ |
878 | ␉␉@result returns pointer to IOWorkLoop.␊ |
879 | ␉*/␊ |
880 | ␉␊ |
881 | ␉IOWorkLoop *␉GetWorkLoop ( void ) const;␊ |
882 | ␉␊ |
883 | ␉/*!␊ |
884 | ␉␉@function GetCommandGate␊ |
885 | ␉␉@abstract Accessor to get an IOCommandGate associated with the workloop.␊ |
886 | ␉␉@discussion Accessor to get an IOCommandGate associated with the ␊ |
887 | ␉␉workloop.␊ |
888 | ␉␉@result returns pointer to IOCommandGate.␊ |
889 | ␉*/␊ |
890 | ␉␊ |
891 | ␉IOCommandGate *␉␉GetCommandGate ( void );␊ |
892 | ␉␊ |
893 | ␉// ---- SCSI Parallel Task Object Accessors ----␊ |
894 | ␉␊ |
895 | ␉/*!␊ |
896 | ␉␉@function GetSCSITaskIdentifier␊ |
897 | ␉␉@abstract Method to retrieve a SCSITaskIdentifier from a valid ␊ |
898 | ␉␉SCSIParallelTaskIdentifier.␊ |
899 | ␉␉@discussion Method to retrieve a SCSITaskIdentifier from a valid ␊ |
900 | ␉␉SCSIParallelTaskIdentifier.␊ |
901 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
902 | ␉␉@result returns SCSITaskIdentifier that represents the original request ␊ |
903 | ␉␉from the SCSI Application Layer client.␊ |
904 | ␉*/␊ |
905 | ␉␊ |
906 | ␉SCSITaskIdentifier␉GetSCSITaskIdentifier ( ␊ |
907 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
908 | ␉␊ |
909 | ␉/*!␊ |
910 | ␉␉@function GetTargetIdentifier␊ |
911 | ␉␉@abstract Method to get the SCSITargetIdentifier associated with a ␊ |
912 | ␉␉request.␊ |
913 | ␉␉@discussion␉Method to get the SCSITargetIdentifier associated with a ␊ |
914 | ␉␉request.␊ |
915 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
916 | ␉␉@result returns SCSITargetIdentifier ␊ |
917 | ␉*/␊ |
918 | ␉␊ |
919 | ␉SCSITargetIdentifier␉GetTargetIdentifier ( ␊ |
920 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
921 | ␉␊ |
922 | ␉// ---- Methods for Accessing data in the client's SCSI Task Object ----␉␊ |
923 | ␉// Method to retrieve the LUN that identifies the Logical Unit whose Task␊ |
924 | ␉// Set to which this task is to be added.␊ |
925 | ␉␊ |
926 | ␉/*!␊ |
927 | ␉␉@function GetLogicalUnitNumber␊ |
928 | ␉␉@abstract Method to get the logical unit number associated with a ␊ |
929 | ␉␉request.␊ |
930 | ␉␉@discussion Method to get the logical unit number associated with a ␊ |
931 | ␉␉request.␊ |
932 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
933 | ␉␉@result returns a valid 64-bit logical unit number.␊ |
934 | ␉*/␊ |
935 | ␉␊ |
936 | ␉SCSILogicalUnitNumber␉GetLogicalUnitNumber ( ␊ |
937 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
938 | ␉␊ |
939 | ␉/*!␊ |
940 | ␉␉@function GetTaggedTaskIdentifier␊ |
941 | ␉␉@abstract Method to retrieve the SCSI Tagged Task Identifier of the ␊ |
942 | ␉␉task. If the returned value is equal to kSCSIUntaggedTaskIdentifier,␊ |
943 | ␉␉then this task is untagged. ␊ |
944 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
945 | ␉␉@result an SCSITaskAttribute value.␊ |
946 | ␉*/␊ |
947 | ␉␊ |
948 | ␉SCSITaggedTaskIdentifier GetTaggedTaskIdentifier (␊ |
949 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier␉parallelTask );␊ |
950 | ␉␊ |
951 | ␉/*!␊ |
952 | ␉␉@function GetTaskAttribute␊ |
953 | ␉␉@abstract Method to retrieve the SCSI Task Attribute of the task ␊ |
954 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
955 | ␉␉@result an SCSITaskAttribute value.␊ |
956 | ␉*/␊ |
957 | ␉␊ |
958 | ␉SCSITaskAttribute␉␉GetTaskAttribute (␊ |
959 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier␉parallelTask );␊ |
960 | ␉␊ |
961 | ␉/*!␊ |
962 | ␉␉@function GetCommandDescriptorBlockSize␊ |
963 | ␉␉@abstract Method to retrieve the size of the SCSI Command Descriptor ␊ |
964 | ␉␉Block (CDB).␊ |
965 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
966 | ␉␉@result returns the size of the SCSI Command Descriptor Block in bytes.␊ |
967 | ␉*/␊ |
968 | ␉␊ |
969 | ␉UInt8␉GetCommandDescriptorBlockSize ( ␊ |
970 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
971 | ␉␊ |
972 | ␉/*!␊ |
973 | ␉␉@function GetCommandDescriptorBlock␊ |
974 | ␉␉@abstract Method to retrieve the SCSI Command Descriptor Block (CDB).␊ |
975 | ␉␉@discussion This will always return a 16 Byte CDB. If the Protocol Layer ␊ |
976 | ␉␉driver does not support 16 Byte CDBs, it will have to create a local ␊ |
977 | ␉␉SCSICommandDescriptorBlock variable to get the CDB data and then ␊ |
978 | ␉␉transfer the needed bytes from there.␊ |
979 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
980 | ␉␉@param cdbData is a SCSICommandDescriptorBlock pointer to 16 byte CDB␊ |
981 | ␉␉@result returns true if data was copied to cdbData pointer␊ |
982 | ␉*/␊ |
983 | ␉␊ |
984 | ␉bool␉GetCommandDescriptorBlock (␊ |
985 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉␉parallelTask,␊ |
986 | ␉␉␉␉␉␉␉SCSICommandDescriptorBlock * ␉cdbData );␊ |
987 | ␉␊ |
988 | ␉/*!␊ |
989 | ␉␉@function GetDataTransferDirection␊ |
990 | ␉␉@abstract Retrieves the data transfer direction for any data associated␊ |
991 | ␉␉with the request.␊ |
992 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
993 | ␉␉@result One of the valid data transfer directions described in ␊ |
994 | ␉␉<IOKit/scsi/SCSITask.h>␊ |
995 | ␉*/␊ |
996 | ␉␊ |
997 | ␉UInt8␉GetDataTransferDirection ( SCSIParallelTaskIdentifier parallelTask );␊ |
998 | ␉␊ |
999 | ␉/*!␊ |
1000 | ␉␉@function GetRequestedDataTransferCount␊ |
1001 | ␉␉@abstract Retrieves the requested data transfer count for any data ␊ |
1002 | ␉␉associated with the request.␊ |
1003 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1004 | ␉␉@result The requested data transfer count in bytes.␊ |
1005 | ␉*/␊ |
1006 | ␉␊ |
1007 | ␉UInt64␉GetRequestedDataTransferCount ( ␊ |
1008 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1009 | ␉␊ |
1010 | ␉/*!␊ |
1011 | ␉␉@function GetRealizedDataTransferCount␊ |
1012 | ␉␉@abstract Retrieves the realized data transfer count for any data ␊ |
1013 | ␉␉associated with the request.␊ |
1014 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1015 | ␉␉@result The realized data transfer count in bytes.␊ |
1016 | ␉*/␊ |
1017 | ␉␊ |
1018 | ␉UInt64␉GetRealizedDataTransferCount (␊ |
1019 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1020 | ␉␊ |
1021 | ␉/*!␊ |
1022 | ␉␉@function SetRealizedDataTransferCount␊ |
1023 | ␉␉@abstract Sets the realized data transfer count in bytes.␊ |
1024 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1025 | ␉␉@param realizedTransferCountInBytes is the number of bytes actually ␊ |
1026 | ␉␉transferred.␊ |
1027 | ␉␉@result true means the data transfer count was successfully set.␊ |
1028 | ␉*/␊ |
1029 | ␉␊ |
1030 | ␉bool␉SetRealizedDataTransferCount ( ␊ |
1031 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1032 | ␉␉␉␉␉␉␉UInt64 ␉␉realizedTransferCountInBytes );␊ |
1033 | ␉␊ |
1034 | ␉/*!␊ |
1035 | ␉␉@function IncrementRealizedDataTransferCount␊ |
1036 | ␉␉@abstract Increments the realized data transfer count. This method is␊ |
1037 | ␉␉helpful for when the HBA has to do multiple passes of DMA because there ␊ |
1038 | ␉␉are more scatter-gather elements than it can process in one pass.␊ |
1039 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1040 | ␉␉@param realizedTransferCountInBytes is the number of bytes to add to the␊ |
1041 | ␉␉realized data count for the task.␊ |
1042 | ␉*/␊ |
1043 | ␉␊ |
1044 | ␉void␉IncrementRealizedDataTransferCount (␊ |
1045 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1046 | ␉␉␉␉␉␉␉UInt64 ␉␉realizedTransferCountInBytes );␊ |
1047 | ␉␊ |
1048 | ␉/*!␊ |
1049 | ␉␉@function GetDataBuffer␊ |
1050 | ␉␉@abstract Method to retrieve client buffer from the request.␊ |
1051 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1052 | ␉␉@result returns pointer to an IOMemoryDescriptor which represents the ␊ |
1053 | ␉␉buffer.␊ |
1054 | ␉*/␊ |
1055 | ␉␊ |
1056 | ␉IOMemoryDescriptor * GetDataBuffer ( ␊ |
1057 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1058 | ␉␊ |
1059 | ␉/*!␊ |
1060 | ␉␉@function GetDataBufferOffset␊ |
1061 | ␉␉@abstract Method to retrieve offset into client buffer at which to start␊ |
1062 | ␉␉processing.␊ |
1063 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1064 | ␉␉@result returns offset in bytes␊ |
1065 | ␉*/␊ |
1066 | ␉␊ |
1067 | ␉UInt64␉GetDataBufferOffset ( SCSIParallelTaskIdentifier parallelTask );␊ |
1068 | ␊ |
1069 | ␉/*!␊ |
1070 | ␉␉@function GetDMACommand␊ |
1071 | ␉␉@abstract Method to retrieve a pointer to an IODMACommand from the request.␊ |
1072 | ␉␉@discussion For devices utilizing DMA, the IODMACommand object should be ␊ |
1073 | ␉␉obtained via GetDMACommand(). The subclass is responsible for calling prepare()␊ |
1074 | ␉␉on the IODMACommand object using the proper offset obtained via GetDataBufferOffset()␊ |
1075 | ␉␉and correct size obtained via GetRequestedDataTransferCount(). The subclass␊ |
1076 | ␉␉is further responsible for calling complete() on the IODMACommand object once␊ |
1077 | ␉␉all DMA operations have finished.␊ |
1078 | ␉␉NB: Subclasses should not call IODMACommand::setMemoryDescriptor().␊ |
1079 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1080 | ␉␉@result returns pointer to an IODMACommand which is used in conjunction␊ |
1081 | ␉␉with the task.␊ |
1082 | ␉*/␊ |
1083 | ␉␊ |
1084 | ␉IODMACommand * GetDMACommand ( ␊ |
1085 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1086 | ␉␊ |
1087 | ␉/*!␊ |
1088 | ␉␉@function GetTimeoutDuration␊ |
1089 | ␉␉@abstract Method to retrieve the timeout duration in milliseconds for a ␊ |
1090 | ␉␉request.␊ |
1091 | ␉␉@discussion Method to retrieve the timeout duration in milliseconds for␊ |
1092 | ␉␉a request. A value of zero represents an infinite timeout, or on ␊ |
1093 | ␉␉hardware where infinite timeouts are not possible, substitute the ␊ |
1094 | ␉␉longest timeout possible.␊ |
1095 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1096 | ␉␉@result returns timeout duration in milliseconds␊ |
1097 | ␉*/␊ |
1098 | ␉␊ |
1099 | ␉UInt32␉GetTimeoutDuration ( SCSIParallelTaskIdentifier parallelTask );␊ |
1100 | ␊ |
1101 | ␉/*!␊ |
1102 | ␉␉@function SetAutoSenseData␊ |
1103 | ␉␉@abstract Method to set the auto sense data buffer associated with a ␊ |
1104 | ␉␉request.␊ |
1105 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1106 | ␉␉@param newSensedata pointer to auto sense data buffer␊ |
1107 | ␉␉@result returns true if data in newSenseData was succesfully into the ␊ |
1108 | ␉␉task object␊ |
1109 | ␉*/␊ |
1110 | ␉␊ |
1111 | ␉bool␉SetAutoSenseData ( ␊ |
1112 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1113 | ␉␉␉␉␉␉␉SCSI_Sense_Data * ␉␉␉newSenseData,␊ |
1114 | ␉␉␉␉␉␉␉UInt8␉␉␉␉␉␉senseDataSize );␊ |
1115 | ␉␊ |
1116 | ␉/*!␊ |
1117 | ␉␉@function GetAutoSenseData␊ |
1118 | ␉␉@abstract Method to retrieve auto sense data buffer associated with a ␊ |
1119 | ␉␉request.␊ |
1120 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1121 | ␉␉@param receivingBuffer pointer to auto sense data buffer␊ |
1122 | ␉␉@result returns true if successfully copied data into receivingBuffer␊ |
1123 | ␉*/␊ |
1124 | ␉␊ |
1125 | ␉bool␉GetAutoSenseData ( ␊ |
1126 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1127 | ␉␉␉␉␉␉␉SCSI_Sense_Data * ␉␉␉receivingBuffer,␊ |
1128 | ␉␉␉␉␉␉␉UInt8␉␉␉␉␉␉senseDataSize );␊ |
1129 | ␉␊ |
1130 | ␉/*!␊ |
1131 | ␉␉@function GetAutoSenseDataSize␊ |
1132 | ␉␉@abstract Method to retrieve auto sense data buffer size associated with a ␊ |
1133 | ␉␉request.␊ |
1134 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1135 | ␉␉@result returns Size of auto sense data buffer.␊ |
1136 | ␉*/␊ |
1137 | ␉␊ |
1138 | ␉UInt8␉GetAutoSenseDataSize ( ␊ |
1139 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1140 | ␉␊ |
1141 | ␉␊ |
1142 | ␉/*!␊ |
1143 | ␉␉@function GetSCSIParallelFeatureNegotiation␊ |
1144 | ␉␉@abstract Method to retrieve the requested value for negotiation of the.␊ |
1145 | ␉␉@discussion Query as to whether the SCSI Parallel Device object has ␊ |
1146 | ␉␉negotiated wide data transfers.␊ |
1147 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1148 | ␉␉@result A valid SCSIParallelFeatureControl.␊ |
1149 | ␉*/␊ |
1150 | ␉␊ |
1151 | ␉SCSIParallelFeatureRequest␉␉GetSCSIParallelFeatureNegotiation ( ␊ |
1152 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1153 | ␉␉␉␉␉␉␉SCSIParallelFeature ␉␉requestedFeature );␊ |
1154 | ␉␊ |
1155 | ␉/*!␊ |
1156 | ␉␉@function GetSCSIParallelFeatureNegotiationCount␊ |
1157 | ␉␉@abstract Method to retrieve the number of requested negotiations.␊ |
1158 | ␉␉@discussion Query as to the number of SCSI Parallel Features that are␊ |
1159 | ␉␉requested to either be negotitated or cleared. These are all features␊ |
1160 | ␉␉that are set to either kSCSIParallelFeature_AttemptNegotiation or ␊ |
1161 | ␉␉kSCSIParallelFeature_ClearNegotiation. If the return value is zero,␊ |
1162 | ␉␉then all features are set to kSCSIParallelFeature_NoNegotiation␊ |
1163 | ␉␉and all feature negotiations are to remain as they currently exist.␊ |
1164 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1165 | ␉␉@result an unsigned integer up to 64 bits in size.␊ |
1166 | ␉*/␊ |
1167 | ␉␊ |
1168 | ␉UInt64␉␉GetSCSIParallelFeatureNegotiationCount ( ␊ |
1169 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask);␊ |
1170 | ␉␊ |
1171 | ␉/*!␊ |
1172 | ␉␉@function SetSCSIParallelFeatureNegotiationResult␊ |
1173 | ␉␉@abstract Method to set the wide data transfer negotiation result.␊ |
1174 | ␉␉@discussion Method to set the wide data transfer negotiation result.␊ |
1175 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1176 | ␉␉@param requestedFeature The SCSIParallelFeature that the has been set to ␉␊ |
1177 | ␉␉newResult.␊ |
1178 | ␉␉@param newResult A valid SCSIParallelFeatureResult value.␊ |
1179 | ␉*/␊ |
1180 | ␉␊ |
1181 | ␉void␉␉SetSCSIParallelFeatureNegotiationResult ( ␊ |
1182 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1183 | ␉␉␉␉␉␉␉SCSIParallelFeature ␉␉requestedFeature, ␊ |
1184 | ␉␉␉␉␉␉␉SCSIParallelFeatureResult ␉newResult );␊ |
1185 | ␉␊ |
1186 | ␉/*!␊ |
1187 | ␉␉@function GetSCSIParallelFeatureNegotiationResult␊ |
1188 | ␉␉@abstract Method to retrieve the result of any wide transfer ␊ |
1189 | ␉␉negotiations.␊ |
1190 | ␉␉@discussion Query as to whether the SCSI Parallel Controller object has ␊ |
1191 | ␉␉negotiated wide data transfers.␊ |
1192 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1193 | ␉␉@result A valid SCSIParallelFeatureResult.␊ |
1194 | ␉*/␊ |
1195 | ␉␊ |
1196 | ␉SCSIParallelFeatureResult␉␉GetSCSIParallelFeatureNegotiationResult ( ␊ |
1197 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1198 | ␉␉␉␉␉␉␉SCSIParallelFeature ␉␉requestedFeature );␊ |
1199 | ␉␊ |
1200 | ␉/*!␊ |
1201 | ␉␉@function GetSCSIParallelFeatureNegotiationResultCount␊ |
1202 | ␉␉@abstract Method to retrieve the number of changed negotiations.␊ |
1203 | ␉␉@discussion Query as to the number of SCSI Parallel Features that have␊ |
1204 | ␉␉been changed to either negotitated or cleared. These are all features␊ |
1205 | ␉␉that are set to either kSCSIParallelFeature_NegotitiationCleared or ␊ |
1206 | ␉␉kSCSIParallelFeature_NegotitiationSuccess. If the return value is zero,␊ |
1207 | ␉␉then all features are set to kSCSIParallelFeature_NegotitiationUnchanged.␊ |
1208 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1209 | ␉␉@result an unsigned integer up to 64 bits in size.␊ |
1210 | ␉*/␊ |
1211 | ␉␊ |
1212 | ␉UInt64␉␉GetSCSIParallelFeatureNegotiationResultCount ( ␊ |
1213 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask);␊ |
1214 | ␉␊ |
1215 | ␉// Controller Task Identifier related member routines␊ |
1216 | ␉␊ |
1217 | ␉/*!␊ |
1218 | ␉␉@function SetControllerTaskIdentifier␊ |
1219 | ␉␉@abstract Method to set the Controller Task Identifier.␊ |
1220 | ␉␉@discussion This method allows the Controller Child Class␊ |
1221 | ␉␉driver to set a unique identifier to associate with the specified␊ |
1222 | ␉␉SCSI Parallel Task. This identifier is designed to be used by␊ |
1223 | ␉␉controllers that do not have access to the LUN and Tag information␊ |
1224 | ␉␉when notified by the HBA that a request has completed.␊ |
1225 | ␉␉If the kSCSIParallelTaskControllerIDQueueHead is used, this␊ |
1226 | ␉␉member routine will return the first Task on the queue.␊ |
1227 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1228 | ␉␉@param newIdentifier unsigned 64 bit integer token.␊ |
1229 | ␉␉@result none␊ |
1230 | ␉*/␊ |
1231 | ␉␊ |
1232 | ␉void␉SetControllerTaskIdentifier (␊ |
1233 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1234 | ␉␉␉␉␉␉␉UInt64 ␉␉␉␉␉␉newIdentifier );␊ |
1235 | ␉␊ |
1236 | ␉UInt64␉GetControllerTaskIdentifier (␊ |
1237 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask);␊ |
1238 | ␉␊ |
1239 | ␉␊ |
1240 | ␉// The HBA Data related fields␊ |
1241 | ␉␊ |
1242 | ␉/*!␊ |
1243 | ␉␉@function GetHBADataSize␊ |
1244 | ␉␉@abstract Method to retrieve the HBA Data Size in bytes.␊ |
1245 | ␉␉@discussion Method to retrieve the HBA Data Size in bytes.␊ |
1246 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1247 | ␉␉@result returns HBA Data size in bytes.␊ |
1248 | ␉*/␊ |
1249 | ␉␊ |
1250 | ␉UInt32␉GetHBADataSize ( SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1251 | ␉␊ |
1252 | ␉/*!␊ |
1253 | ␉␉@function GetHBADataPointer␊ |
1254 | ␉␉@abstract Method to retrieve the HBA Data pointer.␊ |
1255 | ␉␉@discussion Method to retrieve the HBA Data pointer.␊ |
1256 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1257 | ␉␉@result returns pointer to buffer for HBA specific data, NULL if ␊ |
1258 | ␉␉none found or GetHBADataSize() returns zero.␊ |
1259 | ␉*/␊ |
1260 | ␉␊ |
1261 | ␉void *␉GetHBADataPointer ( SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1262 | ␉␊ |
1263 | ␉/*!␊ |
1264 | ␉␉@function GetHBADataDescriptor␊ |
1265 | ␉␉@abstract Method to retrieve the IOMemoryDescriptor associated with␊ |
1266 | ␉␉the HBA Data.␊ |
1267 | ␉␉@discussion Method to retrieve the IOMemoryDescriptor associated with␊ |
1268 | ␉␉the HBA Data.␊ |
1269 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1270 | ␉␉@result returns pointer to an IOMemoryDescriptor that wraps the HBA ␊ |
1271 | ␉␉specific data buffer, NULL if none found or GetHBADataSize() returns zero.␊ |
1272 | ␉*/␊ |
1273 | ␉␊ |
1274 | ␉IOMemoryDescriptor *␉GetHBADataDescriptor (␊ |
1275 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier ␉parallelTask );␊ |
1276 | ␉␊ |
1277 | ␉// ---- SCSI Parallel Device Object Accessors ----␊ |
1278 | ␉␊ |
1279 | ␉// The HBA Data related fields␊ |
1280 | ␉␊ |
1281 | ␉/*!␊ |
1282 | ␉␉@function GetHBATargetDataSize␊ |
1283 | ␉␉@abstract Method to retrieve the HBA Data Size in bytes.␊ |
1284 | ␉␉@discussion Method to retrieve the HBA Data Size in bytes.␊ |
1285 | ␉␉@param targetDevice A valid SCSITargetIdentifier.␊ |
1286 | ␉␉@result returns HBA Data size in bytes.␊ |
1287 | ␉*/␊ |
1288 | ␉␊ |
1289 | ␉UInt32␉GetHBATargetDataSize ( SCSITargetIdentifier ␉targetID );␊ |
1290 | ␉␊ |
1291 | ␉/*!␊ |
1292 | ␉␉@function GetHBATargetDataPointer␊ |
1293 | ␉␉@abstract Method to retrieve the HBA Data pointer.␊ |
1294 | ␉␉@discussion Method to retrieve the HBA Data pointer.␊ |
1295 | ␉␉@param targetDevice A valid SCSITargetIdentifier.␊ |
1296 | ␉␉@result returns pointer to buffer for HBA specific data, NULL if ␊ |
1297 | ␉␉none found or GetHBADataSize is zero.␊ |
1298 | ␉*/␊ |
1299 | ␉␊ |
1300 | ␉void *␉GetHBATargetDataPointer ( SCSITargetIdentifier ␉targetID );␊ |
1301 | ␉␊ |
1302 | ␉␊ |
1303 | #if 0␊ |
1304 | #pragma mark -␊ |
1305 | #pragma mark Additional Child Class APIs␊ |
1306 | #endif␊ |
1307 | ␉␊ |
1308 | ␉␊ |
1309 | ␉// ---- Timeout Related Methods ----␊ |
1310 | ␉␊ |
1311 | ␉/*!␊ |
1312 | ␉␉@function SetTimeoutForTask␊ |
1313 | ␉␉@abstract Method to set the timeout duration in milliseconds for a ␊ |
1314 | ␉␉request.␊ |
1315 | ␉␉@discussion Method to set the timeout duration in milliseconds for a ␊ |
1316 | ␉␉request.␊ |
1317 | ␉␉@param parallelTask A valid SCSIParallelTaskIdentifier.␊ |
1318 | ␉␉@param timeoutOverride A timeout value in milliseconds in case the␊ |
1319 | ␉␉HBA driver wishes to override the default value provided in the␊ |
1320 | ␉␉parallelTask.␊ |
1321 | ␉*/␊ |
1322 | ␉␊ |
1323 | ␉void␉SetTimeoutForTask ( SCSIParallelTaskIdentifier ␉parallelTask,␊ |
1324 | ␉␉␉␉␉␉␉␉UInt32␉␉␉␉␉␉timeoutOverride = 0 );␊ |
1325 | ␉␊ |
1326 | ␉/*!␊ |
1327 | ␉␉@function HandleTimeout␊ |
1328 | ␉␉@abstract Method to handle command timeouts.␊ |
1329 | ␉␉@discussion Method to handle command timeouts. This should␊ |
1330 | ␉␉be overridden by the child class in order to clean up HBA␊ |
1331 | ␉␉specific structures after a timeout has occurred. This method␊ |
1332 | ␉␉is called on the workloop (it holds the gate).␊ |
1333 | ␉␉@param parallelRequest A valid SCSIParallelTaskIdentifier.␊ |
1334 | ␉*/␊ |
1335 | ␉␊ |
1336 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 9 );␊ |
1337 | ␉␊ |
1338 | ␉virtual void␉␉HandleTimeout (␊ |
1339 | ␉␉␉␉␉␉␉SCSIParallelTaskIdentifier parallelRequest );␊ |
1340 | ␉␊ |
1341 | ␉␊ |
1342 | ␉// ---- Filter Interrupt ----␊ |
1343 | ␉␊ |
1344 | ␉/*!␊ |
1345 | ␉␉@function FilterInterruptRequest␊ |
1346 | ␉␉@abstract Filter method called at primary interrupt time.␊ |
1347 | ␉␉@discussion Filter method called at primary interrupt time.␊ |
1348 | ␉␉This should only be overridden by the child class in order␊ |
1349 | ␉␉to determine if an interrupt occurred for this controller instance.␊ |
1350 | ␉␉Since all work occurs at primary interrupt time, this routine␊ |
1351 | ␉␉should be quick and efficient and defer as much processing as␊ |
1352 | ␉␉possible to the HandleInterruptRequest() method.␊ |
1353 | ␉␉␊ |
1354 | ␉␉NOTE: Unlike the HandleInterruptRequest() and HandleTimeout()␊ |
1355 | ␉␉methods, FilterInterruptRequest() is NOT called with the␊ |
1356 | ␉␉workloop lock held.␊ |
1357 | ␉␉␊ |
1358 | ␉␉If the value returned by FilterInterruptRequest() is true, the␊ |
1359 | ␉␉secondary interrupt thread will be scheduled and the hardware␊ |
1360 | ␉␉interrupt line will be disabled. If the controller instance shares␊ |
1361 | ␉␉that interrupt line with other devices, it can cause large␊ |
1362 | ␉␉interrupt latencies. If the controller instance can disable the␊ |
1363 | ␉␉interrupt in the chip itself, the following can be done to reduce␊ |
1364 | ␉␉interrupt latencies:␊ |
1365 | ␉␉␊ |
1366 | ␉␉- Interrupt occurs␊ |
1367 | ␉␉- FilterInterruptRequest() method is called.␊ |
1368 | ␉␉␉- If the interrupt is not for this controller, return false␊ |
1369 | ␉␉␉ immediately.␊ |
1370 | ␉␉␉- If the interrupt is for this controller, and the controller␊ |
1371 | ␉␉␉ can disable interrupts for this chip, the controller should␊ |
1372 | ␉␉␉ disable the interrupts for this chip, call SignalInterrupt(),␊ |
1373 | ␉␉␉ and return false. This causes the secondary interrupt thread␊ |
1374 | ␉␉␉ to get scheduled, yet does not disable the interrupt line for␊ |
1375 | ␉␉␉ all devices tied to that interrupt. This effectively allows␊ |
1376 | ␉␉␉ other devices to process their interrrupts, thus reducing␊ |
1377 | ␉␉␉ interrupt latency for those devices.␊ |
1378 | ␉␉- HandleInterruptRequest() method is called.␊ |
1379 | ␉␉␉- Controller processes interrupt and completes I/O requests.␊ |
1380 | ␉␉␉- Controller re-enables interrupts for the device.␊ |
1381 | ␉␉␊ |
1382 | ␉␉NOTE: If you use this approach, the interrupting condition MUST be␊ |
1383 | ␉␉cleared from the hardware, otherwise an infinite process interrupt␊ |
1384 | ␉␉loop will occur.␊ |
1385 | ␉␉␊ |
1386 | ␉␉If the controller cannot disable interrupts on the chip, it should␊ |
1387 | ␉␉simply return true if an interrupt has occurred for its device.␊ |
1388 | ␉␉␊ |
1389 | ␉␉@result True if the hardware interrupt line should be disabled,␊ |
1390 | ␉␉otherwise false.␊ |
1391 | ␉*/␊ |
1392 | ␉␊ |
1393 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 10 );␊ |
1394 | ␉␊ |
1395 | ␉virtual bool␉␉FilterInterruptRequest ( void );␊ |
1396 | ␉␊ |
1397 | ␉/*!␊ |
1398 | ␉␉@function InitializeDMASpecification␊ |
1399 | ␉␉@abstract Called to initialize an IODMACommand with a DMA specification.␊ |
1400 | ␉␉@param command A pointer to a valid IODMACommand object. Subclasses␊ |
1401 | ␉␉should override this method and call IODMACommand::initWithSpecification()␊ |
1402 | ␉␉supplying the proper arguments to that method based on the DMA strategy.␊ |
1403 | ␉␉@result boolean value indicating success or failure.␊ |
1404 | ␉*/␊ |
1405 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 11 );␊ |
1406 | ␉␊ |
1407 | ␉virtual bool␉InitializeDMASpecification ( IODMACommand * command );␊ |
1408 | ␉␊ |
1409 | ␉/*!␊ |
1410 | ␉␉@function CreateDeviceInterrupt␊ |
1411 | ␉␉@abstract Called to create an IOInterruptEventSource for the device. Subclasses␊ |
1412 | ␉␉may wish to use a different interrupt index than 0 (e.g. for using PCI Message␊ |
1413 | ␉␉Signaled Interrupts) or might not need an interrupt at all (virtual HBA).␊ |
1414 | ␉␉@param action A pointer to the action routine that should be passed to either␊ |
1415 | ␉␉IOInterruptEventSource::interruptEventSource() or␊ |
1416 | ␉␉IOFilterInterruptEventSource::filterInterruptEventSource as the method to call␊ |
1417 | ␉␉when an interrupt occurs for the device (sometimes called the "deferred procedure call"␊ |
1418 | ␉␉or the "secondary context method". By passing this routine along, it will␊ |
1419 | ␉␉properly wire up the HandleInterruptRequest() method you should override to handle␊ |
1420 | ␉␉interrupts.␊ |
1421 | ␉␉@param filter A pointer to the filter routine that should be passed to␊ |
1422 | ␉␉IOFilterInterruptEventSource::filterInterruptEventSource as the method to call␊ |
1423 | ␉␉at primary interrupt time when an interrupt occurs for the device.␊ |
1424 | ␉␉By passing this routine along, it will properly wire up the␊ |
1425 | ␉␉FilterInterruptRequest() method you may override to handle primary interrupts.␊ |
1426 | ␉␉@result IOInterruptEventSource. May return NULL if and only if there is no␊ |
1427 | ␉␉hardware interrupt associated with this device.␊ |
1428 | ␉*/␊ |
1429 | ␉OSMetaClassDeclareReservedUsed ( IOSCSIParallelInterfaceController, 12 );␊ |
1430 | ␉␊ |
1431 | ␉virtual IOInterruptEventSource *␉CreateDeviceInterrupt (␊ |
1432 | ␉␉␉␉␉␉␉␉␉␉␉IOInterruptEventSource::Action␉␉␉action,␊ |
1433 | ␉␉␉␉␉␉␉␉␉␉␉IOFilterInterruptEventSource::Filter␉filter,␊ |
1434 | ␉␉␉␉␉␉␉␉␉␉␉IOService *␉␉␉␉␉␉␉␉provider );␊ |
1435 | ␉␊ |
1436 | ␉// Padding for the Child Class API␊ |
1437 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 13 );␊ |
1438 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 14 );␊ |
1439 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 15 );␊ |
1440 | ␉OSMetaClassDeclareReservedUnused ( IOSCSIParallelInterfaceController, 16 );␊ |
1441 | ␉␊ |
1442 | ␉␊ |
1443 | #if 0␊ |
1444 | #pragma mark -␊ |
1445 | #pragma mark Internal Use Only␊ |
1446 | #endif␊ |
1447 | ␉␊ |
1448 | private:␊ |
1449 | ␉␊ |
1450 | ␉// binary compatibility instance variable expansion␊ |
1451 | ␉struct ExpansionData { };␊ |
1452 | ␉ExpansionData * fIOSCSIParallelInterfaceControllerExpansionData;␊ |
1453 | ␉␊ |
1454 | ␉IOService *␉␉␉␉␉fProvider;␊ |
1455 | ␉OSSet *␉␉␉␉␉␉fClients;␊ |
1456 | ␉␊ |
1457 | ␉static SInt32␉␉␉␉fSCSIParallelDomainCount;␊ |
1458 | ␉SInt32␉␉␉␉␉␉fSCSIDomainIdentifier;␊ |
1459 | ␉␊ |
1460 | ␉// The HBA attributes␊ |
1461 | ␉SCSIInitiatorIdentifier␉␉fInitiatorIdentifier;␊ |
1462 | ␉␊ |
1463 | ␉// The maximum SCSI Device Identifier support by the HBA␊ |
1464 | ␉// This is retreived from the child class via the ␊ |
1465 | ␉SCSIDeviceIdentifier␉␉fHighestSupportedDeviceID;␊ |
1466 | ␉␊ |
1467 | ␉// The total number of tasks that the HBA can proccess at a time.␊ |
1468 | ␉// This is retrieved from the child class via ReportMaximumTaskCount␊ |
1469 | ␉UInt32␉␉␉␉␉␉fSupportedTaskCount;␊ |
1470 | ␉␊ |
1471 | ␉// The Number of requests that are currently outstanding for the current␊ |
1472 | ␉// instantiation.␊ |
1473 | ␉UInt16␉␉␉␉␉␉fOutstandingRequests;␊ |
1474 | ␉␊ |
1475 | ␉// The member variable to indicate if the current instantiation has been␊ |
1476 | ␉// succesfully intialized.␊ |
1477 | ␉bool␉␉␉␉␉␉fHBAHasBeenInitialized;␊ |
1478 | ␉␊ |
1479 | ␉// The member variable to indicate if the current instantiation is running.␊ |
1480 | ␉// A true means that the last or only Start call made was successful. A␊ |
1481 | ␉// false value means that either a successful Start has not been made or a␊ |
1482 | ␉// Stop call has been made.␊ |
1483 | ␉bool␉␉␉␉␉␉fHBACanAcceptClientRequests;␊ |
1484 | ␉␊ |
1485 | ␉// The pool for the available SCSI Parallel Task objects␊ |
1486 | ␉IOCommandPool *␉␉␉␉fParallelTaskPool;␊ |
1487 | ␉␊ |
1488 | ␉// WorkLoop variables␊ |
1489 | ␉IOWorkLoop *␉␉␉␉fWorkLoop;␊ |
1490 | ␉IOTimerEventSource *␉␉fTimerEvent;␊ |
1491 | ␉IOInterruptEventSource *␉fDispatchEvent;␊ |
1492 | ␉␊ |
1493 | ␉IOCommandGate *␉␉␉␉fControllerGate;␊ |
1494 | ␉␊ |
1495 | ␉bool␉␉␉␉␉␉AllocateSCSIParallelTasks ( void );␊ |
1496 | ␉void␉␉␉␉␉␉DeallocateSCSIParallelTasks ( void );␊ |
1497 | ␉␊ |
1498 | ␉IOWorkLoop *␉␉␉␉getWorkLoop ( void ) const;␊ |
1499 | ␉bool ␉␉␉␉␉␉CreateWorkLoop ( IOService * provider );␊ |
1500 | ␉void ␉␉␉␉␉␉ReleaseWorkLoop ( void );␊ |
1501 | ␉␊ |
1502 | ␉// SCSI Parallel Device List␊ |
1503 | ␉// The SCSI Parallel Device List will consist of 16 elements to represent ␊ |
1504 | ␉// identifiers that end in 0h through Fh. Each array element will point␊ |
1505 | ␉// to a device object that represents the beginning of a linked list of␊ |
1506 | ␉// device objects. By using an array of linked lists, the traversal time␊ |
1507 | ␉// to find an object on a bus that supports a large number of devices, such␊ |
1508 | ␉// as Fibre Channel, will be significantly lower than having to walk a list ␊ |
1509 | ␉// that is comprised of all devices on the bus. For parallel wide and ␊ |
1510 | ␉// narrow busses, which support 16 and 8 devices respectively, this will act ␊ |
1511 | ␉// like a simple array of device objects.␊ |
1512 | ␉enum␊ |
1513 | ␉{␊ |
1514 | ␉␉kSCSIParallelDeviceListArrayCount ␉= 16,␊ |
1515 | ␉␉kSCSIParallelDeviceListIndexMask␉= 0x0F␊ |
1516 | ␉};␊ |
1517 | ␉␊ |
1518 | ␉IOSimpleLock * ␉␉␉␉␉fDeviceLock;␊ |
1519 | ␉IOSCSIParallelInterfaceDevice *␉␊ |
1520 | ␉␉␉␉␉fParallelDeviceList[kSCSIParallelDeviceListArrayCount];␊ |
1521 | ␉␊ |
1522 | ␉void␉␉␉InitializeDeviceList ( void );␊ |
1523 | ␉void␉␉␉AddDeviceToTargetList ( ␊ |
1524 | ␉␉␉␉␉␉␉IOSCSIParallelInterfaceDevice *␉newDevice );␊ |
1525 | ␉void␉␉␉RemoveDeviceFromTargetList ( ␊ |
1526 | ␉␉␉␉␉␉␉IOSCSIParallelInterfaceDevice * victimDevice );␊ |
1527 | ␉␊ |
1528 | ␉// The Interrupt Service Routine for the controller.␊ |
1529 | ␉static void␉␉ServiceInterrupt (␊ |
1530 | ␉␉␉␉␉␉␉OSObject *␉␉␉␉␉theObject, ␊ |
1531 | ␉␉␉␉␉␉␉IOInterruptEventSource *␉theSource,␊ |
1532 | ␉␉␉␉␉␉␉int␉␉␉␉␉␉␉count );␊ |
1533 | ␉␊ |
1534 | ␉static void␉␉TimeoutOccurred ( OSObject * owner, IOTimerEventSource * sender );␊ |
1535 | ␉␊ |
1536 | ␉static bool␉␉FilterInterrupt (␊ |
1537 | ␉␉␉␉␉␉␉OSObject *␉␉␉␉␉␉theObject,␊ |
1538 | ␉␉␉␉␉␉␉IOFilterInterruptEventSource *␉theSource );␊ |
1539 | ␉␊ |
1540 | ␉// IOService support methods␊ |
1541 | ␉// These shall not be overridden by the HBA child classes.␊ |
1542 | ␉bool␉␉␉start ( IOService * ␉␉␉␉provider );␊ |
1543 | ␉void␉␉␉stop ( ␉IOService * ␉␉␉␉provider );␊ |
1544 | ␊ |
1545 | ␊ |
1546 | protected:␊ |
1547 | ␉␊ |
1548 | ␉// These may be overriden by the HBA child classes if necessary, but should␊ |
1549 | ␉// call the superclass implementation.␊ |
1550 | ␉virtual bool␉handleOpen ( ␊ |
1551 | ␉␉␉␉␉␉␉IOService * ␉␉␉␉client, ␊ |
1552 | ␉␉␉␉␉␉␉IOOptionBits ␉␉␉␉options, ␊ |
1553 | ␉␉␉␉␉␉␉void * ␉␉␉␉␉␉arg );␊ |
1554 | ␊ |
1555 | ␉virtual void␉handleClose ( ␊ |
1556 | ␉␉␉␉␉␉␉IOService * ␉␉␉␉client, ␊ |
1557 | ␉␉␉␉␉␉␉IOOptionBits ␉␉␉␉options );␊ |
1558 | ␊ |
1559 | ␉virtual bool␉handleIsOpen ( ␊ |
1560 | ␉␉␉␉␉␉␉const IOService * ␉␉␉client ) const;␊ |
1561 | ␉␊ |
1562 | ␉virtual bool␉willTerminate ( IOService * provider, IOOptionBits options );␊ |
1563 | ␉virtual bool␉didTerminate ( IOService * provider, IOOptionBits options, bool * defer );␊ |
1564 | ␉␊ |
1565 | };␊ |
1566 | ␊ |
1567 | ␊ |
1568 | #endif␉/* __IOKIT_IO_SCSI_PARALLEL_INTERFACE_CONTROLLER_H__ */ |