4 * Modifed by Eryk Vershen
5 * from an original by Martin Minow
9 * Copyright 1993-1998 by Apple Computer, Inc.
12 * Permission to use, copy, modify, and distribute this software and
13 * its documentation for any purpose and without fee is hereby granted,
14 * provided that the above copyright notice appears in all copies and
15 * that both the copyright notice and this permission notice appear in
16 * supporting documentation.
18 * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
19 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE.
22 * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
23 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
25 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
26 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29 #ifndef __DoScsiCommand__
30 #define __DoScsiCommand__
33 #include "MacSCSICommand.h"
52 #define kOriginalSCSIBusAdaptor (0xFF)
54 #define SameSCSIDevice(a, b) ((*((UInt32 *) &a)) == (*((UInt32 *) &b)))
57 * Cheap 'n dirty memory clear routine.
59 #define CLEAR(dst) clear_memory((void *) &dst, sizeof dst)
65 #if !defined(__NewTypesDefined__)
66 #define __NewTypesDefined__
67 typedef signed char SInt8
;
68 typedef signed short SInt16
;
69 typedef signed long SInt32
;
70 typedef unsigned char UInt8
;
71 typedef unsigned short UInt16
;
72 typedef unsigned long UInt32
;
73 typedef unsigned long ItemCount
;
74 typedef unsigned long ByteCount
;
96 EXTERN
int gSCSIHiBusID
;
97 EXTERN SCSIExecIOPB
*gSCSIExecIOPBPtr
;
98 EXTERN UInt32 gSCSIExecIOPBPtrLen
;
102 * Forward declarations
105 Boolean
IsIllegalRequest(OSErr scsiStatus
, const SCSI_Sense_Data
*senseDataPtr
);
106 Boolean
IsNoMedia(OSErr scsiStatus
, const SCSI_Sense_Data
*senseDataPtr
);
108 * All SCSI Commands come here.
109 * if scsiDevice.busID == kOriginalSCSIBusAdaptor, IM-IV SCSI will be called.
110 * scsiFlags should be scsiDirectionNone, scsiDirectionIn, or scsiDirectionOut
111 * actualTransferCount may be NULL if you don't care.
112 * Both old and new SCSI return SCSI Manager 4.3 errors.
114 * DoSCSICommand throws really serious errors, but returns SCSI errors such
115 * as dataRunError and scsiDeviceNotThere.
118 DeviceIdent scsiDevice
,
119 ConstStr255Param currentAction
,
120 const SCSI_CommandPtr callerSCSICommand
,
122 ByteCount dataLength
,
124 ByteCount
*actualTransferCount
,
125 SCSI_Sense_Data
*sensePtr
,
126 StringPtr senseMessage
130 #endif /* __DoScsiCommand__ */