Root/
Source at commit 1166 created 13 years 10 days ago. By meklort, Fixed recent Makefile changes. Please do not use /Users/evan/SourceCode/tmp/chameleon/trunk or VPATH. the *only* time you should use /Users/evan/SourceCode/tmp/chameleon/trunk is when setting the SRCROOT variable. Also note that very soon make pkg is going to be removed. The pkg build script in trunk is very out of date. Instead please use the package maker at http://forge.voodooprojects.org/p/chameleonApplications/. Once this is ready for trunk it will be merged. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * The contents of this file constitute Original Code as defined in and␊ |
7 | * are subject to the Apple Public Source License Version 1.1 (the␊ |
8 | * "License"). You may not use this file except in compliance with the␊ |
9 | * License. Please obtain a copy of the License at␊ |
10 | * http://www.apple.com/publicsource and read it before using this file.␊ |
11 | * ␊ |
12 | * This Original Code and all software distributed under the License are␊ |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the␊ |
17 | * License for the specific language governing rights and limitations␊ |
18 | * under the License.␊ |
19 | * ␊ |
20 | * @APPLE_LICENSE_HEADER_END@␊ |
21 | */␊ |
22 | /*␊ |
23 | * IOFireWireFamilyCommon.h␊ |
24 | * IOFireWireUserClient/IOFireWireFamily␊ |
25 | *␊ |
26 | * Created by NWG on Fri Apr 28 2000.␊ |
27 | * Copyright (c) 2000-2001 Apple Computer, Inc. All rights reserved.␊ |
28 | *␊ |
29 | */␊ |
30 | /*␊ |
31 | ␉$Log: IOFireWireFamilyCommon.h,v $␊ |
32 | ␉Revision 1.79 2008/07/15 01:29:44 collin␊ |
33 | ␉<rdar://problem/5859733> & <rdar://problem/5843668>␊ |
34 | ␉␊ |
35 | ␉Revision 1.78 2008/05/08 02:33:22 collin␊ |
36 | ␉more K64␊ |
37 | ␉␊ |
38 | ␉Revision 1.77 2008/04/24 00:01:39 collin␊ |
39 | ␉more K640␊ |
40 | ␉␊ |
41 | ␉Revision 1.76 2007/12/05 04:52:08 collin␊ |
42 | ␉integrate chex workaround␊ |
43 | ␉␊ |
44 | ␉Revision 1.75 2007/08/31 20:29:06 collin␊ |
45 | ␉fixed 5437835␊ |
46 | ␉␊ |
47 | ␉Revision 1.74 2007/04/24 21:40:23 arulchan␊ |
48 | ␉headerdoc changes␊ |
49 | ␉␊ |
50 | ␉Revision 1.73 2007/04/24 21:28:24 arulchan␊ |
51 | ␉changes for headerdoc␊ |
52 | ␉␊ |
53 | ␉Revision 1.72 2007/04/13 19:37:01 calderon␊ |
54 | ␉Integrated FireWireKPrintf implemented␊ |
55 | ␉␊ |
56 | ␉Revision 1.71 2007/03/14 18:41:43 collin␊ |
57 | ␉*** empty log message ***␊ |
58 | ␉␊ |
59 | ␉Revision 1.70 2007/02/28 23:10:13 ayanowit␊ |
60 | ␉Another IRMAllocation fix.␊ |
61 | ␉␊ |
62 | ␉Revision 1.69 2007/02/20 01:25:28 collin␊ |
63 | ␉*** empty log message ***␊ |
64 | ␉␊ |
65 | ␉Revision 1.68 2007/02/17 00:26:51 collin␊ |
66 | ␉*** empty log message ***␊ |
67 | ␉␊ |
68 | ␉Revision 1.67 2007/02/15 19:42:07 ayanowit␊ |
69 | ␉For 4369537, eliminated support for legacy DCL SendPacketWithHeader, since it didn't work anyway, and NuDCL does support it.␊ |
70 | ␉␊ |
71 | ␉Revision 1.66 2007/02/15 01:23:39 arulchan␊ |
72 | ␉changes in AssignCycleMaster␊ |
73 | ␉␊ |
74 | ␉Revision 1.65 2007/02/09 04:44:06 collin␊ |
75 | ␉*** empty log message ***␊ |
76 | ␉␊ |
77 | ␉Revision 1.64 2007/01/26 20:52:31 ayanowit␊ |
78 | ␉changes to user-space isoch stuff to support 64-bit apps.␊ |
79 | ␉␊ |
80 | ␉Revision 1.63 2007/01/16 01:41:02 gecko1␊ |
81 | ␉4159728 Add improved async lock based check for bad IRMs␊ |
82 | ␉␊ |
83 | ␉Revision 1.62 2007/01/15 23:29:05 arulchan␊ |
84 | ␉Fixed Skipped Packet Handler Notifications␊ |
85 | ␉␊ |
86 | ␉Revision 1.61 2007/01/12 22:15:14 arulchan␊ |
87 | ␉Added flag kIOFWEnableBeingRoot␊ |
88 | ␉␊ |
89 | ␉Revision 1.60 2007/01/10 22:14:44 calderon␊ |
90 | ␉Fixed 4046607 Propagate vendor/model from IIDC UnitDepedantInfoDir␊ |
91 | ␉Fixed some null termination shinanigans in getIndexValue(string)␊ |
92 | ␉␊ |
93 | ␉Revision 1.59 2007/01/08 18:47:19 ayanowit␊ |
94 | ␉More 64-bit changes for isoch.␊ |
95 | ␉␊ |
96 | ␉Revision 1.58 2006/07/07 20:18:25 calderon␊ |
97 | ␉4227201: SpeedMap and HopCount table reductions.␊ |
98 | ␉␊ |
99 | ␉Revision 1.57 2006/04/03 21:29:48 collin␊ |
100 | ␉*** empty log message ***␊ |
101 | ␉␊ |
102 | ␉Revision 1.56 2006/02/09 00:21:51 niels␊ |
103 | ␉merge chardonnay branch to tot␊ |
104 | ␉␊ |
105 | ␉Revision 1.55.4.1 2005/08/06 01:31:31 collin␊ |
106 | ␉*** empty log message ***␊ |
107 | ␉␊ |
108 | ␉Revision 1.55 2005/03/12 03:27:51 collin␊ |
109 | ␉*** empty log message ***␊ |
110 | ␉␊ |
111 | ␉Revision 1.54 2005/01/12 06:34:53 collin␊ |
112 | ␉*** empty log message ***␊ |
113 | ␉␊ |
114 | ␉Revision 1.53 2004/05/04 22:52:19 niels␊ |
115 | ␉*** empty log message ***␊ |
116 | ␉␊ |
117 | ␉Revision 1.52 2004/03/26 01:42:53 gecko1␊ |
118 | ␉Add code to disable any port directly connected to an iPod when we go to sleep.␊ |
119 | ␉␊ |
120 | ␉Revision 1.51 2004/03/05 00:33:59 calderon␊ |
121 | ␉Fixed 3570909 - FireWire - iokit_fw_errs should be defined in hex␊ |
122 | ␉All decimal #define errors in header changed to hex␊ |
123 | ␉␊ |
124 | ␉Revision 1.50 2003/11/07 21:01:18 niels␊ |
125 | ␉Revision 1.49 2003/10/21 01:16:41 collin␊ |
126 | ␉Revision 1.48 2003/10/17 00:25:24 collin␊ |
127 | ␉Revision 1.47 2003/10/15 02:19:45 collin␊ |
128 | ␉Revision 1.46 2003/07/22 10:49:47 niels␊ |
129 | ␉Revision 1.45 2003/07/21 06:52:59 niels␊ |
130 | ␉merge isoch to TOT␊ |
131 | ␉␊ |
132 | ␉Revision 1.44.4.5 2003/07/21 06:44:44 niels␊ |
133 | ␉Revision 1.44.4.4 2003/07/18 00:17:42 niels␊ |
134 | ␉Revision 1.44.4.3 2003/07/14 22:08:53 niels␊ |
135 | ␉Revision 1.44.4.2 2003/07/09 21:24:01 niels␊ |
136 | ␉Revision 1.44.4.1 2003/07/01 20:54:07 niels␊ |
137 | ␉isoch merge␊ |
138 | ␉␊ |
139 | ␉Revision 1.44 2003/03/17 01:05:22 collin␊ |
140 | ␉Revision 1.43 2003/03/07 01:26:06 collin␊ |
141 | ␉Revision 1.42 2003/02/19 22:33:17 niels␊ |
142 | ␉add skip cycle DCL␊ |
143 | ␉␊ |
144 | ␉Revision 1.41 2003/02/18 00:14:01 collin␊ |
145 | ␉Revision 1.40 2003/02/17 21:47:52 collin␊ |
146 | ␉Revision 1.39 2002/12/05 19:08:37 niels␊ |
147 | ␉remove trailing commas from enums in IOFireWireFamilyCommon.h␊ |
148 | ␉␊ |
149 | ␉Revision 1.38 2002/11/01 20:45:57 collin␊ |
150 | ␉add enhanced IRM with support for the BROADCAST_CHANNEL register␊ |
151 | ␉␊ |
152 | ␉Revision 1.37 2002/10/01 02:40:27 collin␊ |
153 | ␉security mode support␊ |
154 | ␉␊ |
155 | ␉Revision 1.36 2002/09/25 21:17:14 collin␊ |
156 | ␉fix headers again.␊ |
157 | ␉␊ |
158 | ␉Revision 1.35 2002/09/25 00:27:23 niels␊ |
159 | ␉flip your world upside-down␊ |
160 | ␉␊ |
161 | ␉Revision 1.34 2002/09/12 22:41:53 niels␊ |
162 | ␉add GetIRMNodeID() to user client␊ |
163 | ␉␊ |
164 | */␊ |
165 | ␊ |
166 | /*! @header IOFireWireFamilyCommon.h␊ |
167 | This file contains useful definitions for working with FireWire␊ |
168 | in the kernel and in user space␊ |
169 | */␊ |
170 | ␊ |
171 | #ifndef __IOFireWireFamilyCommon_H__␊ |
172 | #define __IOFireWireFamilyCommon_H__␊ |
173 | ␊ |
174 | #ifdef KERNEL␊ |
175 | #ifndef __IOKIT_IOTYPES_H␊ |
176 | ␉#include <IOKit/IOTypes.h>␊ |
177 | #endif␊ |
178 | #else␊ |
179 | #include <IOKit/IOKitLib.h>␊ |
180 | #endif␊ |
181 | ␊ |
182 | //#define LEGACY_SHUTDOWN␊ |
183 | ␊ |
184 | #define FW_OLD_DCL_DEFS␊ |
185 | #define FW_OLD_BIT_DEFS␊ |
186 | ␊ |
187 | // =================================================================␊ |
188 | // bit ranges and fields␊ |
189 | // =================================================================␊ |
190 | #pragma mark -␊ |
191 | #pragma mark BITS␊ |
192 | ␊ |
193 | // FireWire bit defs.␊ |
194 | ␊ |
195 | #define BIT(x)␉␉( 1 << (x) )␊ |
196 | #define FW_BIT(x)␉( 1 << (31 - (x) ) )␊ |
197 | ␊ |
198 | #define FWBitRange(start, end)␉␉␉␉␉␉\␊ |
199 | (␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
200 | ␉((((UInt32) 0xFFFFFFFF) << (start)) >>␉␉␉\␊ |
201 | ␉ ((start) + (31 - (end)))) <<␉␉␉␉␉\␊ |
202 | ␉(31 - (end))␉␉␉␉␉␉␉␉␉\␊ |
203 | )␊ |
204 | ␊ |
205 | #define FWBitRangePhase(start, end)␉␉␉␉␉\␊ |
206 | ␉(31 - (end))␊ |
207 | ␊ |
208 | #define BitRange(start, end)␉␉␉␉␉␉\␊ |
209 | (␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
210 | ␉((((UInt32) 0xFFFFFFFF) << (31 - (end))) >>␉␉\␊ |
211 | ␉ ((31 - (end)) + (start))) <<␉␉␉␉␉\␊ |
212 | ␉(start)␉␉␉␉␉␉␉␉␉␉␉\␊ |
213 | )␊ |
214 | ␊ |
215 | ␊ |
216 | #define BitRangePhase(start, end)␉␉␉␉␉\␊ |
217 | ␉(start)␊ |
218 | ␊ |
219 | // =================================================================␊ |
220 | // FireWire messages & errors␊ |
221 | // =================================================================␊ |
222 | #pragma mark -␊ |
223 | #pragma mark MESSAGES AND ERRORS␊ |
224 | ␊ |
225 | #define␉iokit_fw_err(return) (sys_iokit|sub_iokit_firewire|return)␊ |
226 | ␊ |
227 | // e0008010 -> 0xe000801f Response codes from response packets␊ |
228 | ␊ |
229 | // Base of Response error codes␊ |
230 | #define kIOFireWireResponseBase␉␉␉␉␉␉␉iokit_fw_err(0x10)␊ |
231 | ␊ |
232 | // e0008020 -- Bus reset during command execution (current bus generation does␊ |
233 | // not match that specified in command.)␊ |
234 | #define kIOFireWireBusReset␉␉␉␉␉␉␉␉(kIOFireWireResponseBase+kFWResponseBusResetError)␊ |
235 | ␊ |
236 | // e0008001 -- Can't find requested entry in ROM␊ |
237 | #define kIOConfigNoEntry␉␉␉␉␉␉␉␉iokit_fw_err(0x1)␊ |
238 | ␊ |
239 | // e0008002 -- In pending queue waiting to execute␊ |
240 | #define kIOFireWirePending␉␉␉␉␉␉␉␉iokit_fw_err(0x2)␊ |
241 | ␊ |
242 | // e0008003 -- Last DCL callback of program (internal use)␊ |
243 | #define kIOFireWireLastDCLToken␉␉␉␉␉␉␉iokit_fw_err(0x3)␊ |
244 | ␊ |
245 | // e0008004␊ |
246 | #define kIOFireWireConfigROMInvalid␉␉␉␉␉␉iokit_fw_err(0x4)␊ |
247 | ␊ |
248 | // e0008005␊ |
249 | #define kIOFireWireAlreadyRegistered␉␉␉␉␉iokit_fw_err(0x5)␊ |
250 | ␊ |
251 | // e0008006␊ |
252 | #define kIOFireWireMultipleTalkers␉␉␉␉␉␉iokit_fw_err(0x6)␊ |
253 | ␊ |
254 | // e0008007␊ |
255 | #define kIOFireWireChannelActive␉␉␉␉␉␉iokit_fw_err(0x7)␊ |
256 | ␊ |
257 | // e0008008␊ |
258 | #define kIOFireWireNoListenerOrTalker␉␉␉␉␉iokit_fw_err(0x8)␊ |
259 | ␊ |
260 | // e0008009␊ |
261 | #define kIOFireWireNoChannels␉␉␉␉␉␉␉iokit_fw_err(0x9)␊ |
262 | ␊ |
263 | // e000800A␊ |
264 | #define kIOFireWireChannelNotAvailable␉␉␉␉␉iokit_fw_err(0xA)␊ |
265 | ␊ |
266 | // e000800B␊ |
267 | #define kIOFireWireSeparateBus␉␉␉␉␉␉␉iokit_fw_err(0xB)␊ |
268 | ␊ |
269 | // e000800C␊ |
270 | #define kIOFireWireBadSelfIDs␉␉␉␉␉␉␉iokit_fw_err(0xC)␊ |
271 | ␊ |
272 | // e000800D␊ |
273 | #define kIOFireWireLowCableVoltage␉␉␉␉␉␉iokit_fw_err(0xD)␊ |
274 | ␊ |
275 | // e000800E␊ |
276 | #define kIOFireWireInsufficientPower␉␉␉␉␉iokit_fw_err(0xE)␊ |
277 | ␊ |
278 | // e000800f␊ |
279 | #define kIOFireWireOutOfTLabels␉␉␉␉␉␉␉iokit_fw_err(0xF)␊ |
280 | ␊ |
281 | |
282 | ␊ |
283 | // e0008101␊ |
284 | #define kIOFireWireBogusDCLProgram␉␉␉␉␉␉iokit_fw_err(0x101)␊ |
285 | ␊ |
286 | // e0008102␊ |
287 | #define kIOFireWireTalkingAndListening␉␉␉␉␉iokit_fw_err(0x102)␊ |
288 | ␊ |
289 | // e0008103␊ |
290 | #define kIOFireWireHardwareSlept␉␉␉␉␉␉iokit_fw_err(0x103)␊ |
291 | ␊ |
292 | // e0008104␉␉// let's resume here...␊ |
293 | ␊ |
294 | // e0008104 -- In the middle of completing␊ |
295 | #define kIOFireWireCompleting␉␉␉␉␉␉␉iokit_fw_err(0x104)␊ |
296 | ␊ |
297 | // e0008105 -- Invalid Response Length␊ |
298 | #define kIOFireWireInvalidResponseLength␉␉␉␉iokit_fw_err(0x105)␊ |
299 | ␊ |
300 | // e0008106 -- Isoch Bandwidth Not Available␊ |
301 | #define kIOFireWireIsochBandwidthNotAvailable␉␉␉iokit_fw_err(0x106)␊ |
302 | ␊ |
303 | ␊ |
304 | // e00087d0␊ |
305 | #define kIOFWMessageServiceIsRequestingClose ␉␉␉(UInt32)iokit_fw_err(0x7D0)␊ |
306 | #define kIOFWMessagePowerStateChanged ␉␉␉␉␉(UInt32)iokit_fw_err(0x7D1)␊ |
307 | #define kIOFWMessageTopologyChanged␉␉␉␉␉␉(UInt32)iokit_fw_err(0x7D2)␊ |
308 | // =================================================================␊ |
309 | // Pseudo address space response codes␊ |
310 | // =================================================================␊ |
311 | #pragma mark -␊ |
312 | #pragma mark PSEDUO ADDRESS SPACE RESPONSE CODES␊ |
313 | enum␊ |
314 | {␊ |
315 | ␉kFWResponseComplete␉␉␉= 0,␉// OK!␊ |
316 | ␉kFWResponseConflictError␉= 4,␉// Resource conflict, may retry␊ |
317 | ␉kFWResponseDataError␉␉= 5,␉// Data not available␊ |
318 | ␉kFWResponseTypeError␉␉= 6,␉// Operation not supported␊ |
319 | ␉kFWResponseAddressError␉␉= 7,␉// Address not valid in target device␊ |
320 | ␉kFWResponseBusResetError␉= 16,␉// Pseudo response generated locally␊ |
321 | ␉kFWResponsePending␉␉␉= 17␉// Pseudo response, real response sent later.␊ |
322 | };␊ |
323 | ␊ |
324 | //␊ |
325 | // Pseudo address space response codes␊ |
326 | //␊ |
327 | enum␊ |
328 | {␊ |
329 | ␉kFWAckTimeout␉␉␉␉= -1,␉// Pseudo ack generated locally␊ |
330 | ␉kFWAckComplete␉␉␉␉= 1,␊ |
331 | ␉kFWAckPending␉␉␉␉= 2,␊ |
332 | ␉kFWAckBusyX␉␉␉␉␉= 4,␊ |
333 | ␉kFWAckBusyA␉␉␉␉␉= 5,␊ |
334 | ␉kFWAckBusyB␉␉␉␉␉= 6,␊ |
335 | ␉kFWAckDataError␉␉␉␉= 13,␊ |
336 | ␉kFWAckTypeError␉␉␉␉= 14␊ |
337 | };␊ |
338 | ␊ |
339 | // =================================================================␊ |
340 | // FireWire bus speed numbers␊ |
341 | // =================================================================␊ |
342 | #pragma mark -␊ |
343 | #pragma mark BUS SPEED NUMBERS␊ |
344 | ␊ |
345 | typedef enum␊ |
346 | {␊ |
347 | ␉kFWSpeed100MBit␉␉␉= 0,␊ |
348 | ␉kFWSpeed200MBit␉␉␉= 1,␊ |
349 | ␉kFWSpeed400MBit␉␉␉= 2,␊ |
350 | ␉kFWSpeed800MBit␉␉␉= 3,␊ |
351 | ␉kFWSpeedReserved␉␉= 3,␉// In all cases, 1394B Devices report this speed, ␊ |
352 | ␉␉␉␉␉␉␉␉␉// each port of the PHY could be different␊ |
353 | ␉␊ |
354 | ␉kFWSpeedUnknownMask␉␉= 0x80,␉// If speed was reserved and we haven't probed it further␊ |
355 | ␉␊ |
356 | ␉kFWSpeedMaximum␉␉␉= 0x7FFFFFFF,␉␊ |
357 | ␉kFWSpeedInvalid␉␉␉= 0x80000000␊ |
358 | } IOFWSpeed;␊ |
359 | ␊ |
360 | // =================================================================␊ |
361 | // FWAddress␊ |
362 | // =================================================================␊ |
363 | #pragma mark -␊ |
364 | #pragma mark FWADDRESS␊ |
365 | //␊ |
366 | // The venerable FWAddress structure. This is the standard␊ |
367 | // struct to use for passing FireWire addresses.␊ |
368 | //␊ |
369 | ␊ |
370 | typedef struct FWAddressStruct␊ |
371 | {␊ |
372 | UInt16␉nodeID;␉␉// bus/node␊ |
373 | UInt16␉addressHi;␉// Top 16 bits of node address.␊ |
374 | UInt32␉addressLo;␉// Bottom 32 bits of node address␊ |
375 | ␉␊ |
376 | ␉//␊ |
377 | ␉// Useful C++ only constructors␊ |
378 | ␉//␊ |
379 | ␉#ifdef __cplusplus␊ |
380 | ␉FWAddressStruct(const FWAddressStruct & a): ␊ |
381 | ␉␉␉nodeID(a.nodeID), addressHi(a.addressHi), addressLo(a.addressLo) {};␊ |
382 | FWAddressStruct(UInt16 h=0xdead, UInt32 l=0xcafebabe) : ␊ |
383 | ␉␉␉nodeID(0), addressHi(h), addressLo(l) {};␊ |
384 | ␉FWAddressStruct(UInt16 h, UInt32 l, UInt16 n) :␊ |
385 | ␉␉␉nodeID(n), addressHi(h), addressLo(l) {};␊ |
386 | ␉#endif␊ |
387 | } FWAddress, *FWAddressPtr ;␊ |
388 | ␊ |
389 | // =================================================================␊ |
390 | // Config ROM␊ |
391 | // =================================================================␊ |
392 | #pragma mark -␊ |
393 | #pragma mark CONFIG ROM␊ |
394 | ␊ |
395 | //␊ |
396 | // CSR bit defs.␊ |
397 | //␊ |
398 | ␊ |
399 | #define CSR_BIT(x) FW_BIT(x)␊ |
400 | ␊ |
401 | #define CSRBitRange(start, end)␉␉␉␉␉␉\␊ |
402 | (␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
403 | ␉((((UInt32) 0xFFFFFFFF) << (start)) >>␉␉␉\␊ |
404 | ␉((start) + (31 - (end)))) <<␉␉␉␉␉\␊ |
405 | ␉(31 - (end))␉␉␉␉␉␉␉␉␉\␊ |
406 | )␊ |
407 | ␊ |
408 | #define CSRBitRangePhase(start, end)␉␉␉␉\␊ |
409 | ␉(31 - end)␊ |
410 | ␊ |
411 | //␊ |
412 | // Key types.␊ |
413 | //␊ |
414 | ␊ |
415 | typedef enum␊ |
416 | {␊ |
417 | ␉kConfigImmediateKeyType␉␉= 0,␊ |
418 | ␉kConfigOffsetKeyType␉␉= 1,␊ |
419 | ␉kConfigLeafKeyType␉␉= 2,␊ |
420 | ␉kConfigDirectoryKeyType␉␉= 3,␊ |
421 | ␉kInvalidConfigROMEntryType␉= 0xff␊ |
422 | } IOConfigKeyType;␊ |
423 | ␊ |
424 | //␊ |
425 | // Key values.␊ |
426 | //␊ |
427 | ␊ |
428 | enum␊ |
429 | {␊ |
430 | ␉kConfigTextualDescriptorKey␉␉= 0x01,␊ |
431 | ␉kConfigBusDependentInfoKey␉␉= 0x02,␊ |
432 | ␉kConfigModuleVendorIdKey␉␉= 0x03,␊ |
433 | ␉kConfigModuleHwVersionKey␉␉= 0x04,␊ |
434 | ␉kConfigModuleSpecIdKey␉␉␉= 0x05,␊ |
435 | ␉kConfigModuleSwVersionKey␉␉= 0x06,␊ |
436 | ␉kConfigModuleDependentInfoKey␉= 0x07,␊ |
437 | ␉kConfigNodeVendorIdKey␉␉␉= 0x08,␊ |
438 | ␉kConfigNodeHwVersionKey␉␉␉= 0x09,␊ |
439 | ␉kConfigNodeSpecIdKey␉␉␉= 0x0A,␊ |
440 | ␉kConfigNodeSwVersionKey␉␉␉= 0x0B,␊ |
441 | ␉kConfigNodeCapabilitiesKey␉␉= 0x0C,␊ |
442 | ␉kConfigNodeUniqueIdKey␉␉␉= 0x0D,␊ |
443 | ␉kConfigNodeUnitsExtentKey␉␉= 0x0E,␊ |
444 | ␉kConfigNodeMemoryExtentKey␉␉= 0x0F,␊ |
445 | ␉kConfigNodeDependentInfoKey␉␉= 0x10,␊ |
446 | ␉kConfigUnitDirectoryKey␉␉␉= 0x11,␊ |
447 | ␉kConfigUnitSpecIdKey␉␉␉= 0x12,␊ |
448 | ␉kConfigUnitSwVersionKey␉␉␉= 0x13,␊ |
449 | ␉kConfigUnitDependentInfoKey␉␉= 0x14,␊ |
450 | ␉kConfigUnitLocationKey␉␉␉= 0x15,␊ |
451 | ␉kConfigUnitPollMaskKey␉␉␉= 0x16,␊ |
452 | ␉kConfigModelIdKey␉␉␉␉= 0x17,␊ |
453 | ␉kConfigGenerationKey␉␉␉= 0x38,␉␉// Apple-specific␊ |
454 | ␊ |
455 | ␉kConfigRootDirectoryKey␉␉␉= 0xffff␉// Not a real key␊ |
456 | };␊ |
457 | ␊ |
458 | enum␊ |
459 | {␊ |
460 | ␉kConfigSBP2LUN␉␉␉␉␉= 0x14,␊ |
461 | ␉kConfigSBP2Revision␉␉␉␉= 0x21,␊ |
462 | ␉kConfigSBP2MAO␉␉␉␉␉= 0x54␉␊ |
463 | };␊ |
464 | ␊ |
465 | // Core CSR registers.␊ |
466 | enum␊ |
467 | {␊ |
468 | ␉kCSRStateUnitDepend␉␉␉= CSRBitRange(0, 15),␊ |
469 | ␉kCSRStateUnitDependPhase␉= CSRBitRangePhase(0, 15),␊ |
470 | ␊ |
471 | ␉kCSRStateBusDepend␉␉␉= CSRBitRange(16, 23),␊ |
472 | ␉kCSRStateBusDependPhase␉␉= CSRBitRangePhase(16, 23),␊ |
473 | ␊ |
474 | ␉kCSRStateLost␉␉␉␉= CSR_BIT(24),␊ |
475 | ␉kCSRStateDReq␉␉␉␉= CSR_BIT(25),␊ |
476 | ␉kCSRStateELog␉␉␉␉= CSR_BIT(27),␊ |
477 | ␉kCSRStateAtn␉␉␉␉= CSR_BIT(28),␊ |
478 | ␉kCSRStateOff␉␉␉␉= CSR_BIT(29),␊ |
479 | ␊ |
480 | ␉kCSRStateState␉␉␉␉= CSRBitRange(30, 31),␊ |
481 | ␉kCSRStateStatePhase␉␉␉= CSRBitRangePhase(30, 31),␊ |
482 | ␉kCSRStateStateRunning␉␉= 0,␊ |
483 | ␉kCSRStateStateInitializing␉= 1,␊ |
484 | ␉kCSRStateStateTesting␉␉= 2,␊ |
485 | ␉kCSRStateStateDead␉␉␉= 3␊ |
486 | };␊ |
487 | ␊ |
488 | // Config ROM entry bit locations.␊ |
489 | ␊ |
490 | enum␊ |
491 | {␊ |
492 | ␉kConfigBusInfoBlockLength␉␉= CSRBitRange (0, 7),␊ |
493 | ␉kConfigBusInfoBlockLengthPhase␉= CSRBitRangePhase (0, 7),␊ |
494 | ␊ |
495 | ␉kConfigROMCRCLength␉␉␉␉= CSRBitRange (8, 15),␊ |
496 | ␉kConfigROMCRCLengthPhase␉␉= CSRBitRangePhase (8, 15),␊ |
497 | ␊ |
498 | ␉kConfigROMCRCValue␉␉␉␉= CSRBitRange (16, 31),␊ |
499 | ␉kConfigROMCRCValuePhase␉␉␉= CSRBitRangePhase (16, 31),␊ |
500 | ␊ |
501 | ␉kConfigEntryKeyType␉␉␉␉= CSRBitRange (0, 1),␊ |
502 | ␉kConfigEntryKeyTypePhase␉␉= CSRBitRangePhase (0, 1),␊ |
503 | ␊ |
504 | ␉kConfigEntryKeyValue␉␉␉= CSRBitRange (2, 7),␊ |
505 | ␉kConfigEntryKeyValuePhase␉␉= CSRBitRangePhase (2, 7),␊ |
506 | ␊ |
507 | ␉kConfigEntryValue␉␉␉␉= CSRBitRange (8, 31),␊ |
508 | ␉kConfigEntryValuePhase␉␉␉= CSRBitRangePhase (8, 31),␊ |
509 | ␊ |
510 | ␉kConfigLeafDirLength␉␉␉= CSRBitRange (0, 15),␊ |
511 | ␉kConfigLeafDirLengthPhase␉␉= CSRBitRangePhase (0, 15),␊ |
512 | ␊ |
513 | ␉kConfigLeafDirCRC␉␉␉␉= CSRBitRange (16, 31),␊ |
514 | ␉kConfigLeafDirCRCPhase␉␉␉= CSRBitRangePhase (16, 31)␊ |
515 | };␊ |
516 | ␊ |
517 | //␊ |
518 | // Key types.␊ |
519 | //␊ |
520 | typedef enum␊ |
521 | {␊ |
522 | ␉kCSRImmediateKeyType␉␉= 0,␊ |
523 | ␉kCSROffsetKeyType␉␉␉= 1,␊ |
524 | ␉kCSRLeafKeyType␉␉␉␉= 2,␊ |
525 | ␉kCSRDirectoryKeyType␉␉= 3,␊ |
526 | kInvalidCSRROMEntryType␉␉= 0xff␊ |
527 | } IOCSRKeyType;␊ |
528 | ␊ |
529 | // CSR 64-bit fixed address defs.␊ |
530 | ␊ |
531 | enum␊ |
532 | {␊ |
533 | ␉kCSRNodeID␉␉␉␉␉␉␉␉= CSRBitRange (0, 15),␊ |
534 | ␉kCSRNodeIDPhase␉␉␉␉␉␉␉= CSRBitRangePhase (0, 15),␊ |
535 | ␊ |
536 | ␉kCSRInitialMemorySpaceBaseAddressHi␉␉= 0x00000000,␊ |
537 | ␉kCSRInitialMemorySpaceBaseAddressLo␉␉= 0x00000000,␊ |
538 | ␊ |
539 | ␉kCSRPrivateSpaceBaseAddressHi␉␉␉= 0x0000FFFF,␊ |
540 | ␉kCSRPrivateSpaceBaseAddressLo␉␉␉= 0xE0000000,␊ |
541 | ␊ |
542 | ␉kCSRRegisterSpaceBaseAddressHi␉␉␉= 0x0000FFFF,␊ |
543 | ␉kCSRRegisterSpaceBaseAddressLo␉␉␉= 0xF0000000,␊ |
544 | ␊ |
545 | ␉kCSRCoreRegistersBaseAddress␉␉␉= kCSRRegisterSpaceBaseAddressLo,␊ |
546 | ␉kCSRStateClearAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0000,␊ |
547 | ␉kCSRStateSetAddress␉␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0004,␊ |
548 | ␉kCSRNodeIDsAddress␉␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0008,␊ |
549 | ␉kCSRResetStartAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x000C,␊ |
550 | ␉kCSRIndirectAddressAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0010,␊ |
551 | ␉kCSRIndirectDataAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0014,␊ |
552 | ␉kCSRSplitTimeoutHiAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0018,␊ |
553 | ␉kCSRSplitTimeoutLoAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x001C,␊ |
554 | ␉kCSRArgumentHiAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0020,␊ |
555 | ␉kCSRArgumentLoAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0024,␊ |
556 | ␉kCSRTestStartAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0028,␊ |
557 | ␉kCSRTestStatusAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x002C,␊ |
558 | ␉kCSRUnitsBaseHiAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0030,␊ |
559 | ␉kCSRUnitsBaseLoAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0034,␊ |
560 | ␉kCSRUnitsBoundHiAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0038,␊ |
561 | ␉kCSRUnitsBoundLoAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x003C,␊ |
562 | ␉kCSRMemoryBaseHiAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0040,␊ |
563 | ␉kCSRMemoryBaseLoAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0044,␊ |
564 | ␉kCSRMemoryBoundHiAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0048,␊ |
565 | ␉kCSRMemoryBoundLoAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x004C,␊ |
566 | ␉kCSRInterruptTargetAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0050,␊ |
567 | ␉kCSRInterruptMaskAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0054,␊ |
568 | ␉kCSRClockValueHiAddress␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0058,␊ |
569 | ␉kCSRClockValueMidAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x005C,␊ |
570 | ␉kCSRClockTickPeriodMidAddress␉␉␉= kCSRCoreRegistersBaseAddress + 0x0060,␊ |
571 | ␉kCSRClockTickPeriodLoAddress␉␉␉= kCSRCoreRegistersBaseAddress + 0x0064,␊ |
572 | ␉kCSRClockStrobeArrivedHiAddress␉␉␉= kCSRCoreRegistersBaseAddress + 0x0068,␊ |
573 | ␉kCSRClockStrobeArrivedMidAddress␉␉= kCSRCoreRegistersBaseAddress + 0x006C,␊ |
574 | ␉kCSRClockInfo0Address␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0070,␊ |
575 | ␉kCSRClockInfo1Address␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0074,␊ |
576 | ␉kCSRClockInfo2Address␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0078,␊ |
577 | ␉kCSRClockInfo3Address␉␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x007C,␊ |
578 | ␉kCSRMessageRequestAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0080,␊ |
579 | ␉kCSRMessageResponseAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x00C0,␊ |
580 | ␉kCSRErrorLogBufferAddress␉␉␉␉= kCSRCoreRegistersBaseAddress + 0x0180,␊ |
581 | ␊ |
582 | ␉kCSRBusDependentRegistersBaseAddress␉= kCSRRegisterSpaceBaseAddressLo + 0x0200,␊ |
583 | ␉kCSRBusyTimeout␉␉␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0210,␊ |
584 | ␉kCSRBusManagerID␉␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x021C,␊ |
585 | ␉kCSRBandwidthAvailable␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0220,␊ |
586 | ␉kCSRChannelsAvailable31_0␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0224,␊ |
587 | ␉kCSRChannelsAvailable63_32␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0228,␊ |
588 | ␉kCSRBroadcastChannel␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0234,␊ |
589 | ␉␊ |
590 | ␉kConfigROMBaseAddress␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x0400,␊ |
591 | ␉kConfigBIBHeaderAddress␉␉␉␉␉= kConfigROMBaseAddress,␊ |
592 | ␉kConfigBIBBusNameAddress␉␉␉␉= kConfigROMBaseAddress + 4,␊ |
593 | ␉␊ |
594 | ␉kPCRBaseAddress␉␉␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0x900,␊ |
595 | ␉kFCPCommandAddress␉␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0xb00,␊ |
596 | ␉kFCPResponseAddress␉␉␉␉␉␉= kCSRRegisterSpaceBaseAddressLo + 0xd00␊ |
597 | };␊ |
598 | ␊ |
599 | // from figure 10-7 of 1394a␊ |
600 | #define kBroadcastChannelInitialValues ␉0x8000001f␊ |
601 | #define kBroadcastChannelValidMask ␉␉0x40000000␊ |
602 | ␊ |
603 | // CSR defined 64 bit unique ID.␊ |
604 | ␊ |
605 | typedef UInt64 CSRNodeUniqueID;␊ |
606 | ␊ |
607 | // FireWire core CSR registers.␊ |
608 | ␊ |
609 | enum␊ |
610 | {␊ |
611 | ␉kFWCSRStateGone␉␉␉␉= FW_BIT(16),␊ |
612 | ␉kFWCSRStateLinkOff␉␉␉= FW_BIT(22),␊ |
613 | ␉kFWCSRStateCMstr␉␉␉= FW_BIT(23)␊ |
614 | };␊ |
615 | ␊ |
616 | // FireWire bus/nodeID address defs.␊ |
617 | ␊ |
618 | enum␊ |
619 | {␊ |
620 | ␉kFWAddressBusID␉␉␉␉= FWBitRange (16, 25) << kCSRNodeIDPhase,␊ |
621 | ␉kFWAddressBusIDPhase␉␉= FWBitRangePhase (16, 25) + kCSRNodeIDPhase,␊ |
622 | ␊ |
623 | ␉kFWAddressNodeID␉␉␉= FWBitRange (26, 31) << kCSRNodeIDPhase,␊ |
624 | ␉kFWAddressNodeIDPhase␉␉= FWBitRangePhase (26, 31) + kCSRNodeIDPhase,␊ |
625 | ␊ |
626 | ␉kFWLocalBusID␉␉␉␉= 1023,␊ |
627 | ␉kFWBroadcastNodeID␉␉␉= 63,␊ |
628 | ␉kFWBadNodeID␉␉␉␉= 0xffff,␊ |
629 | ␊ |
630 | ␉kFWLocalBusAddress␉␉␉= kFWLocalBusID << kFWAddressBusIDPhase,␊ |
631 | ␉kFWBroadcastAddress␉␉␉= kFWBroadcastNodeID << kFWAddressNodeIDPhase␊ |
632 | };␊ |
633 | ␊ |
634 | #define FWNodeBaseAddress(busID, nodeID)␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
635 | (␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
636 | ␉(busID << kFWAddressBusIDPhase) |␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
637 | ␉(nodeID << kFWAddressNodeIDPhase)␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
638 | )␊ |
639 | ␊ |
640 | #define FWNodeRegisterSpaceBaseAddressHi(busID, nodeID)␉␉␉␉␉␉␉␉␉\␊ |
641 | (␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
642 | ␉FWNodeBaseAddress (busID, nodeID) |␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
643 | ␉kCSRRegisterSpaceBaseAddressHi␉␉␉␉␉␉␉␉␉␉␉␉␉␉\␊ |
644 | )␊ |
645 | ␊ |
646 | // FireWire CSR bus info block defs.␊ |
647 | ␊ |
648 | enum␊ |
649 | {␊ |
650 | ␉kFWBIBHeaderAddress␉␉␉␉␉= kConfigBIBHeaderAddress,␊ |
651 | ␉kFWBIBBusNameAddress␉␉␉␉= kConfigBIBBusNameAddress,␊ |
652 | ␉kFWBIBNodeCapabilitiesAddress␉␉= kConfigROMBaseAddress + 8,␊ |
653 | ␉kFWBIBNodeUniqueIDHiAddress␉␉␉= kConfigROMBaseAddress + 12,␊ |
654 | ␉kFWBIBNodeUniqueIDLoAddress␉␉␉= kConfigROMBaseAddress + 16,␊ |
655 | ␊ |
656 | ␉kFWBIBBusName␉␉␉␉␉␉= 0x31333934, //'1394'␊ |
657 | ␊ |
658 | ␉kFWBIBIrmc␉␉␉␉␉␉␉= FW_BIT(0),␊ |
659 | ␉kFWBIBCmc␉␉␉␉␉␉␉= FW_BIT(1),␊ |
660 | ␉kFWBIBIsc␉␉␉␉␉␉␉= FW_BIT(2),␊ |
661 | ␉kFWBIBBmc␉␉␉␉␉␉␉= FW_BIT(3),␊ |
662 | ␉kFWBIBCycClkAcc␉␉␉␉␉␉= FWBitRange (8, 15),␊ |
663 | ␉kFWBIBCycClkAccPhase␉␉␉␉= FWBitRangePhase (8, 15),␊ |
664 | ␉kFWBIBMaxRec␉␉␉␉␉␉= FWBitRange (16, 19),␊ |
665 | ␉kFWBIBMaxRecPhase␉␉␉␉␉= FWBitRangePhase (16, 19),␊ |
666 | ␉kFWBIBMaxROM␉␉␉␉␉␉= FWBitRange (20, 21),␊ |
667 | ␉kFWBIBMaxROMPhase␉␉␉␉␉= FWBitRangePhase (20, 21),␊ |
668 | ␉kFWBIBGeneration␉␉␉␉␉= FWBitRange (24, 27),␊ |
669 | ␉kFWBIBGenerationPhase␉␉␉␉= FWBitRangePhase (24, 27),␊ |
670 | ␉kFWBIBLinkSpeed␉␉␉␉␉␉= FWBitRange (29, 31),␊ |
671 | ␉kFWBIBLinkSpeedPhase␉␉␉␉= FWBitRangePhase (29, 31)␊ |
672 | };␊ |
673 | ␊ |
674 | enum␊ |
675 | {␊ |
676 | ␉kConfigUnitSpecAppleA27␉␉␉␉= 0x000a27,␊ |
677 | ␉kConfigUnitSpec1394TA1␉␉␉␉= 0x00a02d,␊ |
678 | ␉␊ |
679 | ␉kConfigUnitSWVersMacintosh10␉␉= 10,␊ |
680 | ␉kConfigUnitSWVersIIDC100␉␉␉= 0x000100,␊ |
681 | ␉kConfigUnitSWVersIIDC101␉␉␉= 0x000101,␊ |
682 | ␉kConfigUnitSWVersIIDC102␉␉␉= 0x000102␊ |
683 | };␊ |
684 | ␊ |
685 | ␊ |
686 | // =================================================================␊ |
687 | // Isoch defines␊ |
688 | // =================================================================␊ |
689 | #pragma mark -␊ |
690 | #pragma mark ISOCH␊ |
691 | ␊ |
692 | enum␊ |
693 | {␊ |
694 | ␉kFWIsochDataLength␉␉= FWBitRange (0, 15),␊ |
695 | ␉kFWIsochDataLengthPhase␉= FWBitRangePhase (0, 15),␊ |
696 | ␉␊ |
697 | ␉kFWIsochTag␉␉␉␉= FWBitRange (16, 17),␊ |
698 | ␉kFWIsochTagPhase␉␉= FWBitRangePhase (16, 17),␊ |
699 | ␊ |
700 | ␉kFWIsochChanNum␉␉␉= FWBitRange (18, 23),␊ |
701 | ␉kFWIsochChanNumPhase␉= FWBitRangePhase (18, 23),␊ |
702 | ␊ |
703 | ␉kFWIsochTCode␉␉␉= FWBitRange (24, 27),␊ |
704 | ␉kFWIsochTCodePhase␉␉= FWBitRangePhase (24, 27),␊ |
705 | ␊ |
706 | ␉kFWIsochSy␉␉␉␉= FWBitRange (28, 31),␊ |
707 | ␉kFWIsochSyPhase␉␉␉= FWBitRangePhase (28, 31)␊ |
708 | };␊ |
709 | ␊ |
710 | #define CHAN_BIT(x) ␉␉(((UInt64)1) << (63 - (x))␊ |
711 | #define CHAN_MASK(x) ␉␉(~CHAN_BIT(X))␊ |
712 | ␊ |
713 | typedef enum␊ |
714 | {␊ |
715 | ␉kFWNeverMultiMode = 0,␊ |
716 | ␉kFWAllowMultiMode,␊ |
717 | ␉kFWSuggestMultiMode,␊ |
718 | ␉kFWAlwaysMultiMode,␊ |
719 | ␉␊ |
720 | ␉kFWDefaultIsochResourceFlags = kFWNeverMultiMode␊ |
721 | } IOFWIsochResourceFlags ;␊ |
722 | ␊ |
723 | enum␊ |
724 | {␊ |
725 | ␉kFWIsochChannelDefaultFlags = 0,␊ |
726 | ␉kFWIsochChannelDoNotResumeOnWake = BIT(1)␊ |
727 | } ;␊ |
728 | ␊ |
729 | typedef enum␊ |
730 | {␊ |
731 | ␉kFWIsochPortDefaultOptions = 0,␊ |
732 | ␉kFWIsochPortUseSeparateKernelThread␉␉= BIT(1),␊ |
733 | ␉kFWIsochEnableRobustness␉␉␉= BIT(2),␊ |
734 | ␉kFWIsochBigEndianUpdates␉␉␉= BIT(3),␉// private␊ |
735 | ␉kFWIsochRequireLastContext␉␉␉= BIT(4),␉// private␊ |
736 | } IOFWIsochPortOptions ;␊ |
737 | ␊ |
738 | // =================================================================␊ |
739 | // DCL opcode defs.␊ |
740 | // =================================================================␊ |
741 | #pragma mark -␊ |
742 | #pragma mark DCL OPCODES␊ |
743 | ␊ |
744 | enum␊ |
745 | {␊ |
746 | ␉kFWDCLImmediateEvent␉␉␉␉= 0,␊ |
747 | ␉kFWDCLCycleEvent␉␉␉␉␉= 1,␊ |
748 | ␉kFWDCLSyBitsEvent␉␉␉␉␉= 2␊ |
749 | };␊ |
750 | ␊ |
751 | typedef enum␊ |
752 | {␊ |
753 | ␉kFWDCLInvalidNotification␉␉␉␉= 0␊ |
754 | ␉, kFWDCLUpdateNotification␉␉␉␉= 1␊ |
755 | ␉, kFWDCLModifyNotification␉␉␉␉= 2␊ |
756 | ␉, kFWNuDCLModifyNotification␉␉␉= 3␊ |
757 | ␉, kFWNuDCLModifyJumpNotification␉␉= 4␊ |
758 | ␉, kFWNuDCLUpdateNotification␉␉␉= 5␊ |
759 | } IOFWDCLNotificationType ;␊ |
760 | ␊ |
761 | enum␊ |
762 | {␊ |
763 | ␉kFWDCLOpDynamicFlag␉␉␉␉␉= BIT(16),␊ |
764 | ␉kFWDCLOpVendorDefinedFlag␉␉␉= BIT(17),␊ |
765 | ␉kFWDCLOpFlagMask␉␉␉␉␉= BitRange (16, 31),␊ |
766 | ␉kFWDCLOpFlagPhase␉␉␉␉␉= BitRangePhase (16, 31)␊ |
767 | };␊ |
768 | ␊ |
769 | enum␊ |
770 | {␊ |
771 | ␉kDCLInvalidOp␉␉␉␉␉␉= 0,␊ |
772 | ␉kDCLSendPacketStartOp␉␉␉␉= 1,␊ |
773 | ␉//kDCLSendPacketWithHeaderStartOp␉␉= 2, // Deprecated legacy DCL opcode! Use NuDCL instead!␊ |
774 | ␉kDCLSendPacketOp␉␉␉␉␉= 3,␊ |
775 | ␉kDCLSendBufferOp␉␉␉␉␉= 4,␉// obsolete - do not use␊ |
776 | ␉kDCLReceivePacketStartOp␉␉␉= 5,␊ |
777 | ␉kDCLReceivePacketOp␉␉␉␉␉= 6,␊ |
778 | ␉kDCLReceiveBufferOp␉␉␉␉␉= 7,␉// obsolete - do not use␊ |
779 | ␉kDCLCallProcOp␉␉␉␉␉␉= 8,␊ |
780 | ␉kDCLLabelOp␉␉␉␉␉␉␉= 9,␊ |
781 | ␉kDCLJumpOp␉␉␉␉␉␉␉= 10,␊ |
782 | ␉kDCLSetTagSyncBitsOp␉␉␉␉= 11,␊ |
783 | ␉kDCLUpdateDCLListOp␉␉␉␉␉= 12,␊ |
784 | ␉kDCLTimeStampOp␉␉␉␉␉␉= 13,␊ |
785 | ␉kDCLPtrTimeStampOp␉␉␉␉␉= 14,␊ |
786 | ␉kDCLSkipCycleOp␉␉␉␉␉␉= 15,␊ |
787 | ␊ |
788 | ␉kDCLNuDCLLeaderOp␉␉␉␉␉= 20␉// compilerData field contains NuDCLRef to start of NuDCL␊ |
789 | ␉␉␉␉␉␉␉␉␉␉␉␉// program.␊ |
790 | ␉␉␉␉␉␉␉␉␉␉␉␉// Should not need to use this directly.␊ |
791 | };␊ |
792 | ␊ |
793 | #ifdef FW_OLD_DCL_DEFS␊ |
794 | ␊ |
795 | //typedef struct DCLCommandStruct ;␊ |
796 | //typedef void (DCLCallCommandProc)(DCLCommandStruct* command);␊ |
797 | ␊ |
798 | #else␊ |
799 | ␊ |
800 | //typedef struct DCLCommand ;␊ |
801 | //typedef void (DCLCallCommandProc)(DCLCommand* command);␊ |
802 | ␊ |
803 | #endif␊ |
804 | ␊ |
805 | // =================================================================␊ |
806 | // DCL structs␊ |
807 | // =================================================================␊ |
808 | #pragma mark -␊ |
809 | #pragma mark DCL␊ |
810 | ␊ |
811 | #ifdef __LP64__␉␉␊ |
812 | typedef void* DCLCallProcDataType;␊ |
813 | #else␊ |
814 | typedef UInt32 DCLCallProcDataType;␊ |
815 | #endif␊ |
816 | ␊ |
817 | #ifdef KERNEL␊ |
818 | ␉#ifdef __LP64__␉␉␊ |
819 | ␉␉typedef void* DCLCompilerDataType;␊ |
820 | ␉#else␊ |
821 | ␉␉typedef UInt32 DCLCompilerDataType;␊ |
822 | ␉#endif␊ |
823 | #else␊ |
824 | ␉␉typedef UInt32 DCLCompilerDataType;␊ |
825 | #endif␊ |
826 | ␊ |
827 | typedef struct DCLCommandStruct␊ |
828 | {␊ |
829 | ␉struct DCLCommandStruct *␉pNextDCLCommand;␉␉// Next DCL command.␊ |
830 | ␉DCLCompilerDataType␉␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
831 | ␉UInt32␉␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
832 | ␉UInt32␉␉␉␉␉␉operands[1];␉␉␉// DCL operands (size varies)␊ |
833 | } DCLCommand;␊ |
834 | ␊ |
835 | typedef void (DCLCallCommandProc)(DCLCommand * command);␊ |
836 | ␊ |
837 | typedef struct DCLTransferPacketStruct␊ |
838 | {␊ |
839 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉␉// Next DCL command.␊ |
840 | ␉DCLCompilerDataType␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
841 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
842 | ␉void *␉␉␉␉␉buffer;␉␉␉␉␉// Packet buffer.␊ |
843 | ␉UInt32␉␉␉␉␉size;␉␉␉␉␉// Buffer size.␊ |
844 | } DCLTransferPacket ;␊ |
845 | ␊ |
846 | typedef struct DCLTransferBufferStruct␊ |
847 | {␊ |
848 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉␉// Next DCL command.␊ |
849 | ␉DCLCompilerDataType␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
850 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
851 | ␉void *␉␉␉␉␉buffer;␉␉␉␉␉// Buffer.␊ |
852 | ␉UInt32␉␉␉␉␉size;␉␉␉␉␉// Buffer size.␊ |
853 | ␉UInt16␉␉␉␉␉packetSize;␉␉␉␉// Size of packets to send.␊ |
854 | ␉UInt16␉␉␉␉␉reserved;␊ |
855 | ␉UInt32␉␉␉␉␉bufferOffset;␉␉␉// Current offset into buffer.␊ |
856 | } DCLTransferBuffer ;␊ |
857 | ␊ |
858 | typedef struct DCLCallProcStruct␊ |
859 | {␊ |
860 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
861 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
862 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
863 | ␉DCLCallCommandProc *␉proc;␉␉␉␉// Procedure to call.␊ |
864 | ␉DCLCallProcDataType␉␉procData;␉␉␉// Data for use by called procedure.␊ |
865 | } DCLCallProc;␊ |
866 | ␊ |
867 | typedef struct DCLLabelStruct␊ |
868 | {␊ |
869 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
870 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
871 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
872 | } DCLLabel;␊ |
873 | ␊ |
874 | typedef struct DCLJumpStruct␊ |
875 | {␊ |
876 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
877 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
878 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
879 | ␉DCLLabel *␉␉␉␉pJumpDCLLabel;␉␉// DCL label to jump to.␊ |
880 | } DCLJump;␊ |
881 | ␊ |
882 | typedef struct DCLSetTagSyncBitsStruct␊ |
883 | {␊ |
884 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
885 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
886 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
887 | ␉UInt16␉␉␉␉␉tagBits;␉␉␉// Tag bits for following packets.␊ |
888 | ␉UInt16␉␉␉␉␉syncBits;␉␉␉// Sync bits for following packets.␊ |
889 | } DCLSetTagSyncBits;␊ |
890 | ␊ |
891 | typedef struct DCLUpdateDCLListStruct␊ |
892 | {␊ |
893 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
894 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
895 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
896 | ␉DCLCommand **␉␉␉dclCommandList;␉␉// List of DCL commands to update.␊ |
897 | ␉UInt32␉␉␉␉␉numDCLCommands;␉␉// Number of DCL commands in list.␊ |
898 | } DCLUpdateDCLList;␊ |
899 | ␊ |
900 | typedef struct DCLTimeStampStruct␊ |
901 | {␊ |
902 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
903 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
904 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
905 | ␉UInt32␉␉␉␉␉timeStamp;␉␉␉// Time stamp.␊ |
906 | } DCLTimeStamp;␊ |
907 | ␊ |
908 | typedef struct DCLPtrTimeStampStruct␊ |
909 | {␊ |
910 | ␉DCLCommand *␉␉␉pNextDCLCommand;␉// Next DCL command.␊ |
911 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
912 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
913 | ␉UInt32 *␉␉␉␉timeStampPtr;␉␉// Where to store the time stamp.␊ |
914 | } DCLPtrTimeStamp ;␊ |
915 | ␊ |
916 | typedef struct ␊ |
917 | {␊ |
918 | ␉DCLCommand *␉␉␉pNextDCLCommand ;␉// unused - always NULL␊ |
919 | ␉DCLCompilerDataType␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
920 | ␉UInt32␉␉␉␉␉opcode ;␉␉␉// must be kDCLNuDCLLeaderOp␊ |
921 | ␉void*␉␉␉␉ ␉program ;␉␉␉// NuDCL program here...␊ |
922 | } DCLNuDCLLeader ;␊ |
923 | ␊ |
924 | #ifdef FW_OLD_DCL_DEFS␊ |
925 | ␊ |
926 | // should not use these...␊ |
927 | ␊ |
928 | typedef DCLCommand*␉␉␉␉DCLCommandPtr ;␊ |
929 | typedef DCLTransferBuffer*␉␉DCLTransferBufferPtr ;␊ |
930 | typedef DCLTransferPacket*␉␉DCLTransferPacketPtr ;␊ |
931 | typedef DCLCallProc*␉␉␉DCLCallProcPtr ;␊ |
932 | typedef DCLLabel*␉␉␉␉DCLLabelPtr ;␊ |
933 | typedef DCLJump*␉␉␉␉DCLJumpPtr ;␊ |
934 | typedef DCLSetTagSyncBits*␉␉DCLSetTagSyncBitsPtr ;␊ |
935 | typedef DCLUpdateDCLList*␉␉DCLUpdateDCLListPtr ;␊ |
936 | typedef DCLTimeStamp*␉␉␉DCLTimeStampPtr ;␊ |
937 | typedef DCLPtrTimeStamp*␉␉DCLPtrTimeStampPtr ;␊ |
938 | typedef DCLCallCommandProc* ␉DCLCallCommandProcPtr ;␊ |
939 | ␊ |
940 | #endif␊ |
941 | ␊ |
942 | ␊ |
943 | // =================================================================␊ |
944 | // User-Lib Export DCL structs - Thses structus are used to pass␊ |
945 | // a user-created legacy DCL program down into kernel space. These␊ |
946 | // structs allow support for both 32-bit and 64-bit user-space clients.␊ |
947 | // These structs should only be used internally. They are not for␊ |
948 | // clients to create DCL programs with.␊ |
949 | // =================================================================␊ |
950 | ␊ |
951 | typedef struct UserExportDCLCommandStruct␊ |
952 | {␊ |
953 | ␉mach_vm_address_t␉␉␉␉␉pClientDCLStruct;␉␉// A pointer to the client's DCL struct␊ |
954 | ␉mach_vm_address_t␉␉␉␉␉pNextDCLCommand;␉␉// Next DCL command.␊ |
955 | ␉uint64_t␉␉␉␉␉␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
956 | ␉UInt32␉␉␉␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
957 | ␉UInt32␉␉␉␉␉␉␉␉operands[1];␉␉␉// DCL operands (size varies)␊ |
958 | } __attribute__ ((packed)) UserExportDCLCommand;␊ |
959 | ␊ |
960 | typedef void (UserExportDCLCallCommandProc)(UserExportDCLCommand * command);␊ |
961 | ␊ |
962 | typedef struct UserExportDCLTransferPacketStruct␊ |
963 | {␊ |
964 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉␉// A pointer to the client's DCL struct␊ |
965 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉␉// Next DCL command.␊ |
966 | ␉uint64_t␉␉␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
967 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
968 | ␉mach_vm_address_t␉␉buffer;␉␉␉␉␉// Packet buffer.␊ |
969 | ␉UInt32␉␉␉␉␉size;␉␉␉␉␉// Buffer size.␊ |
970 | } __attribute__ ((packed)) UserExportDCLTransferPacket ;␊ |
971 | ␊ |
972 | typedef struct UserExportDCLTransferBufferStruct␊ |
973 | {␊ |
974 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉␉// A pointer to the client's DCL struct␊ |
975 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉␉// Next DCL command.␊ |
976 | ␉uint64_t␉␉␉␉compilerData;␉␉␉// Data for use by DCL compiler.␊ |
977 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉␉// DCL opcode.␊ |
978 | ␉mach_vm_address_t␉␉buffer;␉␉␉␉␉// Buffer.␊ |
979 | ␉UInt32␉␉␉␉␉size;␉␉␉␉␉// Buffer size.␊ |
980 | ␉UInt16␉␉␉␉␉packetSize;␉␉␉␉// Size of packets to send.␊ |
981 | ␉UInt16␉␉␉␉␉reserved;␊ |
982 | ␉UInt32␉␉␉␉␉bufferOffset;␉␉␉// Current offset into buffer.␊ |
983 | } __attribute__ ((packed)) UserExportDCLTransferBuffer ;␊ |
984 | ␊ |
985 | typedef struct UserExportDCLCallProcStruct␊ |
986 | {␊ |
987 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
988 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
989 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
990 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
991 | ␉mach_vm_address_t␉␉proc;␉␉␉␉// Procedure to call.␊ |
992 | ␉uint64_t␉␉␉␉procData;␉␉␉// Data for use by called procedure.␊ |
993 | } __attribute__ ((packed)) UserExportDCLCallProc;␊ |
994 | ␊ |
995 | typedef struct UserExportDCLLabelStruct␊ |
996 | {␊ |
997 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
998 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
999 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1000 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1001 | } __attribute__ ((packed)) UserExportDCLLabel;␊ |
1002 | ␊ |
1003 | typedef struct UserExportDCLJumpStruct␊ |
1004 | {␊ |
1005 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1006 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
1007 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1008 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1009 | ␉mach_vm_address_t␉␉pJumpDCLLabel;␉␉// DCL label to jump to.␊ |
1010 | } __attribute__ ((packed)) UserExportDCLJump;␊ |
1011 | ␊ |
1012 | typedef struct UserExportDCLSetTagSyncBitsStruct␊ |
1013 | {␊ |
1014 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1015 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
1016 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1017 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1018 | ␉UInt16␉␉␉␉␉tagBits;␉␉␉// Tag bits for following packets.␊ |
1019 | ␉UInt16␉␉␉␉␉syncBits;␉␉␉// Sync bits for following packets.␊ |
1020 | } __attribute__ ((packed)) UserExportDCLSetTagSyncBits;␊ |
1021 | ␊ |
1022 | typedef struct UserExportDCLUpdateDCLListStruct␊ |
1023 | {␊ |
1024 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1025 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
1026 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1027 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1028 | ␉mach_vm_address_t␉␉dclCommandList;␉␉// List of DCL commands to update.␊ |
1029 | ␉UInt32␉␉␉␉␉numDCLCommands;␉␉// Number of DCL commands in list.␊ |
1030 | } __attribute__ ((packed)) UserExportDCLUpdateDCLList;␊ |
1031 | ␊ |
1032 | typedef struct UserExportDCLTimeStampStruct␊ |
1033 | {␊ |
1034 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1035 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
1036 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1037 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1038 | ␉UInt32␉␉␉␉␉timeStamp;␉␉␉// Time stamp.␊ |
1039 | } __attribute__ ((packed)) UserExportDCLTimeStamp;␊ |
1040 | ␊ |
1041 | typedef struct UserExportDCLPtrTimeStampStruct␊ |
1042 | {␊ |
1043 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1044 | ␉mach_vm_address_t␉␉pNextDCLCommand;␉// Next DCL command.␊ |
1045 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1046 | ␉UInt32␉␉␉␉␉opcode;␉␉␉␉// DCL opcode.␊ |
1047 | ␉mach_vm_address_t␉␉timeStampPtr;␉␉// Where to store the time stamp.␊ |
1048 | } __attribute__ ((packed)) UserExportDCLPtrTimeStamp ;␊ |
1049 | ␊ |
1050 | typedef struct ␊ |
1051 | {␊ |
1052 | ␉mach_vm_address_t␉␉pClientDCLStruct;␉// A pointer to the client's DCL struct␊ |
1053 | ␉mach_vm_address_t␉␉pNextDCLCommand ;␉// unused - always NULL␊ |
1054 | ␉uint64_t␉␉␉␉compilerData;␉␉// Data for use by DCL compiler.␊ |
1055 | ␉UInt32␉␉␉␉␉opcode ;␉␉␉// must be kDCLNuDCLLeaderOp␊ |
1056 | ␉mach_vm_address_t␉ ␉program ;␉␉␉// NuDCL program here...␊ |
1057 | } __attribute__ ((packed)) UserExportDCLNuDCLLeader ;␊ |
1058 | ␊ |
1059 | ␊ |
1060 | // =================================================================␊ |
1061 | // NuDCL␊ |
1062 | // =================================================================␊ |
1063 | #pragma mark -␊ |
1064 | #pragma mark NUDCL␊ |
1065 | ␊ |
1066 | typedef struct __NuDCL *␉NuDCLRef ;␊ |
1067 | typedef NuDCLRef␉␉␉NuDCLSendPacketRef ;␊ |
1068 | typedef NuDCLRef␉␉␉NuDCLSkipCycleRef ;␊ |
1069 | typedef NuDCLRef␉␉␉NuDCLReceivePacketRef ;␊ |
1070 | ␊ |
1071 | typedef void (*NuDCLCallback)( void* refcon, NuDCLRef dcl );␊ |
1072 | ␊ |
1073 | typedef enum␊ |
1074 | {␊ |
1075 | ␉kNuDCLDynamic = BIT( 1 ),␊ |
1076 | ␉kNuDCLUpdateBeforeCallback = BIT( 2 )␊ |
1077 | ␊ |
1078 | } NuDCLFlags ;␊ |
1079 | ␊ |
1080 | // =================================================================␊ |
1081 | // Miscellaneous␊ |
1082 | // =================================================================␊ |
1083 | #pragma mark -␊ |
1084 | #pragma mark MISCELLANEOUS␊ |
1085 | ␊ |
1086 | typedef void* FWClientCommandID ;␊ |
1087 | ␊ |
1088 | typedef struct IOFireWireSessionRefOpaqueStuct* IOFireWireSessionRef ;␊ |
1089 | ␊ |
1090 | //␊ |
1091 | // bus management constants.␊ |
1092 | //␊ |
1093 | ␊ |
1094 | enum␊ |
1095 | {␊ |
1096 | ␉kFWBusManagerArbitrationTimeoutDuration␉= 625 // durationMillisecond␊ |
1097 | };␊ |
1098 | ␊ |
1099 | //␊ |
1100 | // bus characteristics.␊ |
1101 | //␊ |
1102 | ␊ |
1103 | enum␊ |
1104 | {␊ |
1105 | ␉kFWMaxBusses␉␉␉␉= 1023,␊ |
1106 | ␉kFWMaxNodesPerBus␉␉␉= 63,␊ |
1107 | ␉kFWMaxNodeHops␉␉␉␉= 16␊ |
1108 | };␊ |
1109 | ␊ |
1110 | /*! @enum␉␉NodeFlags␊ |
1111 | ␊ |
1112 | ␉@abstract␉Flags that specify characteristics of the FireWire device node.␊ |
1113 | ␉␊ |
1114 | ␉@constant␉kIOFWDisablePhysicalAccess ␉␉Disable physical memory access␊ |
1115 | ␉␊ |
1116 | ␉@constant␉kIOFWDisableAllPhysicalAccess␉Disable all physical memory access␊ |
1117 | ␉␊ |
1118 | ␉@constant␉kIOFWEnableRetryOnAckD␉␉␉Enable retry on Ack D␊ |
1119 | ␉␊ |
1120 | ␉@constant␉kIOFWLimitAsyncPacketSize␉␉Limit async packet size␊ |
1121 | ␉␊ |
1122 | ␉@constant␉kIOFWDisablePhyOnSleep␉␉␉Disable Phy, when machine is in Sleep mode␊ |
1123 | ␉␊ |
1124 | ␉@constant␉kIOFWMustBeRoot␉␉␉␉␉Attempt to make this device root, There is no guarentee Mac OS will succeed in making the device ␊ |
1125 | ␉ root.␊ |
1126 | ␉␉␉␉␉␉␉␉␉␉␉␉␊ |
1127 | ␉@constant␉kIOFWMustNotBeRoot␉␉␉␉Attempt to prevent this device from being root, There is no guarentee Mac OS will succeed in preventing the device ␊ |
1128 | ␉ from being root.␊ |
1129 | ␉␉␉␉␉␉␉␉␉␉␉␉␊ |
1130 | ␉@constant␉kIOFWMustHaveGap63␉␉␉␉Attempt to ensure the gap count is 63, when this device is on the bus. Gap 63 reduces bus performance significantly,␊ |
1131 | ␉␉␉␉␉␉␉␉␉␉␉␉so this flag should be used only when absolutely necessary. There is no guarentee Mac OS will succeed in forcing␊ |
1132 | ␉␉␉␉␉␉␉␉␉␉␉␉the gap count to 63.␊ |
1133 | */␊ |
1134 | enum␊ |
1135 | {␊ |
1136 | kIOFWDisablePhysicalAccess ␉␉= (1 << 0),␊ |
1137 | ␉kIOFWDisableAllPhysicalAccess ␉= (1 << 1),␊ |
1138 | ␉kIOFWEnableRetryOnAckD␉␉␉= (1 << 2),␊ |
1139 | ␉kIOFWLimitAsyncPacketSize␉␉= (1 << 3),␊ |
1140 | ␉kIOFWDisablePhyOnSleep␉␉␉= (1 << 4),␊ |
1141 | ␉kIOFWMustBeRoot␉␉␉␉␉= (1 << 5),␊ |
1142 | ␉kIOFWMustNotBeRoot␉␉␉␉= (1 << 6),␊ |
1143 | ␉kIOFWMustHaveGap63␉␉␉␉= (1 << 7)␊ |
1144 | };␊ |
1145 | ␊ |
1146 | //␊ |
1147 | // write flags␊ |
1148 | //␊ |
1149 | ␊ |
1150 | enum IOFWWriteFlags␊ |
1151 | {␊ |
1152 | ␉kIOFWWriteFlagsNone␉␉␉␉= 0x00000000,␊ |
1153 | ␉kIOFWWriteFlagsDeferredNotify ␉= 0x00000001,␊ |
1154 | ␉kIOFWWriteFastRetryOnBusy␉␉= 0x00000002,␊ |
1155 | ␉kIOFWWriteBlockRequest␉␉␉= 0x00000004,␉␉// force a block request␊ |
1156 | };␊ |
1157 | ␊ |
1158 | //␊ |
1159 | // read flags␊ |
1160 | //␊ |
1161 | ␊ |
1162 | enum IOFWReadFlags␊ |
1163 | {␊ |
1164 | ␉kIOFWReadFlagsNone␉␉␉␉= 0x00000000,␊ |
1165 | ␉kIOFWReadBlockRequest␉␉␉= 0x00000004,␉␉// force a block request␊ |
1166 | ␉kIOFWReadPingTime␉␉␉␉= 0x00000008␉␉// ping time␊ |
1167 | };␊ |
1168 | ␊ |
1169 | //␊ |
1170 | // security modes␊ |
1171 | //␊ |
1172 | ␊ |
1173 | enum IOFWSecurityMode␊ |
1174 | {␊ |
1175 | ␉kIOFWSecurityModeNormal = 0,␊ |
1176 | ␉kIOFWSecurityModeSecure = 1,␊ |
1177 | ␉kIOFWSecurityModeSecurePermanent = 2␊ |
1178 | };␊ |
1179 | ␊ |
1180 | //␊ |
1181 | // physical access settings␊ |
1182 | //␊ |
1183 | ␊ |
1184 | enum IOFWPhysicalAccessMode␊ |
1185 | {␊ |
1186 | ␉kIOFWPhysicalAccessEnabled = 0,␊ |
1187 | ␉kIOFWPhysicalAccessDisabled = 1,␊ |
1188 | ␉kIOFWPhysicalAccessDisabledForGeneration = 2␊ |
1189 | };␊ |
1190 | ␊ |
1191 | enum␊ |
1192 | {␊ |
1193 | ␉kIOFWSpecID_AAPL = 0xa27,␊ |
1194 | ␉kIOFWSWVers_KPF = 0x40␊ |
1195 | };␊ |
1196 | ␊ |
1197 | // old style bit defs␊ |
1198 | #ifdef FW_OLD_BIT_DEFS␊ |
1199 | ␊ |
1200 | ␉#define kBit0␉BIT(0)␊ |
1201 | ␉#define kBit1␉BIT(1)␊ |
1202 | ␉#define kBit2␉BIT(2)␊ |
1203 | ␉#define kBit3␉BIT(3)␊ |
1204 | ␉#define kBit4␉BIT(4)␊ |
1205 | ␉#define kBit5␉BIT(5)␊ |
1206 | ␉#define kBit6␉BIT(6)␊ |
1207 | ␉#define kBit7␉BIT(7)␊ |
1208 | ␉#define kBit8␉BIT(8)␊ |
1209 | ␉#define kBit9␉BIT(9)␊ |
1210 | ␉#define kBit10␉BIT(10)␊ |
1211 | ␉#define kBit11␉BIT(11)␊ |
1212 | ␉#define kBit12␉BIT(12)␊ |
1213 | ␉#define kBit13␉BIT(13)␊ |
1214 | ␉#define kBit14␉BIT(14)␊ |
1215 | ␉#define kBit15␉BIT(15)␊ |
1216 | ␉#define kBit16␉BIT(16)␊ |
1217 | ␉#define kBit17␉BIT(17)␊ |
1218 | ␉#define kBit18␉BIT(18)␊ |
1219 | ␉#define kBit19␉BIT(19)␊ |
1220 | ␉#define kBit20␉BIT(20)␊ |
1221 | ␉#define kBit21␉BIT(21)␊ |
1222 | ␉#define kBit22␉BIT(22)␊ |
1223 | ␉#define kBit23␉BIT(23)␊ |
1224 | ␉#define kBit24␉BIT(24)␊ |
1225 | ␉#define kBit25␉BIT(25)␊ |
1226 | ␉#define kBit26␉BIT(26)␊ |
1227 | ␉#define kBit27␉BIT(27)␊ |
1228 | ␉#define kBit28␉BIT(28)␊ |
1229 | ␉#define kBit29␉BIT(29)␊ |
1230 | ␉#define kBit30␉BIT(30)␊ |
1231 | ␉#define kBit31␉BIT(31)␊ |
1232 | ␊ |
1233 | #endif␊ |
1234 | ␊ |
1235 | #endif //__IOFireWireFamilyCommon_H__␊ |
1236 |