#include #include #include #include #include #include #include #include #include #include #include extern struct flash_dev *flash; static void do_ftl_probe(FILE *out, const char **argv, size_t argc) { (void)argv; (void)argc; if (flash) { flash_release(flash); flash = NULL; } if (!(flash = flash_probe())) { fprintf(out, "error: unable to probe the flash device.\n"); return; } if (!(flash = ftl_mount(flash))) { fprintf(out, "error: unable to mount the flash translation layer.\n"); return; } } static struct cmd ftl_cmds[] = { { "probe", NULL, do_ftl_probe }, { NULL, NULL, NULL }, }; void do_ftl_cmd(FILE *out, const char **argv, size_t argc) { if (argc < 1) { fprintf(out, "usage: flash \n"); return; } cmd_exec(ftl_cmds, out, argv, argc); }