]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/IOCDBlockStorageDevice.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / IOCDBlockStorageDevice.h
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 /*
23 * IOCDBlockStorageDevice.h
24 *
25 * This class is the protocol for generic CDROM functionality, independent of
26 * the physical connection protocol (e.g. SCSI, ATA, USB).
27 *
28 * The APIs are the union of CDROM (block storage) data APIs and all
29 * necessary low-level CD APIs.
30 *
31 * A subclass implements relay methods that translate our requests into
32 * calls to a protocol- and device-specific provider.
33 */
34
35 #ifndef _IOCDBLOCKSTORAGEDEVICE_H
36 #define _IOCDBLOCKSTORAGEDEVICE_H
37
38 #include <IOKit/IOTypes.h>
39 #include <IOKit/storage/IOCDTypes.h>
40 #include <IOKit/storage/IOBlockStorageDevice.h>
41
42 /* Property used for matching, so the generic driver gets the nub it wants. */
43 #define kIOBlockStorageDeviceTypeCDROM "CDROM"
44
45 class IOMemoryDescriptor;
46
47 class IOCDBlockStorageDevice : public IOBlockStorageDevice {
48
49 OSDeclareAbstractStructors(IOCDBlockStorageDevice)
50
51 protected:
52
53 struct ExpansionData { /* */ };
54 ExpansionData * _expansionData;
55
56 public:
57
58 /* Overrides from IORegistryEntry */
59
60 virtual bool init(OSDictionary * properties);
61
62 /*-----------------------------------------*/
63 /* CD APIs */
64 /*-----------------------------------------*/
65
66 virtual IOReturn doAsyncReadCD(IOMemoryDescriptor *buffer,
67 UInt32 block,UInt32 nblks,
68 CDSectorArea sectorArea,
69 CDSectorType sectorType,
70 IOStorageCompletion completion) = 0;
71 virtual UInt32 getMediaType(void) = 0;
72 virtual IOReturn readISRC(UInt8 track,CDISRC isrc) = 0;
73 virtual IOReturn readMCN(CDMCN mcn) = 0;
74 virtual IOReturn readTOC(IOMemoryDescriptor * buffer) = 0;
75
76 /*-----------------------------------------*/
77 /* APIs exported by IOCDAudioControl */
78 /*-----------------------------------------*/
79
80 virtual IOReturn audioPause(bool pause) = 0;
81 virtual IOReturn audioPlay(CDMSF timeStart,CDMSF timeStop) = 0;
82 virtual IOReturn audioScan(CDMSF timeStart,bool reverse) = 0;
83 virtual IOReturn audioStop() = 0;
84 virtual IOReturn getAudioStatus(CDAudioStatus *status) = 0;
85 virtual IOReturn getAudioVolume(UInt8 *leftVolume,UInt8 *rightVolume) = 0;
86 virtual IOReturn setAudioVolume(UInt8 leftVolume,UInt8 rightVolume) = 0;
87
88 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 0);
89 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 1);
90 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 2);
91 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 3);
92 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 4);
93 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 5);
94 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 6);
95 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 7);
96 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 8);
97 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 9);
98 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 10);
99 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 11);
100 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 12);
101 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 13);
102 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 14);
103 OSMetaClassDeclareReservedUnused(IOCDBlockStorageDevice, 15);
104 };
105 #endif