]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/scsi/IOSCSIDVDDriveNub.h
xnu-124.13.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / scsi / IOSCSIDVDDriveNub.h
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 /* This subclass implements a relay to a protocol- and device-specific provider. */
23
24 #ifndef _IOSCSIDVDDRIVENUB_H
25 #define _IOSCSIDVDDRIVENUB_H
26
27 #include <IOKit/storage/IODVDBlockStorageDevice.h>
28 #include <IOKit/storage/IODVDTypes.h>
29
30 class IOSCSIDVDDrive;
31
32 class IOSCSIDVDDriveNub : public IODVDBlockStorageDevice {
33
34 OSDeclareDefaultStructors(IOSCSIDVDDriveNub)
35
36 public:
37
38 /* Overrides from IOService */
39
40 virtual bool attach(IOService * provider);
41
42 /* Overrides from IOBlockStorageDevice: */
43
44 virtual IOReturn doAsyncReadWrite(IOMemoryDescriptor *buffer,
45 UInt32 block,UInt32 nblks,
46 IOStorageCompletion completion);
47 virtual IOReturn doSyncReadWrite(IOMemoryDescriptor *buffer,UInt32 block,UInt32 nblks);
48
49 /* --------------------------------------------------------------------------*/
50 /* APIs used by the IOBlockStorageDevice portion of IODVDBlockStorageDevice: */
51 /* --------------------------------------------------------------------------*/
52
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);
73
74 /*-----------------------------------------*/
75 /* CD APIs */
76 /*-----------------------------------------*/
77
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);
87
88 /*-----------------------------------------*/
89 /* APIs exported by IOCDAudioControl */
90 /*-----------------------------------------*/
91
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);
99
100 /* DVD APIs beyond standard CD APIs: */
101
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);
106 protected:
107
108 IOSCSIDVDDrive * _provider;
109
110 };
111 #endif