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