Lines Matching refs:num
354 uint num; /* number of bytes which must be processed */ member
1203 ns->regs.num = 0; in switch_to_ready_state()
1436 static int do_read_error(struct nandsim *ns, int num) in do_read_error() argument
1441 prandom_bytes(ns->buf.byte, num); in do_read_error()
1448 static void do_bit_flips(struct nandsim *ns, int num) in do_bit_flips() argument
1455 int pos = prandom_u32() % (num * 8); in do_bit_flips()
1468 static void read_page(struct nandsim *ns, int num) in read_page() argument
1475 memset(ns->buf.byte, 0xFF, num); in read_page()
1482 if (do_read_error(ns, num)) in read_page()
1485 tx = read_file(ns, ns->cfile, ns->buf.byte, num, pos); in read_page()
1486 if (tx != num) { in read_page()
1490 do_bit_flips(ns, num); in read_page()
1498 memset(ns->buf.byte, 0xFF, num); in read_page()
1502 if (do_read_error(ns, num)) in read_page()
1504 memcpy(ns->buf.byte, NS_PAGE_BYTE_OFF(ns), num); in read_page()
1505 do_bit_flips(ns, num); in read_page()
1540 static int prog_page(struct nandsim *ns, int num) in prog_page() argument
1559 tx = read_file(ns, ns->cfile, pg_off, num, off); in prog_page()
1560 if (tx != num) { in prog_page()
1565 for (i = 0; i < num; i++) in prog_page()
1576 tx = write_file(ns, ns->cfile, pg_off, num, off); in prog_page()
1577 if (tx != num) { in prog_page()
1603 for (i = 0; i < num; i++) in prog_page()
1616 int num; in do_state_action() local
1640 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1641 read_page(ns, num); in do_state_action()
1644 num, NS_RAW_OFFSET(ns) + ns->regs.off); in do_state_action()
1708 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1709 if (num != ns->regs.count) { in do_state_action()
1711 ns->regs.count, num); in do_state_action()
1715 if (prog_page(ns, num) == -1) in do_state_action()
1721 num, ns->regs.row, ns->regs.column, NS_RAW_OFFSET(ns) + ns->regs.off); in do_state_action()
1824 && ns->regs.count != ns->regs.num) { in switch_state()
1826 ns->regs.num - ns->regs.count); in switch_state()
1842 ns->regs.num = ns->regs.count = 0; in switch_state()
1855 ns->regs.num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in switch_state()
1859 ns->regs.num = ns->geom.idbytes; in switch_state()
1863 ns->regs.count = ns->regs.num = 0; in switch_state()
1880 ns->regs.num = ns->geom.pgaddrbytes; in switch_state()
1884 ns->regs.num = ns->geom.secaddrbytes; in switch_state()
1888 ns->regs.num = 1; in switch_state()
1893 ns->regs.num = ns->geom.pgaddrbytes - ns->geom.secaddrbytes; in switch_state()
1904 ns->regs.num = 0; in switch_state()
1936 if (ns->regs.count == ns->regs.num) { in ns_nand_read_byte()
1952 NS_DBG("read_byte: read ID byte %d, total = %d\n", ns->regs.count, ns->regs.num); in ns_nand_read_byte()
1960 if (ns->regs.count == ns->regs.num) { in ns_nand_read_byte()
2051 ns->regs.num = ns->geom.pgaddrbytes; in ns_nand_write_byte()
2054 ns->regs.num = ns->geom.secaddrbytes; in ns_nand_write_byte()
2057 ns->regs.num = 1; in ns_nand_write_byte()
2073 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2084 (uint)byte, ns->regs.count, ns->regs.num); in ns_nand_write_byte()
2086 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2106 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2108 ns->regs.num); in ns_nand_write_byte()
2164 if (ns->regs.count + len > ns->regs.num) { in ns_nand_write_buf()
2173 if (ns->regs.count == ns->regs.num) { in ns_nand_write_buf()
2207 if (ns->regs.count + len > ns->regs.num) { in ns_nand_read_buf()
2216 if (ns->regs.count == ns->regs.num) { in ns_nand_read_buf()