]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/scsi/scsi-device/SCSIDevice.h
c8e019d0a77820cd60889988355004e937b365fd
[apple/xnu.git] / iokit / IOKit / scsi / scsi-device / SCSIDevice.h
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 *
24 * SCSIDevice.h
25 *
26 */
27
28 #ifndef _SCSIDEVICE_H
29 #define _SCSIDEVICE_H
30
31 #define kDefaultInquirySize 255
32
33 typedef struct SCSITargetLun
34 {
35 UInt8 target;
36 UInt8 lun;
37 UInt8 reserved[2];
38 } SCSITargetLun;
39
40 typedef struct SCSILunParms
41 {
42 Boolean disableDisconnect;
43
44 UInt32 reserved[16];
45 } SCSILunParms;
46
47 typedef struct SCSITargetParms
48 {
49 UInt32 transferPeriodpS;
50 UInt32 transferOffset;
51 UInt32 transferWidth;
52 UInt32 transferOptions;
53
54 Boolean enableTagQueuing;
55 Boolean disableParity;
56
57 UInt32 reserved[16];
58 } SCSITargetParms;
59
60 enum SCSITransferOptions
61 {
62 kSCSITransferOptionClockDT = 0x00000001,
63 kSCSITransferOptionQAS = 0x00000100,
64 kSCSITransferOptionIUS = 0x00000200,
65 kSCSITransferOptionPPR = 0x00000400,
66 };
67
68 #define kSCSITransferOptionsSCSI3 (kSCSITransferOptionClockDT | kSCSITransferOptionQAS | kSCSITransferOptionIUS | kSCSITransferOptionPPR)
69
70
71 enum SCSIDeviceTimeouts
72 {
73 kSCSITimerIntervalmS = 500,
74 kSCSIProbeTimeoutmS = 5000,
75 kSCSIResetIntervalmS = 3000,
76 kSCSIAbortTimeoutmS = 5000,
77 kSCSIReqSenseTimeoutmS = 5000,
78 kSCSIDisableTimeoutmS = 5000,
79 };
80
81 enum SCSIClientMessage
82 {
83 kSCSIClientMsgNone = 0x00005000,
84 kSCSIClientMsgDeviceAbort,
85 kSCSIClientMsgDeviceReset,
86 kSCSIClientMsgBusReset,
87
88 kSCSIClientMsgDone = 0x80000000,
89 };
90
91 enum SCSIQueueType
92 {
93 kQTypeNormalQ = 0,
94 kQTypeBypassQ = 1,
95 };
96
97 enum SCSIQueuePosition
98 {
99 kQPositionTail = 0,
100 kQPositionHead = 1,
101 };
102
103
104 #define kSCSIMaxProperties 12
105
106 #define kSCSIPropertyTarget "SCSI Target" /* OSNumber */
107 #define kSCSIPropertyLun "SCSI Lun" /* OSNumber */
108 #define kSCSIPropertyIOUnit "IOUnit" /* OSNumber */
109 #define kSCSIPropertyDeviceTypeID "SCSI Device Type" /* OSNumber */
110 #define kSCSIPropertyRemovableMedia "SCSI Removable Media" /* OSBoolean */
111 #define kSCSIPropertyVendorName "SCSI Vendor Name" /* OSString */
112 #define kSCSIPropertyProductName "SCSI Product Name" /* OSString */
113 #define kSCSIPropertyProductRevision "SCSI Product Revision" /* OSString */
114 #define kSCSIPropertyTransferPeriod "SCSI Transfer Period" /* OSNumber */
115 #define kSCSIPropertyTransferOffset "SCSI Transfer Offset" /* OSNumber */
116 #define kSCSIPropertyTransferWidth "SCSI Transfer Width" /* OSNumber */
117 #define kSCSIPropertyTransferOptions "SCSI Transfer Options" /* OSNumber */
118 #define kSCSIPropertyCmdQueue "SCSI CmdQueue Enabled" /* OSNumber */
119
120 #endif