]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/io/disk/v2_0/include/diskio.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / io / disk / v2_0 / include / diskio.h
1 #ifndef CYGONCE_DISKIO_H
2 #define CYGONCE_DISKIO_H
3 // ====================================================================
4 //
5 //      diskio.h
6 //
7 //      Device I/O 
8 //
9 // ====================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 2003, 2004, 2006 eCosCentric Limited
14 //
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
18 //
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22 // for more details.
23 //
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 //
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
34 //
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
37 //
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 // ====================================================================
41 //#####DESCRIPTIONBEGIN####
42 //
43 // Author(s):     savin
44 // Date:          2003-06-09
45 // Purpose:       Special support for disk I/O devices
46 // Description:
47 //
48 //####DESCRIPTIONEND####
49 //
50 // ====================================================================
51
52 // This file contains the user-level visible I/O interfaces
53
54 #include <pkgconf/hal.h>
55 #include <cyg/infra/cyg_type.h>
56 #include <cyg/io/config_keys.h>
57
58 #include <cyg/io/devtab.h>
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63     
64 struct cyg_disk_identify_t
65 {
66     char        serial[20+1];      // serial number
67     char        firmware_rev[8+1]; // firmware revision
68     char        model_num[40+1];   // model number 
69     cyg_uint32  cylinders_num;     // number of cylinders         (CHS)
70     cyg_uint32  heads_num;         // number of heads             (CHS)
71     cyg_uint32  sectors_num;       // number of sectors per track (CHS)
72     cyg_uint32  lba_sectors_num;   // total number of sectors in LBA mode
73     cyg_uint32  phys_block_size;   // physical block size in sectors
74     cyg_uint32  max_transfer;      // Maximum transfer size in bytes
75 };
76
77 struct  cyg_disk_partition_t
78 {
79     cyg_uint8  type;    // partition type
80     cyg_uint8  state;   // state 0x00 - inactive, 0x80 - active
81     cyg_uint32 start;   // first sector number
82     cyg_uint32 end;     // last sector number
83     cyg_uint32 size;    // size in sectors
84 };
85
86 struct  cyg_disk_info_t
87 {
88     cyg_disk_partition_t       *partitions;    // partition table
89     int                         partitions_num;// partition table size
90     cyg_disk_identify_t         ident;         // identify data
91     cyg_uint32                  block_size;    // logical block size
92     cyg_uint32                  blocks_num;    // number of blocks on disk
93     cyg_uint32                  phys_block_size; // physical block size
94     cyg_bool                    connected;     // true if device connected
95     cyg_ucount16                mounts;        // total number of mounts for all partitions
96 };
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif  /* CYGONCE_DISKIO_H */
103 /* EOF diskio.h */