yaffsfs: Add commenting for OS glue interface
[yaffs2.git] / direct / test-framework / nandsim_file.c
1 /*
2  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
3  *
4  * Copyright (C) 2010-2011 Aleph One Ltd.
5  *
6  * Created by Charles Manning <charles@aleph1.co.uk>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12
13 #include "nandsim_file.h"
14 #include "nandstore_file.h"
15 #include "nandsim.h"
16 #include <unistd.h>
17
18
19 struct nand_chip *nandsim_file_init(const char *fname,
20                                 int blocks,
21                                 int pages_per_block,
22                                 int data_bytes_per_page,
23                                 int spare_bytes_per_page,
24                                 int bus_width_shift)
25 {
26         struct nand_store *store = NULL;
27         struct nand_chip *chip = NULL;
28
29         store = nandstore_file_init(fname, blocks, pages_per_block,
30                                         data_bytes_per_page,
31                                         spare_bytes_per_page);
32         if(store)
33                 chip = nandsim_init(store, bus_width_shift);
34
35         if(chip)
36                 return chip;
37
38         if(store){
39                 /* tear down */
40         }
41         return NULL;
42 }