]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/ata/ata-device/IOATACommand.h
ad7737fcaa992a2836d18ac5277e160a8c31f092
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 _IOATACOMMAND_H
28 #define _IOATACOMMAND_H
33 class IOATACommand
: public IOCDBCommand
35 OSDeclareAbstractStructors(IOATACommand
)
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 IOATACommand users -------------------------*/
99 * Set/Get ATA taskfile information.
101 virtual void setTaskfile( ATATaskfile
*taskfile
) = 0;
102 virtual void getTaskfile( ATATaskfile
*taskfile
) = 0;
103 virtual ATAProtocol
getProtocol() = 0;
104 virtual UInt32
getResultMask() = 0;
105 virtual UInt32
getFlags() = 0;
108 * Set/Get CDB information. (ATA specific version).
110 virtual void setCDB( ATACDBInfo
*scsiCmd
) = 0;
111 virtual void getCDB( ATACDBInfo
*scsiCmd
) = 0;
114 * Get/Set CDB results. (ATA specific version).
116 virtual IOReturn
getResults( ATAResults
*results
) = 0;
117 virtual void setResults( ATAResults
*results
) = 0;
120 * Get ATA Device this command is directed to.
122 virtual IOATADevice
*getDevice( IOATADevice
*deviceType
) = 0;
125 * Get ATA Target/Lun for this command.
127 virtual ATAUnit
getUnit() = 0;
130 * Get/Set queue routing for this command.
132 virtual void setQueueInfo( UInt32 forQueueType
= kATAQTypeNormalQ
, UInt32 forQueuePosition
= kATAQPositionTail
) = 0;
133 virtual void getQueueInfo( UInt32
*forQueueType
, UInt32
*forQueuePosition
= 0 ) = 0;