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
14 #include <linux/usb/composite.h>
23 struct ums_board_info {
24 int (*read_sector)(struct ums_device *ums_dev,
25 ulong start, lbaint_t blkcnt, void *buf);
26 int (*write_sector)(struct ums_device *ums_dev,
27 ulong start, lbaint_t blkcnt, const void *buf);
28 void (*get_capacity)(struct ums_device *ums_dev,
29 long long int *capacity);
31 struct ums_device ums_dev;
34 extern void board_usb_init(void);
36 extern int fsg_init(struct ums_board_info *);
37 extern void fsg_cleanup(void);
38 extern struct ums_board_info *board_ums_init(unsigned int,
39 unsigned int, unsigned int);
40 extern int usb_gadget_handle_interrupts(void);
41 extern int fsg_main_thread(void *);
43 #ifdef CONFIG_USB_GADGET_MASS_STORAGE
44 int fsg_add(struct usb_configuration *c);
46 int fsg_add(struct usb_configuration *c)
51 #endif /* __USB_MASS_STORAGE_H__ */