2018-05-07 05:58:06 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2013-03-05 19:10:17 +08: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-06 00:40:11 +08:00
|
|
|
#include <part.h>
|
2013-09-17 21:58:21 +08:00
|
|
|
#include <linux/usb/composite.h>
|
2013-03-05 19:10:17 +08:00
|
|
|
|
2014-01-07 22:08:37 +08:00
|
|
|
/* Wait at maximum 60 seconds for cable connection */
|
|
|
|
#define UMS_CABLE_READY_TIMEOUT 60
|
|
|
|
|
2013-10-23 20:30:42 +08:00
|
|
|
struct ums {
|
|
|
|
int (*read_sector)(struct ums *ums_dev,
|
2013-03-05 19:10:17 +08:00
|
|
|
ulong start, lbaint_t blkcnt, void *buf);
|
2013-10-23 20:30:42 +08:00
|
|
|
int (*write_sector)(struct ums *ums_dev,
|
2013-03-05 19:10:17 +08:00
|
|
|
ulong start, lbaint_t blkcnt, const void *buf);
|
2013-10-23 20:30:44 +08:00
|
|
|
unsigned int start_sector;
|
|
|
|
unsigned int num_sectors;
|
2013-03-05 19:10:17 +08:00
|
|
|
const char *name;
|
2016-03-01 06:25:34 +08:00
|
|
|
struct blk_desc block_dev;
|
2013-03-05 19:10:17 +08:00
|
|
|
};
|
|
|
|
|
2020-06-29 10:12:26 +08:00
|
|
|
int fsg_init(struct ums *ums_devs, int count, unsigned int controller_idx);
|
2013-10-05 01:22:26 +08:00
|
|
|
void fsg_cleanup(void);
|
|
|
|
int fsg_main_thread(void *);
|
2013-09-17 21:58:21 +08:00
|
|
|
int fsg_add(struct usb_configuration *c);
|
2013-03-05 19:10:17 +08:00
|
|
|
#endif /* __USB_MASS_STORAGE_H__ */
|