2013-03-05 11:10:17 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Samsung Electrnoics
|
|
|
|
* Lukasz Majewski <l.majewski@samsung.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2013-03-05 11:10:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#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;
|
2014-05-05 16:40:11 +00:00
|
|
|
block_dev_desc_t *block_dev;
|
2013-03-05 11:10:17 +00:00
|
|
|
};
|
|
|
|
|
2013-10-23 12:30:42 +00:00
|
|
|
extern struct ums *ums;
|
|
|
|
|
|
|
|
int fsg_init(struct ums *);
|
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__ */
|