]>
Commit | Line | Data |
---|---|---|
1c79356b A |
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 | * IOATADevice.h | |
25 | * | |
26 | * | |
27 | * Methods in this header provide information about the ATA device | |
28 | * the device client driver is submitting the ATACommand(s) to. | |
29 | * | |
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 | |
32 | * IOATACommand.h | |
33 | */ | |
34 | ||
35 | #ifndef _IOATADEVICE_H | |
36 | #define _IOATADEVICE_H | |
37 | ||
38 | class IOATACommand; | |
39 | ||
40 | class IOATADevice : public IOCDBDevice | |
41 | { | |
42 | OSDeclareAbstractStructors(IOATADevice) | |
43 | ||
44 | /*------------------Methods provided to IOCDBDevice clients-----------------------*/ | |
45 | public: | |
46 | ||
47 | /* | |
48 | * Allocate a CDB Command | |
49 | */ | |
50 | virtual IOCDBCommand *allocCommand( IOCDBDevice *cdbDevice, UInt32 clientDataSize = 0 ) = 0; | |
51 | ||
52 | /* | |
53 | * Abort all outstanding commands on this device | |
54 | */ | |
55 | virtual void abort() = 0; | |
56 | ||
57 | /* | |
58 | * Reset device (also aborts all outstanding commands) | |
59 | */ | |
60 | virtual void reset() = 0; | |
61 | ||
62 | /* | |
63 | * Obtain information about this device | |
64 | */ | |
65 | virtual void getInquiryData( void *inquiryBuffer, | |
66 | UInt32 inquiryBufSize, | |
67 | UInt32 *inquiryDataSize ) = 0; | |
68 | ||
69 | /*------------------Additional methods provided to IOATADevice clients-----------------------*/ | |
70 | public: | |
71 | /* | |
72 | * Allocate a ATACommand | |
73 | */ | |
74 | virtual IOATACommand *allocCommand( IOATADevice *scsiDevice, UInt32 clientDataSize = 0 ) = 0; | |
75 | ||
76 | /* | |
77 | * Obtain information about this device | |
78 | */ | |
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; | |
89 | ||
90 | /* | |
91 | * Select default device timing for this device | |
92 | */ | |
93 | virtual bool selectTiming( ATATimingProtocol timingProtocol, bool fNotifyMsg = false ) = 0; | |
94 | ||
95 | /* | |
96 | * Queue management commands | |
97 | */ | |
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; | |
102 | ||
103 | }; | |
104 | ||
105 | #define kIOATADevice ((IOATADevice *)0) | |
106 | ||
107 | #endif |