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@
23 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
25 * IOATAPIDVDDriveNub.h
27 * This subclass implements a relay to a protocol and device-specific
31 * 2-Sep-1999 Joe Liu (jliu) created.
34 #ifndef _IOATAPIDVDDRIVENUB_H
35 #define _IOATAPIDVDDRIVENUB_H
37 #include <IOKit/IOTypes.h>
38 #include <IOKit/storage/IODVDBlockStorageDevice.h>
39 #include <IOKit/storage/IODVDTypes.h>
41 class IOATAPIDVDDrive
;
43 class IOATAPIDVDDriveNub
: public IODVDBlockStorageDevice
45 OSDeclareDefaultStructors(IOATAPIDVDDriveNub
)
48 IOATAPIDVDDrive
* _provider
;
52 * Overrides from IOService.
54 virtual bool attach(IOService
* provider
);
55 virtual void detach(IOService
* provider
);
58 * Mandatory overrides from IOBlockStorageDevice.
60 virtual IOReturn
doAsyncReadWrite(IOMemoryDescriptor
* buffer
,
63 IOStorageCompletion completion
);
65 virtual IOReturn
doSyncReadWrite(IOMemoryDescriptor
* buffer
,
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
);
91 /*-----------------------------------------*/
93 /*-----------------------------------------*/
95 virtual IOReturn
doAsyncReadCD(IOMemoryDescriptor
* buffer
,
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
);
106 /*-----------------------------------------*/
107 /* APIs exported by IOCDAudioControl */
108 /*-----------------------------------------*/
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
,
119 /*-----------------------------------------*/
121 /*-----------------------------------------*/
123 virtual IOReturn
reportKey(IOMemoryDescriptor
* buffer
,
124 const DVDKeyClass keyClass
,
127 const DVDKeyFormat keyFormat
);
129 virtual IOReturn
sendKey(IOMemoryDescriptor
* buffer
,
130 const DVDKeyClass keyClass
,
132 const DVDKeyFormat keyFormat
);
135 #endif /* !_IOATAPIDVDDRIVENUB_H */