Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25733
b: refs/heads/master
c: aafe5bd
h: refs/heads/master
i:
  25731: 7267d3c
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Apr 14, 2006
1 parent 3805abd commit f3e34d0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e32b5767fca231e1c84b84e877a26766c27510f
refs/heads/master: aafe5bd6ec341edfaf3233d272febbb8862a7251
26 changes: 17 additions & 9 deletions trunk/drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@
* setting are not allowed when the medium is loaded.
*
* This gadget driver is heavily based on "Gadget Zero" by David Brownell.
* The driver's SCSI command interface was based on the "Information
* technology - Small Computer System Interface - 2" document from
* X3T9.2 Project 375D, Revision 10L, 7-SEP-93, available at
* <http://www.t10.org/ftp/t10/drafts/s2/s2-r10l.pdf>. The single exception
* is opcode 0x23 (READ FORMAT CAPACITIES), which was based on the
* "Universal Serial Bus Mass Storage Class UFI Command Specification"
* document, Revision 1.0, December 14, 1998, available at
* <http://www.usb.org/developers/devclass_docs/usbmass-ufi10.pdf>.
*/


Expand Down Expand Up @@ -340,11 +348,9 @@ MODULE_LICENSE("Dual BSD/GPL");

#define MAX_LUNS 8

/* Arggh! There should be a module_param_array_named macro! */
static char *file[MAX_LUNS];
static int ro[MAX_LUNS];

static struct {
char *file[MAX_LUNS];
int ro[MAX_LUNS];
int num_filenames;
int num_ros;
unsigned int nluns;
Expand Down Expand Up @@ -376,10 +382,11 @@ static struct {
};


module_param_array(file, charp, &mod_data.num_filenames, S_IRUGO);
module_param_array_named(file, mod_data.file, charp, &mod_data.num_filenames,
S_IRUGO);
MODULE_PARM_DESC(file, "names of backing files or devices");

module_param_array(ro, bool, &mod_data.num_ros, S_IRUGO);
module_param_array_named(ro, mod_data.ro, bool, &mod_data.num_ros, S_IRUGO);
MODULE_PARM_DESC(ro, "true to force read-only");

module_param_named(luns, mod_data.nluns, uint, S_IRUGO);
Expand Down Expand Up @@ -3868,7 +3875,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)

for (i = 0; i < fsg->nluns; ++i) {
curlun = &fsg->luns[i];
curlun->ro = ro[i];
curlun->ro = mod_data.ro[i];
curlun->dev.parent = &gadget->dev;
curlun->dev.driver = &fsg_driver.driver;
dev_set_drvdata(&curlun->dev, fsg);
Expand All @@ -3885,8 +3892,9 @@ static int __init fsg_bind(struct usb_gadget *gadget)
kref_get(&fsg->ref);
}

if (file[i] && *file[i]) {
if ((rc = open_backing_file(curlun, file[i])) != 0)
if (mod_data.file[i] && *mod_data.file[i]) {
if ((rc = open_backing_file(curlun,
mod_data.file[i])) != 0)
goto out;
} else if (!mod_data.removable) {
ERROR(fsg, "no file given for LUN%d\n", i);
Expand Down

0 comments on commit f3e34d0

Please sign in to comment.