]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/cdb/IOCDBCommand.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 _IOCDBCOMMAND_H
28 #define _IOCDBCOMMAND_H
30 #include <IOKit/IOCommand.h>
32 typedef void (*CallbackFn
)(void *target
, void *refcon
);
36 class IOCDBCommand
: public IOCommand
38 OSDeclareAbstractStructors(IOCDBCommand
)
40 /*------------------Methods provided to IOCDBCommand users -------------------------*/
43 * Set/Get IOMemoryDescriptor object to I/O data buffer or sense data buffer.
45 virtual void setPointers( IOMemoryDescriptor
*desc
,
48 bool isSense
= false ) = 0;
50 virtual void getPointers( IOMemoryDescriptor
**desc
,
51 UInt32
*transferCount
,
53 bool isSense
= false ) = 0;
55 * Set/Get command timeout (mS)
57 virtual void setTimeout( UInt32 timeoutmS
) = 0;
58 virtual UInt32
getTimeout() = 0;
61 * Set async callback routine. Specifying no parameters indicates synchronous call.
63 virtual void setCallback( void *target
= 0, CallbackFn callback
= 0, void *refcon
= 0 ) = 0;
66 * Set/Get CDB information. (Generic CDB version)
68 virtual void setCDB( CDBInfo
*cdbInfo
) = 0;
69 virtual void getCDB( CDBInfo
*cdbInfo
) = 0;
72 * Get CDB results. (Generic CDB version)
74 virtual IOReturn
getResults( CDBResults
*cdbResults
) = 0;
77 * Get CDB Device this command is directed to.
79 virtual IOCDBDevice
*getDevice( IOCDBDevice
*deviceType
) = 0;
80 #define kIOCDBDevice ((IOCDBDevice *)0)
85 virtual bool execute( UInt32
*sequenceNumber
= 0 ) = 0;
86 virtual void abort( UInt32 sequenceNumber
) = 0;
87 virtual void complete() = 0;
90 * Get pointers to client and command data.
92 virtual void *getCommandData() = 0;
93 virtual void *getClientData() = 0;
96 * Get unique sequence number assigned to command.
98 virtual UInt32
getSequenceNumber() = 0;