]> git.saurik.com Git - apple/xnu.git/blame - iokit/Families/IOSCSIDVDDrive/IOSCSIDVDDriveNub.cpp
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / Families / IOSCSIDVDDrive / IOSCSIDVDDriveNub.cpp
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 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#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>
27
28#define super IODVDBlockStorageDevice
29OSDefineMetaClassAndStructors(IOSCSIDVDDriveNub,IODVDBlockStorageDevice)
30
31bool
32IOSCSIDVDDriveNub::attach(IOService * provider)
33{
34 if (!super::attach(provider)) {
35 return(false);
36 }
37
38 _provider = OSDynamicCast(IOSCSIDVDDrive,provider);
39 if (_provider == NULL) {
40 return(false);
41 } else {
42 return(true);
43 }
44}
45
46IOReturn
47IOSCSIDVDDriveNub::audioPause(bool pause)
48{
49 return(_provider->audioPause(pause));
50}
51
52IOReturn
53IOSCSIDVDDriveNub::audioPlay(CDMSF timeStart,CDMSF timeStop)
54{
55 return(_provider->audioPlay(timeStart,timeStop));
56}
57
58IOReturn
59IOSCSIDVDDriveNub::audioScan(CDMSF timeStart,bool reverse)
60{
61 return(_provider->audioScan(timeStart,reverse));
62}
63
64IOReturn
65IOSCSIDVDDriveNub::audioStop()
66{
67 return(_provider->audioStop());
68}
69
70IOReturn
71IOSCSIDVDDriveNub::doAsyncReadCD(IOMemoryDescriptor *buffer,
72 UInt32 block,UInt32 nblks,
73 CDSectorArea sectorArea,
74 CDSectorType sectorType,
75 IOStorageCompletion completion)
76{
77 return(_provider->doAsyncReadCD(buffer,block,nblks,
78 sectorArea,sectorType,
79 completion));
80}
81
82IOReturn
83IOSCSIDVDDriveNub::doAsyncReadWrite(IOMemoryDescriptor *buffer,
84 UInt32 block,UInt32 nblks,
85 IOStorageCompletion completion)
86{
87 return(_provider->doAsyncReadWrite(buffer,block,nblks,completion));
88}
89
90IOReturn
91IOSCSIDVDDriveNub::doSyncReadWrite(IOMemoryDescriptor *buffer,UInt32 block,UInt32 nblks)
92{
93 return(_provider->doSyncReadWrite(buffer,block,nblks));
94}
95
96IOReturn
97IOSCSIDVDDriveNub::doEjectMedia(void)
98{
99 return(_provider->doEjectMedia());
100}
101
102IOReturn
103IOSCSIDVDDriveNub::doFormatMedia(UInt64 byteCapacity)
104{
105 return(_provider->doFormatMedia(byteCapacity));
106}
107
108UInt32
109IOSCSIDVDDriveNub::doGetFormatCapacities(UInt64 * capacities,UInt32 capacitiesMaxCount) const
110{
111 return(_provider->doGetFormatCapacities(capacities,capacitiesMaxCount));
112}
113
114IOReturn
115IOSCSIDVDDriveNub::doLockUnlockMedia(bool doLock)
116{
117 return(_provider->doLockUnlockMedia(doLock));
118}
119
120IOReturn
121IOSCSIDVDDriveNub::doSynchronizeCache(void)
122{
123 return(_provider->doSynchronizeCache());
124}
125
126IOReturn
127IOSCSIDVDDriveNub::getAudioStatus(CDAudioStatus *status)
128{
129 return(_provider->getAudioStatus(status));
130}
131
132IOReturn
133IOSCSIDVDDriveNub::getAudioVolume(UInt8 *leftVolume,UInt8 *rightVolume)
134{
135 return(_provider->getAudioVolume(leftVolume,rightVolume));
136}
137
138UInt32
139IOSCSIDVDDriveNub::getMediaType(void)
140{
141 return(_provider->getMediaType());
142}
143
144char *
145IOSCSIDVDDriveNub::getVendorString(void)
146{
147 return(_provider->getVendorString());
148}
149
150char *
151IOSCSIDVDDriveNub::getProductString(void)
152{
153 return(_provider->getProductString());
154}
155
156char *
157IOSCSIDVDDriveNub::getRevisionString(void)
158{
159 return(_provider->getRevisionString());
160}
161
162char *
163IOSCSIDVDDriveNub::getAdditionalDeviceInfoString(void)
164{
165 return(_provider->getAdditionalDeviceInfoString());
166}
167
168IOReturn
169IOSCSIDVDDriveNub::readISRC(UInt8 track,CDISRC isrc)
170{
171 return(_provider->readISRC(track,isrc));
172}
173
174IOReturn
175IOSCSIDVDDriveNub::readMCN(CDMCN mcn)
176{
177 return(_provider->readMCN(mcn));
178}
179
180IOReturn
181IOSCSIDVDDriveNub::readTOC(IOMemoryDescriptor *buffer)
182{
183 return(_provider->readTOC(buffer));
184}
185
186IOReturn
187IOSCSIDVDDriveNub::reportBlockSize(UInt64 *blockSize)
188{
189 return(_provider->reportBlockSize(blockSize));
190}
191
192IOReturn
193IOSCSIDVDDriveNub::reportEjectability(bool *isEjectable)
194{
195 return(_provider->reportEjectability(isEjectable));
196}
197
198IOReturn
199IOSCSIDVDDriveNub::reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
200 const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat)
201{
202 return(_provider->reportKey(buffer,keyClass,lba,agid,keyFormat));
203}
204
205IOReturn
206IOSCSIDVDDriveNub::reportLockability(bool *isLockable)
207{
208 return(_provider->reportLockability(isLockable));
209}
210
211IOReturn
212IOSCSIDVDDriveNub::reportPollRequirements(bool *pollIsRequired,bool *pollIsExpensive)
213{
214 return(_provider-> reportPollRequirements(pollIsRequired,pollIsExpensive));
215}
216
217IOReturn
218IOSCSIDVDDriveNub::reportMaxReadTransfer (UInt64 blockSize,UInt64 *max)
219{
220 return(_provider->reportMaxReadTransfer(blockSize,max));
221}
222
223IOReturn
224IOSCSIDVDDriveNub::reportMaxValidBlock(UInt64 *maxBlock)
225{
226 return(_provider->reportMaxValidBlock(maxBlock));
227}
228
229IOReturn
230IOSCSIDVDDriveNub::reportMaxWriteTransfer(UInt64 blockSize,UInt64 *max)
231{
232 return(_provider->reportMaxWriteTransfer(blockSize,max));
233}
234
235IOReturn
236IOSCSIDVDDriveNub::reportMediaState(bool *mediaPresent,bool *changed)
237{
238 return(_provider->reportMediaState(mediaPresent,changed));
239}
240
241IOReturn
242IOSCSIDVDDriveNub::reportRemovability(bool *isRemovable)
243{
244 return(_provider->reportRemovability(isRemovable));
245}
246
247IOReturn
248IOSCSIDVDDriveNub::reportWriteProtection(bool *isWriteProtected)
249{
250 return(_provider->reportWriteProtection(isWriteProtected));
251}
252
253IOReturn
254IOSCSIDVDDriveNub::sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
255 const UInt8 agid,const DVDKeyFormat keyFormat)
256{
257 return(_provider->sendKey(buffer,keyClass,agid,keyFormat));
258}
259
260IOReturn
261IOSCSIDVDDriveNub::setAudioVolume(UInt8 leftVolume,UInt8 rightVolume)
262{
263 return(_provider->setAudioVolume(leftVolume,rightVolume));
264}