Lines Matching refs:oob

151 static int sm_read_lba(struct sm_oob *oob)  in sm_read_lba()  argument
160 if (!memcmp(oob, erased_pattern, SM_OOB_SIZE)) in sm_read_lba()
164 lba_test = *(uint16_t *)oob->lba_copy1 ^ *(uint16_t*)oob->lba_copy2; in sm_read_lba()
169 lba = sm_get_lba(oob->lba_copy1); in sm_read_lba()
172 lba = sm_get_lba(oob->lba_copy2); in sm_read_lba()
177 static void sm_write_lba(struct sm_oob *oob, uint16_t lba) in sm_write_lba() argument
189 oob->lba_copy1[0] = oob->lba_copy2[0] = tmp[0]; in sm_write_lba()
190 oob->lba_copy1[1] = oob->lba_copy2[1] = tmp[1]; in sm_write_lba()
219 static int sm_correct_sector(uint8_t *buffer, struct sm_oob *oob) in sm_correct_sector() argument
224 if (__nand_correct_data(buffer, ecc, oob->ecc1, SM_SMALL_PAGE) < 0) in sm_correct_sector()
230 if (__nand_correct_data(buffer, ecc, oob->ecc2, SM_SMALL_PAGE) < 0) in sm_correct_sector()
238 uint8_t *buffer, struct sm_oob *oob) in sm_read_sector() argument
253 if (!oob) in sm_read_sector()
254 oob = &tmp_oob; in sm_read_sector()
259 ops.oobbuf = (void *)oob; in sm_read_sector()
288 if (oob->reserved != 0xFFFFFFFF && !is_power_of_2(~oob->reserved)) in sm_read_sector()
299 if (!sm_sector_valid(oob)) { in sm_read_sector()
307 (ftl->smallpagenand && sm_correct_sector(buffer, oob))) { in sm_read_sector()
320 uint8_t *buffer, struct sm_oob *oob) in sm_write_sector() argument
341 ops.oobbuf = (void *)oob; in sm_write_sector()
369 struct sm_oob oob; in sm_write_block() local
374 memset(&oob, 0xFF, SM_OOB_SIZE); in sm_write_block()
375 sm_write_lba(&oob, lba); in sm_write_block()
383 oob.data_status = 0xFF; in sm_write_block()
391 oob.data_status = 0; in sm_write_block()
396 SM_SMALL_PAGE, oob.ecc1); in sm_write_block()
399 SM_SMALL_PAGE, oob.ecc2); in sm_write_block()
402 buf + boffset, &oob)) in sm_write_block()
430 struct sm_oob oob; in sm_mark_block_bad() local
433 memset(&oob, 0xFF, SM_OOB_SIZE); in sm_mark_block_bad()
434 oob.block_status = 0xF0; in sm_mark_block_bad()
448 sm_write_sector(ftl, zone, block, boffset, NULL, &oob); in sm_mark_block_bad()
513 struct sm_oob oob; in sm_check_block() local
526 if (sm_read_sector(ftl, zone, block, boffset, NULL, &oob)) in sm_check_block()
529 test_lba = sm_read_lba(&oob); in sm_check_block()
668 struct sm_oob oob; in sm_read_cis() local
671 0, ftl->cis_block, ftl->cis_boffset, ftl->cis_buffer, &oob)) in sm_read_cis()
674 if (!sm_sector_valid(&oob) || !sm_block_valid(&oob)) in sm_read_cis()
688 struct sm_oob oob; in sm_find_cis() local
696 if (sm_read_sector(ftl, 0, block, 0, NULL, &oob)) in sm_find_cis()
699 if (!sm_block_valid(&oob)) in sm_find_cis()
712 if (sm_read_sector(ftl, 0, block, boffset, NULL, &oob)) in sm_find_cis()
715 if (!sm_sector_valid(&oob)) in sm_find_cis()
761 struct sm_oob oob; in sm_init_zone() local
791 if (sm_read_sector(ftl, zone_num, block, 0, NULL, &oob)) in sm_init_zone()
796 if (sm_block_erased(&oob)) { in sm_init_zone()
806 if (!sm_block_valid(&oob)) { in sm_init_zone()
812 lba = sm_read_lba(&oob); in sm_init_zone()