Coccinelle release 0.2.5-rc8
[bpt/coccinelle.git] / tests / toplevel_struct.c
1 struct SHT usb_stor_host_template = {
2 /* basic userland interface stuff */
3 .name = "usb-storage",
4 .proc_name = "usb-storage",
5 .proc_info2 = usb_storage_proc_info2,
6 .proc_info = usb_storage_proc_info,
7 .proc_dir = NULL,
8 .info = usb_storage_info,
9 .ioctl = NULL,
10
11 /* old-style detect and release */
12 .detect = NULL,
13 .release = NULL,
14
15 /* command interface -- queued only */
16 .command = NULL,
17 .queuecommand = usb_storage_queuecommand,
18
19 /* error and abort handlers */
20 .eh_abort_handler = usb_storage_command_abort,
21 .eh_device_reset_handler = usb_storage_device_reset,
22 .eh_bus_reset_handler = usb_storage_bus_reset,
23 .eh_host_reset_handler = NULL,
24 .eh_strategy_handler = NULL,
25
26 /* queue commands only, only one command per LUN */
27 .can_queue = 1,
28 .cmd_per_lun = 1,
29
30 /* unknown initiator id */
31 .this_id = -1,
32
33 /* no limit on commands */
34 .max_sectors = 0,
35
36 /* pre- and post- device scan functions */
37 .slave_alloc = NULL,
38 .slave_configure = NULL,
39 .slave_destroy = NULL,
40
41 /* lots of sg segments can be handled */
42 .sg_tablesize = SG_ALL,
43
44 /* use 32-bit address space for DMA */
45 .unchecked_isa_dma = FALSE,
46 .highmem_io = FALSE,
47
48 /* merge commands... this seems to help performance, but
49 * periodically someone should test to see which setting is more
50 * optimal.
51 */
52 .use_clustering = TRUE,
53
54 /* emulated HBA */
55 .emulated = TRUE,
56
57 /* sorry, no BIOS to help us */
58 .bios_param = NULL,
59
60 /* module management */
61 .module = THIS_MODULE
62 };
63
64 /* For a device that is "Not Ready" */
65 unsigned char usb_stor_sense_notready[18] = {
66 [0] = 0x70, /* current error */
67 [2] = 0x02, /* not ready */
68 [7] = 0x0a, /* additional length */
69 [12] = 0x04, /* not ready */
70 [13] = 0x03 /* manual intervention */
71 };
72
73
74 void usb_storage_proc_info(int i) {
75 f(1);
76 }
77
78 void usb_storage_proc_info2(int i) {
79 f(27);
80 }
81
82
83 void not_usb_storage_proc_info(int i) {
84 f(1);
85 }