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