Lines Matching defs:nand
20 #include <linux/mtd/nand.h>
21 #include <linux/mtd/nand-ecc-sw-hamming.h>
358 * @nand: NAND device
362 int nand_ecc_sw_hamming_calculate(struct nand_device *nand,
365 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv;
366 unsigned int step_size = nand->ecc.ctx.conf.step_size;
447 * @nand: NAND device
454 int nand_ecc_sw_hamming_correct(struct nand_device *nand, unsigned char *buf,
458 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv;
459 unsigned int step_size = nand->ecc.ctx.conf.step_size;
467 int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand)
469 struct nand_ecc_props *conf = &nand->ecc.ctx.conf;
471 struct mtd_info *mtd = nanddev_to_mtd(nand);
492 conf->step_size = nand->ecc.user_conf.step_size;
503 ret = nand_ecc_init_req_tweaking(&engine_conf->req_ctx, nand);
515 nand->ecc.ctx.priv = engine_conf;
516 nand->ecc.ctx.nsteps = mtd->writesize / conf->step_size;
517 nand->ecc.ctx.total = nand->ecc.ctx.nsteps * engine_conf->code_size;
532 void nand_ecc_sw_hamming_cleanup_ctx(struct nand_device *nand)
534 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv;
545 static int nand_ecc_sw_hamming_prepare_io_req(struct nand_device *nand,
548 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv;
549 struct mtd_info *mtd = nanddev_to_mtd(nand);
550 int eccsize = nand->ecc.ctx.conf.step_size;
552 int eccsteps = nand->ecc.ctx.nsteps;
553 int total = nand->ecc.ctx.total;
576 nand_ecc_sw_hamming_calculate(nand, data, &ecccalc[i]);
582 static int nand_ecc_sw_hamming_finish_io_req(struct nand_device *nand,
585 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv;
586 struct mtd_info *mtd = nanddev_to_mtd(nand);
587 int eccsize = nand->ecc.ctx.conf.step_size;
588 int total = nand->ecc.ctx.total;
590 int eccsteps = nand->ecc.ctx.nsteps;
619 nand_ecc_sw_hamming_calculate(nand, data, &ecccalc[i]);
622 for (eccsteps = nand->ecc.ctx.nsteps, i = 0, data = req->databuf.in;
625 int stat = nand_ecc_sw_hamming_correct(nand, data,