1
2
3
4
5
6 #ifndef _BUSLOGIC_H
7
8 int buslogic_detect(Scsi_Host_Template *);
9 int buslogic_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
10 int buslogic_abort(Scsi_Cmnd *);
11 const char *buslogic_info(struct Scsi_Host *);
12 int buslogic_reset(Scsi_Cmnd *);
13 int buslogic_biosparam(Disk *, kdev_t, int *);
14
15
16 #define BUSLOGIC { NULL, NULL, \
17 NULL, \
18 NULL, \
19 "BusLogic", \
20 buslogic_detect, \
21 0, \
22 buslogic_info, \
23 0, \
24 buslogic_queuecommand, \
25 buslogic_abort, \
26 buslogic_reset, \
27 0, \
28 buslogic_biosparam, \
29 0, \
30 0, \
31 0, \
32 0, \
33 0, \
34 0, \
35 ENABLE_CLUSTERING \
36 }
37
38 #ifdef BUSLOGIC_PRIVATE_H
39
40
41 #ifndef TRUE
42 # define TRUE 1
43 #endif
44 #ifndef FALSE
45 # define FALSE 0
46 #endif
47
48 #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr)[0])
49
50 #define PACKED __attribute__((packed))
51
52 #define BD_ABORT 0x0001
53 #define BD_COMMAND 0x0002
54 #define BD_DETECT 0x0004
55 #define BD_ERRORS 0x0008
56 #define BD_INTERRUPT 0x0010
57 #define BD_IO 0x0020
58 #define BD_RESET 0x0040
59 #define BD_UNDOCUMENTED 0x0080
60
61
62
63 #define STATUS(base) (base)
64 #define DACT 0x80
65 #define DFAIL 0x40
66 #define INREQ 0x20
67 #define HARDY 0x10
68 #define CPRBSY 0x08
69 #define DIRRDY 0x04
70
71 #define CMDINV 0x01
72
73 #define DATA_IN(base) (STATUS(base) + 1)
74
75 #define INTERRUPT(base) (STATUS(base) + 2)
76 #define INTV 0x80
77
78 #define RSTS 0x08
79 #define CMDC 0x04
80 #define MBOR 0x02
81 #define IMBL 0x01
82 #define INTRMASK 0x8F
83
84
85 #define GEOMETRY(base) (STATUS(base) + 3)
86 #define GEO_GT_1GB 0x80
87
88 #define GEO_XLATION_S_D1 0x0C
89 #define GEO_XLATION_S_D0 0x03
90
91
92
93 #define CONTROL(base) STATUS(base)
94 #define RHARD 0x80
95 #define RSOFT 0x40
96 #define RINT 0x20
97 #define RSBUS 0x10
98
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_VER_NO_LAST 0x84
124 #define CMD_VER_NO_LETTER 0x85
125 #define CMD_RET_MODEL_NO 0x8B
126 #define CMD_INQEXTSETUP 0x8D
127 #define CMD_ROUND_ROBIN 0x8F
128
129 #define CMD_READ_FW_LCL_RAM 0x91
130 #define CMD_WRITE_INQ_BUF 0x9A
131
132 #define CMD_READ_INQ_BUF 0x9B
133
134
135 #define MBX_NOT_IN_USE 0x00
136 #define MBX_ACTION_START 0x01
137 #define MBX_ACTION_ABORT 0x02
138 #define MBX_COMPLETION_OK 0x01
139 #define MBX_COMPLETION_ABORTED 0x02
140 #define MBX_COMPLETION_NOT_FOUND 0x03
141 #define MBX_COMPLETION_ERROR 0x04
142
143
144 struct mailbox {
145 void *ccbptr;
146 unsigned char btstat;
147 unsigned char sdstat;
148 unsigned char reserved;
149 unsigned char status;
150 };
151
152
153 struct chain {
154 unsigned long datalen;
155 void *dataptr;
156 };
157
158 #define MAX_CDB 12
159
160 struct ccb {
161 unsigned char op;
162 unsigned char dir;
163 unsigned char cdblen;
164 unsigned char rsalen;
165 unsigned long datalen;
166 void *dataptr;
167 unsigned char reserved[2];
168 unsigned char hastat;
169 unsigned char tarstat;
170 unsigned char id;
171 unsigned char lun;
172 unsigned char cdb[MAX_CDB];
173 unsigned char ccbcontrol;
174 unsigned char commlinkid;
175 void *linkptr;
176 void *senseptr;
177 };
178
179 #define CCB_OP_INIT 0x00
180 #define CCB_OP_TARG 0x01
181 #define CCB_OP_INIT_SG 0x02
182 #define CCB_OP_INIT_R 0x03
183
184 #define CCB_OP_INIT_SG_R 0x04
185
186 #define CCB_OP_BUS_RESET 0x81
187
188 #endif
189
190 #endif