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