1 /*
2 * sbpcd.h Specify interface address and interface type here.
3 */
4
5 /*
6 * Attention! This file contains user-serviceable parts!
7 * I recommend to make use of it...
8 *
9 * The definitions for the first controller can get overridden by
10 * the kernel command line ("lilo boot option").
11 * Examples:
12 * sbpcd=0x230,SoundBlaster
13 * or
14 * sbpcd=0x300,LaserMate
15 * or
16 * sbpcd=0x330,SPEA
17 *
18 * If sbpcd gets used as a module, you can load it with
19 * insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x230,1
20 * or
21 * insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x300,0
22 * or
23 * insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x330,2
24 * respective to override the configured address and type.
25 */
26
27 /*
28 * define your CDROM port base address as CDROM_PORT
29 * and specify the type of your interface card as SBPRO.
30 *
31 * Read linux/drivers/block/README.sbpcd if you are in doubt about the
32 * type of your interface card (you should do that anyway).
33 *
34 * address:
35 * ========
36 * SBPRO type addresses typically are 0x0230 (=0x220+0x10), 0x0250, ...
37 * LASERMATE type (CI-101P, WDH-7001C) addresses typically are 0x0300, ...
38 * SPEA addresses are from the LASERMATE type and range.
39 * There are some soundcards on the market with 0x0630, 0x0650, ...; their
40 * type is not obvious (both types are possible).
41 *
42 * example: if your SBPRO audio address is 0x220, specify 0x230 and SBPRO 1.
43 * if your soundcard has its CDROM port above 0x300, specify
44 * that address and try SBPRO 0 first.
45 *
46 * interface type:
47 * ===============
48 * set SBPRO to 1 for "true" SoundBlaster card
49 * set SBPRO to 0 for "compatible" soundcards and
50 * for "poor" (no sound) interface cards.
51 * set SBPRO to 2 for the SPEA Media FX card
52 *
53 * Almost all "compatible" sound boards need to set SBPRO to 0.
54 * If SBPRO is set wrong, the drives will get found - but any
55 * data access will give errors (audio access will work).
56 * The "OmniCD" no-sound interface card from CreativeLabs needs SBPRO 1.
57 *
58 * mail to emoenke@gwdg.de if you have a "compatible" sound card which
59 * in fact needs to set SBPRO to 1 (not any known at time).
60 *
61 * sound base:
62 * ===========
63 * The SOUND_BASE definition tells if we should try to turn the CD sound
64 * channels on. It will only be of use regarding soundcards with a SbPro
65 * compatible mixer.
66 *
67 * Example: #define SOUND_BASE 0x220 enables the sound card's CD channels
68 * #define SOUND_BASE 0 leaves the soundcard untouched
69 */
70 #if !(SBPCD_ISSUE-1) /* first (or if you have only one) interface board: */
71 #define CDROM_PORT 0x340 /* <-----------<< port address */
72 #define SBPRO 0 /* <-----------<< interface type */
73 #define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */
74 #define SOUND_BASE 0x220 /* <-----------<< sound address of this card or 0 */
75 #endif
76 #if !(SBPCD_ISSUE-2) /* ==================== second interface board: === */
77 #define CDROM_PORT 0x344 /* <-----------<< port address */
78 #define SBPRO 0 /* <-----------<< interface type */
79 #define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */
80 #define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0 */
81 #endif
82 #if !(SBPCD_ISSUE-3) /* ===================== third interface board: === */
83 #define CDROM_PORT 0x634 /* <-----------<< port address */
84 #define SBPRO 1 /* <-----------<< interface type */
85 #define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */
86 #define SOUND_BASE 0x240 /* <-----------<< sound address of this card or 0 */
87 #endif
88 #if !(SBPCD_ISSUE-4) /* ==================== fourth interface board: === */
89 #define CDROM_PORT 0x634 /* <-----------<< port address */
90 #define SBPRO 0 /* <-----------<< interface type */
91 #define MAX_DRIVES 4 /* set to 1 if the card does not use "drive select" */
92 #define SOUND_BASE 0x000 /* <-----------<< sound address of this card or 0 */
93 #endif
94
95 /*
96 * some more or less user dependent definitions - service them!
97 */
98
99 /* Set this to 0 after you have configured your interface definitions right. */
100 #define DISTRIBUTION 1
101
102 /* max. number of audio frames to read with one */
103 /* request (allocates n* 2352 bytes kernel memory!) */
104 /* may be freely adjusted, f.e. 75 (= 1 sec.), at */
105 /* runtime by use of the CDROMAUDIOBUFSIZ ioctl. */
106 #define READ_AUDIO 0
107
108 /* tray control: eject tray if no disk is in (0 or 1) */
109 #define JUKEBOX 1
110
111 /* tray control: eject tray after last use (0 or 1) */
112 #define EJECT 1
113
114 /*==========================================================================*/
115 /*==========================================================================*/
116 /*
117 * nothing to change below here if you are not experimenting
118 */
119 #ifndef _LINUX_SBPCD_H
120
121 #define _LINUX_SBPCD_H
122 /*==========================================================================*/
123 /*==========================================================================*/
124 #define LONG_TIMING 0 /* test against timeouts with "gold" CDs on CR-521 */
125 #undef FUTURE
126
127 #define TEST_UPC 0
128 #define SPEA_TEST 0
129 #define TEST_STI 0
130 #undef PATH_CHECK
131 /*==========================================================================*/
132 /*
133 * DDI interface definitions
134 * "invented" by Fred N. van Kempen..
135 */
136 #define DDIOCSDBG 0x9000
137
138 /*==========================================================================*/
139 /*
140 * "private" IOCTL functions
141 */
142 #define CDROMAUDIOBUFSIZ 0x5382 /* set the audio buffer size */
143
144 /*==========================================================================*/
145 /*
146 * Debug output levels
147 */
148 #define DBG_INF 1 /* necessary information */
149 #define DBG_BSZ 2 /* BLOCK_SIZE trace */
150 #define DBG_REA 3 /* READ status trace */
151 #define DBG_CHK 4 /* MEDIA CHECK trace */
152 #define DBG_TIM 5 /* datarate timer test */
153 #define DBG_INI 6 /* initialization trace */
154 #define DBG_TOC 7 /* tell TocEntry values */
155 #define DBG_IOC 8 /* ioctl trace */
156 #define DBG_STA 9 /* ResponseStatus() trace */
157 #define DBG_ERR 10 /* cc_ReadError() trace */
158 #define DBG_CMD 11 /* cmd_out() trace */
159 #define DBG_WRN 12 /* give explanation before auto-probing */
160 #define DBG_MUL 13 /* multi session code test */
161 #define DBG_IDX 14 /* test code for drive_id !=0 */
162 #define DBG_IOX 15 /* some special information */
163 #define DBG_DID 16 /* drive ID test */
164 #define DBG_RES 17 /* drive reset info */
165 #define DBG_SPI 18 /* SpinUp test */
166 #define DBG_IOS 19 /* ioctl trace: subchannel functions */
167 #define DBG_IO2 20 /* ioctl trace: general */
168 #define DBG_UPC 21 /* show UPC information */
169 #define DBG_XA1 22 /* XA mode debugging */
170 #define DBG_LCK 23 /* door (un)lock info */
171 #define DBG_SQ1 24 /* dump SubQ frame */
172 #define DBG_AUD 25 /* READ AUDIO debugging */
173 #define DBG_SEQ 26 /* Sequoia interface configuration trace */
174 #define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */
175 #define DBG_CD2 28 /* MKE CD200 debugging trace */
176 #define DBG_TEA 29 /* TEAC CD-55A debugging trace */
177 #define DBG_TE2 30 /* TEAC CD-55A 2nd debugging level */
178 #define DBG_000 31 /* unnecessary information */
179
180 /*==========================================================================*/
181 /*==========================================================================*/
182
183 /*
184 * bits of flags_cmd_out:
185 */
186 #define f_respo3 0x100
187 #define f_putcmd 0x80
188 #define f_respo2 0x40
189 #define f_lopsta 0x20
190 #define f_getsta 0x10
191 #define f_ResponseStatus 0x08
192 #define f_obey_p_check 0x04
193 #define f_bit1 0x02
194 #define f_wait_if_busy 0x01
195
196 /*
197 * diskstate_flags:
198 */
199 #define x80_bit 0x80
200 #define upc_bit 0x40
201 #define volume_bit 0x20
202 #define toc_bit 0x10
203 #define multisession_bit 0x08
204 #define cd_size_bit 0x04
205 #define subq_bit 0x02
206 #define frame_size_bit 0x01
207
208 /*
209 * disk states (bits of diskstate_flags):
210 */
211 #define upc_valid (D_S[d].diskstate_flags&upc_bit)
212 #define volume_valid (D_S[d].diskstate_flags&volume_bit)
213 #define toc_valid (D_S[d].diskstate_flags&toc_bit)
214 #define cd_size_valid (D_S[d].diskstate_flags&cd_size_bit)
215 #define subq_valid (D_S[d].diskstate_flags&subq_bit)
216 #define frame_size_valid (D_S[d].diskstate_flags&frame_size_bit)
217
218 /*
219 * the status_bits variable
220 */
221 #define p_success 0x100
222 #define p_door_closed 0x80
223 #define p_caddy_in 0x40
224 #define p_spinning 0x20
225 #define p_check 0x10
226 #define p_busy_new 0x08
227 #define p_door_locked 0x04
228 #define p_disk_ok 0x01
229
230 /*
231 * LCS-7260 special status result bits:
232 */
233 #define p_lcs_door_locked 0x02
234 #define p_lcs_door_closed 0x01
235
236 /*
237 * CR-52x special status result bits:
238 */
239 #define p_caddin_old 0x40
240 #define p_success_old 0x08
241 #define p_busy_old 0x04
242 #define p_bit_1 0x02 /* hopefully unused now */
243
244 /*
245 * "generation specific" defs of the status result bits:
246 */
247 #define p0_door_closed 0x80
248 #define p0_caddy_in 0x40
249 #define p0_spinning 0x20
250 #define p0_check 0x10
251 #define p0_success 0x08 /* unused */
252 #define p0_busy 0x04
253 #define p0_bit_1 0x02 /* unused */
254 #define p0_disk_ok 0x01
255
256 #define pL_disk_in 0x40
257 #define pL_spinning 0x20
258 #define pL_check 0x10
259 #define pL_success 0x08 /* unused ?? */
260 #define pL_busy 0x04
261 #define pL_door_locked 0x02
262 #define pL_door_closed 0x01
263
264 #define p1_door_closed 0x80
265 #define p1_disk_in 0x40
266 #define p1_spinning 0x20
267 #define p1_check 0x10
268 #define p1_busy 0x08
269 #define p1_door_locked 0x04
270 #define p1_bit_1 0x02 /* unused */
271 #define p1_disk_ok 0x01
272
273 #define p2_disk_ok 0x80
274 #define p2_door_locked 0x40
275 #define p2_spinning 0x20
276 #define p2_busy2 0x10
277 #define p2_busy1 0x08
278 #define p2_door_closed 0x04
279 #define p2_disk_in 0x02
280 #define p2_check 0x01
281
282 /*
283 * used drive states:
284 */
285 #define st_door_closed (D_S[d].status_bits&p_door_closed)
286 #define st_caddy_in (D_S[d].status_bits&p_caddy_in)
287 #define st_spinning (D_S[d].status_bits&p_spinning)
288 #define st_check (D_S[d].status_bits&p_check)
289 #define st_busy (D_S[d].status_bits&p_busy_new)
290 #define st_door_locked (D_S[d].status_bits&p_door_locked)
291 #define st_diskok (D_S[d].status_bits&p_disk_ok)
292
293 /*
294 * bits of the CDi_status register:
295 */
296 #define s_not_result_ready 0x04 /* 0: "result ready" */
297 #define s_not_data_ready 0x02 /* 0: "data ready" */
298 #define s_attention 0x01 /* 1: "attention required" */
299 /*
300 * usable as:
301 */
302 #define DRV_ATTN ((inb(CDi_status)&s_attention)!=0)
303 #define DATA_READY ((inb(CDi_status)&s_not_data_ready)==0)
304 #define RESULT_READY ((inb(CDi_status)&s_not_result_ready)==0)
305
306 /*
307 * drive types (firmware versions):
308 */
309 #define drv_fam0 0x08 /* CR-52x family */
310 #define drv_199 (drv_fam0+0x01) /* <200 */
311 #define drv_200 (drv_fam0+0x02) /* <201 */
312 #define drv_201 (drv_fam0+0x03) /* <210 */
313 #define drv_210 (drv_fam0+0x04) /* <211 */
314 #define drv_211 (drv_fam0+0x05) /* <300 */
315 #define drv_300 (drv_fam0+0x06) /* >=300 */
316
317 #define drv_famL 0x10 /* Longshine family */
318 #define drv_260 (drv_famL+0x01) /* LCS-7260 */
319 #define drv_e1 (drv_famL+0x01) /* LCS-7260, firmware "A E1" */
320 #define drv_f4 (drv_famL+0x02) /* LCS-7260, firmware "A4F4" */
321
322 #define drv_fam1 0x20 /* CR-56x family */
323 #define drv_099 (drv_fam1+0x01) /* <100 */
324 #define drv_100 (drv_fam1+0x02) /* >=100, only 5.00 known here */
325
326 #define drv_famT 0x40 /* TEAC CD-55A */
327 #define drv_fam2 0x80 /* CD200 family */
328
329 #define fam0_drive (D_S[d].drv_type&drv_fam0)
330 #define famL_drive (D_S[d].drv_type&drv_famL)
331 #define fam1_drive (D_S[d].drv_type&drv_fam1)
332 #define fam2_drive (D_S[d].drv_type&drv_fam2)
333 #define famT_drive (D_S[d].drv_type&drv_famT)
334 #define fam0L_drive (D_S[d].drv_type&(drv_fam0|drv_famL))
335 #define fam1L_drive (D_S[d].drv_type&(drv_fam1|drv_famL))
336 #define fam01_drive (D_S[d].drv_type&(drv_fam0|drv_fam1))
337 #define fam12_drive (D_S[d].drv_type&(drv_fam1|drv_fam2))
338 #define fam2T_drive (D_S[d].drv_type&(drv_fam2|drv_famT))
339
340 /*
341 * audio states:
342 */
343 #define audio_playing 2
344 #define audio_pausing 1
345
346 /*
347 * drv_pattern, drv_options:
348 */
349 #define speed_auto 0x80
350 #define speed_300 0x40
351 #define speed_150 0x20
352 #define audio_mono 0x04
353
354 /*
355 * values of cmd_type (0 else):
356 */
357 #define READ_M1 0x01 /* "data mode 1": 2048 bytes per frame */
358 #define READ_M2 0x02 /* "data mode 2": 12+2048+280 bytes per frame */
359 #define READ_SC 0x04 /* "subchannel info": 96 bytes per frame */
360 #define READ_AU 0x08 /* "audio frame": 2352 bytes per frame */
361
362 /*
363 * sense_byte:
364 *
365 * values: 00
366 * 01
367 * 81
368 * 82 "raw audio" mode
369 * xx from infobuf[0] after 85 00 00 00 00 00 00
370 */
371
372 /* audio status (bin) */
373 #define aud_00 0x00 /* Audio status byte not supported or not valid */
374 #define audx11 0x0b /* Audio play operation in progress */
375 #define audx12 0x0c /* Audio play operation paused */
376 #define audx13 0x0d /* Audio play operation successfully completed */
377 #define audx14 0x0e /* Audio play operation stopped due to error */
378 #define audx15 0x0f /* No current audio status to return */
379
380 /* audio status (bcd) */
381 #define aud_11 0x11 /* Audio play operation in progress */
382 #define aud_12 0x12 /* Audio play operation paused */
383 #define aud_13 0x13 /* Audio play operation successfully completed */
384 #define aud_14 0x14 /* Audio play operation stopped due to error */
385 #define aud_15 0x15 /* No current audio status to return */
386
387
388 /*
389 * highest allowed drive number (MINOR+1)
390 */
391 #define NR_SBPCD 4
392
393 /*
394 * we try to never disable interrupts - seems to work
395 */
396 #define SBPCD_DIS_IRQ 0
397
398 /*
399 * "write byte to port"
400 */
401 #define OUT(x,y) outb(y,x)
402
403 /*==========================================================================*/
404
405 #define MIXER_CD_Volume 0x28 /* internal SB Pro register address */
406
407 /*==========================================================================*/
408 /*
409 * Creative Labs Programmers did this:
410 */
411 #define MAX_TRACKS 120 /* why more than 99? */
412
413 /*==========================================================================*/
414 /*
415 * To make conversions easier (machine dependent!)
416 */
417 typedef union _msf
418 {
419 u_int n;
420 u_char c[4];
421 } MSF;
422
423 typedef union _blk
424 {
425 u_int n;
426 u_char c[4];
427 } BLK;
428
429 /*==========================================================================*/
430
431 /*============================================================================
432 ==============================================================================
433
434 COMMAND SET of "old" drives like CR-521, CR-522
435 (the CR-562 family is different):
436
437 No. Command Code
438 --------------------------------------------
439
440 Drive Commands:
441 1 Seek 01
442 2 Read Data 02
443 3 Read XA-Data 03
444 4 Read Header 04
445 5 Spin Up 05
446 6 Spin Down 06
447 7 Diagnostic 07
448 8 Read UPC 08
449 9 Read ISRC 09
450 10 Play Audio 0A
451 11 Play Audio MSF 0B
452 12 Play Audio Track/Index 0C
453
454 Status Commands:
455 13 Read Status 81
456 14 Read Error 82
457 15 Read Drive Version 83
458 16 Mode Select 84
459 17 Mode Sense 85
460 18 Set XA Parameter 86
461 19 Read XA Parameter 87
462 20 Read Capacity 88
463 21 Read SUB_Q 89
464 22 Read Disc Code 8A
465 23 Read Disc Information 8B
466 24 Read TOC 8C
467 25 Pause/Resume 8D
468 26 Read Packet 8E
469 27 Read Path Check 00
470
471
472 all numbers (lba, msf-bin, msf-bcd, counts) to transfer high byte first
473
474 mnemo 7-byte command #bytes response (r0...rn)
475 ________ ____________________ ____
476
477 Read Status:
478 status: 81. (1) one-byte command, gives the main
479 status byte
480 Read Error:
481 check1: 82 00 00 00 00 00 00. (6) r1: audio status
482
483 Read Packet:
484 check2: 8e xx 00 00 00 00 00. (xx) gets xx bytes response, relating
485 to commands 01 04 05 07 08 09
486
487 Play Audio:
488 play: 0a ll-bb-aa nn-nn-nn. (0) play audio, ll-bb-aa: starting block (lba),
489 nn-nn-nn: #blocks
490 Play Audio MSF:
491 0b mm-ss-ff mm-ss-ff (0) play audio from/to
492
493 Play Audio Track/Index:
494 0c ...
495
496 Pause/Resume:
497 pause: 8d pr 00 00 00 00 00. (0) pause (pr=00)
498 resume (pr=80) audio playing
499
500 Mode Select:
501 84 00 nn-nn ??-?? 00 (0) nn-nn: 2048 or 2340
502 possibly defines transfer size
503
504 set_vol: 84 83 00 00 sw le 00. (0) sw(itch): lrxxxxxx (off=1)
505 le(vel): min=0, max=FF, else half
506 (firmware 2.11)
507
508 Mode Sense:
509 get_vol: 85 03 00 00 00 00 00. (2) tell current audio volume setting
510
511 Read Disc Information:
512 tocdesc: 8b 00 00 00 00 00 00. (6) read the toc descriptor ("msf-bin"-format)
513
514 Read TOC:
515 tocent: 8c fl nn 00 00 00 00. (8) read toc entry #nn
516 (fl=0:"lba"-, =2:"msf-bin"-format)
517
518 Read Capacity:
519 capacit: 88 00 00 00 00 00 00. (5) "read CD-ROM capacity"
520
521
522 Read Path Check:
523 ping: 00 00 00 00 00 00 00. (2) r0=AA, r1=55
524 ("ping" if the drive is connected)
525
526 Read Drive Version:
527 ident: 83 00 00 00 00 00 00. (12) gives "MATSHITAn.nn"
528 (n.nn = 2.01, 2.11., 3.00, ...)
529
530 Seek:
531 seek: 01 00 ll-bb-aa 00 00. (0)
532 seek: 01 02 mm-ss-ff 00 00. (0)
533
534 Read Data:
535 read: 02 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2048 bytes,
536 starting at block xx-xx-xx
537 fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
538
539 Read XA-Data:
540 read: 03 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2340 bytes,
541 starting at block xx-xx-xx
542 fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
543
544 Read SUB_Q:
545 89 fl 00 00 00 00 00. (13) r0: audio status, r4-r7: lba/msf,
546 fl=0: "lba", fl=2: "msf"
547
548 Read Disc Code:
549 8a 00 00 00 00 00 00. (14) possibly extended "check condition"-info
550
551 Read Header:
552 04 00 ll-bb-aa 00 00. (0) 4 bytes response with "check2"
553 04 02 mm-ss-ff 00 00. (0) 4 bytes response with "check2"
554
555 Spin Up:
556 05 00 ll-bb-aa 00 00. (0) possibly implies a "seek"
557
558 Spin Down:
559 06 ...
560
561 Diagnostic:
562 07 00 ll-bb-aa 00 00. (2) 2 bytes response with "check2"
563 07 02 mm-ss-ff 00 00. (2) 2 bytes response with "check2"
564
565 Read UPC:
566 08 00 ll-bb-aa 00 00. (16)
567 08 02 mm-ss-ff 00 00. (16)
568
569 Read ISRC:
570 09 00 ll-bb-aa 00 00. (15) 15 bytes response with "check2"
571 09 02 mm-ss-ff 00 00. (15) 15 bytes response with "check2"
572
573 Set XA Parameter:
574 86 ...
575
576 Read XA Parameter:
577 87 ...
578
579 ==============================================================================
580 ============================================================================*/
581
582 /*
583 * commands
584 *
585 * CR-52x: CMD0_
586 * CR-56x: CMD1_
587 * CD200: CMD2_
588 * LCS-7260: CMDL_
589 * TEAC CD-55A: CMDT_
590 */
591 #define CMD1_RESET 0x0a
592 #define CMD2_RESET 0x01
593 #define CMDT_RESET 0xc0
594
595 #define CMD1_LOCK_CTL 0x0c
596 #define CMD2_LOCK_CTL 0x1e
597 #define CMDT_LOCK_CTL CMD2_LOCK_CTL
598 #define CMDL_LOCK_CTL 0x0e
599
600 #define CMD1_TRAY_CTL 0x07
601 #define CMD2_TRAY_CTL 0x1b
602 #define CMDT_TRAY_CTL CMD2_TRAY_CTL
603 #define CMDL_TRAY_CTL 0x0d
604
605 #define CMD1_MULTISESS 0x8d
606 #define CMDL_MULTISESS 0x8c
607
608 #define CMD1_SUBCHANINF 0x11
609 #define CMD2_SUBCHANINF 0x??
610
611 #define CMD1_ABORT 0x08
612 #define CMD2_ABORT 0x08
613 #define CMDT_ABORT 0x08
614
615 #define CMD2_x02 0x02
616
617 #define CMD2_SETSPEED 0xda
618
619 #define CMD0_PATH_CHECK 0x00
620 #define CMD1_PATH_CHECK 0x???
621 #define CMD2_PATH_CHECK 0x???
622 #define CMDT_PATH_CHECK 0x???
623 #define CMDL_PATH_CHECK CMD0_PATH_CHECK
624
625 #define CMD0_SEEK 0x01
626 #define CMD1_SEEK CMD0_SEEK
627 #define CMD2_SEEK 0x2b
628 #define CMDT_SEEK CMD2_SEEK
629 #define CMDL_SEEK CMD0_SEEK
630
631 #define CMD0_READ 0x02
632 #define CMD1_READ 0x10
633 #define CMD2_READ 0x28
634 #define CMDT_READ CMD2_READ
635 #define CMDL_READ CMD0_READ
636
637 #define CMD0_READ_XA 0x03
638 #define CMD2_READ_XA 0xd4
639 #define CMDL_READ_XA CMD0_READ_XA /* really ?? */
640
641 #define CMD0_READ_HEAD 0x04
642
643 #define CMD0_SPINUP 0x05
644 #define CMD1_SPINUP 0x02
645 #define CMD2_SPINUP CMD2_TRAY_CTL
646 #define CMDL_SPINUP CMD0_SPINUP
647
648 #define CMD0_SPINDOWN 0x06 /* really??? */
649 #define CMD1_SPINDOWN 0x06
650 #define CMD2_SPINDOWN CMD2_TRAY_CTL
651 #define CMDL_SPINDOWN 0x0d
652
653 #define CMD0_DIAG 0x07
654
655 #define CMD0_READ_UPC 0x08
656 #define CMD1_READ_UPC 0x88
657 #define CMD2_READ_UPC 0x???
658 #define CMDL_READ_UPC CMD0_READ_UPC
659
660 #define CMD0_READ_ISRC 0x09
661
662 #define CMD0_PLAY 0x0a
663 #define CMD1_PLAY 0x???
664 #define CMD2_PLAY 0x???
665 #define CMDL_PLAY CMD0_PLAY
666
667 #define CMD0_PLAY_MSF 0x0b
668 #define CMD1_PLAY_MSF 0x0e
669 #define CMD2_PLAY_MSF 0x47
670 #define CMDT_PLAY_MSF CMD2_PLAY_MSF
671 #define CMDL_PLAY_MSF 0x???
672
673 #define CMD0_PLAY_TI 0x0c
674 #define CMD1_PLAY_TI 0x0f
675
676 #define CMD0_STATUS 0x81
677 #define CMD1_STATUS 0x05
678 #define CMD2_STATUS 0x00
679 #define CMDT_STATUS CMD2_STATUS
680 #define CMDL_STATUS CMD0_STATUS
681
682 #define CMD0_READ_ERR 0x82
683 #define CMD1_READ_ERR CMD0_READ_ERR
684 #define CMD2_READ_ERR 0x03
685 #define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */
686 #define CMDL_READ_ERR CMD0_READ_ERR
687
688 #define CMD0_READ_VER 0x83
689 #define CMD1_READ_VER CMD0_READ_VER
690 #define CMD2_READ_VER 0x12
691 #define CMDT_READ_VER CMD2_READ_VER /* really ?? */
692 #define CMDL_READ_VER CMD0_READ_VER
693
694 #define CMD0_SETMODE 0x84
695 #define CMD1_SETMODE 0x09
696 #define CMD2_SETMODE 0x55
697 #define CMDT_SETMODE CMD2_SETMODE
698 #define CMDL_SETMODE CMD0_SETMODE
699
700 #define CMD0_GETMODE 0x85
701 #define CMD1_GETMODE 0x84
702 #define CMD2_GETMODE 0x5a
703 #define CMDT_GETMODE CMD2_GETMODE
704 #define CMDL_GETMODE CMD0_GETMODE
705
706 #define CMD0_SET_XA 0x86
707
708 #define CMD0_GET_XA 0x87
709
710 #define CMD0_CAPACITY 0x88
711 #define CMD1_CAPACITY 0x85
712 #define CMD2_CAPACITY 0x25
713 #define CMDL_CAPACITY CMD0_CAPACITY /* missing in some firmware versions */
714
715 #define CMD0_READSUBQ 0x89
716 #define CMD1_READSUBQ 0x87
717 #define CMD2_READSUBQ 0x42
718 #define CMDT_READSUBQ CMD2_READSUBQ
719 #define CMDL_READSUBQ CMD0_READSUBQ
720
721 #define CMD0_DISKCODE 0x8a
722
723 #define CMD0_DISKINFO 0x8b
724 #define CMD1_DISKINFO CMD0_DISKINFO
725 #define CMD2_DISKINFO 0x43
726 #define CMDT_DISKINFO CMD2_DISKINFO
727 #define CMDL_DISKINFO CMD0_DISKINFO
728
729 #define CMD0_READTOC 0x8c
730 #define CMD1_READTOC CMD0_READTOC
731 #define CMD2_READTOC 0x???
732 #define CMDL_READTOC CMD0_READTOC
733
734 #define CMD0_PAU_RES 0x8d
735 #define CMD1_PAU_RES 0x0d
736 #define CMD2_PAU_RES 0x4b
737 #define CMDT_PAUSE CMD2_PAU_RES
738 #define CMDL_PAU_RES CMD0_PAU_RES
739
740 #define CMD0_PACKET 0x8e
741 #define CMD1_PACKET CMD0_PACKET
742 #define CMD2_PACKET 0x???
743 #define CMDL_PACKET CMD0_PACKET
744
745 /*==========================================================================*/
746 /*==========================================================================*/
747 #endif _LINUX_SBPCD_H
748 /*==========================================================================*/
749 /*
750 * Overrides for Emacs so that we follow Linus's tabbing style.
751 * Emacs will notice this stuff at the end of the file and automatically
752 * adjust the settings for this buffer only. This must remain at the end
753 * of the file.
754 * ---------------------------------------------------------------------------
755 * Local variables:
756 * c-indent-level: 8
757 * c-brace-imaginary-offset: 0
758 * c-brace-offset: -8
759 * c-argdecl-indent: 8
760 * c-label-offset: -8
761 * c-continued-statement-offset: 8
762 * c-continued-brace-offset: 0
763 * End:
764 */