1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #define GSCD_BASE_ADDR 0x340
20
21
22 #define GSCD_DMA_CHANNEL 3
23
24
25
26
27 #define GSCDPORT(x) (gscd_port + (x))
28
29
30
31
32
33 #define CMD_STATUS 0x01
34 #define CMD_READSUBQ 0x02
35 #define CMD_SEEK 0x05
36 #define CMD_READ 0x07
37 #define CMD_RESET 0x11
38 #define CMD_SETMODE 0x15
39 #define CMD_PLAY 0x17
40 #define CMD_LOCK_CTL 0x22
41 #define CMD_IDENT 0x31
42 #define CMD_SETSPEED 0x32
43 #define CMD_GETMODE 0x41
44 #define CMD_PAUSE 0x51
45 #define CMD_READTOC 0x61
46 #define CMD_DISKINFO 0x71
47 #define CMD_TRAY_CTL 0x81
48
49
50
51
52 #define ST_PLAYING 0x80
53 #define ST_UNLOCKED 0x40
54 #define ST_NO_DISK 0x20
55 #define ST_DOOR_OPEN 0x10
56 #define ST_x08 0x08
57 #define ST_x04 0x04
58 #define ST_INVALID 0x02
59 #define ST_x01 0x01
60
61
62
63
64 #define TYPE_INFO 0x01
65 #define TYPE_DATA 0x02
66
67
68
69
70 #define MOD_POLLED 0x80
71 #define MOD_x08 0x08
72 #define MOD_RAW 0x04
73
74 #define READ_DATA(port, buf, nr) insb(port, buf, nr)
75
76 #define SET_TIMER(func, jifs) \
77 ((timer_table[GSCD_TIMER].expires = jiffies + jifs), \
78 (timer_table[GSCD_TIMER].fn = func), \
79 (timer_active |= 1<<GSCD_TIMER))
80
81 #define CLEAR_TIMER timer_active &= ~(1<<GSCD_TIMER)
82
83 #define MAX_TRACKS 104
84
85 struct msf {
86 unsigned char min;
87 unsigned char sec;
88 unsigned char frame;
89 };
90
91 struct gscd_Play_msf {
92 struct msf start;
93 struct msf end;
94 };
95
96 struct gscd_DiskInfo {
97 unsigned char first;
98 unsigned char last;
99 struct msf diskLength;
100 struct msf firstTrack;
101 };
102
103 struct gscd_Toc {
104 unsigned char ctrl_addr;
105 unsigned char track;
106 unsigned char pointIndex;
107 struct msf trackTime;
108 struct msf diskTime;
109 };
110