5 static int usb_storage_proc_info (char *buffer
, char **start
, off_t offset
,
6 int length
, int hostno
, int inout
)
10 struct Scsi_Host
*hostptr
;
13 /* if someone is sending us data, just throw it away */
17 /* find our data from the given hostno */
18 hostptr
= scsi_host_hn_get(hostno
);
19 if (!hostptr
) { /* if we couldn't find it, we return an error */
22 us
= (struct us_data
*)hostptr
->hostdata
[0];
24 /* if we couldn't find it, we return an error */
26 scsi_host_put(hostptr
);
30 /* print the controller name */
31 SPRINTF(" Host scsi%d: usb-storage\n", hostno
);
33 SPRINTF(" Transport: %s\n", us
->transport_name
);
35 /* show the device flags */
36 if (pos
< buffer
+ length
) {
37 pos
+= sprintf(pos
, " Quirks:");
40 #define DO_FLAG(a) if (f & US_FL_##a) pos += sprintf(pos, " " #a)
45 DO_FLAG(SCM_MULT_TARG
);
47 DO_FLAG(FIX_CAPACITY
);
53 /* release the reference count on this host */
54 scsi_host_put(hostptr
);
57 * Calculate start of next buffer, and return value.
59 *start
= buffer
+ offset
;
61 if ((pos
- buffer
) < offset
)
63 else if ((pos
- buffer
- offset
) < length
)
64 return (pos
- buffer
- offset
);
71 static int usb_storage_info (int i
, struct Scsi_Host
*myhostptr
) {
75 usb_storage_proc_info(buffer
, 0, 0, 100, 40, -1);
79 struct SHT usb_stor_host_template
= {
80 /* basic userland interface stuff */
81 .name
= "usb-storage",
82 .proc_name
= "usb-storage",
83 .proc_info
= usb_storage_proc_info
,
85 .info
= usb_storage_info
,
88 /* old-style detect and release */
92 /* command interface -- queued only */
94 .queuecommand
= usb_storage_queuecommand
,
96 /* error and abort handlers */
97 .eh_abort_handler
= usb_storage_command_abort
,
98 .eh_device_reset_handler
= usb_storage_device_reset
,
99 .eh_bus_reset_handler
= usb_storage_bus_reset
,
100 .eh_host_reset_handler
= NULL
,
101 .eh_strategy_handler
= NULL
,
103 /* queue commands only, only one command per LUN */
107 /* unknown initiator id */
110 /* no limit on commands */
113 /* pre- and post- device scan functions */
115 .slave_configure
= NULL
,
116 .slave_destroy
= NULL
,
118 /* lots of sg segments can be handled */
119 .sg_tablesize
= SG_ALL
,
121 /* use 32-bit address space for DMA */
122 .unchecked_isa_dma
= FALSE
,
125 /* merge commands... this seems to help performance, but
126 * periodically someone should test to see which setting is more
129 .use_clustering
= TRUE
,
134 /* sorry, no BIOS to help us */
137 /* module management */
138 .module
= THIS_MODULE