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 #undef CONTROL
30 #define CONTROL 1
31 #define TIMEOUT 2
32 #define TOTSECT 3
33 #define TOTHEAD 4
34 #define TOTCYLH 5
35 #define TOTCYLL 6
36 #define LADRSHH 7
37 #define LADRSHL 8
38 #define LADRSLH 9
39 #define LADRSLL 10
40 #define SECTNUM 11
41 #define HEADNUM 12
42 #define CYLNUMH 13
43 #define CYLNUML 14
44 #define TARGETU 15
45 #define CMDPHAS 16
46 #define SYNCTXR 17
47 #define TXCNTH 18
48 #define TXCNTM 19
49 #define TXCNTL 20
50 #define DESTID 21
51 #define SRCID 22
52 #define SCSIST 23
53 #define COMMAND 24
54 #define WDDATA 25
55 #define AUXSTAT 31
56
57
58 #define OWN_EAF 0x08
59 #define OWN_EHP 0x10
60 #define OWN_FS0 0x40
61 #define OWN_FS1 0x80
62
63 #define AUX_DBR 0
64 #define AUX_PE 1
65 #define AUX_CIP 0x10
66 #define AUX_BSY 0x20
67 #define AUX_LCI 0x40
68 #define AUX_INT 0x80
69
70
71 #define IN2000_TMOUT 0x1f
72
73
74 #undef any2scsi
75 #define any2scsi(up, p) \
76 (up)[0] = (((unsigned long)(p)) >> 16); \
77 (up)[1] = (((unsigned long)(p)) >> 8); \
78 (up)[2] = ((unsigned long)(p));
79
80 #undef scsi2int
81 #define scsi2int(up) ( ((((long)*(up))&0x1f) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
82
83 #undef xany2scsi
84 #define xany2scsi(up, p) \
85 (up)[0] = ((long)(p)) >> 24; \
86 (up)[1] = ((long)(p)) >> 16; \
87 (up)[2] = ((long)(p)) >> 8; \
88 (up)[3] = ((long)(p));
89
90 #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
91 + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
92
93 #define MAX_CDB 12
94 #define MAX_SENSE 14
95 #define MAX_STATUS 32
96
97 int in2000_detect(Scsi_Host_Template *);
98 int in2000_command(Scsi_Cmnd *);
99 int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
100 int in2000_abort(Scsi_Cmnd *);
101 int in2000_reset(Scsi_Cmnd *);
102 int in2000_biosparam(Disk *, int, int*);
103
104 #ifndef NULL
105 #define NULL 0
106 #endif
107
108
109 #define IN2000_SG SG_ALL
110 #define IN2000 {NULL, NULL, NULL, \
111 "in2000", PROC_SCSI_IN2000, \
112 "Always IN2000", in2000_detect, NULL, \
113 NULL, in2000_command, \
114 in2000_queuecommand, \
115 in2000_abort, \
116 in2000_reset, \
117 NULL, \
118 in2000_biosparam, \
119 1, 7, IN2000_SG, 1, 0, 0}
120
121 #endif