1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef __SJCD_H__
14 #define __SJCD_H__
15
16
17
18
19 #define SJCD_BASE_ADDR 0x340
20
21
22
23
24 #define SJCD_INTR_NR 10
25
26
27
28
29 #define SJCD_DMA 0
30
31
32
33
34 #define SJCDPORT( x ) ( sjcd_port + ( x ) )
35
36
37
38 #define SST_NOT_READY 0x10
39 #define SST_MEDIA_CHANGED 0x20
40 #define SST_DOOR_OPENED 0x40
41
42
43
44
45
46 #define SCMD_EJECT_TRAY 0xD0
47 #define SCMD_LOCK_TRAY 0xD2
48 #define SCMD_UNLOCK_TRAY 0xD4
49 #define SCMD_CLOSE_TRAY 0xD6
50
51 #define SCMD_RESET 0xFA
52 #define SCMD_GET_STATUS 0x80
53 #define SCMD_GET_VERSION 0xCC
54
55 #define SCMD_DATA_READ 0xA0
56 #define SCMD_SEEK 0xA0
57 #define SCMD_PLAY 0xA0
58
59 #define SCMD_GET_QINFO 0xA8
60
61 #define SCMD_SET_MODE 0xC4
62 #define SCMD_MODE_PLAY 0xE0
63 #define SCMD_MODE_COOKED 0xF8
64 #define SCMD_MODE_RAW 0xF9
65 #define SCMD_MODE_x20_BIT 0x20
66
67 #define SCMD_SET_VOLUME 0xAE
68 #define SCMD_PAUSE 0xE0
69 #define SCMD_STOP 0xE0
70
71 #define SCMD_GET_DISK_INFO 0xAA
72 #define SCMD_GET_1_TRACK 0xA0
73 #define SCMD_GET_L_TRACK 0xA1
74 #define SCMD_GET_D_SIZE 0xA2
75
76
77
78
79 #define S_READ_DATA( port, buf, nr ) insb( port, buf, nr )
80
81 #define SJCD_MAX_TRACKS 100
82
83 struct msf {
84 unsigned char min;
85 unsigned char sec;
86 unsigned char frame;
87 };
88
89 struct sjcd_hw_disk_info {
90 unsigned char track_control;
91 unsigned char track_no;
92 unsigned char x, y, z;
93 union {
94 unsigned char track_no;
95 struct msf track_msf;
96 } un;
97 };
98
99 struct sjcd_hw_qinfo {
100 unsigned char track_control;
101 unsigned char track_no;
102 unsigned char x;
103 struct msf rel;
104 struct msf abs;
105 };
106
107 struct sjcd_play_msf {
108 struct msf start;
109 struct msf end;
110 };
111
112 struct sjcd_disk_info {
113 unsigned char first;
114 unsigned char last;
115 struct msf disk_length;
116 struct msf first_track;
117 };
118
119 struct sjcd_toc {
120 unsigned char ctrl_addr;
121 unsigned char track;
122 unsigned char point_index;
123 struct msf track_time;
124 struct msf disk_time;
125 };
126
127 struct sjcd_stat {
128 int ticks;
129 int tticks[ 8 ];
130 int idle_ticks;
131 int start_ticks;
132 int mode_ticks;
133 int read_ticks;
134 int data_ticks;
135 int stop_ticks;
136 int stopping_ticks;
137 };
138
139 #endif