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