Lines Matching refs:this

173 	struct nand_chip *this = mtd_to_nand(mtd);  in read_bbt()  local
183 from = ((loff_t)page) << this->page_shift; in read_bbt()
186 len = min(totlen, (size_t)(1 << this->bbt_erase_shift)); in read_bbt()
222 this->bbt_erase_shift); in read_bbt()
223 bbt_mark_entry(this, offs + act, in read_bbt()
234 this->bbt_erase_shift); in read_bbt()
237 bbt_mark_entry(this, offs + act, in read_bbt()
240 bbt_mark_entry(this, offs + act, in read_bbt()
264 struct nand_chip *this = mtd_to_nand(mtd); in read_abs_bbt() local
269 for (i = 0; i < this->numchips; i++) { in read_abs_bbt()
272 this->chipsize >> this->bbt_erase_shift, in read_abs_bbt()
276 offs += this->chipsize >> this->bbt_erase_shift; in read_abs_bbt()
280 mtd->size >> this->bbt_erase_shift, td, 0); in read_abs_bbt()
389 struct nand_chip *this = mtd_to_nand(mtd); in read_abs_bbts() local
393 scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift, in read_abs_bbts()
402 scan_read(mtd, buf, (loff_t)md->pages[0] << this->page_shift, in read_abs_bbts()
455 struct nand_chip *this = mtd_to_nand(mtd); in create_bbt() local
468 numblocks = mtd->size >> this->bbt_erase_shift; in create_bbt()
472 if (chip >= this->numchips) { in create_bbt()
474 chip + 1, this->numchips); in create_bbt()
477 numblocks = this->chipsize >> this->bbt_erase_shift; in create_bbt()
480 from = (loff_t)startblock << this->bbt_erase_shift; in create_bbt()
483 if (this->bbt_options & NAND_BBT_SCANLASTPAGE) in create_bbt()
490 if (this->block_bad) in create_bbt()
491 ret = this->block_bad(mtd, from); in create_bbt()
498 bbt_mark_entry(this, i, BBT_BLOCK_FACTORY_BAD); in create_bbt()
504 from += (1 << this->bbt_erase_shift); in create_bbt()
526 struct nand_chip *this = mtd_to_nand(mtd); in search_bbt() local
531 int blocktopage = this->bbt_erase_shift - this->page_shift; in search_bbt()
535 startblock = (mtd->size >> this->bbt_erase_shift) - 1; in search_bbt()
544 chips = this->numchips; in search_bbt()
545 bbtblocks = this->chipsize >> this->bbt_erase_shift; in search_bbt()
549 bbtblocks = mtd->size >> this->bbt_erase_shift; in search_bbt()
560 loff_t offs = (loff_t)actblock << this->bbt_erase_shift; in search_bbt()
573 startblock += this->chipsize >> this->bbt_erase_shift; in search_bbt()
621 struct nand_chip *this = mtd_to_nand(mtd); in write_bbt() local
641 numblocks = (int)(this->chipsize >> this->bbt_erase_shift); in write_bbt()
644 nrchips = this->numchips; in write_bbt()
650 numblocks = (int)(mtd->size >> this->bbt_erase_shift); in write_bbt()
681 switch (bbt_get_entry(this, block)) { in write_bbt()
687 (this->bbt_erase_shift - this->page_shift); in write_bbt()
715 to = ((loff_t)page) << this->page_shift; in write_bbt()
720 to &= ~(((loff_t)1 << this->bbt_erase_shift) - 1); in write_bbt()
721 len = 1 << this->bbt_erase_shift; in write_bbt()
731 ops.ooblen = (len >> this->page_shift) * mtd->oobsize; in write_bbt()
738 pageoffs = page - (int)(to >> this->page_shift); in write_bbt()
739 offs = pageoffs << this->page_shift; in write_bbt()
766 (len >> this->page_shift)* mtd->oobsize); in write_bbt()
780 dat = bbt_get_entry(this, chip * numblocks + i); in write_bbt()
788 einfo.len = 1 << this->bbt_erase_shift; in write_bbt()
822 struct nand_chip *this = mtd_to_nand(mtd); in nand_memory_bbt() local
824 return create_bbt(mtd, this->buffers->databuf, bd, -1); in nand_memory_bbt()
841 struct nand_chip *this = mtd_to_nand(mtd); in check_create() local
842 struct nand_bbt_descr *td = this->bbt_td; in check_create()
843 struct nand_bbt_descr *md = this->bbt_md; in check_create()
848 chips = this->numchips; in check_create()
897 if (!(this->bbt_options & NAND_BBT_CREATE_EMPTY)) in check_create()
965 struct nand_chip *this = mtd_to_nand(mtd); in mark_bbt_region() local
971 chips = this->numchips; in mark_bbt_region()
972 nrblocks = (int)(this->chipsize >> this->bbt_erase_shift); in mark_bbt_region()
975 nrblocks = (int)(mtd->size >> this->bbt_erase_shift); in mark_bbt_region()
983 block = td->pages[i] >> (this->bbt_erase_shift - this->page_shift); in mark_bbt_region()
984 oldval = bbt_get_entry(this, block); in mark_bbt_region()
985 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
989 this->bbt_erase_shift); in mark_bbt_region()
998 oldval = bbt_get_entry(this, block); in mark_bbt_region()
999 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
1011 this->bbt_erase_shift); in mark_bbt_region()
1025 struct nand_chip *this = mtd_to_nand(mtd); in verify_bbt_descr() local
1036 BUG_ON((this->bbt_options & NAND_BBT_NO_OOB) && in verify_bbt_descr()
1037 !(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1044 BUG_ON(!(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1045 BUG_ON(!(this->bbt_options & NAND_BBT_NO_OOB)); in verify_bbt_descr()
1053 table_size = this->chipsize >> this->bbt_erase_shift; in verify_bbt_descr()
1055 table_size = mtd->size >> this->bbt_erase_shift; in verify_bbt_descr()
1060 BUG_ON(table_size > (1 << this->bbt_erase_shift)); in verify_bbt_descr()
1077 struct nand_chip *this = mtd_to_nand(mtd); in nand_scan_bbt() local
1080 struct nand_bbt_descr *td = this->bbt_td; in nand_scan_bbt()
1081 struct nand_bbt_descr *md = this->bbt_md; in nand_scan_bbt()
1083 len = (mtd->size >> (this->bbt_erase_shift + 2)) ? : 1; in nand_scan_bbt()
1088 this->bbt = kzalloc(len, GFP_KERNEL); in nand_scan_bbt()
1089 if (!this->bbt) in nand_scan_bbt()
1107 len = (1 << this->bbt_erase_shift); in nand_scan_bbt()
1108 len += (len >> this->page_shift) * mtd->oobsize; in nand_scan_bbt()
1136 kfree(this->bbt); in nand_scan_bbt()
1137 this->bbt = NULL; in nand_scan_bbt()
1150 struct nand_chip *this = mtd_to_nand(mtd); in nand_update_bbt() local
1154 struct nand_bbt_descr *td = this->bbt_td; in nand_update_bbt()
1155 struct nand_bbt_descr *md = this->bbt_md; in nand_update_bbt()
1157 if (!this->bbt || !td) in nand_update_bbt()
1161 len = (1 << this->bbt_erase_shift); in nand_update_bbt()
1162 len += (len >> this->page_shift) * mtd->oobsize; in nand_update_bbt()
1169 chip = (int)(offs >> this->chip_shift); in nand_update_bbt()
1256 static int nand_create_badblock_pattern(struct nand_chip *this) in nand_create_badblock_pattern() argument
1259 if (this->badblock_pattern) { in nand_create_badblock_pattern()
1266 bd->options = this->bbt_options & BADBLOCK_SCAN_MASK; in nand_create_badblock_pattern()
1267 bd->offs = this->badblockpos; in nand_create_badblock_pattern()
1268 bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1; in nand_create_badblock_pattern()
1271 this->badblock_pattern = bd; in nand_create_badblock_pattern()
1284 struct nand_chip *this = mtd_to_nand(mtd); in nand_default_bbt() local
1288 if (this->bbt_options & NAND_BBT_USE_FLASH) { in nand_default_bbt()
1290 if (!this->bbt_td) { in nand_default_bbt()
1291 if (this->bbt_options & NAND_BBT_NO_OOB) { in nand_default_bbt()
1292 this->bbt_td = &bbt_main_no_oob_descr; in nand_default_bbt()
1293 this->bbt_md = &bbt_mirror_no_oob_descr; in nand_default_bbt()
1295 this->bbt_td = &bbt_main_descr; in nand_default_bbt()
1296 this->bbt_md = &bbt_mirror_descr; in nand_default_bbt()
1300 this->bbt_td = NULL; in nand_default_bbt()
1301 this->bbt_md = NULL; in nand_default_bbt()
1304 if (!this->badblock_pattern) { in nand_default_bbt()
1305 ret = nand_create_badblock_pattern(this); in nand_default_bbt()
1310 return nand_scan_bbt(mtd, this->badblock_pattern); in nand_default_bbt()
1320 struct nand_chip *this = mtd_to_nand(mtd); in nand_isreserved_bbt() local
1323 block = (int)(offs >> this->bbt_erase_shift); in nand_isreserved_bbt()
1324 return bbt_get_entry(this, block) == BBT_BLOCK_RESERVED; in nand_isreserved_bbt()
1335 struct nand_chip *this = mtd_to_nand(mtd); in nand_isbad_bbt() local
1338 block = (int)(offs >> this->bbt_erase_shift); in nand_isbad_bbt()
1339 res = bbt_get_entry(this, block); in nand_isbad_bbt()
1362 struct nand_chip *this = mtd_to_nand(mtd); in nand_markbad_bbt() local
1365 block = (int)(offs >> this->bbt_erase_shift); in nand_markbad_bbt()
1368 bbt_mark_entry(this, block, BBT_BLOCK_WORN); in nand_markbad_bbt()
1371 if (this->bbt_options & NAND_BBT_USE_FLASH) in nand_markbad_bbt()