root/include/linux/sbpcd.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


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

/* [previous][next][first][last][top][bottom][index][help] */