3 * This file is part of mtd_probe
5 * Copyright (C) 2010 - Maxim Levitsky
7 * mtd_probe is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * mtd_probe is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with mtd_probe; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301 USA
22 #include "mtd_probe.h"
24 #include <sys/ioctl.h>
25 #include <mtd/mtd-user.h>
26 #include <sys/types.h>
32 int main(int argc, char** argv) {
35 printf("usage: mtd_probe /dev/mtd[n]\n");
39 int mtd_fd = open(argv[1], O_RDONLY);
46 int error = ioctl(mtd_fd, MEMGETINFO, &mtd_info);
52 probe_smart_media(mtd_fd, &mtd_info);