1/*
2 * Copyright (c) 1998-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24
25#ifndef _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_TIMESTAMPS_H_
26#define _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_TIMESTAMPS_H_
27
28#include <IOKit/IOTypes.h>
29
30#include <sys/kdebug.h>
31#include <IOKit/scsi/IOSCSIArchitectureModelFamilyTimestamps.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37
38
39
40/* The trace codes consist of the following (see IOSCSIArchitectureModelFamilyTimestamps.h):
41 *
42 * ----------------------------------------------------------------------
43 *|              |               |              |               |Func   |
44 *| Class (8)    | SubClass (8)  | SAM Class(6) |  Code (8)     |Qual(2)|
45 * ----------------------------------------------------------------------
46 *
47 * DBG_IOKIT(05h)  DBG_IOSAM(27h)	  (20h)
48 *
49 * See <sys/kdebug.h> and IOTimeStamp.h for more details.
50 *
51 */
52
53// FireWire tracepoints								0x05278000 - 0x052783FF
54enum
55{
56	kGUID								= 1,		/* 0x05278004 */
57	kLoginRequest						= 2,		/* 0x05278008 */
58	kLoginCompletion					= 3,		/* 0x0527800C */
59	kLoginLost							= 4,		/* 0x05278010 */
60	kLoginResumed						= 5,		/* 0x05278014 */
61	kSendSCSICommand1					= 6,		/* 0x05278018 */
62	kSendSCSICommand2					= 7,		/* 0x0527801C */
63	kSCSICommandSenseData				= 8,		/* 0x05278020 */
64	kCompleteSCSICommand				= 9,		/* 0x05278024 */
65	kSubmitOrb							= 10,		/* 0x05278028 */
66	kStatusNotify						= 11,		/* 0x0527802C */
67	kFetchAgentReset					= 12,		/* 0x05278030 */
68	kFetchAgentResetComplete			= 13,		/* 0x05278034 */
69	kLogicalUnitReset					= 14,		/* 0x05278038 */
70	kLogicalUnitResetComplete			= 15		/* 0x0527803C */
71};
72
73// Tracepoint macros.
74#define FW_TRACE(code)	( ( ( DBG_IOKIT & 0xFF ) << 24) | ( ( DBG_IOSAM & 0xFF ) << 16 ) | ( kSAMClassFireWire << 10 ) | ( ( code & 0xFF ) << 2 ) )
75
76#ifdef __cplusplus
77}
78#endif
79
80
81#endif	/* _IOKIT_IO_FIREWIRE_SERIAL_BUS_PROTOCOL_TRANSPORT_TIMESTAMPS_H_ */
82