]>
Commit | Line | Data |
---|---|---|
1c79356b A |
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 | /* IOSCSICDDriveNub.h created by rick on Wed 07-Apr-1999 */ | |
23 | ||
24 | /* This subclass implements a relay to a protocol- and device-specific provider. */ | |
25 | ||
26 | #ifndef _IOSCSICDDRIVENUB_H | |
27 | #define _IOSCSICDDRIVENUB_H | |
28 | ||
29 | #include <IOKit/IOTypes.h> | |
30 | #include <IOKit/storage/IOCDBlockStorageDevice.h> | |
31 | ||
32 | class IOSCSICDDrive; | |
33 | ||
34 | class IOSCSICDDriveNub : public IOCDBlockStorageDevice { | |
35 | ||
36 | OSDeclareDefaultStructors(IOSCSICDDriveNub) | |
37 | ||
38 | public: | |
39 | ||
40 | /* Overrides from IOService */ | |
41 | ||
42 | virtual bool attach(IOService * provider); | |
43 | ||
44 | /* Overrides from IOBlockStorageDevice: */ | |
45 | ||
46 | virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor *buffer, | |
47 | UInt32 block,UInt32 nblks, | |
48 | IOStorageCompletion completion); | |
49 | virtual IOReturn doSyncReadWrite(IOMemoryDescriptor *buffer,UInt32 block,UInt32 nblks); | |
50 | ||
51 | /* --------------------------------------------------------------------------*/ | |
52 | /* APIs used by the IOBlockStorageDevice portion of IOCDBlockStorageDevice: */ | |
53 | /* --------------------------------------------------------------------------*/ | |
54 | ||
55 | virtual IOReturn doEjectMedia(void); | |
56 | virtual IOReturn doFormatMedia(UInt64 byteCapacity); | |
57 | virtual UInt32 doGetFormatCapacities(UInt64 * capacities, | |
58 | UInt32 capacitiesMaxCount) const; | |
59 | virtual IOReturn doLockUnlockMedia(bool doLock); | |
60 | virtual IOReturn doSynchronizeCache(void); | |
61 | virtual char * getVendorString(void); | |
62 | virtual char * getProductString(void); | |
63 | virtual char * getRevisionString(void); | |
64 | virtual char * getAdditionalDeviceInfoString(void); | |
65 | virtual IOReturn reportBlockSize(UInt64 *blockSize); | |
66 | virtual IOReturn reportEjectability(bool *isEjectable); | |
67 | virtual IOReturn reportLockability(bool *isLockable); | |
68 | virtual IOReturn reportPollRequirements(bool *pollIsRequired,bool *pollIsExpensive); | |
69 | virtual IOReturn reportMaxReadTransfer(UInt64 blockSize,UInt64 *max); | |
70 | virtual IOReturn reportMaxValidBlock(UInt64 *maxBlock); | |
71 | virtual IOReturn reportMaxWriteTransfer(UInt64 blockSize,UInt64 *max); | |
72 | virtual IOReturn reportMediaState(bool *mediaPresent,bool *changed); | |
73 | virtual IOReturn reportRemovability(bool *isRemovable); | |
74 | virtual IOReturn reportWriteProtection(bool *isWriteProtected); | |
75 | ||
76 | /*-----------------------------------------*/ | |
77 | /* CD APIs */ | |
78 | /*-----------------------------------------*/ | |
79 | ||
80 | virtual IOReturn doAsyncReadCD(IOMemoryDescriptor *buffer, | |
81 | UInt32 block,UInt32 nblks, | |
82 | CDSectorArea sectorArea, | |
83 | CDSectorType sectorType, | |
84 | IOStorageCompletion completion); | |
85 | virtual UInt32 getMediaType(void); | |
86 | virtual IOReturn readISRC(UInt8 track,CDISRC isrc); | |
87 | virtual IOReturn readMCN(CDMCN mcn); | |
88 | virtual IOReturn readTOC(IOMemoryDescriptor * buffer); | |
89 | ||
90 | /*-----------------------------------------*/ | |
91 | /* APIs exported by IOCDAudioControl */ | |
92 | /*-----------------------------------------*/ | |
93 | ||
94 | virtual IOReturn audioPause(bool pause); | |
95 | virtual IOReturn audioPlay(CDMSF timeStart,CDMSF timeStop); | |
96 | virtual IOReturn audioScan(CDMSF timeStart,bool reverse); | |
97 | virtual IOReturn audioStop(); | |
98 | virtual IOReturn getAudioStatus(CDAudioStatus *status); | |
99 | virtual IOReturn getAudioVolume(UInt8 *leftVolume,UInt8 *rightVolume); | |
100 | virtual IOReturn setAudioVolume(UInt8 leftVolume,UInt8 rightVolume); | |
101 | ||
102 | protected: | |
103 | ||
104 | IOSCSICDDrive * _provider; | |
105 | }; | |
106 | #endif |