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@
23 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
27 * This subclass implements a relay to a protocol and device-specific
31 * 2-Sep-1999 Joe Liu (jliu) created.
34 #ifndef _IOATAPICDDRIVENUB_H
35 #define _IOATAPICDDRIVENUB_H
37 #include <IOKit/IOTypes.h>
38 #include <IOKit/storage/IOCDBlockStorageDevice.h>
42 class IOATAPICDDriveNub
: public IOCDBlockStorageDevice
44 OSDeclareDefaultStructors(IOATAPICDDriveNub
)
47 IOATAPICDDrive
* _provider
;
51 * Overrides from IOService.
53 virtual bool attach(IOService
* provider
);
54 virtual void detach(IOService
* provider
);
57 * Mandatory overrides from IOBlockStorageDevice.
59 virtual IOReturn
doAsyncReadWrite(IOMemoryDescriptor
* buffer
,
62 IOStorageCompletion completion
);
64 virtual IOReturn
doSyncReadWrite(IOMemoryDescriptor
* buffer
,
68 virtual IOReturn
doFormatMedia(UInt64 byteCapacity
);
69 virtual UInt32
doGetFormatCapacities(UInt64
* capacities
,
70 UInt32 capacitiesMaxCount
) const;
71 virtual IOReturn
doSynchronizeCache();
72 virtual IOReturn
doEjectMedia();
73 virtual IOReturn
doLockUnlockMedia(bool doLock
);
74 virtual char * getVendorString();
75 virtual char * getProductString();
76 virtual char * getRevisionString();
77 virtual char * getAdditionalDeviceInfoString();
78 virtual IOReturn
reportBlockSize(UInt64
* blockSize
);
79 virtual IOReturn
reportEjectability(bool * isEjectable
);
80 virtual IOReturn
reportLockability(bool * isLockable
);
81 virtual IOReturn
reportMediaState(bool * mediaPresent
, bool * changed
);
82 virtual IOReturn
reportPollRequirements(bool * pollIsRequired
,
83 bool * pollIsExpensive
);
84 virtual IOReturn
reportMaxReadTransfer (UInt64 blockSize
, UInt64
* max
);
85 virtual IOReturn
reportMaxValidBlock(UInt64
* maxBlock
);
86 virtual IOReturn
reportMaxWriteTransfer(UInt64 blockSize
, UInt64
* max
);
87 virtual IOReturn
reportRemovability(bool * isRemovable
);
88 virtual IOReturn
reportWriteProtection(bool * isWriteProtected
);
90 /*-----------------------------------------*/
92 /*-----------------------------------------*/
94 virtual IOReturn
doAsyncReadCD(IOMemoryDescriptor
* buffer
,
97 CDSectorArea sectorArea
,
98 CDSectorType sectorType
,
99 IOStorageCompletion completion
);
100 virtual UInt32
getMediaType();
101 virtual IOReturn
readISRC(UInt8 track
, CDISRC isrc
);
102 virtual IOReturn
readMCN(CDMCN mcn
);
103 virtual IOReturn
readTOC(IOMemoryDescriptor
* buffer
);
105 /*-----------------------------------------*/
106 /* APIs exported by IOCDAudioControl */
107 /*-----------------------------------------*/
109 virtual IOReturn
audioPause(bool pause
);
110 virtual IOReturn
audioPlay(CDMSF timeStart
,CDMSF timeStop
);
111 virtual IOReturn
audioScan(CDMSF timeStart
,bool reverse
);
112 virtual IOReturn
audioStop();
113 virtual IOReturn
getAudioStatus(CDAudioStatus
* status
);
114 virtual IOReturn
getAudioVolume(UInt8
* leftVolume
,
115 UInt8
* rightVolume
);
116 virtual IOReturn
setAudioVolume(UInt8 leftVolume
, UInt8 rightVolume
);
119 #endif /* !_IOATAPICDDRIVENUB_H */