2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 /* Sym8xxInterface.h created by russb2 on Sat 30-May-1998 */
26 * This file contains shared data structures between the script and the driver
30 #define MAX_SCSI_TARGETS 16
31 #define MAX_SCSI_LUNS 8
32 #define MAX_SCSI_TAG 256
33 #define MIN_SCSI_TAG 128
35 #define kHostAdapterSCSIId 7
37 #define MAX_SCHED_MAILBOXES 256
38 #define kMailBoxEmpty 0
39 #define kMailBoxCancel 1
41 #define kSCSITimerIntervalMS 250
42 #define kReqSenseTimeoutMS 3000
43 #define kAbortTimeoutMS 3000
44 #define kResetQuiesceDelayMS 3000
45 #define kAbortScriptTimeoutMS 50
48 * NEXUS DATA Structure
50 * The Nexus structure contains per-request information for the script/driver
51 * to execute a SCSI request.
54 typedef struct SGEntry
61 * Note: There are (3) SG List entries reserved for use by the driver,
62 * i.e SG Entries 0-1 and the last entry in the list.
64 #define MAX_SGLIST_ENTRIES (64+3)
67 * This part of the Nexus structure contains the script engine clock registers to
68 * be used for this request. This information is also contained in the per-target
69 * table (AdapterInterface->targetClocks).
71 typedef struct NexusParms
80 * Pointers in the Nexus to our CDB/MsgOut data are in this format.
82 typedef struct NexusData
88 typedef struct Nexus Nexus
;
91 NexusParms targetParms
;
98 UInt32 currentDataPtr
;
102 UInt8 dataXferCalled
;
103 UInt8 wideResidCount
;
107 * Data buffers for nexus
112 SGEntry sgListData
[MAX_SGLIST_ENTRIES
];
119 * The mailbox is used to send an Abort or Bus Device Reset to a device
120 * This mailbox is 4 bytes long, and all the necessary information are
121 * contained in this mailbox (No nexus Data associated)
123 typedef struct IOAbortBdrMailBox
125 UInt8 identify
; /* Identify msg (0xC0) if Abort A0 */
126 UInt8 tag
; /* Tag Message or Zero A1 */
127 UInt8 scsi_id
; /* SCSI id of the target of the request A2 */
128 UInt8 message
; /* Abort(0x06) or Bdr(0x0C) or AbortTag (0x0D) A3 */
134 * This mailbox is used to signal the completion of an I/O to the driver.
137 typedef struct IODoneMailBox
139 UInt8 nexus
; /* Nexus of the completed I/O */
140 UInt8 status
; /* Status of the completed I/O */
142 UInt8 semaphore
; /* If set, these contents are valid */
148 * This structure contains the shared data between the script and
149 * the driver. The script's local variable table is updated to point to the
150 * physical addresses of the data in this control block.
153 typedef struct TargetClocks
161 typedef struct AdapterInterface
163 Nexus
**nexusPtrsVirt
;
164 Nexus
**nexusPtrsPhys
;
166 Nexus
*nexusArrayPhys
[MAX_SCSI_TAG
]; /* Active SRBs or -1 */
167 Nexus
*schedMailBox
[MAX_SCHED_MAILBOXES
]; /* New SRBs */
168 TargetClocks targetClocks
[MAX_SCSI_TARGETS
];
170 UInt32 xferSWideInst
[4];
174 #define SCRIPT_VAR(x) ( *(UInt32 *)(chipRamAddr+(x)) )