xref: /openbmc/u-boot/include/usb_mass_storage.h (revision ec48b6c9)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2011 Samsung Electrnoics
4  * Lukasz Majewski <l.majewski@samsung.com>
5  */
6 
7 #ifndef __USB_MASS_STORAGE_H__
8 #define __USB_MASS_STORAGE_H__
9 
10 #define SECTOR_SIZE		0x200
11 #include <part.h>
12 #include <linux/usb/composite.h>
13 
14 /* Wait at maximum 60 seconds for cable connection */
15 #define UMS_CABLE_READY_TIMEOUT	60
16 
17 struct ums {
18 	int (*read_sector)(struct ums *ums_dev,
19 			   ulong start, lbaint_t blkcnt, void *buf);
20 	int (*write_sector)(struct ums *ums_dev,
21 			    ulong start, lbaint_t blkcnt, const void *buf);
22 	unsigned int start_sector;
23 	unsigned int num_sectors;
24 	const char *name;
25 	struct blk_desc block_dev;
26 };
27 
28 int fsg_init(struct ums *ums_devs, int count);
29 void fsg_cleanup(void);
30 int fsg_main_thread(void *);
31 int fsg_add(struct usb_configuration *c);
32 #endif /* __USB_MASS_STORAGE_H__ */
33