Lines Matching refs:num

354 		uint     num;     /* number of bytes which must be processed */  member
1204 ns->regs.num = 0; in switch_to_ready_state()
1437 static int do_read_error(struct nandsim *ns, int num) in do_read_error() argument
1442 prandom_bytes(ns->buf.byte, num); in do_read_error()
1449 static void do_bit_flips(struct nandsim *ns, int num) in do_bit_flips() argument
1456 int pos = prandom_u32() % (num * 8); in do_bit_flips()
1469 static void read_page(struct nandsim *ns, int num) in read_page() argument
1476 memset(ns->buf.byte, 0xFF, num); in read_page()
1483 if (do_read_error(ns, num)) in read_page()
1486 tx = read_file(ns, ns->cfile, ns->buf.byte, num, pos); in read_page()
1487 if (tx != num) { in read_page()
1491 do_bit_flips(ns, num); in read_page()
1499 memset(ns->buf.byte, 0xFF, num); in read_page()
1503 if (do_read_error(ns, num)) in read_page()
1505 memcpy(ns->buf.byte, NS_PAGE_BYTE_OFF(ns), num); in read_page()
1506 do_bit_flips(ns, num); in read_page()
1541 static int prog_page(struct nandsim *ns, int num) in prog_page() argument
1560 tx = read_file(ns, ns->cfile, pg_off, num, off); in prog_page()
1561 if (tx != num) { in prog_page()
1566 for (i = 0; i < num; i++) in prog_page()
1577 tx = write_file(ns, ns->cfile, pg_off, num, off); in prog_page()
1578 if (tx != num) { in prog_page()
1604 for (i = 0; i < num; i++) in prog_page()
1617 int num; in do_state_action() local
1641 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1642 read_page(ns, num); in do_state_action()
1645 num, NS_RAW_OFFSET(ns) + ns->regs.off); in do_state_action()
1709 num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in do_state_action()
1710 if (num != ns->regs.count) { in do_state_action()
1712 ns->regs.count, num); in do_state_action()
1716 if (prog_page(ns, num) == -1) in do_state_action()
1722 num, ns->regs.row, ns->regs.column, NS_RAW_OFFSET(ns) + ns->regs.off); in do_state_action()
1825 && ns->regs.count != ns->regs.num) { in switch_state()
1827 ns->regs.num - ns->regs.count); in switch_state()
1843 ns->regs.num = ns->regs.count = 0; in switch_state()
1856 ns->regs.num = ns->geom.pgszoob - ns->regs.off - ns->regs.column; in switch_state()
1860 ns->regs.num = ns->geom.idbytes; in switch_state()
1864 ns->regs.count = ns->regs.num = 0; in switch_state()
1881 ns->regs.num = ns->geom.pgaddrbytes; in switch_state()
1885 ns->regs.num = ns->geom.secaddrbytes; in switch_state()
1889 ns->regs.num = 1; in switch_state()
1894 ns->regs.num = ns->geom.pgaddrbytes - ns->geom.secaddrbytes; in switch_state()
1905 ns->regs.num = 0; in switch_state()
1937 if (ns->regs.count == ns->regs.num) { in ns_nand_read_byte()
1953 NS_DBG("read_byte: read ID byte %d, total = %d\n", ns->regs.count, ns->regs.num); in ns_nand_read_byte()
1961 if (ns->regs.count == ns->regs.num) { in ns_nand_read_byte()
2052 ns->regs.num = ns->geom.pgaddrbytes; in ns_nand_write_byte()
2055 ns->regs.num = ns->geom.secaddrbytes; in ns_nand_write_byte()
2058 ns->regs.num = 1; in ns_nand_write_byte()
2074 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2085 (uint)byte, ns->regs.count, ns->regs.num); in ns_nand_write_byte()
2087 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2107 if (ns->regs.count == ns->regs.num) { in ns_nand_write_byte()
2109 ns->regs.num); in ns_nand_write_byte()
2165 if (ns->regs.count + len > ns->regs.num) { in ns_nand_write_buf()
2174 if (ns->regs.count == ns->regs.num) { in ns_nand_write_buf()
2208 if (ns->regs.count + len > ns->regs.num) { in ns_nand_read_buf()
2217 if (ns->regs.count == ns->regs.num) { in ns_nand_read_buf()