2 * Copyright (C) 2011 Samsung Electrnoics
3 * Lukasz Majewski <l.majewski@samsung.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __USB_MASS_STORAGE_H__
9 #define __USB_MASS_STORAGE_H__
11 #define SECTOR_SIZE 0x200
13 #include <linux/usb/composite.h>
15 #ifndef UMS_START_SECTOR
16 #define UMS_START_SECTOR 0
19 #ifndef UMS_NUM_SECTORS
20 #define UMS_NUM_SECTORS 0
23 /* Wait at maximum 60 seconds for cable connection */
24 #define UMS_CABLE_READY_TIMEOUT 60
27 int (*read_sector)(struct ums *ums_dev,
28 ulong start, lbaint_t blkcnt, void *buf);
29 int (*write_sector)(struct ums *ums_dev,
30 ulong start, lbaint_t blkcnt, const void *buf);
31 unsigned int start_sector;
32 unsigned int num_sectors;
37 extern struct ums *ums;
39 int fsg_init(struct ums *);
40 void fsg_cleanup(void);
41 struct ums *ums_init(unsigned int);
42 int fsg_main_thread(void *);
44 #ifdef CONFIG_USB_GADGET_MASS_STORAGE
45 int fsg_add(struct usb_configuration *c);
47 int fsg_add(struct usb_configuration *c)
52 #endif /* __USB_MASS_STORAGE_H__ */