/src/barebox/fs/fat/fat-diskio.c
Line | Count | Source |
1 | | // SPDX-License-Identifier: GPL-2.0-only |
2 | | /* |
3 | | * fat.c - FAT filesystem barebox driver |
4 | | * |
5 | | * Copyright (c) 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix |
6 | | */ |
7 | | |
8 | | #include <common.h> |
9 | | #include <linux/ctype.h> |
10 | | #include "integer.h" |
11 | | #include "ff.h" |
12 | | #include "diskio.h" |
13 | | |
14 | | DSTATUS disk_status(FATFS *fat) |
15 | 0 | { |
16 | 0 | return 0; |
17 | 0 | } |
18 | | |
19 | | DWORD get_fattime(void) |
20 | 0 | { |
21 | 0 | return 0; |
22 | 0 | } |
23 | | |
24 | | DRESULT disk_ioctl (FATFS *fat, BYTE command, void *buf) |
25 | 1.19k | { |
26 | 1.19k | switch (command) { |
27 | 1.19k | case GET_SECTOR_SIZE: |
28 | 1.19k | *(WORD *)buf = disk_sector_size(fat); |
29 | 1.19k | return RES_OK; |
30 | 0 | case CTRL_SYNC: |
31 | 0 | #if _READONLY == 0 |
32 | 0 | return disk_flush(fat); |
33 | | #else |
34 | | return RES_OK; |
35 | | #endif |
36 | 0 | default: |
37 | 0 | return RES_PARERR; |
38 | 1.19k | } |
39 | 1.19k | } |
40 | | |
41 | | WCHAR ff_convert(WCHAR src, UINT dir) |
42 | 67.4k | { |
43 | 67.4k | if (src <= 0x80) |
44 | 63.1k | return src; |
45 | 4.24k | else |
46 | 4.24k | return '?'; |
47 | 67.4k | } |
48 | | |
49 | | WCHAR ff_wtoupper(WCHAR chr) |
50 | 394M | { |
51 | 394M | if (chr <= 0x80) |
52 | 8.81M | return toupper(chr); |
53 | 385M | else |
54 | 385M | return '?'; |
55 | 394M | } |