summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs/src/dosfs/dosfs.h
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-11-20 03:11:41 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-11-20 03:11:41 +0000
commitc36f885aa7b4390efdf5b89adc6866e1024e1ceb (patch)
treea386de34a591223bba3bbb03cc2759048ba964a3 /cpukit/libfs/src/dosfs/dosfs.h
parent2004-11-20 Ralf Corsepius <ralf.corsepiu@rtems.org> (diff)
downloadrtems-c36f885aa7b4390efdf5b89adc6866e1024e1ceb.tar.bz2
2004-11-20 Ralf Corsepius <ralf.corsepiu@rtems.org>
PR 720/filesystem: * libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h, libfs/src/dosfs/msdos_format.c: Adaptations to msdos_format. (From Thomas Doerfler <Thomas.Doerfler@imd-systems.de>). * libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h, libfs/src/dosfs/msdos_format.c: Adaptations to RTEMS-4.7.
Diffstat (limited to 'cpukit/libfs/src/dosfs/dosfs.h')
-rw-r--r--cpukit/libfs/src/dosfs/dosfs.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/cpukit/libfs/src/dosfs/dosfs.h b/cpukit/libfs/src/dosfs/dosfs.h
index 2524690aec..ff9ef0037f 100644
--- a/cpukit/libfs/src/dosfs/dosfs.h
+++ b/cpukit/libfs/src/dosfs/dosfs.h
@@ -12,6 +12,7 @@
*
* @(#) $Id$
*/
+
#ifndef __DOSFS_DOSFS_H__
#define __DOSFS_DOSFS_H__
@@ -24,6 +25,53 @@ extern "C" {
extern rtems_filesystem_operations_table msdos_ops;
+#define MSDOS_FMT_FATANY 0
+#define MSDOS_FMT_FAT12 1
+#define MSDOS_FMT_FAT16 2
+#define MSDOS_FMT_FAT32 3
+
+/*
+ * data to be filled out for formatter: parameters for format call
+ * any parameter set to 0 or NULL will be automatically detected/computed
+ */
+typedef struct {
+ const char *OEMName; /* OEM Name string or NULL */
+ const char *VolLabel; /* Volume Label string or NULL */
+ uint32_t sectors_per_cluster; /* request value: sectors per cluster */
+ uint32_t fat_num; /* request value: number of FATs on disk */
+ uint32_t files_per_root_dir; /* request value: file entries in root */
+ uint8_t fattype; /* request value: MSDOS_FMT_FAT12/16/32 */
+ uint8_t media; /* media code. default: 0xF8 */
+ boolean quick_format; /* TRUE: do not clear out data sectors */
+ uint32_t cluster_align; /* requested value: cluster alignment */
+ /* make sector number of first sector */
+ /* of first cluster divisible by this */
+ /* value. This can optimize clusters */
+ /* to be located at start of track */
+ /* or start of flash block */
+} msdos_format_request_param_t;
+
+/*=========================================================================*\
+| Function: |
+\*-------------------------------------------------------------------------*/
+int msdos_format
+(
+/*-------------------------------------------------------------------------*\
+| Purpose: |
+| format device with msdos filesystem |
++---------------------------------------------------------------------------+
+| Input Parameters: |
+\*-------------------------------------------------------------------------*/
+ const char *devname, /* device name */
+ const msdos_format_request_param_t *rqdata /* requested fmt parameters */
+ /* set to NULL for automatic */
+ /* determination */
+ );
+/*-------------------------------------------------------------------------*\
+| Return Value: |
+| 0, if success, -1 and errno if failed |
+\*=========================================================================*/
+
#ifdef __cplusplus
}
#endif