]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/ata/IOATAHDDriveNub.h
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / ata / IOATAHDDriveNub.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 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
24 *
25 * IOATAHDDriveNub.h
26 *
27 * This subclass implements a relay to a protocol and device-specific
28 * provider.
29 *
30 * HISTORY
31 * Aug 27, 1999 jliu - Created.
32 */
33
34 #ifndef _IOATAHDDRIVENUB_H
35 #define _IOATAHDDRIVENUB_H
36
37 #include <IOKit/IOTypes.h>
38 #include <IOKit/storage/IOBlockStorageDevice.h>
39
40 class IOATAHDDrive;
41
42 class IOATAHDDriveNub : public IOBlockStorageDevice
43 {
44 OSDeclareDefaultStructors(IOATAHDDriveNub)
45
46 protected:
47 IOATAHDDrive * _provider;
48
49 public:
50 /*
51 * Overrides from IOService.
52 */
53 virtual bool attach(IOService * provider);
54 virtual void detach(IOService * provider);
55
56 /*
57 * Mandatory overrides from IOBlockStorageDevice.
58 */
59 virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor * buffer,
60 UInt32 block,
61 UInt32 nblks,
62 IOStorageCompletion completion);
63 virtual IOReturn doSyncReadWrite(IOMemoryDescriptor * buffer,
64 UInt32 block,
65 UInt32 nblks);
66 virtual IOReturn doEjectMedia();
67 virtual IOReturn doFormatMedia(UInt64 byteCapacity);
68 virtual UInt32 doGetFormatCapacities(UInt64 * capacities,
69 UInt32 capacitiesMaxCount) const;
70 virtual IOReturn doLockUnlockMedia(bool doLock);
71 virtual IOReturn doSynchronizeCache();
72 virtual char * getVendorString();
73 virtual char * getProductString();
74 virtual char * getRevisionString();
75 virtual char * getAdditionalDeviceInfoString();
76 virtual IOReturn reportBlockSize(UInt64 * blockSize);
77 virtual IOReturn reportEjectability(bool * isEjectable);
78 virtual IOReturn reportLockability(bool * isLockable);
79 virtual IOReturn reportMediaState(bool * mediaPresent, bool * changed);
80 virtual IOReturn reportPollRequirements(bool * pollIsRequired,
81 bool * pollIsExpensive);
82 virtual IOReturn reportMaxReadTransfer (UInt64 blockSize,UInt64 * max);
83 virtual IOReturn reportMaxValidBlock(UInt64 * maxBlock);
84 virtual IOReturn reportMaxWriteTransfer(UInt64 blockSize,UInt64 * max);
85 virtual IOReturn reportRemovability(bool * isRemovable);
86 virtual IOReturn reportWriteProtection(bool * isWriteProtected);
87 };
88
89 #endif /* !_IOATAHDDRIVENUB_H */