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