1 #ifndef _IN2000_H
2
3
4
5
6
7
8
9 #include <linux/types.h>
10 #include <linux/ioport.h>
11
12
13
14 #define INSTAT (base + 0x0)
15 #define INDATA (base + 0x1)
16 #define INFIFO (base + 0x2)
17 #define INREST (base + 0x3)
18 #define INFCNT (base + 0x4)
19 #define INFRST (base + 0x5)
20 #define INFWRT (base + 0x7)
21 #define INFLED (base + 0x8)
22 #define INNLED (base + 0x9)
23 #define INVERS (base + 0xa)
24 #define ININTR (base + 0xc)
25 #define G2CNTRL_HRDY 0x20
26
27
28 #define OWNID 0
29 #define CONTROL 1
30 #define TIMEOUT 2
31 #define TOTSECT 3
32 #define TOTHEAD 4
33 #define TOTCYLH 5
34 #define TOTCYLL 6
35 #define LADRSHH 7
36 #define LADRSHL 8
37 #define LADRSLH 9
38 #define LADRSLL 10
39 #define SECTNUM 11
40 #define HEADNUM 12
41 #define CYLNUMH 13
42 #define CYLNUML 14
43 #define TARGETU 15
44 #define CMDPHAS 16
45 #define SYNCTXR 17
46 #define TXCNTH 18
47 #define TXCNTM 19
48 #define TXCNTL 20
49 #define DESTID 21
50 #define SRCID 22
51 #define SCSIST 23
52 #define COMMAND 24
53 #define WDDATA 25
54 #define AUXSTAT 31
55
56
57 #define OWN_EAF 0x08
58 #define OWN_EHP 0x10
59 #define OWN_FS0 0x40
60 #define OWN_FS1 0x80
61
62 #define AUX_DBR 0
63 #define AUX_PE 1
64 #define AUX_CIP 0x10
65 #define AUX_BSY 0x20
66 #define AUX_LCI 0x40
67 #define AUX_INT 0x80
68
69
70 #define IN2000_TMOUT 0x1f
71
72 #if 0
73
74 struct in2000_chain {
75 ulong dataptr;
76 ulong datalen;
77 };
78 #endif
79
80
81 #define any2scsi(up, p) \
82 (up)[0] = (((unsigned long)(p)) >> 16); \
83 (up)[1] = (((unsigned long)(p)) >> 8); \
84 (up)[2] = ((unsigned long)(p));
85
86 #define scsi2int(up) ( ((((long)*(up))&0x1f) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
87
88 #define xany2scsi(up, p) \
89 (up)[0] = ((long)(p)) >> 24; \
90 (up)[1] = ((long)(p)) >> 16; \
91 (up)[2] = ((long)(p)) >> 8; \
92 (up)[3] = ((long)(p));
93
94 #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
95 + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
96
97 #define MAX_CDB 12
98 #define MAX_SENSE 14
99 #define MAX_STATUS 32
100
101 static int in2000_detect(Scsi_Host_Template *);
102 static int in2000_command(Scsi_Cmnd *);
103 static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
104 static int in2000_abort(Scsi_Cmnd *);
105 static int in2000_reset(Scsi_Cmnd *);
106 static int in2000_biosparam(Disk *, int, int*);
107
108
109 #ifndef NULL
110 #define NULL 0
111 #endif
112
113
114 #define IN2000_SG SG_ALL
115 #define IN2000 {NULL, "Always IN2000", in2000_detect, NULL, \
116 NULL, in2000_command, \
117 in2000_queuecommand, \
118 in2000_abort, \
119 in2000_reset, \
120 NULL, \
121 in2000_biosparam, \
122 1, 7, IN2000_SG, 1, 0, 0}
123
124 #endif