Lines Matching full:mtdinfo
45 struct mtd_info_user mtdinfo;
125 ret = ioctl(fd, MEMGETINFO, &mtdinfo);
133 printf("size: %u\n", mtdinfo.size);
134 printf("erase size: %u\n", mtdinfo.erasesize);
135 printf("write size: %u\n", mtdinfo.writesize);
136 printf("oob size: %u\n", mtdinfo.oobsize);
139 buffer = malloc(mtdinfo.writesize + mtdinfo.oobsize + spare_size);
142 mtdinfo.writesize + mtdinfo.oobsize);
146 oobbuf.length = mtdinfo.oobsize;
147 oob_data = (uint32_t *)((uint8_t *)buffer + mtdinfo.writesize);
148 memset(oob_data, 0xff, mtdinfo.oobsize + spare_size);
180 rawmode = mtdinfo.oobsize;
189 end = len ? (start + len) : mtdinfo.size;
190 for (pos = start, opos = 0; pos < end; pos += mtdinfo.writesize) {
195 ret = read(fd, buffer, mtdinfo.writesize + rawmode);
196 if (ret < (int)mtdinfo.writesize) {
214 bpos = pos / mtdinfo.erasesize * mtdinfo.erasesize;
243 ret = write(outfd, buffer, mtdinfo.writesize + spare_size);
244 if (ret < (int)(mtdinfo.writesize + spare_size)) {
257 opos += mtdinfo.writesize + spare_size;
262 if (test_empty(buffer, mtdinfo.writesize + mtdinfo.oobsize + spare_size))
264 else if (verbose > 2 || (verbose > 1 && !(pos & (mtdinfo.erasesize - 1))))