Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
nand_bbt.c File Reference
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/bbm.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/string.h>

Go to the source code of this file.




int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
int nand_update_bbt (struct mtd_info *mtd, loff_t offs)
int nand_default_bbt (struct mtd_info *mtd)
int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt)
 EXPORT_SYMBOL (nand_scan_bbt)
 EXPORT_SYMBOL (nand_default_bbt)
 EXPORT_SYMBOL_GPL (nand_update_bbt)

Macro Definition Documentation


Definition at line 1296 of file nand_bbt.c.

Function Documentation

EXPORT_SYMBOL ( nand_scan_bbt  )
EXPORT_SYMBOL ( nand_default_bbt  )
EXPORT_SYMBOL_GPL ( nand_update_bbt  )
int nand_default_bbt ( struct mtd_info mtd)

nand_default_bbt - [NAND Interface] Select a default bad block table for the device : MTD device structure

This function selects the default bad block table support for the device and calls the nand_scan_bbt function.

Definition at line 1332 of file nand_bbt.c.

int nand_isbad_bbt ( struct mtd_info mtd,
loff_t  offs,
int  allowbbt 

nand_isbad_bbt - [NAND Interface] Check if a block is bad : MTD device structure : offset in the device : allow access to bad block table region

Definition at line 1381 of file nand_bbt.c.

int nand_scan_bbt ( struct mtd_info mtd,
struct nand_bbt_descr bd 

nand_scan_bbt - [NAND Interface] scan, find, read and maybe create bad block table(s) : MTD device structure : descriptor for the good/bad block search pattern

The function checks, if a bad block table(s) is/are already available. If not it scans the device for manufacturer marked good / bad blocks and writes the bad block table(s) to the selected place.

The bad block table memory is allocated here. It must be freed by calling the nand_free_bbt function.

Definition at line 1121 of file nand_bbt.c.

int nand_update_bbt ( struct mtd_info mtd,
loff_t  offs 

nand_update_bbt - [NAND Interface] update bad block table(s) : MTD device structure : the offset of the newly marked block

The function updates the bad block table(s).

Definition at line 1189 of file nand_bbt.c.