aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-04-18 12:43:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:40 -0400
commitd794ac7ae3613c2abfb678617ac7d74c8ff0099c (patch)
tree78a96a3c3b33626f168c11418027d316121d7f76 /drivers/usb/gadget
parent76f4af8efc72b6091d230cbe718cedca06d2d79e (diff)
[PATCH] USB: g_file_storage: export "stall" parameter
This patch changes the g_file_storage driver to make the "stall" module parameter generally available; currently it is available only if the testing version of the module has been configured. It also fixes a typo in a comment -- thanks, Pat! Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/file_storage.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 507a24924177..f5ce45c4b2a3 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -81,6 +81,10 @@
81 * removable Default false, boolean for removable media 81 * removable Default false, boolean for removable media
82 * luns=N Default N = number of filenames, number of 82 * luns=N Default N = number of filenames, number of
83 * LUNs to support 83 * LUNs to support
84 * stall Default determined according to the type of
85 * USB device controller (usually true),
86 * boolean to permit the driver to halt
87 * bulk endpoints
84 * transport=XXX Default BBB, transport name (CB, CBI, or BBB) 88 * transport=XXX Default BBB, transport name (CB, CBI, or BBB)
85 * protocol=YYY Default SCSI, protocol name (RBC, 8020 or 89 * protocol=YYY Default SCSI, protocol name (RBC, 8020 or
86 * ATAPI, QIC, UFI, 8070, or SCSI; 90 * ATAPI, QIC, UFI, 8070, or SCSI;
@@ -91,14 +95,10 @@
91 * buflen=N Default N=16384, buffer size used (will be 95 * buflen=N Default N=16384, buffer size used (will be
92 * rounded down to a multiple of 96 * rounded down to a multiple of
93 * PAGE_CACHE_SIZE) 97 * PAGE_CACHE_SIZE)
94 * stall Default determined according to the type of
95 * USB device controller (usually true),
96 * boolean to permit the driver to halt
97 * bulk endpoints
98 * 98 *
99 * If CONFIG_USB_FILE_STORAGE_TEST is not set, only the "file", "ro", 99 * If CONFIG_USB_FILE_STORAGE_TEST is not set, only the "file", "ro",
100 * "removable", and "luns" options are available; default values are used 100 * "removable", "luns", and "stall" options are available; default values
101 * for everything else. 101 * are used for everything else.
102 * 102 *
103 * The pathnames of the backing files and the ro settings are available in 103 * The pathnames of the backing files and the ro settings are available in
104 * the attribute files "file" and "ro" in the lun<n> subdirectory of the 104 * the attribute files "file" and "ro" in the lun<n> subdirectory of the
@@ -342,14 +342,15 @@ static struct {
342 int num_ros; 342 int num_ros;
343 unsigned int nluns; 343 unsigned int nluns;
344 344
345 int removable;
346 int can_stall;
347
345 char *transport_parm; 348 char *transport_parm;
346 char *protocol_parm; 349 char *protocol_parm;
347 int removable;
348 unsigned short vendor; 350 unsigned short vendor;
349 unsigned short product; 351 unsigned short product;
350 unsigned short release; 352 unsigned short release;
351 unsigned int buflen; 353 unsigned int buflen;
352 int can_stall;
353 354
354 int transport_type; 355 int transport_type;
355 char *transport_name; 356 char *transport_name;
@@ -360,11 +361,11 @@ static struct {
360 .transport_parm = "BBB", 361 .transport_parm = "BBB",
361 .protocol_parm = "SCSI", 362 .protocol_parm = "SCSI",
362 .removable = 0, 363 .removable = 0,
364 .can_stall = 1,
363 .vendor = DRIVER_VENDOR_ID, 365 .vendor = DRIVER_VENDOR_ID,
364 .product = DRIVER_PRODUCT_ID, 366 .product = DRIVER_PRODUCT_ID,
365 .release = 0xffff, // Use controller chip type 367 .release = 0xffff, // Use controller chip type
366 .buflen = 16384, 368 .buflen = 16384,
367 .can_stall = 1,
368 }; 369 };
369 370
370 371
@@ -380,6 +381,9 @@ MODULE_PARM_DESC(luns, "number of LUNs");
380module_param_named(removable, mod_data.removable, bool, S_IRUGO); 381module_param_named(removable, mod_data.removable, bool, S_IRUGO);
381MODULE_PARM_DESC(removable, "true to simulate removable media"); 382MODULE_PARM_DESC(removable, "true to simulate removable media");
382 383
384module_param_named(stall, mod_data.can_stall, bool, S_IRUGO);
385MODULE_PARM_DESC(stall, "false to prevent bulk stalls");
386
383 387
384/* In the non-TEST version, only the module parameters listed above 388/* In the non-TEST version, only the module parameters listed above
385 * are available. */ 389 * are available. */
@@ -404,9 +408,6 @@ MODULE_PARM_DESC(release, "USB release number");
404module_param_named(buflen, mod_data.buflen, uint, S_IRUGO); 408module_param_named(buflen, mod_data.buflen, uint, S_IRUGO);
405MODULE_PARM_DESC(buflen, "I/O buffer size"); 409MODULE_PARM_DESC(buflen, "I/O buffer size");
406 410
407module_param_named(stall, mod_data.can_stall, bool, S_IRUGO);
408MODULE_PARM_DESC(stall, "false to prevent bulk stalls");
409
410#endif /* CONFIG_USB_FILE_STORAGE_TEST */ 411#endif /* CONFIG_USB_FILE_STORAGE_TEST */
411 412
412 413
@@ -2657,7 +2658,7 @@ static int check_command(struct fsg_dev *fsg, int cmnd_size,
2657 } 2658 }
2658 } 2659 }
2659 2660
2660 /* Check that the LUN values are oonsistent */ 2661 /* Check that the LUN values are consistent */
2661 if (transport_is_bbb()) { 2662 if (transport_is_bbb()) {
2662 if (fsg->lun != lun) 2663 if (fsg->lun != lun)
2663 DBG(fsg, "using LUN %d from CBW, " 2664 DBG(fsg, "using LUN %d from CBW, "