aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:21 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:21 -0500
commit455d80a9553915251b6392e31c39aeb8f8a94d68 (patch)
tree3b9452a3ee0d3a3de67f316f13bb6e3db00531fa /drivers/ide/ide-cd.h
parent0ba11211f9ac583333aac44daec5af4f7eeba217 (diff)
ide-cd: remove struct atapi_capabilities_page (take 2)
* Remove struct atapi_capabilities_page. * Add ATAPI_CAPABILITIES_PAGE[_PAD]_SIZE define. v2: * The buf[] array access indexes were swapped between 'curspeed'/'maxspeed'. (Noticed by Borislav Petkov). Cc: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.h')
-rw-r--r--drivers/ide/ide-cd.h223
1 files changed, 4 insertions, 219 deletions
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h
index 8dbe346b4b44..9d88b1a7ffe5 100644
--- a/drivers/ide/ide-cd.h
+++ b/drivers/ide/ide-cd.h
@@ -50,6 +50,10 @@
50#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS) 50#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
51#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32) 51#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
52 52
53/* Capabilities Page size including 8 bytes of Mode Page Header */
54#define ATAPI_CAPABILITIES_PAGE_SIZE (8 + 20)
55#define ATAPI_CAPABILITIES_PAGE_PAD_SIZE 4
56
53/* Configuration flags. These describe the capabilities of the drive. 57/* Configuration flags. These describe the capabilities of the drive.
54 They generally do not change after initialization, unless we learn 58 They generally do not change after initialization, unless we learn
55 more about the drive from stuff failing. */ 59 more about the drive from stuff failing. */
@@ -124,225 +128,6 @@ struct atapi_toc {
124 /* One extra for the leadout. */ 128 /* One extra for the leadout. */
125}; 129};
126 130
127/* This should probably go into cdrom.h along with the other
128 * generic stuff now in the Mt. Fuji spec.
129 */
130struct atapi_capabilities_page {
131 struct mode_page_header header;
132#if defined(__BIG_ENDIAN_BITFIELD)
133 __u8 parameters_saveable : 1;
134 __u8 reserved1 : 1;
135 __u8 page_code : 6;
136#elif defined(__LITTLE_ENDIAN_BITFIELD)
137 __u8 page_code : 6;
138 __u8 reserved1 : 1;
139 __u8 parameters_saveable : 1;
140#else
141#error "Please fix <asm/byteorder.h>"
142#endif
143
144 byte page_length;
145
146#if defined(__BIG_ENDIAN_BITFIELD)
147 __u8 reserved2 : 2;
148 /* Drive supports reading of DVD-RAM discs */
149 __u8 dvd_ram_read : 1;
150 /* Drive supports reading of DVD-R discs */
151 __u8 dvd_r_read : 1;
152 /* Drive supports reading of DVD-ROM discs */
153 __u8 dvd_rom : 1;
154 /* Drive supports reading CD-R discs with addressing method 2 */
155 __u8 method2 : 1; /* reserved in 1.2 */
156 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
157 __u8 cd_rw_read : 1; /* reserved in 1.2 */
158 /* Drive supports read from CD-R discs (orange book, part II) */
159 __u8 cd_r_read : 1; /* reserved in 1.2 */
160#elif defined(__LITTLE_ENDIAN_BITFIELD)
161 /* Drive supports read from CD-R discs (orange book, part II) */
162 __u8 cd_r_read : 1; /* reserved in 1.2 */
163 /* Drive can read from CD-R/W (CD-E) discs (orange book, part III) */
164 __u8 cd_rw_read : 1; /* reserved in 1.2 */
165 /* Drive supports reading CD-R discs with addressing method 2 */
166 __u8 method2 : 1;
167 /* Drive supports reading of DVD-ROM discs */
168 __u8 dvd_rom : 1;
169 /* Drive supports reading of DVD-R discs */
170 __u8 dvd_r_read : 1;
171 /* Drive supports reading of DVD-RAM discs */
172 __u8 dvd_ram_read : 1;
173 __u8 reserved2 : 2;
174#else
175#error "Please fix <asm/byteorder.h>"
176#endif
177
178#if defined(__BIG_ENDIAN_BITFIELD)
179 __u8 reserved3 : 2;
180 /* Drive can write DVD-RAM discs */
181 __u8 dvd_ram_write : 1;
182 /* Drive can write DVD-R discs */
183 __u8 dvd_r_write : 1;
184 __u8 reserved3a : 1;
185 /* Drive can fake writes */
186 __u8 test_write : 1;
187 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
188 __u8 cd_rw_write : 1; /* reserved in 1.2 */
189 /* Drive supports write to CD-R discs (orange book, part II) */
190 __u8 cd_r_write : 1; /* reserved in 1.2 */
191#elif defined(__LITTLE_ENDIAN_BITFIELD)
192 /* Drive can write to CD-R discs (orange book, part II) */
193 __u8 cd_r_write : 1; /* reserved in 1.2 */
194 /* Drive can write to CD-R/W (CD-E) discs (orange book, part III) */
195 __u8 cd_rw_write : 1; /* reserved in 1.2 */
196 /* Drive can fake writes */
197 __u8 test_write : 1;
198 __u8 reserved3a : 1;
199 /* Drive can write DVD-R discs */
200 __u8 dvd_r_write : 1;
201 /* Drive can write DVD-RAM discs */
202 __u8 dvd_ram_write : 1;
203 __u8 reserved3 : 2;
204#else
205#error "Please fix <asm/byteorder.h>"
206#endif
207
208#if defined(__BIG_ENDIAN_BITFIELD)
209 __u8 reserved4 : 1;
210 /* Drive can read multisession discs. */
211 __u8 multisession : 1;
212 /* Drive can read mode 2, form 2 data. */
213 __u8 mode2_form2 : 1;
214 /* Drive can read mode 2, form 1 (XA) data. */
215 __u8 mode2_form1 : 1;
216 /* Drive supports digital output on port 2. */
217 __u8 digport2 : 1;
218 /* Drive supports digital output on port 1. */
219 __u8 digport1 : 1;
220 /* Drive can deliver a composite audio/video data stream. */
221 __u8 composite : 1;
222 /* Drive supports audio play operations. */
223 __u8 audio_play : 1;
224#elif defined(__LITTLE_ENDIAN_BITFIELD)
225 /* Drive supports audio play operations. */
226 __u8 audio_play : 1;
227 /* Drive can deliver a composite audio/video data stream. */
228 __u8 composite : 1;
229 /* Drive supports digital output on port 1. */
230 __u8 digport1 : 1;
231 /* Drive supports digital output on port 2. */
232 __u8 digport2 : 1;
233 /* Drive can read mode 2, form 1 (XA) data. */
234 __u8 mode2_form1 : 1;
235 /* Drive can read mode 2, form 2 data. */
236 __u8 mode2_form2 : 1;
237 /* Drive can read multisession discs. */
238 __u8 multisession : 1;
239 __u8 reserved4 : 1;
240#else
241#error "Please fix <asm/byteorder.h>"
242#endif
243
244#if defined(__BIG_ENDIAN_BITFIELD)
245 __u8 reserved5 : 1;
246 /* Drive can return Media Catalog Number (UPC) info. */
247 __u8 upc : 1;
248 /* Drive can return International Standard Recording Code info. */
249 __u8 isrc : 1;
250 /* Drive supports C2 error pointers. */
251 __u8 c2_pointers : 1;
252 /* R-W data will be returned deinterleaved and error corrected. */
253 __u8 rw_corr : 1;
254 /* Subchannel reads can return combined R-W information. */
255 __u8 rw_supported : 1;
256 /* Drive can continue a read cdda operation from a loss of streaming.*/
257 __u8 cdda_accurate : 1;
258 /* Drive can read Red Book audio data. */
259 __u8 cdda : 1;
260#elif defined(__LITTLE_ENDIAN_BITFIELD)
261 /* Drive can read Red Book audio data. */
262 __u8 cdda : 1;
263 /* Drive can continue a read cdda operation from a loss of streaming.*/
264 __u8 cdda_accurate : 1;
265 /* Subchannel reads can return combined R-W information. */
266 __u8 rw_supported : 1;
267 /* R-W data will be returned deinterleaved and error corrected. */
268 __u8 rw_corr : 1;
269 /* Drive supports C2 error pointers. */
270 __u8 c2_pointers : 1;
271 /* Drive can return International Standard Recording Code info. */
272 __u8 isrc : 1;
273 /* Drive can return Media Catalog Number (UPC) info. */
274 __u8 upc : 1;
275 __u8 reserved5 : 1;
276#else
277#error "Please fix <asm/byteorder.h>"
278#endif
279
280#if defined(__BIG_ENDIAN_BITFIELD)
281 /* Drive mechanism types. */
282 mechtype_t mechtype : 3;
283 __u8 reserved6 : 1;
284 /* Drive can eject a disc or changer cartridge. */
285 __u8 eject : 1;
286 /* State of prevent/allow jumper. */
287 __u8 prevent_jumper : 1;
288 /* Present state of door lock. */
289 __u8 lock_state : 1;
290 /* Drive can lock the door. */
291 __u8 lock : 1;
292#elif defined(__LITTLE_ENDIAN_BITFIELD)
293
294 /* Drive can lock the door. */
295 __u8 lock : 1;
296 /* Present state of door lock. */
297 __u8 lock_state : 1;
298 /* State of prevent/allow jumper. */
299 __u8 prevent_jumper : 1;
300 /* Drive can eject a disc or changer cartridge. */
301 __u8 eject : 1;
302 __u8 reserved6 : 1;
303 /* Drive mechanism types. */
304 mechtype_t mechtype : 3;
305#else
306#error "Please fix <asm/byteorder.h>"
307#endif
308
309#if defined(__BIG_ENDIAN_BITFIELD)
310 __u8 reserved7 : 4;
311 /* Drive supports software slot selection. */
312 __u8 sss : 1; /* reserved in 1.2 */
313 /* Changer can report exact contents of slots. */
314 __u8 disc_present : 1; /* reserved in 1.2 */
315 /* Audio for each channel can be muted independently. */
316 __u8 separate_mute : 1;
317 /* Audio level for each channel can be controlled independently. */
318 __u8 separate_volume : 1;
319#elif defined(__LITTLE_ENDIAN_BITFIELD)
320
321 /* Audio level for each channel can be controlled independently. */
322 __u8 separate_volume : 1;
323 /* Audio for each channel can be muted independently. */
324 __u8 separate_mute : 1;
325 /* Changer can report exact contents of slots. */
326 __u8 disc_present : 1; /* reserved in 1.2 */
327 /* Drive supports software slot selection. */
328 __u8 sss : 1; /* reserved in 1.2 */
329 __u8 reserved7 : 4;
330#else
331#error "Please fix <asm/byteorder.h>"
332#endif
333
334 /* Note: the following four fields are returned in big-endian form. */
335 /* Maximum speed (in kB/s). */
336 unsigned short maxspeed;
337 /* Number of discrete volume levels. */
338 unsigned short n_vol_levels;
339 /* Size of cache in drive, in kB. */
340 unsigned short buffer_size;
341 /* Current speed (in kB/s). */
342 unsigned short curspeed;
343 char pad[4];
344};
345
346/* Extra per-device info for cdrom drives. */ 131/* Extra per-device info for cdrom drives. */
347struct cdrom_info { 132struct cdrom_info {
348 ide_drive_t *drive; 133 ide_drive_t *drive;