yaffs-direct: Remove obsolete files
authorCharles Manning <cdhmanning@gmail.com>
Thu, 9 May 2013 07:29:54 +0000 (19:29 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Thu, 9 May 2013 07:29:54 +0000 (19:29 +1200)
Remove files no longer used with new device model.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
direct/test-framework/FrameworkRules.mk
direct/yaffs_nandif.c [deleted file]
direct/yaffs_nandif.h [deleted file]

index 3b6088a..d634793 100644 (file)
@@ -57,7 +57,7 @@ YAFFSDIRECTSYMLINKS =  \
           yaffscfg.h yaffs_qsort.c \
           yaffs_nandemul2k.h yaffs_list.h \
           yaffs_attribs.c \
-          yaffs_nandif.c yaffs_nandif.h yportenv.h \
+          yportenv.h \
           yaffs_hweight.c yaffs_hweight.h \
          yaffs_error.c \
           yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h \
diff --git a/direct/yaffs_nandif.c b/direct/yaffs_nandif.c
deleted file mode 100644 (file)
index 3f1de6d..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Charles Manning <charles@aleph1.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include "yportenv.h"
-#include "yaffs_guts.h"
-
-
-#include "yaffs_nandif.h"
-#include "yaffs_packedtags2.h"
-
-#include "yramsim.h"
-
-#include "yaffs_trace.h"
-#include "yaffsfs.h"
-
-
-/* NB For use with inband tags....
- * We assume that the data buffer is of size totalBytersPerChunk so that
- * we can also use it to load the tags.
- */
-int ynandif_WriteChunkWithTagsToNAND(struct yaffs_dev *dev, int nand_chunk,
-                                     const u8 *data,
-                                     const struct yaffs_ext_tags *tags)
-{
-
-       int retval = 0;
-       struct yaffs_packed_tags2 pt;
-       void *spare;
-       unsigned spareSize = 0;
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       yaffs_trace(YAFFS_TRACE_MTD,
-               "nandmtd2_WriteChunkWithTagsToNAND chunk %d data %p tags %p",
-               nand_chunk, data, tags);
-
-
-       /* For yaffs2 writing there must be both data and tags.
-        * If we're using inband tags, then the tags are stuffed into
-        * the end of the data buffer.
-        */
-
-       if (dev->param.inband_tags) {
-               struct yaffs_packed_tags2_tags_only *pt2tp;
-
-               pt2tp = (struct yaffs_packed_tags2_tags_only *)
-                       (data + dev->data_bytes_per_chunk);
-               yaffs_pack_tags2_tags_only(pt2tp, tags);
-               spare = NULL;
-               spareSize = 0;
-       } else {
-               yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);
-               spare = &pt;
-               spareSize = sizeof(struct yaffs_packed_tags2);
-       }
-
-       retval = geometry->writeChunk(dev, nand_chunk,
-                               data, dev->param.total_bytes_per_chunk,
-                               spare, spareSize);
-
-       return retval;
-}
-
-int ynandif_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev, int nand_chunk,
-                                      u8 *data, struct yaffs_ext_tags *tags)
-{
-       struct yaffs_packed_tags2 pt;
-       int localData = 0;
-       void *spare = NULL;
-       unsigned spareSize;
-       int retval = 0;
-       int eccStatus; /* 0 = ok, 1 = fixed, -1 = unfixed */
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       yaffs_trace(YAFFS_TRACE_MTD,
-               "nandmtd2_ReadChunkWithTagsFromNAND chunk %d data %p tags %p",
-               nand_chunk, data, tags);
-
-       if (!tags) {
-               spare = NULL;
-               spareSize = 0;
-       } else if (dev->param.inband_tags) {
-
-               if (!data) {
-                       localData = 1;
-                       data = yaffs_get_temp_buffer(dev);
-               }
-               spare = NULL;
-               spareSize = 0;
-       } else {
-               spare = &pt;
-               spareSize = sizeof(struct yaffs_packed_tags2);
-       }
-
-       retval = geometry->readChunk(dev, nand_chunk,
-                                data,
-                                data ? dev->param.total_bytes_per_chunk : 0,
-                                spare, spareSize,
-                                &eccStatus);
-
-       if (dev->param.inband_tags) {
-               if (tags) {
-                       struct yaffs_packed_tags2_tags_only *pt2tp;
-                       pt2tp = (struct yaffs_packed_tags2_tags_only *)
-                                       &data[dev->data_bytes_per_chunk];
-                       yaffs_unpack_tags2_tags_only(tags, pt2tp);
-               }
-       } else {
-               if (tags)
-                       yaffs_unpack_tags2(tags, &pt, !dev->param.no_tags_ecc);
-       }
-
-       if (tags && tags->chunk_used) {
-               if (eccStatus < 0 ||
-                  tags->ecc_result == YAFFS_ECC_RESULT_UNFIXED)
-                       tags->ecc_result = YAFFS_ECC_RESULT_UNFIXED;
-               else if (eccStatus > 0 ||
-                            tags->ecc_result == YAFFS_ECC_RESULT_FIXED)
-                       tags->ecc_result = YAFFS_ECC_RESULT_FIXED;
-               else
-                       tags->ecc_result = YAFFS_ECC_RESULT_NO_ERROR;
-       }
-
-       if (localData)
-               yaffs_release_temp_buffer(dev, data);
-
-       return retval;
-}
-
-int ynandif_MarkNANDBlockBad(struct yaffs_dev *dev, int blockId)
-{
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       return geometry->markBlockBad(dev, blockId);
-}
-
-int ynandif_EraseBlockInNAND(struct yaffs_dev *dev, int blockId)
-{
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       return geometry->eraseBlock(dev, blockId);
-
-}
-
-
-static int ynandif_IsBlockOk(struct yaffs_dev *dev, int blockId)
-{
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       return geometry->checkBlockOk(dev, blockId);
-}
-
-int ynandif_QueryNANDBlock(struct yaffs_dev *dev, int blockId,
-               enum yaffs_block_state *state, u32 *seq_number)
-{
-       unsigned chunkNo;
-       struct yaffs_ext_tags tags;
-
-       *seq_number = 0;
-
-       chunkNo = blockId * dev->param.chunks_per_block;
-
-       if (!ynandif_IsBlockOk(dev, blockId)) {
-               *state = YAFFS_BLOCK_STATE_DEAD;
-       } else {
-               ynandif_ReadChunkWithTagsFromNAND(dev, chunkNo, NULL, &tags);
-
-               if (!tags.chunk_used) {
-                       *state = YAFFS_BLOCK_STATE_EMPTY;
-               } else {
-                       *state = YAFFS_BLOCK_STATE_NEEDS_SCAN;
-                       *seq_number = tags.seq_number;
-               }
-       }
-
-       return YAFFS_OK;
-}
-
-
-int ynandif_InitialiseNAND(struct yaffs_dev *dev)
-{
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       geometry->initialise(dev);
-
-       return YAFFS_OK;
-}
-
-int ynandif_Deinitialise_flash_fn(struct yaffs_dev *dev)
-{
-       struct ynandif_Geometry *geometry = (struct ynandif_Geometry *)(dev->driver_context);
-
-       geometry->deinitialise(dev);
-
-       return YAFFS_OK;
-}
-
-
-struct yaffs_dev *
-       yaffs_add_dev_from_geometry(const YCHAR *name,
-                                       const struct ynandif_Geometry *geometry)
-{
-       YCHAR *clonedName = malloc(sizeof(YCHAR) *
-                               (strnlen(name, YAFFS_MAX_NAME_LENGTH)+1));
-       struct yaffs_dev *dev = malloc(sizeof(struct yaffs_dev));
-       struct yaffs_param *param;
-
-       if (dev && clonedName) {
-               memset(dev, 0, sizeof(struct yaffs_dev));
-               strcpy(clonedName, name);
-
-               param = &dev->param;
-
-               param->name = clonedName;
-               param->write_chunk_tags_fn = ynandif_WriteChunkWithTagsToNAND;
-               param->read_chunk_tags_fn = ynandif_ReadChunkWithTagsFromNAND;
-               param->erase_fn = ynandif_EraseBlockInNAND;
-               param->initialise_flash_fn = ynandif_InitialiseNAND;
-               param->query_block_fn = ynandif_QueryNANDBlock;
-               param->bad_block_fn = ynandif_MarkNANDBlockBad;
-               param->n_caches = 20;
-               param->start_block = geometry->start_block;
-               param->end_block   = geometry->end_block;
-               param->total_bytes_per_chunk  = geometry->dataSize;
-               param->spare_bytes_per_chunk  = geometry->spareSize;
-               param->inband_tags                = geometry->inband_tags;
-               param->chunks_per_block   = geometry->pagesPerBlock;
-               param->use_nand_ecc               = geometry->hasECC;
-               param->is_yaffs2                  = geometry->useYaffs2;
-               param->n_reserved_blocks          = 5;
-               dev->driver_context               = (void *)geometry;
-
-               yaffs_add_device(dev);
-
-               return dev;
-       }
-
-       free(dev);
-       free(clonedName);
-
-       return NULL;
-}
-
diff --git a/direct/yaffs_nandif.h b/direct/yaffs_nandif.h
deleted file mode 100644 (file)
index e780f7f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
- *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
- *
- * Created by Charles Manning <charles@aleph1.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
- *
- * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
- */
-
-
-#ifndef __YNANDIF_H__
-#define __YNANDIF_H__
-
-#include "yaffs_guts.h"
-
-struct ynandif_Geometry {
-       unsigned start_block;
-       unsigned end_block;
-       unsigned dataSize;
-       unsigned spareSize;
-       unsigned pagesPerBlock;
-       unsigned hasECC;
-       unsigned inband_tags;
-       unsigned useYaffs2;
-
-       int (*initialise)(struct yaffs_dev *dev);
-       int (*deinitialise)(struct yaffs_dev *dev);
-
-       int (*readChunk) (struct yaffs_dev *dev,
-                                         unsigned pageId,
-                                         unsigned char *data,
-                                         unsigned dataLength,
-                                         unsigned char *spare,
-                                         unsigned spareLength,
-                                         int *eccStatus);
-       /* ECC status is set to 0 for OK, 1 for fixed, -1 for unfixed. */
-
-       int (*writeChunk)(struct yaffs_dev *dev,
-                                         unsigned pageId,
-                                         const unsigned char *data,
-                                         unsigned dataLength,
-                                         const unsigned char *spare,
-                                         unsigned spareLength);
-
-       int (*eraseBlock)(struct yaffs_dev *dev, unsigned blockId);
-
-       int (*checkBlockOk)(struct yaffs_dev *dev, unsigned blockId);
-       int (*markBlockBad)(struct yaffs_dev *dev, unsigned blockId);
-
-       void *privateData;
-
-};
-
-struct yaffs_dev *
-       yaffs_add_dev_from_geometry(const YCHAR *name,
-                                       const struct ynandif_Geometry *geometry);
-
-
-#endif