2 * Copyright (c) 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 /* This subclass implements a relay to a protocol- and device-specific provider. */
24 #ifndef _IOSCSIDVDDRIVENUB_H
25 #define _IOSCSIDVDDRIVENUB_H
27 #include <IOKit/storage/IODVDBlockStorageDevice.h>
28 #include <IOKit/storage/IODVDTypes.h>
32 class IOSCSIDVDDriveNub
: public IODVDBlockStorageDevice
{
34 OSDeclareDefaultStructors(IOSCSIDVDDriveNub
)
38 /* Overrides from IOService */
40 virtual bool attach(IOService
* provider
);
42 /* Overrides from IOBlockStorageDevice: */
44 virtual IOReturn
doAsyncReadWrite(IOMemoryDescriptor
*buffer
,
45 UInt32 block
,UInt32 nblks
,
46 IOStorageCompletion completion
);
47 virtual IOReturn
doSyncReadWrite(IOMemoryDescriptor
*buffer
,UInt32 block
,UInt32 nblks
);
49 /* --------------------------------------------------------------------------*/
50 /* APIs used by the IOBlockStorageDevice portion of IODVDBlockStorageDevice: */
51 /* --------------------------------------------------------------------------*/
53 virtual IOReturn
doEjectMedia(void);
54 virtual IOReturn
doFormatMedia(UInt64 byteCapacity
);
55 virtual UInt32
doGetFormatCapacities(UInt64
* capacities
,
56 UInt32 capacitiesMaxCount
) const;
57 virtual IOReturn
doLockUnlockMedia(bool doLock
);
58 virtual IOReturn
doSynchronizeCache(void);
59 virtual char * getVendorString(void);
60 virtual char * getProductString(void);
61 virtual char * getRevisionString(void);
62 virtual char * getAdditionalDeviceInfoString(void);
63 virtual IOReturn
reportBlockSize(UInt64
*blockSize
);
64 virtual IOReturn
reportEjectability(bool *isEjectable
);
65 virtual IOReturn
reportLockability(bool *isLockable
);
66 virtual IOReturn
reportPollRequirements(bool *pollIsRequired
,bool *pollIsExpensive
);
67 virtual IOReturn
reportMaxReadTransfer(UInt64 blockSize
,UInt64
*max
);
68 virtual IOReturn
reportMaxValidBlock(UInt64
*maxBlock
);
69 virtual IOReturn
reportMaxWriteTransfer(UInt64 blockSize
,UInt64
*max
);
70 virtual IOReturn
reportMediaState(bool *mediaPresent
,bool *changed
);
71 virtual IOReturn
reportRemovability(bool *isRemovable
);
72 virtual IOReturn
reportWriteProtection(bool *isWriteProtected
);
74 /*-----------------------------------------*/
76 /*-----------------------------------------*/
78 virtual IOReturn
doAsyncReadCD(IOMemoryDescriptor
*buffer
,
79 UInt32 block
,UInt32 nblks
,
80 CDSectorArea sectorArea
,
81 CDSectorType sectorType
,
82 IOStorageCompletion completion
);
83 virtual UInt32
getMediaType(void);
84 virtual IOReturn
readISRC(UInt8 track
,CDISRC isrc
);
85 virtual IOReturn
readMCN(CDMCN mcn
);
86 virtual IOReturn
readTOC(IOMemoryDescriptor
* buffer
);
88 /*-----------------------------------------*/
89 /* APIs exported by IOCDAudioControl */
90 /*-----------------------------------------*/
92 virtual IOReturn
audioPause(bool pause
);
93 virtual IOReturn
audioPlay(CDMSF timeStart
,CDMSF timeStop
);
94 virtual IOReturn
audioScan(CDMSF timeStart
,bool reverse
);
95 virtual IOReturn
audioStop();
96 virtual IOReturn
getAudioStatus(CDAudioStatus
*status
);
97 virtual IOReturn
getAudioVolume(UInt8
*leftVolume
,UInt8
*rightVolume
);
98 virtual IOReturn
setAudioVolume(UInt8 leftVolume
,UInt8 rightVolume
);
100 /* DVD APIs beyond standard CD APIs: */
102 virtual IOReturn
reportKey(IOMemoryDescriptor
*buffer
,const DVDKeyClass keyClass
,
103 const UInt32 lba
,const UInt8 agid
,const DVDKeyFormat keyFormat
);
104 virtual IOReturn
sendKey(IOMemoryDescriptor
*buffer
,const DVDKeyClass keyClass
,
105 const UInt8 agid
,const DVDKeyFormat keyFormat
);
108 IOSCSIDVDDrive
* _provider
;