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 * Methods in this header provide information about the ATA device
28 * the device client driver is submitting the ATACommand(s) to.
30 * Note: ATACommand(s) are allocated and freed by methods in this class.
31 * The remaining methods to setup and submit ATACommands are defined in
35 #ifndef _IOATADEVICE_H
36 #define _IOATADEVICE_H
40 class IOATADevice
: public IOCDBDevice
42 OSDeclareAbstractStructors(IOATADevice
)
44 /*------------------Methods provided to IOCDBDevice clients-----------------------*/
48 * Allocate a CDB Command
50 virtual IOCDBCommand
*allocCommand( IOCDBDevice
*cdbDevice
, UInt32 clientDataSize
= 0 ) = 0;
53 * Abort all outstanding commands on this device
55 virtual void abort() = 0;
58 * Reset device (also aborts all outstanding commands)
60 virtual void reset() = 0;
63 * Obtain information about this device
65 virtual void getInquiryData( void *inquiryBuffer
,
66 UInt32 inquiryBufSize
,
67 UInt32
*inquiryDataSize
) = 0;
69 /*------------------Additional methods provided to IOATADevice clients-----------------------*/
72 * Allocate a ATACommand
74 virtual IOATACommand
*allocCommand( IOATADevice
*scsiDevice
, UInt32 clientDataSize
= 0 ) = 0;
77 * Obtain information about this device
79 virtual ATAUnit
getUnit() = 0;
80 virtual ATADeviceType
getDeviceType() = 0;
81 virtual bool getIdentifyData( ATAIdentify
*identifyBuffer
) = 0;
82 virtual bool getInquiryData( UInt32 inquiryBufSize
, ATAPIInquiry
*inquiryBuffer
) = 0;
83 virtual bool getDeviceCapacity( UInt32
*blockMax
, UInt32
*blockSize
) = 0;
84 virtual bool getProtocolsSupported( ATAProtocol
*protocolsSupported
) = 0;
85 virtual bool getTimingsSupported( ATATimingProtocol
*timingsSupported
) = 0;
86 virtual bool getTimingSelected( ATATimingProtocol
*timingProtocol
) = 0;
87 virtual bool getTiming( ATATimingProtocol
*timingProtocol
, ATATiming
*timing
) = 0;
88 virtual bool getATAPIPktInt() = 0;
91 * Select default device timing for this device
93 virtual bool selectTiming( ATATimingProtocol timingProtocol
, bool fNotifyMsg
= false ) = 0;
96 * Queue management commands
98 virtual void holdQueue( UInt32 queueType
) = 0;
99 virtual void releaseQueue( UInt32 queueType
) = 0;
100 virtual void flushQueue( UInt32 queueType
, IOReturn rc
) = 0;
101 virtual void notifyIdle( void *target
= 0, CallbackFn callback
= 0, void *refcon
= 0 ) = 0;
105 #define kIOATADevice ((IOATADevice *)0)