1/*
2 * Copyright (c) 1998-2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24/*!
25 * @header IODVDBlockStorageDevice
26 * @abstract
27 * This header contains the IODVDBlockStorageDevice class definition.
28 */
29
30#ifndef	_IODVDBLOCKSTORAGEDEVICE_H
31#define	_IODVDBLOCKSTORAGEDEVICE_H
32
33#include <IOKit/storage/IODVDTypes.h>
34
35/*!
36 * @defined kIODVDBlockStorageDeviceClass
37 * @abstract
38 * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class.
39 * @discussion
40 * kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class.
41 */
42
43#define kIODVDBlockStorageDeviceClass "IODVDBlockStorageDevice"
44
45#ifdef KERNEL
46#ifdef __cplusplus
47
48/*
49 * Kernel
50 */
51
52#include <IOKit/storage/IOCDBlockStorageDevice.h>
53
54/* Property used for matching, so the generic driver gets the nub it wants. */
55#define	kIOBlockStorageDeviceTypeDVD	"DVD"
56
57/*!
58 * @class
59 * IODVDBlockStorageDevice : public IOCDBlockStorageDevice
60 * @abstract
61 * The IODVDBlockStorageDevice class is a generic DVD block storage device
62 * abstraction.
63 * @discussion
64 * This class is the protocol for generic DVD functionality, independent of
65 * the physical connection protocol (e.g. SCSI, ATA, USB).
66 *
67 * The APIs are the union of CD APIs and all
68 * necessary new low-level DVD APIs.
69 *
70 * A subclass implements relay methods that translate our requests into
71 * calls to a protocol- and device-specific provider.
72 */
73
74class IODVDBlockStorageDevice : public IOCDBlockStorageDevice {
75
76    OSDeclareAbstractStructors(IODVDBlockStorageDevice)
77
78protected:
79
80    struct ExpansionData { /* */ };
81    ExpansionData * _expansionData;
82
83public:
84
85    /* Overrides from IORegistryEntry */
86
87    virtual bool	init(OSDictionary * properties);
88
89    /* New APIs for DVD */
90
91    virtual IOReturn	reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
92                                        const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat)	= 0;
93
94    virtual IOReturn	sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
95                                        const UInt8 agid,const DVDKeyFormat keyFormat)	= 0;
96
97#ifdef __LP64__
98    virtual IOReturn	readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format,
99                                        const UInt32 address,const UInt8 layer,const UInt8 agid)	= 0;
100#else /* !__LP64__ */
101    virtual IOReturn	readDVDStructure(IOMemoryDescriptor *buffer,const DVDStructureFormat format,
102                                        const UInt32 address,const UInt8 layer,const UInt8 agid); /* 10.1.0 */
103#endif /* !__LP64__ */
104
105#ifdef __LP64__
106    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  0);
107#else /* !__LP64__ */
108    OSMetaClassDeclareReservedUsed(IODVDBlockStorageDevice,  0);
109#endif /* !__LP64__ */
110    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  1);
111    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  2);
112    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  3);
113    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  4);
114    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  5);
115    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  6);
116    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  7);
117    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  8);
118    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice,  9);
119    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 10);
120    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 11);
121    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 12);
122    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 13);
123    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 14);
124    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 15);
125    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 16);
126    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 17);
127    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 18);
128    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 19);
129    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 20);
130    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 21);
131    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 22);
132    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 23);
133    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 24);
134    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 25);
135    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 26);
136    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 27);
137    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 28);
138    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 29);
139    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 30);
140    OSMetaClassDeclareReservedUnused(IODVDBlockStorageDevice, 31);
141};
142
143#endif /* __cplusplus */
144#endif /* KERNEL */
145#endif /* !_IODVDBLOCKSTORAGEDEVICE_H */
146