sbpcd.h 25 KB

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