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