summaryrefslogtreecommitdiffstats
path: root/fs/fdos/fs.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-02-21 08:42:02 -0500
committerTom Rini <trini@ti.com>2014-02-21 08:42:47 -0500
commit1530f6f51ada57a9dd24f07d0f0955a8bf84c7b8 (patch)
tree7ef1cae3c3199b896044e9308494155b1f9dbced /fs/fdos/fs.c
parent4c89a369c7cd6e7ad3adec4601cfa69fec476164 (diff)
downloadtalos-obmc-uboot-1530f6f51ada57a9dd24f07d0f0955a8bf84c7b8.tar.gz
talos-obmc-uboot-1530f6f51ada57a9dd24f07d0f0955a8bf84c7b8.zip
fs/fdos: Remove
We have an unused FAT implementation in fs/fdos, remove. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'fs/fdos/fs.c')
-rw-r--r--fs/fdos/fs.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/fs/fdos/fs.c b/fs/fdos/fs.c
deleted file mode 100644
index 39d3eae20d..0000000000
--- a/fs/fdos/fs.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * (C) Copyright 2002
- * Stäubli Faverges - <www.staubli.com>
- * Pierre AUBERT p.aubert@staubli.com
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <config.h>
-#include <malloc.h>
-
-#include "dos.h"
-#include "fdos.h"
-
-
-/*-----------------------------------------------------------------------------
- * fill_fs -- Read info on file system
- *-----------------------------------------------------------------------------
- */
-static int fill_fs (BootSector_t *boot, Fs_t *fs)
-{
-
- fs -> fat_start = __le16_to_cpu (boot -> nrsvsect);
- fs -> fat_len = __le16_to_cpu (boot -> fatlen);
- fs -> nb_fat = boot -> nfat;
-
- fs -> dir_start = fs -> fat_start + fs -> nb_fat * fs -> fat_len;
- fs -> dir_len = __le16_to_cpu (boot -> dirents) * MDIR_SIZE / SZ_STD_SECTOR;
- fs -> cluster_size = boot -> clsiz;
- fs -> num_clus = (fs -> tot_sectors - fs -> dir_start - fs -> dir_len) / fs -> cluster_size;
-
- return (0);
-}
-
-/*-----------------------------------------------------------------------------
- * fs_init --
- *-----------------------------------------------------------------------------
- */
-int fs_init (Fs_t *fs)
-{
- BootSector_t *boot;
-
- /* Initialize physical device */
- if (dev_open () < 0) {
- PRINTF ("Unable to initialize the fdc\n");
- return (-1);
- }
- init_subdir ();
-
- /* Allocate space for read the boot sector */
- if ((boot = (BootSector_t *)malloc (sizeof (BootSector_t))) == NULL) {
- PRINTF ("Unable to allocate space for boot sector\n");
- return (-1);
- }
-
- /* read boot sector */
- if (dev_read (boot, 0, 1)){
- PRINTF ("Error during boot sector read\n");
- free (boot);
- return (-1);
- }
-
- /* we verify it'a a DOS diskette */
- if (boot -> jump [0] != JUMP_0_1 && boot -> jump [0] != JUMP_0_2) {
- PRINTF ("Not a DOS diskette\n");
- free (boot);
- return (-1);
- }
-
- if (boot -> descr < MEDIA_STD) {
- /* We handle only recent medias (type F0) */
- PRINTF ("unrecognized diskette type\n");
- free (boot);
- return (-1);
- }
-
- if (check_dev (boot, fs) < 0) {
- PRINTF ("Bad diskette\n");
- free (boot);
- return (-1);
- }
-
- if (fill_fs (boot, fs) < 0) {
- free (boot);
-
- return (-1);
- }
-
- /* Read FAT */
- if (read_fat (boot, fs) < 0) {
- free (boot);
- return (-1);
- }
-
- free (boot);
- return (0);
-}
OpenPOWER on IntegriCloud