Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
file_storage.c File Reference
#include <linux/blkdev.h>
#include <linux/completion.h>
#include <linux/dcache.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/fcntl.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/kref.h>
#include <linux/kthread.h>
#include <linux/limits.h>
#include <linux/module.h>
#include <linux/rwsem.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/freezer.h>
#include <linux/utsname.h>
#include <linux/usb/composite.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include "gadget_chips.h"
#include "storage_common.c"

Go to the source code of this file.

Data Structures

struct  fsg_dev
 

Macros

#define DRIVER_DESC   "File-backed Storage Gadget"
 
#define DRIVER_NAME   "g_file_storage"
 
#define DRIVER_VERSION   "1 September 2010"
 
#define transport_is_bbb()   1
 
#define transport_is_cbi()   0
 
#define protocol_is_scsi()   1
 
#define REGISTERED   0
 
#define IGNORE_BULK_OUT   1
 
#define SUSPENDED   2
 
#define CONFIG_VALUE   1
 

Typedefs

typedef void(* fsg_routine_t )(struct fsg_dev *)
 

Functions

 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_AUTHOR ("Alan Stern")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 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_named (serial, mod_data.serial, charp, S_IRUGO)
 
 MODULE_PARM_DESC (serial,"USB serial number")
 
 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_array_named (nofua, mod_data.nofua, bool,&mod_data.num_nofuas, S_IRUGO)
 
 MODULE_PARM_DESC (nofua,"true to ignore SCSI WRITE(10,12) FUA bit")
 
 module_param_named (luns, mod_data.nluns, uint, S_IRUGO)
 
 MODULE_PARM_DESC (luns,"number of LUNs")
 
 module_param_named (removable, mod_data.removable, bool, S_IRUGO)
 
 MODULE_PARM_DESC (removable,"true to simulate removable media")
 
 module_param_named (stall, mod_data.can_stall, bool, S_IRUGO)
 
 MODULE_PARM_DESC (stall,"false to prevent bulk stalls")
 
 module_param_named (cdrom, mod_data.cdrom, bool, S_IRUGO)
 
 MODULE_PARM_DESC (cdrom,"true to emulate cdrom instead of disk")
 
 module_init (fsg_init)
 
 module_exit (fsg_cleanup)
 

Macro Definition Documentation

#define CONFIG_VALUE   1

Definition at line 530 of file file_storage.c.

#define DRIVER_DESC   "File-backed Storage Gadget"

Definition at line 260 of file file_storage.c.

#define DRIVER_NAME   "g_file_storage"

Definition at line 261 of file file_storage.c.

#define DRIVER_VERSION   "1 September 2010"

Definition at line 262 of file file_storage.c.

#define IGNORE_BULK_OUT   1

Definition at line 441 of file file_storage.c.

#define protocol_is_scsi ( )    1

Definition at line 397 of file file_storage.c.

#define REGISTERED   0

Definition at line 440 of file file_storage.c.

#define SUSPENDED   2

Definition at line 442 of file file_storage.c.

#define transport_is_bbb ( )    1

Definition at line 395 of file file_storage.c.

#define transport_is_cbi ( )    0

Definition at line 396 of file file_storage.c.

Typedef Documentation

typedef void(* fsg_routine_t)(struct fsg_dev *)

Definition at line 480 of file file_storage.c.

Function Documentation

MODULE_AUTHOR ( "Alan Stern"  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
module_exit ( fsg_cleanup  )
module_init ( fsg_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param_array_named ( file  ,
mod_data.  file,
charp  ,
&mod_data.  num_filenames,
S_IRUGO   
)
module_param_array_named ( ro  ,
mod_data.  ro,
bool  ,
&mod_data.  num_ros,
S_IRUGO   
)
module_param_array_named ( nofua  ,
mod_data.  nofua,
bool  ,
&mod_data.  num_nofuas,
S_IRUGO   
)
module_param_named ( serial  ,
mod_data.  serial,
charp  ,
S_IRUGO   
)
module_param_named ( luns  ,
mod_data.  nluns,
uint  ,
S_IRUGO   
)
module_param_named ( removable  ,
mod_data.  removable,
bool  ,
S_IRUGO   
)
module_param_named ( stall  ,
mod_data.  can_stall,
bool  ,
S_IRUGO   
)
module_param_named ( cdrom  ,
mod_data.  cdrom,
bool  ,
S_IRUGO   
)
MODULE_PARM_DESC ( file  ,
"names of backing files or devices  
)
MODULE_PARM_DESC ( serial  ,
"USB serial number  
)
MODULE_PARM_DESC ( ro  ,
"true to force read-only"   
)
MODULE_PARM_DESC ( nofua  ,
"true to ignore SCSI WRITE(10,12) FUA bit  
)
MODULE_PARM_DESC ( luns  ,
"number of LUNs"   
)
MODULE_PARM_DESC ( removable  ,
"true to simulate removable media"   
)
MODULE_PARM_DESC ( stall  ,
"false to prevent bulk stalls"   
)
MODULE_PARM_DESC ( cdrom  ,
"true to emulate cdrom instead of disk"   
)

Variable Documentation

unsigned int buflen

Definition at line 308 of file file_storage.c.

bool can_stall

Definition at line 300 of file file_storage.c.

bool cdrom

Definition at line 301 of file file_storage.c.

Definition at line 290 of file file_storage.c.

unsigned int nluns

Definition at line 297 of file file_storage.c.

Definition at line 293 of file file_storage.c.

unsigned int num_filenames

Definition at line 294 of file file_storage.c.

unsigned int num_nofuas

Definition at line 296 of file file_storage.c.

unsigned int num_ros

Definition at line 295 of file file_storage.c.

unsigned short product

Definition at line 306 of file file_storage.c.

char* protocol_name

Definition at line 313 of file file_storage.c.

char* protocol_parm

Definition at line 304 of file file_storage.c.

int protocol_type

Definition at line 312 of file file_storage.c.

unsigned short release

Definition at line 307 of file file_storage.c.

bool removable

Definition at line 299 of file file_storage.c.

Definition at line 292 of file file_storage.c.

char* serial

Definition at line 291 of file file_storage.c.

char* transport_name

Definition at line 311 of file file_storage.c.

char* transport_parm

Definition at line 303 of file file_storage.c.

int transport_type

Definition at line 310 of file file_storage.c.

unsigned short vendor

Definition at line 305 of file file_storage.c.