]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/scsi/scsi-device/IOSCSICommand.h
2 * Copyright (c) 1998-2000 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@
27 #ifndef _IOSCSICOMMAND_H
28 #define _IOSCSICOMMAND_H
33 class IOSCSICommand
: public IOCDBCommand
35 OSDeclareAbstractStructors(IOSCSICommand
)
37 /*------------------Methods provided to IOCDBCommand users -------------------------*/
40 * Set/Get IOMemoryDescriptor object to I/O data buffer or sense data buffer.
42 virtual void setPointers( IOMemoryDescriptor
*desc
,
45 bool isSense
= false ) = 0;
47 virtual void getPointers( IOMemoryDescriptor
**desc
,
48 UInt32
*transferCount
,
50 bool isSense
= false ) = 0;
52 * Set/Get command timeout (mS)
54 virtual void setTimeout( UInt32 timeoutmS
) = 0;
55 virtual UInt32
getTimeout() = 0;
58 * Set async callback routine. Specifying no parameters indicates synchronous call.
60 virtual void setCallback( void *target
= 0, CallbackFn callback
= 0, void *refcon
= 0 ) = 0;
63 * Set/Get CDB information. (Generic CDB version)
65 virtual void setCDB( CDBInfo
*cdbInfo
) = 0;
66 virtual void getCDB( CDBInfo
*cdbInfo
) = 0;
69 * Get CDB results. (Generic CDB version)
71 virtual IOReturn
getResults( CDBResults
*cdbResults
) = 0;
74 * Get CDB Device this command is directed to.
76 virtual IOCDBDevice
*getDevice( IOCDBDevice
*deviceType
) = 0;
81 virtual bool execute( UInt32
*sequenceNumber
= 0 ) = 0;
82 virtual void abort( UInt32 sequenceNumber
) = 0;
83 virtual void complete() = 0;
86 * Get pointers to client and command data.
88 virtual void *getCommandData() = 0;
89 virtual void *getClientData() = 0;
92 * Get unique sequence number assigned to command.
94 virtual UInt32
getSequenceNumber() = 0;
96 /*------------------ Additional methods provided to IOSCSICommand users -------------------------*/
99 * Set/Get CDB information. (SCSI specific version).
101 virtual void setCDB( SCSICDBInfo
*scsiCmd
) = 0;
102 virtual void getCDB( SCSICDBInfo
*scsiCmd
) = 0;
105 * Get/Set CDB results. (SCSI specific version).
107 virtual IOReturn
getResults( SCSIResults
*results
) = 0;
108 virtual void setResults( SCSIResults
*results
) = 0;
111 * Get SCSI Device this command is directed to.
113 virtual IOSCSIDevice
*getDevice( IOSCSIDevice
*deviceType
) = 0;
116 * Get SCSI Target/Lun for this command.
118 virtual void getTargetLun( SCSITargetLun
*targetLun
) = 0;
121 * Get/Set queue routing for this command.
123 virtual void setQueueInfo( UInt32 forQueueType
= kQTypeNormalQ
, UInt32 forQueuePosition
= kQPositionTail
) = 0;
124 virtual void getQueueInfo( UInt32
*forQueueType
, UInt32
*forQueuePosition
= 0 ) = 0;
127 * Set to blank state, call prior to re-use of this object.
129 virtual void zeroCommand() = 0;