Revert last change. Bug noticed by Linus.
[linux-2.6/linux-mips.git] / drivers / cdrom / gscd.h
blob9c294762bbceb7f8bcaaa8a17972859c6f20d02c
1 /*
2 * Definitions for a GoldStar R420 CD-ROM interface
4 * Copyright (C) 1995 Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>
5 * Eberhard Moenkeberg <emoenke@gwdg.de>
7 * Published under the GPL.
9 */
12 /* The Interface Card default address is 0x340. This will work for most
13 applications. Address selection is accomplished by jumpers PN801-1 to
14 PN801-4 on the GoldStar Interface Card.
15 Appropriate settings are: 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360
16 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0 */
18 /* insert here the I/O port address */
19 #define GSCD_BASE_ADDR 0x340
21 /* change this to set the dma-channel */
22 #define GSCD_DMA_CHANNEL 3 /* not used */
24 /************** nothing to set up below here *********************/
26 /* port access macro */
27 #define GSCDPORT(x) (gscd_port + (x))
30 * commands
31 * the lower nibble holds the command length
33 #define CMD_STATUS 0x01
34 #define CMD_READSUBQ 0x02 /* 1: ?, 2: UPC, 5: ? */
35 #define CMD_SEEK 0x05 /* read_mode M-S-F */
36 #define CMD_READ 0x07 /* read_mode M-S-F nsec_h nsec_l */
37 #define CMD_RESET 0x11
38 #define CMD_SETMODE 0x15
39 #define CMD_PLAY 0x17 /* M-S-F M-S-F */
40 #define CMD_LOCK_CTL 0x22 /* 0: unlock, 1: lock */
41 #define CMD_IDENT 0x31
42 #define CMD_SETSPEED 0x32 /* 0: auto */ /* ??? */
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
50 * disk_state:
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
62 * cmd_type:
64 #define TYPE_INFO 0x01
65 #define TYPE_DATA 0x02
68 * read_mode:
70 #define MOD_POLLED 0x80
71 #define MOD_x08 0x08
72 #define MOD_RAW 0x04
74 #define READ_DATA(port, buf, nr) insb(port, buf, nr)
76 #define SET_TIMER(func, jifs) \
77 ((mod_timer(&gscd_timer, jiffies + jifs)), \
78 (gscd_timer.function = func))
80 #define CLEAR_TIMER del_timer_sync(&gscd_timer)
82 #define MAX_TRACKS 104
84 struct msf {
85 unsigned char min;
86 unsigned char sec;
87 unsigned char frame;
90 struct gscd_Play_msf {
91 struct msf start;
92 struct msf end;
95 struct gscd_DiskInfo {
96 unsigned char first;
97 unsigned char last;
98 struct msf diskLength;
99 struct msf firstTrack;
102 struct gscd_Toc {
103 unsigned char ctrl_addr;
104 unsigned char track;
105 unsigned char pointIndex;
106 struct msf trackTime;
107 struct msf diskTime;