2 * Copyright (c) 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@
22 #include <IOKit/IOMemoryDescriptor.h>
23 #include <IOKit/IOLib.h>
24 #include <IOKit/storage/IODVDBlockStorageDevice.h>
25 #include <IOKit/storage/scsi/IOSCSIDVDDriveNub.h>
26 #include <IOKit/storage/scsi/IOSCSIDVDDrive.h>
28 #define super IODVDBlockStorageDevice
29 OSDefineMetaClassAndStructors(IOSCSIDVDDriveNub
,IODVDBlockStorageDevice
)
32 IOSCSIDVDDriveNub::attach(IOService
* provider
)
34 if (!super::attach(provider
)) {
38 _provider
= OSDynamicCast(IOSCSIDVDDrive
,provider
);
39 if (_provider
== NULL
) {
47 IOSCSIDVDDriveNub::audioPause(bool pause
)
49 return(_provider
->audioPause(pause
));
53 IOSCSIDVDDriveNub::audioPlay(CDMSF timeStart
,CDMSF timeStop
)
55 return(_provider
->audioPlay(timeStart
,timeStop
));
59 IOSCSIDVDDriveNub::audioScan(CDMSF timeStart
,bool reverse
)
61 return(_provider
->audioScan(timeStart
,reverse
));
65 IOSCSIDVDDriveNub::audioStop()
67 return(_provider
->audioStop());
71 IOSCSIDVDDriveNub::doAsyncReadCD(IOMemoryDescriptor
*buffer
,
72 UInt32 block
,UInt32 nblks
,
73 CDSectorArea sectorArea
,
74 CDSectorType sectorType
,
75 IOStorageCompletion completion
)
77 return(_provider
->doAsyncReadCD(buffer
,block
,nblks
,
78 sectorArea
,sectorType
,
83 IOSCSIDVDDriveNub::doAsyncReadWrite(IOMemoryDescriptor
*buffer
,
84 UInt32 block
,UInt32 nblks
,
85 IOStorageCompletion completion
)
87 return(_provider
->doAsyncReadWrite(buffer
,block
,nblks
,completion
));
91 IOSCSIDVDDriveNub::doSyncReadWrite(IOMemoryDescriptor
*buffer
,UInt32 block
,UInt32 nblks
)
93 return(_provider
->doSyncReadWrite(buffer
,block
,nblks
));
97 IOSCSIDVDDriveNub::doEjectMedia(void)
99 return(_provider
->doEjectMedia());
103 IOSCSIDVDDriveNub::doFormatMedia(UInt64 byteCapacity
)
105 return(_provider
->doFormatMedia(byteCapacity
));
109 IOSCSIDVDDriveNub::doGetFormatCapacities(UInt64
* capacities
,UInt32 capacitiesMaxCount
) const
111 return(_provider
->doGetFormatCapacities(capacities
,capacitiesMaxCount
));
115 IOSCSIDVDDriveNub::doLockUnlockMedia(bool doLock
)
117 return(_provider
->doLockUnlockMedia(doLock
));
121 IOSCSIDVDDriveNub::doSynchronizeCache(void)
123 return(_provider
->doSynchronizeCache());
127 IOSCSIDVDDriveNub::getAudioStatus(CDAudioStatus
*status
)
129 return(_provider
->getAudioStatus(status
));
133 IOSCSIDVDDriveNub::getAudioVolume(UInt8
*leftVolume
,UInt8
*rightVolume
)
135 return(_provider
->getAudioVolume(leftVolume
,rightVolume
));
139 IOSCSIDVDDriveNub::getMediaType(void)
141 return(_provider
->getMediaType());
145 IOSCSIDVDDriveNub::getVendorString(void)
147 return(_provider
->getVendorString());
151 IOSCSIDVDDriveNub::getProductString(void)
153 return(_provider
->getProductString());
157 IOSCSIDVDDriveNub::getRevisionString(void)
159 return(_provider
->getRevisionString());
163 IOSCSIDVDDriveNub::getAdditionalDeviceInfoString(void)
165 return(_provider
->getAdditionalDeviceInfoString());
169 IOSCSIDVDDriveNub::readISRC(UInt8 track
,CDISRC isrc
)
171 return(_provider
->readISRC(track
,isrc
));
175 IOSCSIDVDDriveNub::readMCN(CDMCN mcn
)
177 return(_provider
->readMCN(mcn
));
181 IOSCSIDVDDriveNub::readTOC(IOMemoryDescriptor
*buffer
)
183 return(_provider
->readTOC(buffer
));
187 IOSCSIDVDDriveNub::reportBlockSize(UInt64
*blockSize
)
189 return(_provider
->reportBlockSize(blockSize
));
193 IOSCSIDVDDriveNub::reportEjectability(bool *isEjectable
)
195 return(_provider
->reportEjectability(isEjectable
));
199 IOSCSIDVDDriveNub::reportKey(IOMemoryDescriptor
*buffer
,const DVDKeyClass keyClass
,
200 const UInt32 lba
,const UInt8 agid
,const DVDKeyFormat keyFormat
)
202 return(_provider
->reportKey(buffer
,keyClass
,lba
,agid
,keyFormat
));
206 IOSCSIDVDDriveNub::reportLockability(bool *isLockable
)
208 return(_provider
->reportLockability(isLockable
));
212 IOSCSIDVDDriveNub::reportPollRequirements(bool *pollIsRequired
,bool *pollIsExpensive
)
214 return(_provider
-> reportPollRequirements(pollIsRequired
,pollIsExpensive
));
218 IOSCSIDVDDriveNub::reportMaxReadTransfer (UInt64 blockSize
,UInt64
*max
)
220 return(_provider
->reportMaxReadTransfer(blockSize
,max
));
224 IOSCSIDVDDriveNub::reportMaxValidBlock(UInt64
*maxBlock
)
226 return(_provider
->reportMaxValidBlock(maxBlock
));
230 IOSCSIDVDDriveNub::reportMaxWriteTransfer(UInt64 blockSize
,UInt64
*max
)
232 return(_provider
->reportMaxWriteTransfer(blockSize
,max
));
236 IOSCSIDVDDriveNub::reportMediaState(bool *mediaPresent
,bool *changed
)
238 return(_provider
->reportMediaState(mediaPresent
,changed
));
242 IOSCSIDVDDriveNub::reportRemovability(bool *isRemovable
)
244 return(_provider
->reportRemovability(isRemovable
));
248 IOSCSIDVDDriveNub::reportWriteProtection(bool *isWriteProtected
)
250 return(_provider
->reportWriteProtection(isWriteProtected
));
254 IOSCSIDVDDriveNub::sendKey(IOMemoryDescriptor
*buffer
,const DVDKeyClass keyClass
,
255 const UInt8 agid
,const DVDKeyFormat keyFormat
)
257 return(_provider
->sendKey(buffer
,keyClass
,agid
,keyFormat
));
261 IOSCSIDVDDriveNub::setAudioVolume(UInt8 leftVolume
,UInt8 rightVolume
)
263 return(_provider
->setAudioVolume(leftVolume
,rightVolume
));