diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-10-09 10:06:01 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-10-10 10:24:04 -0500 |
commit | e5eaa0dc4866181aff655ef3f94cd990172b751f (patch) | |
tree | 4209782f1dd0deef8cdd1da46eee9fca1441c672 /drivers/usb/gadget/f_mass_storage.h | |
parent | 5de862d73b2c1b3fbb0ac8b45eb496d77347d1b8 (diff) | |
download | op-kernel-dev-e5eaa0dc4866181aff655ef3f94cd990172b751f.zip op-kernel-dev-e5eaa0dc4866181aff655ef3f94cd990172b751f.tar.gz |
usb: gadget: f_mass_storage: convert to new function interface with backward compatibility
Converting mass storage to the new function interface requires converting
the USB mass storage's function code and its users.
This patch converts the f_mass_storage.c to the new function interface.
The file is now compiled into a separate usb_f_mass_storage.ko module.
The old function interface is provided by means of a preprocessor conditional
directives. After all users are converted, the old interface can be removed.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.h')
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.h b/drivers/usb/gadget/f_mass_storage.h index 7d9e0bc..42f7db4 100644 --- a/drivers/usb/gadget/f_mass_storage.h +++ b/drivers/usb/gadget/f_mass_storage.h @@ -1,6 +1,7 @@ #ifndef USB_F_MASS_STORAGE_H #define USB_F_MASS_STORAGE_H +#include <linux/usb/composite.h> #include "storage_common.h" struct fsg_module_parameters { @@ -70,6 +71,12 @@ struct fsg_operations { int (*thread_exits)(struct fsg_common *common); }; +struct fsg_opts { + struct fsg_common *common; + struct usb_function_instance func_inst; + bool no_configfs; /* for legacy gadgets */ +}; + struct fsg_lun_config { const char *filename; char ro; @@ -94,6 +101,12 @@ struct fsg_config { unsigned int fsg_num_buffers; }; +static inline struct fsg_opts * +fsg_opts_from_func_inst(const struct usb_function_instance *fi) +{ + return container_of(fi, struct fsg_opts, func_inst); +} + void fsg_common_get(struct fsg_common *common); void fsg_common_put(struct fsg_common *common); @@ -106,6 +119,8 @@ void fsg_common_set_sysfs(struct fsg_common *common, bool sysfs); int fsg_common_set_num_buffers(struct fsg_common *common, unsigned int n); +void fsg_common_free_buffers(struct fsg_common *common); + int fsg_common_set_cdev(struct fsg_common *common, struct usb_composite_dev *cdev, bool can_stall); |