gscd.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Definitions for a GoldStar R420 CD-ROM interface
  3. *
  4. * Copyright (C) 1995 Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>
  5. * Eberhard Moenkeberg <emoenke@gwdg.de>
  6. *
  7. * Published under the GPL.
  8. *
  9. */
  10. /* The Interface Card default address is 0x340. This will work for most
  11. applications. Address selection is accomplished by jumpers PN801-1 to
  12. PN801-4 on the GoldStar Interface Card.
  13. Appropriate settings are: 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360
  14. 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0 */
  15. /* insert here the I/O port address and extent */
  16. #define GSCD_BASE_ADDR 0x340
  17. #define GSCD_IO_EXTENT 4
  18. /************** nothing to set up below here *********************/
  19. /* port access macro */
  20. #define GSCDPORT(x) (gscd_port + (x))
  21. /*
  22. * commands
  23. * the lower nibble holds the command length
  24. */
  25. #define CMD_STATUS 0x01
  26. #define CMD_READSUBQ 0x02 /* 1: ?, 2: UPC, 5: ? */
  27. #define CMD_SEEK 0x05 /* read_mode M-S-F */
  28. #define CMD_READ 0x07 /* read_mode M-S-F nsec_h nsec_l */
  29. #define CMD_RESET 0x11
  30. #define CMD_SETMODE 0x15
  31. #define CMD_PLAY 0x17 /* M-S-F M-S-F */
  32. #define CMD_LOCK_CTL 0x22 /* 0: unlock, 1: lock */
  33. #define CMD_IDENT 0x31
  34. #define CMD_SETSPEED 0x32 /* 0: auto */ /* ??? */
  35. #define CMD_GETMODE 0x41
  36. #define CMD_PAUSE 0x51
  37. #define CMD_READTOC 0x61
  38. #define CMD_DISKINFO 0x71
  39. #define CMD_TRAY_CTL 0x81
  40. /*
  41. * disk_state:
  42. */
  43. #define ST_PLAYING 0x80
  44. #define ST_UNLOCKED 0x40
  45. #define ST_NO_DISK 0x20
  46. #define ST_DOOR_OPEN 0x10
  47. #define ST_x08 0x08
  48. #define ST_x04 0x04
  49. #define ST_INVALID 0x02
  50. #define ST_x01 0x01
  51. /*
  52. * cmd_type:
  53. */
  54. #define TYPE_INFO 0x01
  55. #define TYPE_DATA 0x02
  56. /*
  57. * read_mode:
  58. */
  59. #define MOD_POLLED 0x80
  60. #define MOD_x08 0x08
  61. #define MOD_RAW 0x04
  62. #define READ_DATA(port, buf, nr) insb(port, buf, nr)
  63. #define SET_TIMER(func, jifs) \
  64. ((mod_timer(&gscd_timer, jiffies + jifs)), \
  65. (gscd_timer.function = func))
  66. #define CLEAR_TIMER del_timer_sync(&gscd_timer)
  67. #define MAX_TRACKS 104
  68. struct msf {
  69. unsigned char min;
  70. unsigned char sec;
  71. unsigned char frame;
  72. };
  73. struct gscd_Play_msf {
  74. struct msf start;
  75. struct msf end;
  76. };
  77. struct gscd_DiskInfo {
  78. unsigned char first;
  79. unsigned char last;
  80. struct msf diskLength;
  81. struct msf firstTrack;
  82. };
  83. struct gscd_Toc {
  84. unsigned char ctrl_addr;
  85. unsigned char track;
  86. unsigned char pointIndex;
  87. struct msf trackTime;
  88. struct msf diskTime;
  89. };