Lines Matching refs:ubi

26 void ubi_dump_flash(struct ubi_device *ubi, int pnum, int offset, int len)  in ubi_dump_flash()  argument
31 loff_t addr = (loff_t)pnum * ubi->peb_size + offset; in ubi_dump_flash()
36 err = mtd_read(ubi->mtd, addr, len, &read, buf); in ubi_dump_flash()
38 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes", in ubi_dump_flash()
43 ubi_msg(ubi, "dumping %d bytes of data from PEB %d, offset %d", in ubi_dump_flash()
258 struct ubi_device *ubi; in dfs_file_read() local
263 ubi = ubi_get_device(ubi_num); in dfs_file_read()
264 if (!ubi) in dfs_file_read()
266 d = &ubi->dbg; in dfs_file_read()
311 ubi_put_device(ubi); in dfs_file_read()
321 struct ubi_device *ubi; in dfs_file_write() local
327 ubi = ubi_get_device(ubi_num); in dfs_file_write()
328 if (!ubi) in dfs_file_write()
330 d = &ubi->dbg; in dfs_file_write()
378 ubi_put_device(ubi); in dfs_file_write()
398 int ubi_debugfs_init_dev(struct ubi_device *ubi) in ubi_debugfs_init_dev() argument
401 unsigned long ubi_num = ubi->ubi_num; in ubi_debugfs_init_dev()
404 struct ubi_debug_info *d = &ubi->dbg; in ubi_debugfs_init_dev()
410 ubi->ubi_num); in ubi_debugfs_init_dev()
493 ubi_err(ubi, "cannot create \"%s\" debugfs file or directory, error %d\n", in ubi_debugfs_init_dev()
502 void ubi_debugfs_exit_dev(struct ubi_device *ubi) in ubi_debugfs_exit_dev() argument
505 debugfs_remove_recursive(ubi->dbg.dfs_dir); in ubi_debugfs_exit_dev()
515 int ubi_dbg_power_cut(struct ubi_device *ubi, int caller) in ubi_dbg_power_cut() argument
519 if ((ubi->dbg.emulate_power_cut & caller) == 0) in ubi_dbg_power_cut()
522 if (ubi->dbg.power_cut_counter == 0) { in ubi_dbg_power_cut()
523 ubi->dbg.power_cut_counter = ubi->dbg.power_cut_min; in ubi_dbg_power_cut()
525 if (ubi->dbg.power_cut_max > ubi->dbg.power_cut_min) { in ubi_dbg_power_cut()
526 range = ubi->dbg.power_cut_max - ubi->dbg.power_cut_min; in ubi_dbg_power_cut()
527 ubi->dbg.power_cut_counter += prandom_u32() % range; in ubi_dbg_power_cut()
532 ubi->dbg.power_cut_counter--; in ubi_dbg_power_cut()
533 if (ubi->dbg.power_cut_counter) in ubi_dbg_power_cut()
536 ubi_msg(ubi, "XXXXXXXXXXXXXXX emulating a power cut XXXXXXXXXXXXXXXX"); in ubi_dbg_power_cut()
537 ubi_ro_mode(ubi); in ubi_dbg_power_cut()
550 int ubi_debugfs_init_dev(struct ubi_device *ubi) in ubi_debugfs_init_dev() argument
555 void ubi_debugfs_exit_dev(struct ubi_device *ubi) in ubi_debugfs_exit_dev() argument
559 int ubi_dbg_power_cut(struct ubi_device *ubi, int caller) in ubi_dbg_power_cut() argument