1 #ifndef CYGONCE_DISKIO_H
2 #define CYGONCE_DISKIO_H
3 // ====================================================================
9 // ====================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 2003, 2004, 2006 eCosCentric Limited
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.
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
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.
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.
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.
38 // -------------------------------------------
39 //####ECOSGPLCOPYRIGHTEND####
40 // ====================================================================
41 //#####DESCRIPTIONBEGIN####
45 // Purpose: Special support for disk I/O devices
48 //####DESCRIPTIONEND####
50 // ====================================================================
52 // This file contains the user-level visible I/O interfaces
54 #include <pkgconf/hal.h>
55 #include <cyg/infra/cyg_type.h>
56 #include <cyg/io/config_keys.h>
58 #include <cyg/io/devtab.h>
64 struct cyg_disk_identify_t
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
77 struct cyg_disk_partition_t
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
86 struct cyg_disk_info_t
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
102 #endif /* CYGONCE_DISKIO_H */