]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/ata/IOATAPICDDriveNub.h
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / ata / IOATAPICDDriveNub.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 * IOATAPICDDriveNub.h
26 *
27 * This subclass implements a relay to a protocol and device-specific
28 * provider.
29 *
30 * HISTORY
31 * 2-Sep-1999 Joe Liu (jliu) created.
32 */
33
34 #ifndef _IOATAPICDDRIVENUB_H
35 #define _IOATAPICDDRIVENUB_H
36
37 #include <IOKit/IOTypes.h>
38 #include <IOKit/storage/IOCDBlockStorageDevice.h>
39
40 class IOATAPICDDrive;
41
42 class IOATAPICDDriveNub : public IOCDBlockStorageDevice
43 {
44 OSDeclareDefaultStructors(IOATAPICDDriveNub)
45
46 protected:
47 IOATAPICDDrive * _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
64 virtual IOReturn doSyncReadWrite(IOMemoryDescriptor * buffer,
65 UInt32 block,
66 UInt32 nblks);
67
68 virtual IOReturn doFormatMedia(UInt64 byteCapacity);
69 virtual UInt32 doGetFormatCapacities(UInt64 * capacities,
70 UInt32 capacitiesMaxCount) const;
71 virtual IOReturn doSynchronizeCache();
72 virtual IOReturn doEjectMedia();
73 virtual IOReturn doLockUnlockMedia(bool doLock);
74 virtual char * getVendorString();
75 virtual char * getProductString();
76 virtual char * getRevisionString();
77 virtual char * getAdditionalDeviceInfoString();
78 virtual IOReturn reportBlockSize(UInt64 * blockSize);
79 virtual IOReturn reportEjectability(bool * isEjectable);
80 virtual IOReturn reportLockability(bool * isLockable);
81 virtual IOReturn reportMediaState(bool * mediaPresent, bool * changed);
82 virtual IOReturn reportPollRequirements(bool * pollIsRequired,
83 bool * pollIsExpensive);
84 virtual IOReturn reportMaxReadTransfer (UInt64 blockSize, UInt64 * max);
85 virtual IOReturn reportMaxValidBlock(UInt64 * maxBlock);
86 virtual IOReturn reportMaxWriteTransfer(UInt64 blockSize, UInt64 * max);
87 virtual IOReturn reportRemovability(bool * isRemovable);
88 virtual IOReturn reportWriteProtection(bool * isWriteProtected);
89
90 /*-----------------------------------------*/
91 /* CD APIs */
92 /*-----------------------------------------*/
93
94 virtual IOReturn doAsyncReadCD(IOMemoryDescriptor * buffer,
95 UInt32 block,
96 UInt32 nblks,
97 CDSectorArea sectorArea,
98 CDSectorType sectorType,
99 IOStorageCompletion completion);
100 virtual UInt32 getMediaType();
101 virtual IOReturn readISRC(UInt8 track, CDISRC isrc);
102 virtual IOReturn readMCN(CDMCN mcn);
103 virtual IOReturn readTOC(IOMemoryDescriptor * buffer);
104
105 /*-----------------------------------------*/
106 /* APIs exported by IOCDAudioControl */
107 /*-----------------------------------------*/
108
109 virtual IOReturn audioPause(bool pause);
110 virtual IOReturn audioPlay(CDMSF timeStart,CDMSF timeStop);
111 virtual IOReturn audioScan(CDMSF timeStart,bool reverse);
112 virtual IOReturn audioStop();
113 virtual IOReturn getAudioStatus(CDAudioStatus * status);
114 virtual IOReturn getAudioVolume(UInt8 * leftVolume,
115 UInt8 * rightVolume);
116 virtual IOReturn setAudioVolume(UInt8 leftVolume, UInt8 rightVolume);
117 };
118
119 #endif /* !_IOATAPICDDRIVENUB_H */