2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2013-03-05 11:10:17 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Samsung Electrnoics
|
|
|
|
* Lukasz Majewski <l.majewski@samsung.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __USB_MASS_STORAGE_H__
|
|
|
|
#define __USB_MASS_STORAGE_H__
|
|
|
|
|
|
|
|
#define SECTOR_SIZE 0x200
|
2014-05-05 16:40:11 +00:00
|
|
|
#include <part.h>
|
2013-09-17 13:58:21 +00:00
|
|
|
#include <linux/usb/composite.h>
|
2013-03-05 11:10:17 +00:00
|
|
|
|
2014-01-07 14:08:37 +00:00
|
|
|
/* Wait at maximum 60 seconds for cable connection */
|
|
|
|
#define UMS_CABLE_READY_TIMEOUT 60
|
|
|
|
|
2013-10-23 12:30:42 +00:00
|
|
|
struct ums {
|
|
|
|
int (*read_sector)(struct ums *ums_dev,
|
2013-03-05 11:10:17 +00:00
|
|
|
ulong start, lbaint_t blkcnt, void *buf);
|
2013-10-23 12:30:42 +00:00
|
|
|
int (*write_sector)(struct ums *ums_dev,
|
2013-03-05 11:10:17 +00:00
|
|
|
ulong start, lbaint_t blkcnt, const void *buf);
|
2013-10-23 12:30:44 +00:00
|
|
|
unsigned int start_sector;
|
|
|
|
unsigned int num_sectors;
|
2013-03-05 11:10:17 +00:00
|
|
|
const char *name;
|
2016-02-29 22:25:34 +00:00
|
|
|
struct blk_desc block_dev;
|
2013-03-05 11:10:17 +00:00
|
|
|
};
|
|
|
|
|
2020-06-29 02:12:26 +00:00
|
|
|
int fsg_init(struct ums *ums_devs, int count, unsigned int controller_idx);
|
2013-10-04 17:22:26 +00:00
|
|
|
void fsg_cleanup(void);
|
|
|
|
int fsg_main_thread(void *);
|
2013-09-17 13:58:21 +00:00
|
|
|
int fsg_add(struct usb_configuration *c);
|
2013-03-05 11:10:17 +00:00
|
|
|
#endif /* __USB_MASS_STORAGE_H__ */
|