summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/storage_common.h
Commit message (Collapse)AuthorAgeFilesLines
* usb: gadget: mass storage: fix return of delayed statusPratyush Anand2013-11-251-4/+0
| | | | | | | | | | | | | | | | Mass storage gadget returns DELAYED_STATUS in stead of USB_GADGET_DELAYED_STATUS while handling bulk reset request. Since peripheral driver uses USB_GADGET_DELAYED_STATUS for delayed status handling, therefore replace DELAYED_STATUS by USB_GADGET_DELAYED_STATUS in mass storage driver. Since, DELAYED_STATUS and hence EP0_BUFSIZE will no longer be used now, so remove them. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Cc: Paul Zimmerman <Paul.Zimmerman@synopsys.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: storage_common: pass filesem to fsg_store_cdromAndrzej Pietrasiewicz2013-10-151-1/+2
| | | | | | | | | | If cdrom flag is set ro flag is implied. Try setting the ro first, and only if it succeeds set the cdrom flag. 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>
* usb: gadget: storage_common: add methods to show/store 'cdrom' and 'removable'Andrzej Pietrasiewicz2013-10-101-0/+5
| | | | | | | | This will be required by configfs integration. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: storage_common: make attribute operations more genericAndrzej Pietrasiewicz2013-10-101-10/+11
| | | | | | | | | | Show/store methods for sysfs attributes contain code which can be used also by configfs. Make them abstract the source the lun and rw_semaphore are taken from. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: gadget: f_mass_storage: make sysfs interface optionalAndrzej Pietrasiewicz2013-10-101-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | When configfs is in place, the luns will not be represented in sysfs, so there will be no struct device associated with a lun. In order to maintain compatibility and allow configfs adoption sysfs is made optional in this patch. As a consequence some debug macros need to be adjusted. Two new fields are added to struct fsg_lun: name and name_pfx. The "name" is for storing a string which is presented to the user instead of the dev_name. The "name_pfx", if non-NULL, is prepended to the "name" at printing time. The name_pfx is for a future lun.0, which will be a default group in mass_storage.<name>. By design at USB function configfs group's creation time its name is not known (but instead set a bit later in drivers/usb/gadget/configfs.c:function_make) and it is this name that serves the purpose of the said name prefix. So instead of copying a yet-unknown string a pointer to it is stored in struct fsg_lun. 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>
* usb: gadget: create a utility module for mass_storageAndrzej Pietrasiewicz2013-10-011-0/+210
Converting to configfs requires making the f_mass_storage.c a module. But first we need to get rid of "#include "storage_common.c". This patch makes storage_common.c a separately compiled file, which is built as a utility module named u_ms.ko. After all mass storage users are converted to the new function interface this module can be eliminated by merging it with the mass storage function's module. USB descriptors are exported so that they can be accessed from f_mass_storage. FSG_VENDOR_ID and FSG_PRODUCT_ID are moved to their only user. Handling of CONFIG_USB_GADGET_DEBUG_FILES is moved to f_mass_storage.c. The fsg_num_buffers static is moved to FSG_MODULE_PARAMETER users, so instead of using a global variable the f_mass_storage introduces fsg_num_buffers member in fsg_common (and fsg_config). fsg_strings and fsg_stringtab are moved to f_mass_storage.c. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud