blob: 6d83d93cad7fb2c21d91cf4cc482173e65788c53 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Lukasz Majewskib528f712013-03-05 12:10:17 +01002/*
3 * Copyright (C) 2011 Samsung Electrnoics
4 * Lukasz Majewski <l.majewski@samsung.com>
Lukasz Majewskib528f712013-03-05 12:10:17 +01005 */
6
7#ifndef __USB_MASS_STORAGE_H__
8#define __USB_MASS_STORAGE_H__
9
Stephen Warrence19d972014-05-05 10:40:11 -060010#include <part.h>
Lukasz Majewskiba4e95c2013-09-17 15:58:21 +020011#include <linux/usb/composite.h>
Lukasz Majewskib528f712013-03-05 12:10:17 +010012
Przemyslaw Marczak3603e312014-01-07 15:08:37 +010013/* Wait at maximum 60 seconds for cable connection */
14#define UMS_CABLE_READY_TIMEOUT 60
15
Przemyslaw Marczak93c813b2013-10-23 14:30:42 +020016struct ums {
17 int (*read_sector)(struct ums *ums_dev,
18 ulong start, lbaint_t blkcnt, void *buf);
19 int (*write_sector)(struct ums *ums_dev,
20 ulong start, lbaint_t blkcnt, const void *buf);
Przemyslaw Marczak0697f202013-10-23 14:30:44 +020021 unsigned int start_sector;
22 unsigned int num_sectors;
Przemyslaw Marczak93c813b2013-10-23 14:30:42 +020023 const char *name;
Simon Glass4101f682016-02-29 15:25:34 -070024 struct blk_desc block_dev;
Lukasz Majewskib528f712013-03-05 12:10:17 +010025};
26
Marek Vasutf0322602023-09-01 11:49:54 +020027int fsg_init(struct ums *ums_devs, int count, struct udevice *udc);
Mateusz Zalega16297cf2013-10-04 19:22:26 +020028void fsg_cleanup(void);
Mateusz Zalega16297cf2013-10-04 19:22:26 +020029int fsg_main_thread(void *);
Lukasz Majewskiba4e95c2013-09-17 15:58:21 +020030int fsg_add(struct usb_configuration *c);
Lukasz Majewskib528f712013-03-05 12:10:17 +010031#endif /* __USB_MASS_STORAGE_H__ */