usb_mass_storage.h 849 Bytes
Newer Older
1 2 3 4
/*
 * Copyright (C) 2011 Samsung Electrnoics
 * Lukasz Majewski <l.majewski@samsung.com>
 *
5
 * SPDX-License-Identifier:	GPL-2.0+
6 7 8 9 10 11
 */

#ifndef __USB_MASS_STORAGE_H__
#define __USB_MASS_STORAGE_H__

#define SECTOR_SIZE		0x200
12
#include <part.h>
13
#include <linux/usb/composite.h>
14

15 16 17
/* Wait at maximum 60 seconds for cable connection */
#define UMS_CABLE_READY_TIMEOUT	60

18 19
struct ums {
	int (*read_sector)(struct ums *ums_dev,
20
			   ulong start, lbaint_t blkcnt, void *buf);
21
	int (*write_sector)(struct ums *ums_dev,
22
			    ulong start, lbaint_t blkcnt, const void *buf);
23 24
	unsigned int start_sector;
	unsigned int num_sectors;
25
	const char *name;
26
	struct blk_desc block_dev;
27 28
};

29
int fsg_init(struct ums *ums_devs, int count);
30 31
void fsg_cleanup(void);
int fsg_main_thread(void *);
32
int fsg_add(struct usb_configuration *c);
33
#endif /* __USB_MASS_STORAGE_H__ */