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@
22 #include <IOKit/IOMemoryDescriptor.h>
23 #include <IOKit/IOLib.h>
24 #include <IOKit/storage/scsi/IOSCSICDDriveNub.h>
25 #include <IOKit/storage/scsi/IOSCSICDDrive.h>
27 #define super IOCDBlockStorageDevice
28 OSDefineMetaClassAndStructors(IOSCSICDDriveNub
,IOCDBlockStorageDevice
)
31 IOSCSICDDriveNub::attach(IOService
* provider
)
33 if (!super::attach(provider
)) {
37 _provider
= OSDynamicCast(IOSCSICDDrive
,provider
);
38 if (_provider
== NULL
) {
46 IOSCSICDDriveNub::audioPause(bool pause
)
48 return(_provider
->audioPause(pause
));
52 IOSCSICDDriveNub::audioPlay(CDMSF timeStart
,CDMSF timeStop
)
54 return(_provider
->audioPlay(timeStart
,timeStop
));
58 IOSCSICDDriveNub::audioScan(CDMSF timeStart
,bool reverse
)
60 return(_provider
->audioScan(timeStart
,reverse
));
64 IOSCSICDDriveNub::audioStop()
66 return(_provider
->audioStop());
70 IOSCSICDDriveNub::doAsyncReadCD(IOMemoryDescriptor
*buffer
,
71 UInt32 block
,UInt32 nblks
,
72 CDSectorArea sectorArea
,
73 CDSectorType sectorType
,
74 IOStorageCompletion completion
)
76 return(_provider
->doAsyncReadCD(buffer
,block
,nblks
,
77 sectorArea
,sectorType
,
82 IOSCSICDDriveNub::doAsyncReadWrite(IOMemoryDescriptor
*buffer
,
83 UInt32 block
,UInt32 nblks
,
84 IOStorageCompletion completion
)
86 return(_provider
->doAsyncReadWrite(buffer
,block
,nblks
,completion
));
90 IOSCSICDDriveNub::doSyncReadWrite(IOMemoryDescriptor
*buffer
,UInt32 block
,UInt32 nblks
)
92 return(_provider
->doSyncReadWrite(buffer
,block
,nblks
));
96 IOSCSICDDriveNub::doEjectMedia(void)
98 return(_provider
->doEjectMedia());
102 IOSCSICDDriveNub::doFormatMedia(UInt64 byteCapacity
)
104 return(_provider
->doFormatMedia(byteCapacity
));
108 IOSCSICDDriveNub::doGetFormatCapacities(UInt64
* capacities
,UInt32 capacitiesMaxCount
) const
110 return(_provider
->doGetFormatCapacities(capacities
,capacitiesMaxCount
));
114 IOSCSICDDriveNub::doLockUnlockMedia(bool doLock
)
116 return(_provider
->doLockUnlockMedia(doLock
));
120 IOSCSICDDriveNub::doSynchronizeCache(void)
122 return(_provider
->doSynchronizeCache());
126 IOSCSICDDriveNub::getAudioStatus(CDAudioStatus
*status
)
128 return(_provider
->getAudioStatus(status
));
132 IOSCSICDDriveNub::getAudioVolume(UInt8
*leftVolume
,UInt8
*rightVolume
)
134 return(_provider
->getAudioVolume(leftVolume
,rightVolume
));
138 IOSCSICDDriveNub::getMediaType(void)
140 return(kCDMediaTypeROM
);
144 IOSCSICDDriveNub::getVendorString(void)
146 return(_provider
->getVendorString());
150 IOSCSICDDriveNub::getProductString(void)
152 return(_provider
->getProductString());
156 IOSCSICDDriveNub::getRevisionString(void)
158 return(_provider
->getRevisionString());
162 IOSCSICDDriveNub::getAdditionalDeviceInfoString(void)
164 return(_provider
->getAdditionalDeviceInfoString());
168 IOSCSICDDriveNub::readISRC(UInt8 track
,CDISRC isrc
)
170 return(_provider
->readISRC(track
,isrc
));
174 IOSCSICDDriveNub::readMCN(CDMCN mcn
)
176 return(_provider
->readMCN(mcn
));
180 IOSCSICDDriveNub::readTOC(IOMemoryDescriptor
*buffer
)
182 return(_provider
->readTOC(buffer
));
186 IOSCSICDDriveNub::reportBlockSize(UInt64
*blockSize
)
188 return(_provider
->reportBlockSize(blockSize
));
192 IOSCSICDDriveNub::reportEjectability(bool *isEjectable
)
194 return(_provider
->reportEjectability(isEjectable
));
198 IOSCSICDDriveNub::reportLockability(bool *isLockable
)
200 return(_provider
->reportLockability(isLockable
));
204 IOSCSICDDriveNub::reportPollRequirements(bool *pollIsRequired
,bool *pollIsExpensive
)
206 return(_provider
-> reportPollRequirements(pollIsRequired
,pollIsExpensive
));
210 IOSCSICDDriveNub::reportMaxReadTransfer (UInt64 blockSize
,UInt64
*max
)
212 return(_provider
->reportMaxReadTransfer(blockSize
,max
));
216 IOSCSICDDriveNub::reportMaxValidBlock(UInt64
*maxBlock
)
218 return(_provider
->reportMaxValidBlock(maxBlock
));
222 IOSCSICDDriveNub::reportMaxWriteTransfer(UInt64 blockSize
,UInt64
*max
)
224 return(_provider
->reportMaxWriteTransfer(blockSize
,max
));
228 IOSCSICDDriveNub::reportMediaState(bool *mediaPresent
,bool *changed
)
230 return(_provider
-> reportMediaState(mediaPresent
,changed
));
234 IOSCSICDDriveNub::reportRemovability(bool *isRemovable
)
236 return(_provider
->reportRemovability(isRemovable
));
240 IOSCSICDDriveNub::reportWriteProtection(bool *isWriteProtected
)
242 return(_provider
->reportWriteProtection(isWriteProtected
));
246 IOSCSICDDriveNub::setAudioVolume(UInt8 leftVolume
,UInt8 rightVolume
)
248 return(_provider
->setAudioVolume(leftVolume
,rightVolume
));