Lines Matching full:mtdinfo
44 struct mtd_info_user mtdinfo;
124 ret = ioctl(fd, MEMGETINFO, &mtdinfo);
132 printf("size: %u\n", mtdinfo.size);
133 printf("erase size: %u\n", mtdinfo.erasesize);
134 printf("write size: %u\n", mtdinfo.writesize);
135 printf("oob size: %u\n", mtdinfo.oobsize);
138 buffer = malloc(mtdinfo.writesize + mtdinfo.oobsize + spare_size);
141 mtdinfo.writesize + mtdinfo.oobsize);
145 oobbuf.length = mtdinfo.oobsize;
146 oob_data = (uint32_t *)((uint8_t *)buffer + mtdinfo.writesize);
147 memset(oob_data, 0xff, mtdinfo.oobsize + spare_size);
179 rawmode = mtdinfo.oobsize;
188 end = len ? (start + len) : mtdinfo.size;
189 for (pos = start, opos = 0; pos < end; pos += mtdinfo.writesize) {
194 ret = read(fd, buffer, mtdinfo.writesize + rawmode);
195 if (ret < (int)mtdinfo.writesize) {
213 bpos = pos / mtdinfo.erasesize * mtdinfo.erasesize;
242 ret = write(outfd, buffer, mtdinfo.writesize + spare_size);
243 if (ret < (int)(mtdinfo.writesize + spare_size)) {
256 opos += mtdinfo.writesize + spare_size;
261 if (test_empty(buffer, mtdinfo.writesize + mtdinfo.oobsize + spare_size))
263 else if (verbose > 2 || (verbose > 1 && !(pos & (mtdinfo.erasesize - 1))))