]>
Commit | Line | Data |
---|---|---|
b528f713 ŁM |
1 | /* |
2 | * Copyright (C) 2011 Samsung Electrnoics | |
3 | * Lukasz Majewski <l.majewski@samsung.com> | |
4 | * | |
1a459660 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
b528f713 ŁM |
6 | */ |
7 | ||
8 | #ifndef __USB_MASS_STORAGE_H__ | |
9 | #define __USB_MASS_STORAGE_H__ | |
10 | ||
11 | #define SECTOR_SIZE 0x200 | |
b528f713 | 12 | #include <mmc.h> |
ba4e95c9 | 13 | #include <linux/usb/composite.h> |
b528f713 | 14 | |
93c813b3 PM |
15 | #ifndef UMS_START_SECTOR |
16 | #define UMS_START_SECTOR 0 | |
17 | #endif | |
b528f713 | 18 | |
93c813b3 PM |
19 | #ifndef UMS_NUM_SECTORS |
20 | #define UMS_NUM_SECTORS 0 | |
21 | #endif | |
22 | ||
3603e31d PM |
23 | /* Wait at maximum 60 seconds for cable connection */ |
24 | #define UMS_CABLE_READY_TIMEOUT 60 | |
25 | ||
93c813b3 PM |
26 | struct ums { |
27 | int (*read_sector)(struct ums *ums_dev, | |
b528f713 | 28 | ulong start, lbaint_t blkcnt, void *buf); |
93c813b3 | 29 | int (*write_sector)(struct ums *ums_dev, |
b528f713 | 30 | ulong start, lbaint_t blkcnt, const void *buf); |
0697f206 PM |
31 | unsigned int start_sector; |
32 | unsigned int num_sectors; | |
b528f713 | 33 | const char *name; |
93c813b3 | 34 | struct mmc *mmc; |
b528f713 ŁM |
35 | }; |
36 | ||
93c813b3 PM |
37 | extern struct ums *ums; |
38 | ||
39 | int fsg_init(struct ums *); | |
16297cfb | 40 | void fsg_cleanup(void); |
93c813b3 | 41 | struct ums *ums_init(unsigned int); |
16297cfb | 42 | int fsg_main_thread(void *); |
ba4e95c9 | 43 | int fsg_add(struct usb_configuration *c); |
b528f713 | 44 | #endif /* __USB_MASS_STORAGE_H__ */ |