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

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

Version: ~ [ linux-6.1-rc5 ] ~ [ linux-6.0.8 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.78 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.154 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.224 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.265 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.299 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.333 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright © 2011 Ivan Djelic <ivan.djelic@parrot.com>
  4  *
  5  * This file is the header for the NAND BCH ECC implementation.
  6  */
  7 
  8 #ifndef __MTD_NAND_BCH_H__
  9 #define __MTD_NAND_BCH_H__
 10 
 11 struct mtd_info;
 12 struct nand_chip;
 13 struct nand_bch_control;
 14 
 15 #if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)
 16 
 17 static inline int mtd_nand_has_bch(void) { return 1; }
 18 
 19 /*
 20  * Calculate BCH ecc code
 21  */
 22 int nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
 23                            u_char *ecc_code);
 24 
 25 /*
 26  * Detect and correct bit errors
 27  */
 28 int nand_bch_correct_data(struct nand_chip *chip, u_char *dat,
 29                           u_char *read_ecc, u_char *calc_ecc);
 30 /*
 31  * Initialize BCH encoder/decoder
 32  */
 33 struct nand_bch_control *nand_bch_init(struct mtd_info *mtd);
 34 /*
 35  * Release BCH encoder/decoder resources
 36  */
 37 void nand_bch_free(struct nand_bch_control *nbc);
 38 
 39 #else /* !CONFIG_MTD_NAND_ECC_SW_BCH */
 40 
 41 static inline int mtd_nand_has_bch(void) { return 0; }
 42 
 43 static inline int
 44 nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
 45                        u_char *ecc_code)
 46 {
 47         return -1;
 48 }
 49 
 50 static inline int
 51 nand_bch_correct_data(struct nand_chip *chip, unsigned char *buf,
 52                       unsigned char *read_ecc, unsigned char *calc_ecc)
 53 {
 54         return -ENOTSUPP;
 55 }
 56 
 57 static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd)
 58 {
 59         return NULL;
 60 }
 61 
 62 static inline void nand_bch_free(struct nand_bch_control *nbc) {}
 63 
 64 #endif /* CONFIG_MTD_NAND_ECC_SW_BCH */
 65 
 66 #endif /* __MTD_NAND_BCH_H__ */
 67 

~ [ 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