blob: 35cdcc3d8c7ae77d500f4ca7de85f2a2993a08d4 [file] [log] [blame]
Lukasz Majewski44a6ac92013-03-05 12:10:17 +01001/*
2 * Copyright (C) 2011 Samsung Electrnoics
3 * Lukasz Majewski <l.majewski@samsung.com>
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Lukasz Majewski44a6ac92013-03-05 12:10:17 +01006 */
7
8#ifndef __USB_MASS_STORAGE_H__
9#define __USB_MASS_STORAGE_H__
10
11#define SECTOR_SIZE 0x200
12
13#include <mmc.h>
14
15struct ums_device {
16 struct mmc *mmc;
17 int dev_num;
18 int offset;
19 int part_size;
20};
21
22struct ums_board_info {
23 int (*read_sector)(struct ums_device *ums_dev,
24 ulong start, lbaint_t blkcnt, void *buf);
25 int (*write_sector)(struct ums_device *ums_dev,
26 ulong start, lbaint_t blkcnt, const void *buf);
27 void (*get_capacity)(struct ums_device *ums_dev,
28 long long int *capacity);
29 const char *name;
30 struct ums_device ums_dev;
31};
32
33extern void board_usb_init(void);
34
35extern int fsg_init(struct ums_board_info *);
36extern void fsg_cleanup(void);
37extern struct ums_board_info *board_ums_init(unsigned int,
38 unsigned int, unsigned int);
39extern int usb_gadget_handle_interrupts(void);
40extern int fsg_main_thread(void *);
41
42#endif /* __USB_MASS_STORAGE_H__ */