1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _BUSLOGIC_H
14
15 int buslogic_detect(Scsi_Host_Template *);
16 int buslogic_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
17 int buslogic_abort(Scsi_Cmnd *);
18 const char *buslogic_info(void);
19 int buslogic_reset(Scsi_Cmnd *);
20 int buslogic_biosparam(Disk *, int, int *);
21
22 #define BUSLOGIC_CMDLUN 1
23
24
25
26
27
28
29
30
31 #define BUSLOGIC { NULL, \
32 "BusLogic", \
33 buslogic_detect, \
34 NULL, \
35 buslogic_info, \
36 0, \
37 buslogic_queuecommand, \
38 buslogic_abort, \
39 buslogic_reset, \
40 0, \
41 buslogic_biosparam, \
42 0, \
43 0, \
44 0, \
45 BUSLOGIC_CMDLUN, \
46 0, \
47 0, \
48 ENABLE_CLUSTERING \
49 }
50
51 #ifdef BUSLOGIC_PRIVATE_H
52
53
54 #ifndef TRUE
55 # define TRUE 1
56 #endif
57 #ifndef FALSE
58 # define FALSE 0
59 #endif
60
61 #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr)[0])
62
63 #define PACKED __attribute__((packed))
64
65 #define BD_ABORT 0x0001
66 #define BD_COMMAND 0x0002
67 #define BD_DETECT 0x0004
68 #define BD_INTERRUPT 0x0008
69 #define BD_RESET 0x0010
70
71
72
73 #define STATUS(base) (base)
74 #define DACT 0x80
75 #define DFAIL 0x40
76 #define INREQ 0x20
77 #define HARDY 0x10
78 #define CPRBSY 0x08
79 #define DIRRDY 0x04
80 #define CMDINV 0x01
81 #define STATMASK 0xFD
82
83 #define DATA_IN(base) (STATUS(base) + 1)
84
85 #define INTERRUPT(base) (STATUS(base) + 2)
86 #define INTV 0x80
87 #define RSTS 0x08
88 #define CMDC 0x04
89 #define MBOR 0x02
90 #define IMBL 0x01
91 #define INTRMASK 0x8F
92
93
94 #define CONTROL(base) STATUS(base)
95 #define RHARD 0x80
96 #define RSOFT 0x40
97 #define RINT 0x20
98 #define RSBUS 0x10
99
100 #define COMMAND_PARAMETER(base) (STATUS(base) + 1)
101 #define CMD_TSTCMDCINT 0x00
102 #define CMD_INITMB 0x01
103 #define CMD_START_SCSI 0x02
104 #define CMD_START_BIOS 0x03
105 #define CMD_INQUIRY 0x04
106 #define CMD_ENBOMBRINT 0x05
107 #define CMD_SETSELTIMOUT 0x06
108 #define CMD_BUSON_TIME 0x07
109 #define CMD_BUSOFF_TIME 0x08
110 #define CMD_BUSXFR_RATE 0x09
111 #define CMD_INQ_DEVICES 0x0A
112 #define CMD_RETCONF 0x0B
113 #define CMD_TARGET_MODE 0x0C
114 #define CMD_INQ_SETUP_INFO 0x0D
115 #define CMD_WRITE_LCL_RAM 0x1A
116 #define CMD_READ_LCL_RAM 0x1B
117 #define CMD_WRITE_BM_FIFO 0x1C
118 #define CMD_READ_BM_FIFO 0x1D
119 #define CMD_ECHO 0x1F
120 #define CMD_HA_DIAG 0x20
121 #define CMD_HA_OPTIONS 0x21
122 #define CMD_INITEXTMB 0x81
123 #define CMD_INQEXTSETUP 0x8D
124 #define CMD_WRITE_INQ_BUF 0x9A
125
126 #define CMD_READ_INQ_BUF 0x9B
127
128
129 #define MBX_NOT_IN_USE 0x00
130 #define MBX_ACTION_START 0x01
131 #define MBX_ACTION_ABORT 0x02
132 #define MBX_COMPLETION_OK 0x01
133 #define MBX_COMPLETION_ABORTED 0x02
134 #define MBX_COMPLETION_NOT_FOUND 0x03
135 #define MBX_COMPLETION_ERROR 0x04
136
137
138 struct mailbox {
139 void *ccbptr;
140 unsigned char btstat;
141 unsigned char sdstat;
142 unsigned char reserved;
143 unsigned char status;
144 };
145
146
147 struct chain {
148 unsigned long datalen;
149 void *dataptr;
150 };
151
152 #define MAX_CDB 12
153
154 struct ccb {
155 unsigned char op;
156 unsigned char dir;
157 unsigned char cdblen;
158 unsigned char rsalen;
159 unsigned long datalen;
160 void *dataptr;
161 unsigned char reserved[2];
162 unsigned char hastat;
163 unsigned char tarstat;
164 unsigned char id;
165 unsigned char lun;
166 unsigned char cdb[MAX_CDB];
167 unsigned char ccbcontrol;
168 unsigned char commlinkid;
169 void *linkptr;
170 void *senseptr;
171 };
172
173 #define CCB_OP_INIT 0x00
174 #define CCB_OP_TARG 0x01
175 #define CCB_OP_INIT_SG 0x02
176 #define CCB_OP_INIT_R 0x03
177
178 #define CCB_OP_INIT_SG_R 0x04
179
180 #define CCB_OP_BUS_RESET 0x81
181
182 #endif
183
184 #endif