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