1 | /* |
---|
2 | * dosfs.h |
---|
3 | * |
---|
4 | * Application interface to MSDOS filesystem. |
---|
5 | * |
---|
6 | * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia |
---|
7 | * Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru> |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | * @(#) $Id$ |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef __DOSFS_DOSFS_H__ |
---|
17 | #define __DOSFS_DOSFS_H__ |
---|
18 | |
---|
19 | #ifdef __cplusplus |
---|
20 | extern "C" { |
---|
21 | #endif |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <rtems/libio.h> |
---|
25 | |
---|
26 | extern rtems_filesystem_operations_table msdos_ops; |
---|
27 | |
---|
28 | #define MSDOS_FMT_FATANY 0 |
---|
29 | #define MSDOS_FMT_FAT12 1 |
---|
30 | #define MSDOS_FMT_FAT16 2 |
---|
31 | #define MSDOS_FMT_FAT32 3 |
---|
32 | |
---|
33 | /* |
---|
34 | * data to be filled out for formatter: parameters for format call |
---|
35 | * any parameter set to 0 or NULL will be automatically detected/computed |
---|
36 | */ |
---|
37 | typedef struct { |
---|
38 | const char *OEMName; /* OEM Name string or NULL */ |
---|
39 | const char *VolLabel; /* Volume Label string or NULL */ |
---|
40 | uint32_t sectors_per_cluster; /* request value: sectors per cluster */ |
---|
41 | uint32_t fat_num; /* request value: number of FATs on disk */ |
---|
42 | uint32_t files_per_root_dir; /* request value: file entries in root */ |
---|
43 | uint8_t fattype; /* request value: MSDOS_FMT_FAT12/16/32 */ |
---|
44 | uint8_t media; /* media code. default: 0xF8 */ |
---|
45 | boolean quick_format; /* TRUE: do not clear out data sectors */ |
---|
46 | uint32_t cluster_align; /* requested value: cluster alignment */ |
---|
47 | /* make sector number of first sector */ |
---|
48 | /* of first cluster divisible by this */ |
---|
49 | /* value. This can optimize clusters */ |
---|
50 | /* to be located at start of track */ |
---|
51 | /* or start of flash block */ |
---|
52 | } msdos_format_request_param_t; |
---|
53 | |
---|
54 | /*=========================================================================*\ |
---|
55 | | Function: | |
---|
56 | \*-------------------------------------------------------------------------*/ |
---|
57 | int msdos_format |
---|
58 | ( |
---|
59 | /*-------------------------------------------------------------------------*\ |
---|
60 | | Purpose: | |
---|
61 | | format device with msdos filesystem | |
---|
62 | +---------------------------------------------------------------------------+ |
---|
63 | | Input Parameters: | |
---|
64 | \*-------------------------------------------------------------------------*/ |
---|
65 | const char *devname, /* device name */ |
---|
66 | const msdos_format_request_param_t *rqdata /* requested fmt parameters */ |
---|
67 | /* set to NULL for automatic */ |
---|
68 | /* determination */ |
---|
69 | ); |
---|
70 | /*-------------------------------------------------------------------------*\ |
---|
71 | | Return Value: | |
---|
72 | | 0, if success, -1 and errno if failed | |
---|
73 | \*=========================================================================*/ |
---|
74 | |
---|
75 | #ifdef __cplusplus |
---|
76 | } |
---|
77 | #endif |
---|
78 | |
---|
79 | #endif /* __DOSFS_DOSFS_H__ */ |
---|