]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/IODVDBlockStorageDriver.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / IODVDBlockStorageDriver.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 /*
23 * IODVDBlockStorageDriver.h
24 *
25 * This class implements DVD functionality, independent of
26 * the physical connection protocol (e.g. SCSI, ATA, USB).
27 *
28 * A protocol-specific provider implements the functionality using an appropriate
29 * protocol and commands.
30 */
31
32 #ifndef _IODVDBLOCKSTORAGEDRIVER_H
33 #define _IODVDBLOCKSTORAGEDRIVER_H
34
35 #include <IOKit/IOTypes.h>
36 #include <IOKit/storage/IOCDBlockStorageDriver.h>
37 #include <IOKit/storage/IODVDBlockStorageDevice.h>
38 #include <IOKit/storage/IODVDTypes.h>
39
40 /*!
41 * @defined kIODVDBlockStorageDriverClass
42 * @abstract
43 * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class.
44 * @discussion
45 * kIODVDBlockStorageDriverClass is the name of the IODVDBlockStorageDriver class.
46 */
47
48 #define kIODVDBlockStorageDriverClass "IODVDBlockStorageDriver"
49
50 class IODVDBlockStorageDevice;
51
52 /*!
53 * @class
54 * IODVDBlockStorageDriver : public IOCDBlockStorageDriver
55 * @abstract
56 * Generic DVD Driver.
57 * @discussion
58 * Storage drivers are split into two parts: the Generic Driver handles
59 * all generic device issues, independent of the lower-level transport
60 * mechanism (e.g. SCSI, ATA, USB, FireWire). All storage operations
61 * at the Generic Driver level are translated into a series of generic
62 * device operations. These operations are passed via the Device Nub
63 * to a Transport Driver, which implements the appropriate
64 * transport-dependent protocol to execute these operations.
65 *
66 * To determine the write-protect state of a device (or media), for
67 * example, the generic driver would issue a call to the
68 * Transport Driver's reportWriteProtection method. If this were a SCSI
69 * device, its Transport Driver would issue a Mode Sense command to
70 * extract the write-protection status bit. The Transport Driver then
71 * reports true or false to the generic driver.
72 *
73 * The generic driver therefore has no knowledge of, or involvement
74 * with, the actual commands and mechanisms used to communicate with
75 * the device. It is expected that the generic driver will rarely, if
76 * ever, need to be subclassed to handle device idiosyncrasies; rather,
77 * the Transport Driver should be changed via overrides.
78 *
79 * A generic driver could be subclassed to create a different type of
80 * generic device. The generic driver IODVDBlockStorageDriver class is a subclass
81 * of IOCDBlockStorageDriver, adding DVD functions. Similarly, the Transport Driver
82 * IODVDBlockStorageDevice is a subclass of IOCDBlockStorageDevice, adding DVD
83 * functions.
84 */
85
86 class IODVDBlockStorageDriver : public IOCDBlockStorageDriver {
87
88 OSDeclareDefaultStructors(IODVDBlockStorageDriver)
89
90 protected:
91
92 struct ExpansionData { /* */ };
93 ExpansionData * _expansionData;
94
95 public:
96
97 /* Overrides of IOCDBlockStorageDriver: */
98
99 virtual const char * getDeviceTypeName(void);
100 virtual IOMedia * instantiateDesiredMediaObject(void);
101 virtual IOMedia * instantiateMediaObject(UInt64 base,UInt64 byteSize,
102 UInt32 blockSize,char *mediaName);
103
104 /* End of IOCDBlockStorageDriver overrides. */
105
106 /*!
107 * @function reportKey
108 * @abstract
109 * Get key info from the DVD drive.
110 * @discussion
111 * This function handles the getting of key- and encryption-related data for the drive.
112 * @param buffer
113 * A buffer containing information, as documented in the specification
114 * "MtFuji Commands For Multimedia Devices."
115 * @param keyClass
116 * As documented by MtFuji. See DVDKeyClass.
117 * @param agid
118 * An AGID, as documented by MtFuji.
119 * @param keyFormat
120 * As documented by MtFuji. See DVDKeyFormat.
121 */
122 virtual IOReturn reportKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
123 const UInt32 lba,const UInt8 agid,const DVDKeyFormat keyFormat);
124
125 /*!
126 * @function sendKey
127 * @abstract
128 * Send key info to the DVD drive.
129 * @discussion
130 * This function handles the setting of key- and encryption-related data for the drive.
131 * @param buffer
132 * A buffer containing information, as documented in the specification
133 * "MtFuji Commands For Multimedia Devices."
134 * @param keyClass
135 * As documented by MtFuji. See DVDKeyClass.
136 * @param agid
137 * As documented by MtFuji.
138 * @param keyFormat
139 * As documented by MtFuji. See DVDKeyFormat.
140 */
141 virtual IOReturn sendKey(IOMemoryDescriptor *buffer,const DVDKeyClass keyClass,
142 const UInt8 agid,const DVDKeyFormat keyFormat);
143
144 /*
145 * Obtain this object's provider. We override the superclass's method to
146 * return a more specific subclass of IOService -- IODVDBlockStorageDevice.
147 * This method serves simply as a convenience to subclass developers.
148 */
149
150 virtual IODVDBlockStorageDevice * getProvider() const;
151
152 protected:
153
154 /* Overrides of IOCDBlockStorageDriver behavior. */
155
156 virtual IOReturn acceptNewMedia(void);
157
158 /* End of IOCDBlockStorageDriver overrides. */
159
160 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 0);
161 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 1);
162 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 2);
163 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 3);
164 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 4);
165 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 5);
166 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 6);
167 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 7);
168 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 8);
169 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 9);
170 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 10);
171 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 11);
172 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 12);
173 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 13);
174 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 14);
175 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 15);
176 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 16);
177 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 17);
178 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 18);
179 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 19);
180 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 20);
181 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 21);
182 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 22);
183 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 23);
184 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 24);
185 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 25);
186 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 26);
187 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 27);
188 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 28);
189 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 29);
190 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 30);
191 OSMetaClassDeclareReservedUnused(IODVDBlockStorageDriver, 31);
192 };
193 #endif