Lines Matching refs:engine_conf

26 	struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv;  in nand_ecc_sw_bch_calculate()  local
29 memset(code, 0, engine_conf->code_size); in nand_ecc_sw_bch_calculate()
30 bch_encode(engine_conf->bch, buf, nand->ecc.ctx.conf.step_size, code); in nand_ecc_sw_bch_calculate()
33 for (i = 0; i < engine_conf->code_size; i++) in nand_ecc_sw_bch_calculate()
34 code[i] ^= engine_conf->eccmask[i]; in nand_ecc_sw_bch_calculate()
52 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_correct() local
54 unsigned int *errloc = engine_conf->errloc; in nand_ecc_sw_bch_correct()
57 count = bch_decode(engine_conf->bch, NULL, step_size, read_ecc, in nand_ecc_sw_bch_correct()
84 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_cleanup() local
86 bch_free(engine_conf->bch); in nand_ecc_sw_bch_cleanup()
87 kfree(engine_conf->errloc); in nand_ecc_sw_bch_cleanup()
88 kfree(engine_conf->eccmask); in nand_ecc_sw_bch_cleanup()
110 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_init() local
112 unsigned int eccbytes = engine_conf->code_size; in nand_ecc_sw_bch_init()
120 engine_conf->bch = bch_init(m, t, 0, false); in nand_ecc_sw_bch_init()
121 if (!engine_conf->bch) in nand_ecc_sw_bch_init()
124 engine_conf->eccmask = kzalloc(eccbytes, GFP_KERNEL); in nand_ecc_sw_bch_init()
125 engine_conf->errloc = kmalloc_array(t, sizeof(*engine_conf->errloc), in nand_ecc_sw_bch_init()
127 if (!engine_conf->eccmask || !engine_conf->errloc) { in nand_ecc_sw_bch_init()
140 bch_encode(engine_conf->bch, erased_page, eccsize, in nand_ecc_sw_bch_init()
141 engine_conf->eccmask); in nand_ecc_sw_bch_init()
145 engine_conf->eccmask[i] ^= 0xff; in nand_ecc_sw_bch_init()
148 if (engine_conf->bch->ecc_bytes != eccbytes) { in nand_ecc_sw_bch_init()
150 eccbytes, engine_conf->bch->ecc_bytes); in nand_ecc_sw_bch_init()
174 struct nand_ecc_sw_bch_conf *engine_conf; in nand_ecc_sw_bch_init_ctx() local
230 engine_conf = kzalloc(sizeof(*engine_conf), GFP_KERNEL); in nand_ecc_sw_bch_init_ctx()
231 if (!engine_conf) in nand_ecc_sw_bch_init_ctx()
234 ret = nand_ecc_init_req_tweaking(&engine_conf->req_ctx, nand); in nand_ecc_sw_bch_init_ctx()
238 engine_conf->code_size = code_size; in nand_ecc_sw_bch_init_ctx()
239 engine_conf->calc_buf = kzalloc(mtd->oobsize, GFP_KERNEL); in nand_ecc_sw_bch_init_ctx()
240 engine_conf->code_buf = kzalloc(mtd->oobsize, GFP_KERNEL); in nand_ecc_sw_bch_init_ctx()
241 if (!engine_conf->calc_buf || !engine_conf->code_buf) { in nand_ecc_sw_bch_init_ctx()
246 nand->ecc.ctx.priv = engine_conf; in nand_ecc_sw_bch_init_ctx()
256 nand->ecc.ctx.nsteps * engine_conf->code_size) { in nand_ecc_sw_bch_init_ctx()
267 nand_ecc_cleanup_req_tweaking(&engine_conf->req_ctx); in nand_ecc_sw_bch_init_ctx()
268 kfree(engine_conf->calc_buf); in nand_ecc_sw_bch_init_ctx()
269 kfree(engine_conf->code_buf); in nand_ecc_sw_bch_init_ctx()
271 kfree(engine_conf); in nand_ecc_sw_bch_init_ctx()
279 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_cleanup_ctx() local
281 if (engine_conf) { in nand_ecc_sw_bch_cleanup_ctx()
283 nand_ecc_cleanup_req_tweaking(&engine_conf->req_ctx); in nand_ecc_sw_bch_cleanup_ctx()
284 kfree(engine_conf->calc_buf); in nand_ecc_sw_bch_cleanup_ctx()
285 kfree(engine_conf->code_buf); in nand_ecc_sw_bch_cleanup_ctx()
286 kfree(engine_conf); in nand_ecc_sw_bch_cleanup_ctx()
294 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_prepare_io_req() local
297 int eccbytes = engine_conf->code_size; in nand_ecc_sw_bch_prepare_io_req()
300 u8 *ecccalc = engine_conf->calc_buf; in nand_ecc_sw_bch_prepare_io_req()
312 nand_ecc_tweak_req(&engine_conf->req_ctx, req); in nand_ecc_sw_bch_prepare_io_req()
331 struct nand_ecc_sw_bch_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_bch_finish_io_req() local
335 int eccbytes = engine_conf->code_size; in nand_ecc_sw_bch_finish_io_req()
337 u8 *ecccalc = engine_conf->calc_buf; in nand_ecc_sw_bch_finish_io_req()
338 u8 *ecccode = engine_conf->code_buf; in nand_ecc_sw_bch_finish_io_req()
353 nand_ecc_restore_req(&engine_conf->req_ctx, req); in nand_ecc_sw_bch_finish_io_req()
382 nand_ecc_restore_req(&engine_conf->req_ctx, req); in nand_ecc_sw_bch_finish_io_req()