1
2
3
4
5
6
7
8
9 #ifndef _SEAGATE_H
10 #define SEAGATE_H
11
12
13
14 #ifndef ASM
15 int seagate_st0x_detect(int);
16 int seagate_st0x_command(Scsi_Cmnd *);
17 int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
18
19 int seagate_st0x_abort(Scsi_Cmnd *);
20 const char *seagate_st0x_info(void);
21 int seagate_st0x_reset(Scsi_Cmnd *);
22
23 #ifndef NULL
24 #define NULL 0
25 #endif
26
27 int seagate_st0x_biosparam(Disk *, int, int*);
28
29 #define SEAGATE_ST0X {"Seagate ST-01/ST-02", seagate_st0x_detect, \
30 seagate_st0x_info, seagate_st0x_command, \
31 seagate_st0x_queue_command, seagate_st0x_abort, \
32 seagate_st0x_reset, NULL, seagate_st0x_biosparam, \
33 1, 7, SG_ALL, 1, 0, 0, DISABLE_CLUSTERING}
34 #endif
35
36
37
38
39
40
41 #define PARITY
42
43
44
45
46
47
48
49
50
51
52
53
54 #define CMD_RST 0x01
55 #define CMD_SEL 0x02
56 #define CMD_BSY 0x04
57 #define CMD_ATTN 0x08
58 #define CMD_START_ARB 0x10
59 #define CMD_EN_PARITY 0x20
60 #define CMD_INTR 0x40
61 #define CMD_DRVR_ENABLE 0x80
62
63
64
65
66
67 #define STAT_BSY 0x01
68 #define STAT_MSG 0x02
69 #define STAT_IO 0x04
70 #define STAT_CD 0x08
71 #define STAT_REQ 0x10
72 #define STAT_SEL 0x20
73 #define STAT_PARITY 0x40
74 #define STAT_ARB_CMPL 0x80
75
76
77
78
79
80 #define REQ_MASK (STAT_CD | STAT_IO | STAT_MSG)
81 #define REQ_DATAOUT 0
82 #define REQ_DATAIN STAT_IO
83 #define REQ_CMDOUT STAT_CD
84 #define REQ_STATIN (STAT_CD | STAT_IO)
85 #define REQ_MSGOUT (STAT_MSG | STAT_CD)
86 #define REQ_MSGIN (STAT_MSG | STAT_CD | STAT_IO)
87
88 extern volatile int seagate_st0x_timeout;
89
90 #ifdef PARITY
91 #define BASE_CMD CMD_EN_PARITY
92 #else
93 #define BASE_CMD 0
94 #endif
95
96
97
98
99
100 #define PHASE_BUS_FREE 1
101 #define PHASE_ARBITRATION 2
102 #define PHASE_SELECTION 4
103 #define PHASE_DATAIN 8
104 #define PHASE_DATAOUT 0x10
105 #define PHASE_CMDOUT 0x20
106 #define PHASE_MSGIN 0x40
107 #define PHASE_MSGOUT 0x80
108 #define PHASE_STATUSIN 0x100
109 #define PHASE_ETC (PHASE_DATAIN | PHASE_DATA_OUT | PHASE_CMDOUT | PHASE_MSGIN | PHASE_MSGOUT | PHASE_STATUSIN)
110 #define PRINT_COMMAND 0x200
111 #define PHASE_EXIT 0x400
112 #define PHASE_RESELECT 0x800
113 #define DEBUG_FAST 0x1000
114 #define DEBUG_SG 0x2000
115 #define DEBUG_LINKED 0x4000
116 #define DEBUG_BORKEN 0x8000
117
118
119
120
121
122
123 #define ST0X_BUS_FREE_DELAY 25
124 #define ST0X_SELECTION_DELAY 25
125
126 #define eoi() __asm__("push %%eax\nmovb $0x20, %%al\noutb %%al, $0x20\npop %%eax"::)
127
128 #define SEAGATE 1
129 #define FD 2
130
131
132 #endif
133