]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/ata/IOATAPIDVDDriveNub.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / ata / IOATAPIDVDDriveNub.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 * IOATAPIDVDDriveNub.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 _IOATAPIDVDDRIVENUB_H
35 #define _IOATAPIDVDDRIVENUB_H
36
37 #include <IOKit/IOTypes.h>
38 #include <IOKit/storage/IODVDBlockStorageDevice.h>
39 #include <IOKit/storage/IODVDTypes.h>
40
41 class IOATAPIDVDDrive;
42
43 class IOATAPIDVDDriveNub : public IODVDBlockStorageDevice
44 {
45 OSDeclareDefaultStructors(IOATAPIDVDDriveNub)
46
47 protected:
48 IOATAPIDVDDrive * _provider;
49
50 public:
51 /*
52 * Overrides from IOService.
53 */
54 virtual bool attach(IOService * provider);
55 virtual void detach(IOService * provider);
56
57 /*
58 * Mandatory overrides from IOBlockStorageDevice.
59 */
60 virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor * buffer,
61 UInt32 block,
62 UInt32 nblks,
63 IOStorageCompletion completion);
64
65 virtual IOReturn doSyncReadWrite(IOMemoryDescriptor * buffer,
66 UInt32 block,
67 UInt32 nblks);
68
69 virtual IOReturn doFormatMedia(UInt64 byteCapacity);
70 virtual UInt32 doGetFormatCapacities(UInt64 * capacities,
71 UInt32 capacitiesMaxCount) const;
72 virtual IOReturn doSynchronizeCache();
73 virtual IOReturn doEjectMedia();
74 virtual IOReturn doLockUnlockMedia(bool doLock);
75 virtual char * getVendorString();
76 virtual char * getProductString();
77 virtual char * getRevisionString();
78 virtual char * getAdditionalDeviceInfoString();
79 virtual IOReturn reportBlockSize(UInt64 * blockSize);
80 virtual IOReturn reportEjectability(bool * isEjectable);
81 virtual IOReturn reportLockability(bool * isLockable);
82 virtual IOReturn reportMediaState(bool * mediaPresent, bool * changed);
83 virtual IOReturn reportPollRequirements(bool * pollIsRequired,
84 bool * pollIsExpensive);
85 virtual IOReturn reportMaxReadTransfer (UInt64 blockSize, UInt64 * max);
86 virtual IOReturn reportMaxValidBlock(UInt64 * maxBlock);
87 virtual IOReturn reportMaxWriteTransfer(UInt64 blockSize, UInt64 * max);
88 virtual IOReturn reportRemovability(bool * isRemovable);
89 virtual IOReturn reportWriteProtection(bool * isWriteProtected);
90
91 /*-----------------------------------------*/
92 /* CD APIs */
93 /*-----------------------------------------*/
94
95 virtual IOReturn doAsyncReadCD(IOMemoryDescriptor * buffer,
96 UInt32 block,
97 UInt32 nblks,
98 CDSectorArea sectorArea,
99 CDSectorType sectorType,
100 IOStorageCompletion completion);
101 virtual UInt32 getMediaType();
102 virtual IOReturn readISRC(UInt8 track, CDISRC isrc);
103 virtual IOReturn readMCN(CDMCN mcn);
104 virtual IOReturn readTOC(IOMemoryDescriptor * buffer);
105
106 /*-----------------------------------------*/
107 /* APIs exported by IOCDAudioControl */
108 /*-----------------------------------------*/
109
110 virtual IOReturn audioPause(bool pause);
111 virtual IOReturn audioPlay(CDMSF timeStart, CDMSF timeStop);
112 virtual IOReturn audioScan(CDMSF timeStart, bool reverse);
113 virtual IOReturn audioStop();
114 virtual IOReturn getAudioStatus(CDAudioStatus * status);
115 virtual IOReturn getAudioVolume(UInt8 * leftVolume,
116 UInt8 * rightVolume);
117 virtual IOReturn setAudioVolume(UInt8 leftVolume,
118 UInt8 rightVolume);
119 /*-----------------------------------------*/
120 /* DVD APIs */
121 /*-----------------------------------------*/
122
123 virtual IOReturn reportKey(IOMemoryDescriptor * buffer,
124 const DVDKeyClass keyClass,
125 const UInt32 lba,
126 const UInt8 agid,
127 const DVDKeyFormat keyFormat);
128
129 virtual IOReturn sendKey(IOMemoryDescriptor * buffer,
130 const DVDKeyClass keyClass,
131 const UInt8 agid,
132 const DVDKeyFormat keyFormat);
133 };
134
135 #endif /* !_IOATAPIDVDDRIVENUB_H */