comparison rvinterf/include/ffs.h @ 261:7f14d7c789a7

fc-tmsh ffs2: most commands implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 05 Feb 2014 05:48:47 +0000
parents
children 517e8a428fde
comparison
equal deleted inserted replaced
260:c146f38d2b5f 261:7f14d7c789a7
1 /*
2 * A few generic FFS API definitions which apply to both TMFFS1 and TMFFS2
3 */
4
5 enum FFS_OPEN {
6 FFS_O_EMPTY = 0x00, // Okay?
7 FFS_O_CREATE = 0x01,
8 FFS_O_APPEND = 0x02,
9 FFS_O_EXCL = 0x04,
10 FFS_O_TRUNC = 0x08,
11 FFS_O_RDONLY = 0x10,
12 FFS_O_WRONLY = 0x20,
13 FFS_O_RDWR = FFS_O_RDONLY | FFS_O_WRONLY
14 };
15
16 enum FFS_SEEK {
17 FFS_SEEK_SET = 0,
18 FFS_SEEK_CUR = 1,
19 FFS_SEEK_END = 2
20 };
21
22 enum FFS_QUERY { // data size, description
23 Q_BYTES_FREE = 1, // 4, number of free bytes in FFS
24 Q_BYTES_USED = 2, // 4, number of used bytes in FFS
25 Q_BYTES_LOST = 3, // 4, number of lost bytes in FFS
26 Q_BYTES_MAX = 4, // 4, number of max available bytes in FFS
27 Q_BYTES_FREE_RAW = 5, // 4, number of free raw bytes in FFS (used internal)
28
29 Q_FD_BUF_SIZE = 10, // 4, size of buffer used by stream functions
30
31 Q_TM_BUFADDR = 11, // 4, testmode buffer addr
32 Q_TM_BUFSIZE = 12, // 4, testmode ffs buffer size
33 Q_DEV_BASE = 13, // 4, FFS device base address
34 Q_CHUNK_SIZE_MAX = 14, // 4, max size of chunks made by non stream fkt.
35
36 // FFS versions
37 Q_FFS_API_VERSION = 16, // 2, FFS API Version
38 Q_FFS_DRV_VERSION = 17, // 2, FFS Driver Version
39 Q_FFS_REVISION = 18, // 2, FFS Revision (from PRCS)
40 Q_FFS_FORMAT_READ = 19, // 2, FFS version as read from ffs
41 Q_FFS_LASTERROR = 20, // 2, FFS last error (from init)
42 Q_FFS_FORMAT_WRITE = 21, // 2, FFS version as written to ffs on format
43 Q_FFS_TM_VERSION = 22, // 2, FFS Testmode version
44
45 // File system queries
46 Q_FILENAME_MAX = 24, // 2, max filename length
47 Q_PATH_DEPTH_MAX = 25, // 2, max path/directory nesting depth
48 Q_FD_MAX = 26, // 2, max numbers of simultaneous open files
49
50 Q_OBJECTS_FREE = 32, // 2, number of objects that can be created
51 Q_INODES_USED = 33, // 2, number of inodes used
52 Q_INODES_LOST = 34, // 2, number of inodes lost
53 Q_OBJECTS_USED = 33, // 2, DEPRECATED: old name for Q_INODES_USED
54 Q_OBJECTS_LOST = 34, // 2, DEPRECATED: old name for Q_INODES_LOST
55 Q_OBJECTS_MAX = 35, // 2, max number of valid objects allowed
56 Q_INODES_MAX = 36, // 2, physical total max number of inodes
57 Q_INODES_HIGH = 37, // 2, watermark for when inodes will be reclaimed
58 Q_LOST_HIGH = 38, // 2, watermark for when data block will be reclaimed
59
60 // Device queries
61 Q_DEV_MANUFACTURER = 48, // 2, flash manufacturer ID
62 Q_DEV_DEVICE = 49, // 2, flash device ID
63 Q_DEV_BLOCKS = 50, // 2, number of FFS blocks in device
64 Q_DEV_ATOMSIZE = 51, // 2, atomsize used by FFS for this device
65 Q_DEV_DRIVER = 52, // 2, flash device driver
66
67 // All queries below here are for debug purpose only, are unsupported
68 // and can change at any time without notice!
69
70 // Miscellaneous/Internal
71 Q_BLOCKS_FREE_MIN = 64, // 2, Number of spare blocks (0 or 1)
72
73 Q_BLOCKS_FREE = 70, // 2, number of free blocks
74
75 // Debug queries
76 Q_FS_FLAGS = 80,
77 Q_FS_INODES = 81,
78 Q_FS_ROOT = 82,
79
80 Q_OBJECTS_TOTAL = 90, // 2, Accumulated number of valid objects
81 Q_TOTAL_OBJECTS = 90, // 2, DEPRECATED: old name for Q_OBJECTS_TOTAL
82
83 Q_STATS_FIRST = 100,
84 Q_STATS_DRECLAIMS = 100,
85 Q_STATS_IRECLAIMS = 101,
86 Q_STATS_BRECLAIMS = 102,
87 Q_STATS_DATA_RECLAIMED = 103,
88 Q_STATS_INODES_RECLAIMED = 104,
89 Q_STATS_DATA_ALLOCATED = 105,
90
91 Q_REQUEST_ID_LAST = 110,
92
93 Q_DEBUG_FIRST = 120,
94 Q_DEBUG_0 = 120,
95 Q_DEBUG_1 = 121,
96 Q_DEBUG_2 = 122,
97 Q_DEBUG_3 = 123,
98 Q_DEBUG_LAST = 127,
99
100 // individual lines of the bstat array can be returned by the following
101 // id plus the bstat index of the line wanted.
102 Q_BSTAT = -128
103 };