]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/ata/ata-device/IOATACommand.h
ad7737fcaa992a2836d18ac5277e160a8c31f092
[apple/xnu.git] / iokit / IOKit / ata / ata-device / IOATACommand.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 * IOATACommand.h
25 *
26 */
27 #ifndef _IOATACOMMAND_H
28 #define _IOATACOMMAND_H
29
30 class IOATADevice;
31 class IOATACommand;
32
33 class IOATACommand : public IOCDBCommand
34 {
35 OSDeclareAbstractStructors(IOATACommand)
36
37 /*------------------Methods provided to IOCDBCommand users -------------------------*/
38 public:
39 /*
40 * Set/Get IOMemoryDescriptor object to I/O data buffer or sense data buffer.
41 */
42 virtual void setPointers( IOMemoryDescriptor *desc,
43 UInt32 transferCount,
44 bool isWrite,
45 bool isSense = false ) = 0;
46
47 virtual void getPointers( IOMemoryDescriptor **desc,
48 UInt32 *transferCount,
49 bool *isWrite,
50 bool isSense = false ) = 0;
51 /*
52 * Set/Get command timeout (mS)
53 */
54 virtual void setTimeout( UInt32 timeoutmS ) = 0;
55 virtual UInt32 getTimeout() = 0;
56
57 /*
58 * Set async callback routine. Specifying no parameters indicates synchronous call.
59 */
60 virtual void setCallback( void *target = 0, CallbackFn callback = 0, void *refcon = 0 ) = 0;
61
62 /*
63 * Set/Get CDB information. (Generic CDB version)
64 */
65 virtual void setCDB( CDBInfo *cdbInfo ) = 0;
66 virtual void getCDB( CDBInfo *cdbInfo ) = 0;
67
68 /*
69 * Get CDB results. (Generic CDB version)
70 */
71 virtual IOReturn getResults( CDBResults *cdbResults ) = 0;
72
73 /*
74 * Get CDB Device this command is directed to.
75 */
76 virtual IOCDBDevice *getDevice( IOCDBDevice *deviceType ) = 0;
77
78 /*
79 * Command verbs
80 */
81 virtual bool execute( UInt32 *sequenceNumber = 0 ) = 0;
82 virtual void abort( UInt32 sequenceNumber ) = 0;
83 virtual void complete() = 0;
84
85 /*
86 * Get pointers to client and command data.
87 */
88 virtual void *getCommandData() = 0;
89 virtual void *getClientData() = 0;
90
91 /*
92 * Get unique sequence number assigned to command.
93 */
94 virtual UInt32 getSequenceNumber() = 0;
95
96 /*------------------ Additional methods provided to IOATACommand users -------------------------*/
97 public:
98 /*
99 * Set/Get ATA taskfile information.
100 */
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;
106
107 /*
108 * Set/Get CDB information. (ATA specific version).
109 */
110 virtual void setCDB( ATACDBInfo *scsiCmd ) = 0;
111 virtual void getCDB( ATACDBInfo *scsiCmd ) = 0;
112
113 /*
114 * Get/Set CDB results. (ATA specific version).
115 */
116 virtual IOReturn getResults( ATAResults *results ) = 0;
117 virtual void setResults( ATAResults *results ) = 0;
118
119 /*
120 * Get ATA Device this command is directed to.
121 */
122 virtual IOATADevice *getDevice( IOATADevice *deviceType ) = 0;
123
124 /*
125 * Get ATA Target/Lun for this command.
126 */
127 virtual ATAUnit getUnit() = 0;
128
129 /*
130 * Get/Set queue routing for this command.
131 */
132 virtual void setQueueInfo( UInt32 forQueueType = kATAQTypeNormalQ, UInt32 forQueuePosition = kATAQPositionTail ) = 0;
133 virtual void getQueueInfo( UInt32 *forQueueType, UInt32 *forQueuePosition = 0 ) = 0;
134
135 };
136
137 #endif