00001 #ifndef FS_PHATVOL_H_ 00002 #define FS_PHATVOL_H_ 00003 00004 /* 00005 * Copyright (C) 2005 by egnite Software GmbH. All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. Neither the name of the copyright holders nor the names of 00017 * contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00021 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00022 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00023 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00024 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00025 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00026 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00027 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00028 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00029 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00030 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00031 * SUCH DAMAGE. 00032 * 00033 * For additional information see http://www.ethernut.de/ 00034 */ 00035 00062 #include <cfg/fs.h> 00063 00064 #include <sys/types.h> 00065 #include <sys/file.h> 00066 #include <sys/device.h> 00067 00072 00076 typedef struct __attribute__ ((packed)) _PHATVBR { 00078 u_char boot_jump[3]; 00080 u_char boot_oem[8]; 00085 u_short bios_sectsz; 00087 u_char bios_clustsz; 00093 u_short bios_rsvd_sects; 00095 u_char bios_ntabs; 00097 u_short bios_rootsz; 00099 u_short bios_volsz; 00101 u_char bios_media; 00106 u_short bios_tabsz; 00108 u_short bios_sects_p_trk; 00110 u_short bios_heads; 00115 u_long bios_sects_hidd; 00120 u_long bios_volsz_big; 00121 00126 u_long bios_tabsz_big; 00133 u_short bios_xflags; 00135 u_short bios_fsver; 00137 u_long bios_root_clust; 00139 u_short bios_fsinfo; 00141 u_short bios_boot_bak; 00146 u_char bios_rsvd32[12]; 00147 00153 u_char boot_drive; 00155 u_char boot_rsvd_nt; 00160 u_char boot_xsig; 00162 u_long boot_vol_id; 00164 u_char boot_vol_lbl[11]; 00166 u_char boot_vol_fs[8]; 00167 } PHATVBR; 00168 00172 typedef struct _PHATSECTBUF { 00174 u_char *sect_data; 00176 u_long sect_num; 00178 int sect_dirty; 00179 } PHATSECTBUF; 00180 00184 typedef struct _PHATVOL { 00189 int vol_type; 00191 u_long vol_numfree; 00193 u_long vol_nxtfree; 00195 #if PHAT_SECTOR_BUFFERS 00196 PHATSECTBUF vol_buf[PHAT_SECTOR_BUFFERS]; 00198 int vol_usenext; 00199 #else 00200 PHATSECTBUF vol_buf[1]; 00201 #endif 00202 00203 HANDLE vol_fsmutex; 00205 HANDLE vol_iomutex; 00207 u_int vol_sectsz; 00209 u_int vol_clustsz; 00210 00212 u_long vol_tabsz; 00217 u_long vol_tab_sect[2]; 00218 00220 u_int vol_rootsz; 00222 u_long vol_root_sect; 00224 u_long vol_root_clust; 00225 00231 u_long vol_last_clust; 00236 u_long vol_data_sect; 00237 } PHATVOL; 00238 00241 __BEGIN_DECLS 00242 /* Prototypes */ 00243 extern int PhatVolMount(NUTDEVICE * dev, NUTFILE * blkmnt, u_char part_type); 00244 extern int PhatVolUnmount(NUTDEVICE * dev); 00245 extern u_long PhatClusterSector(NUTFILE * nfp, u_long clust); 00246 00247 __END_DECLS 00248 /* End of prototypes */ 00249 #endif