6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
|
#ifndef _GDTH_IOCTL_H
#define _GDTH_IOCTL_H
#define GDTIOCTL_MASK ('J'<<8)
#define GDTIOCTL_GENERAL (GDTIOCTL_MASK | 0) /* general IOCTL */
#define GDTIOCTL_DRVERS (GDTIOCTL_MASK | 1) /* get driver version */
#define GDTIOCTL_CTRTYPE (GDTIOCTL_MASK | 2) /* get controller type */
#define GDTIOCTL_OSVERS (GDTIOCTL_MASK | 3) /* get OS version */
#define GDTIOCTL_HDRLIST (GDTIOCTL_MASK | 4) /* get host drive list */
#define GDTIOCTL_CTRCNT (GDTIOCTL_MASK | 5) /* get controller count */
#define GDTIOCTL_LOCKDRV (GDTIOCTL_MASK | 6) /* lock host drive */
#define GDTIOCTL_LOCKCHN (GDTIOCTL_MASK | 7) /* lock channel */
#define GDTIOCTL_EVENT (GDTIOCTL_MASK | 8) /* read controller events */
#define GDTIOCTL_SCSI (GDTIOCTL_MASK | 9) /* SCSI command */
#define GDTIOCTL_RESET_BUS (GDTIOCTL_MASK |10) /* reset SCSI bus */
#define GDTIOCTL_RESCAN (GDTIOCTL_MASK |11) /* rescan host drives */
#define GDTIOCTL_RESET_DRV (GDTIOCTL_MASK |12) /* reset (remote) drv. res. */
#define GDTIOCTL_MAGIC 0xaffe0004
#define EVENT_SIZE 294
#define GDTH_MAXSG 32 /* max. s/g elements */
#define MAX_LDRIVES 255 /* max. log. drive count */
#ifdef GDTH_IOCTL_PROC
#define MAX_HDRIVES 100 /* max. host drive count */
#else
#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
#endif
typedef struct {
u32 sg_ptr;
u32 sg_len;
} __attribute__((packed)) gdth_sg_str;
typedef struct {
u64 sg_ptr;
u32 sg_len;
} __attribute__((packed)) gdth_sg64_str;
typedef struct {
u32 BoardNode;
u32 CommandIndex;
u16 OpCode;
union {
struct {
u16 DeviceNo;
u32 BlockNo;
u32 BlockCnt;
u32 DestAddr;
u32 sg_canz;
gdth_sg_str sg_lst[GDTH_MAXSG];
} __attribute__((packed)) cache;
struct {
u16 DeviceNo;
u64 BlockNo;
u32 BlockCnt;
u64 DestAddr;
u32 sg_canz;
gdth_sg64_str sg_lst[GDTH_MAXSG];
} __attribute__((packed)) cache64;
struct {
u16 param_size;
u32 subfunc;
u32 channel;
u64 p_param;
} __attribute__((packed)) ioctl;
struct {
u16 reserved;
union {
struct {
u32 msg_handle;
u64 msg_addr;
} __attribute__((packed)) msg;
u8 data[12];
} su;
} __attribute__((packed)) screen;
struct {
u16 reserved;
u32 direction;
u32 mdisc_time;
u32 mcon_time;
u32 sdata;
u32 sdlen;
u32 clen;
u8 cmd[12];
u8 target;
u8 lun;
u8 bus;
u8 priority;
u32 sense_len;
u32 sense_data;
u32 link_p;
u32 sg_ranz;
gdth_sg_str sg_lst[GDTH_MAXSG];
} __attribute__((packed)) raw;
struct {
u16 reserved;
u32 direction;
u32 mdisc_time;
u32 mcon_time;
u64 sdata;
u32 sdlen;
u32 clen;
u8 cmd[16];
u8 target;
u8 lun;
u8 bus;
u8 priority;
u32 sense_len;
u64 sense_data;
u32 sg_ranz;
gdth_sg64_str sg_lst[GDTH_MAXSG];
} __attribute__((packed)) raw64;
} u;
u8 Service;
u8 reserved;
u16 Status;
u32 Info;
void *RequestBuffer;
} __attribute__((packed)) gdth_cmd_str;
#define ES_ASYNC 1
#define ES_DRIVER 2
#define ES_TEST 3
#define ES_SYNC 4
typedef struct {
u16 size;
union {
char stream[16];
struct {
u16 ionode;
u16 service;
u32 index;
} __attribute__((packed)) driver;
struct {
u16 ionode;
u16 service;
u16 status;
u32 info;
u8 scsi_coord[3];
} __attribute__((packed)) async;
struct {
u16 ionode;
u16 service;
u16 status;
u32 info;
u16 hostdrive;
u8 scsi_coord[3];
u8 sense_key;
} __attribute__((packed)) sync;
struct {
u32 l1, l2, l3, l4;
} __attribute__((packed)) test;
} eu;
u32 severity;
u8 event_string[256];
} __attribute__((packed)) gdth_evt_data;
typedef struct {
u32 first_stamp;
u32 last_stamp;
u16 same_count;
u16 event_source;
u16 event_idx;
u8 application;
u8 reserved;
gdth_evt_data event_data;
} __attribute__((packed)) gdth_evt_str;
#ifdef GDTH_IOCTL_PROC
typedef struct {
u32 magic;
u16 ioctl;
u16 ionode;
u16 service;
u16 timeout;
union {
struct {
u8 command[512];
u8 data[1];
} general;
struct {
u8 lock;
u8 drive_cnt;
u16 drives[MAX_HDRIVES];
} lockdrv;
struct {
u8 lock;
u8 channel;
} lockchn;
struct {
int erase;
int handle;
u8 evt[EVENT_SIZE];
} event;
struct {
u8 bus;
u8 target;
u8 lun;
u8 cmd_len;
u8 cmd[12];
} scsi;
struct {
u16 hdr_no;
u8 flag;
} rescan;
} iu;
} gdth_iowr_str;
typedef struct {
u32 size;
u32 status;
union {
struct {
u8 data[1];
} general;
struct {
u16 version;
} drvers;
struct {
u8 type;
u16 info;
u16 oem_id;
u16 bios_ver;
u16 access;
u16 ext_type;
u16 device_id;
u16 sub_device_id;
} ctrtype;
struct {
u8 version;
u8 subversion;
u16 revision;
} osvers;
struct {
u16 count;
} ctrcnt;
struct {
int handle;
u8 evt[EVENT_SIZE];
} event;
struct {
u8 bus;
u8 target;
u8 lun;
u8 cluster_type;
} hdr_list[MAX_HDRIVES];
} iu;
} gdth_iord_str;
#endif
typedef struct {
u16 ionode;
u16 timeout;
u32 info;
u16 status;
unsigned long data_len;
unsigned long sense_len;
gdth_cmd_str command;
} gdth_ioctl_general;
typedef struct {
u16 ionode;
u8 lock;
u8 drive_cnt;
u16 drives[MAX_HDRIVES];
} gdth_ioctl_lockdrv;
typedef struct {
u16 ionode;
u8 lock;
u8 channel;
} gdth_ioctl_lockchn;
typedef struct {
u8 version;
u8 subversion;
u16 revision;
} gdth_ioctl_osvers;
typedef struct {
u16 ionode;
u8 type;
u16 info;
u16 oem_id;
u16 bios_ver;
u16 access;
u16 ext_type;
u16 device_id;
u16 sub_device_id;
} gdth_ioctl_ctrtype;
typedef struct {
u16 ionode;
int erase;
int handle;
gdth_evt_str event;
} gdth_ioctl_event;
typedef struct {
u16 ionode;
u8 flag;
u16 hdr_no;
struct {
u8 bus;
u8 target;
u8 lun;
u8 cluster_type;
} hdr_list[MAX_HDRIVES];
} gdth_ioctl_rescan;
typedef struct {
u16 ionode;
u16 number;
u16 status;
} gdth_ioctl_reset;
#endif
|