Lines Matching refs:meminfo
78 static void dump_bad(struct mtd_info_user *meminfo, unsigned len, int oob) in dump_bad() argument
80 unsigned char buf[meminfo->writesize]; in dump_bad()
84 len = ((len - 1) | (meminfo->writesize - 1)) + 1; in dump_bad()
87 for (count = 0; count < len; count += meminfo->writesize) { in dump_bad()
88 xwrite(STDOUT_FILENO, buf, meminfo->writesize); in dump_bad()
90 xwrite(STDOUT_FILENO, buf, meminfo->oobsize); in dump_bad()
94 static unsigned next_good_eraseblock(int fd, struct mtd_info_user *meminfo, in next_good_eraseblock() argument
100 if (block_offset >= meminfo->size) { in next_good_eraseblock()
111 block_offset += meminfo->erasesize; in next_good_eraseblock()
126 struct mtd_info_user meminfo; in nandwrite_main() local
151 xioctl(fd, MEMGETINFO, &meminfo); in nandwrite_main()
159 if (length < meminfo.size - mtdoffset) in nandwrite_main()
172 meminfo_writesize = meminfo.writesize; in nandwrite_main()
178 oobbuf = xmalloc(meminfo.oobsize); in nandwrite_main()
181 oob.length = meminfo.oobsize; in nandwrite_main()
184 blockstart = mtdoffset & ~(meminfo.erasesize - 1); in nandwrite_main()
191 tmp = next_good_eraseblock(fd, &meminfo, blockstart); in nandwrite_main()
197 dump_bad(&meminfo, bad_len, opts & OPT_o); in nandwrite_main()
209 limit = MIN(meminfo.size, end_addr); in nandwrite_main()
214 blockstart = mtdoffset & ~(meminfo.erasesize - 1); in nandwrite_main()
217 mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart); in nandwrite_main()
224 dump_bad(&meminfo, bad_len, opts & OPT_o); in nandwrite_main()
231 limit = MIN(meminfo.size, end_addr); in nandwrite_main()
262 xwrite(output_fd, oobbuf, meminfo.oobsize); in nandwrite_main()