~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mtd/nand_bch.h

Version: ~ [ linux-6.1-rc7 ] ~ [ linux-6.0.10 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.80 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.156 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.225 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.267 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.300 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.334 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright © 2011 Ivan Djelic <ivan.djelic@parrot.com>
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  *
  8  * This file is the header for the NAND BCH ECC implementation.
  9  */
 10 
 11 #ifndef __MTD_NAND_BCH_H__
 12 #define __MTD_NAND_BCH_H__
 13 
 14 struct mtd_info;
 15 struct nand_bch_control;
 16 
 17 #if defined(CONFIG_MTD_NAND_ECC_BCH)
 18 
 19 static inline int mtd_nand_has_bch(void) { return 1; }
 20 
 21 /*
 22  * Calculate BCH ecc code
 23  */
 24 int nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
 25                            u_char *ecc_code);
 26 
 27 /*
 28  * Detect and correct bit errors
 29  */
 30 int nand_bch_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc,
 31                           u_char *calc_ecc);
 32 /*
 33  * Initialize BCH encoder/decoder
 34  */
 35 struct nand_bch_control *nand_bch_init(struct mtd_info *mtd);
 36 /*
 37  * Release BCH encoder/decoder resources
 38  */
 39 void nand_bch_free(struct nand_bch_control *nbc);
 40 
 41 #else /* !CONFIG_MTD_NAND_ECC_BCH */
 42 
 43 static inline int mtd_nand_has_bch(void) { return 0; }
 44 
 45 static inline int
 46 nand_bch_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
 47                        u_char *ecc_code)
 48 {
 49         return -1;
 50 }
 51 
 52 static inline int
 53 nand_bch_correct_data(struct mtd_info *mtd, unsigned char *buf,
 54                       unsigned char *read_ecc, unsigned char *calc_ecc)
 55 {
 56         return -ENOTSUPP;
 57 }
 58 
 59 static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
 60 {
 61         return NULL;
 62 }
 63 
 64 static inline void nand_bch_free(struct nand_bch_control *nbc) {}
 65 
 66 #endif /* CONFIG_MTD_NAND_ECC_BCH */
 67 
 68 #endif /* __MTD_NAND_BCH_H__ */
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp