-#probe mtd devices for FTL
+# do not edit this file, it will be overwritten on update
ACTION!="add", GOTO="mtd_probe_end"
KERNEL=="mtd*ro", IMPORT{program}="mtd_probe $tempnode"
-KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN+="/sbin/modprobe sm_ftl"
-
+KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN+="/sbin/modprobe -bv sm_ftl"
LABEL="mtd_probe_end"
-
/*
- * mtd_probe.c
- * This file is part of mtd_probe
- *
* Copyright (C) 2010 - Maxim Levitsky
*
* mtd_probe is free software; you can redistribute it and/or modify
*
* You should have received a copy of the GNU General Public License
* along with mtd_probe; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#include "mtd_probe.h"
#include <unistd.h>
#include <stdlib.h>
-int main(int argc, char** argv) {
-
+int main(int argc, char** argv)
+{
if (argc != 2) {
printf("usage: mtd_probe /dev/mtd[n]\n");
return 1;
/*
- * mtd_probe.h
- * This file is part of mtd_probe
- *
* Copyright (C) 2010 - Maxim Levitsky
*
* mtd_probe is free software; you can redistribute it and/or modify
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
+
#include <mtd/mtd-user.h>
/* Full oob structure as written on the flash */
/*
- * probe_smartmedia.c
- * This file is part of mtd_probe
- *
* Copyright (C) 2010 - Maxim Levitsky
*
* mtd_probe is free software; you can redistribute it and/or modify
#include <stdio.h>
#include <stdlib.h>
#include <mtd/mtd-user.h>
-
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
};
-void probe_smart_media(int mtd_fd, mtd_info_t* info) {
-
+void probe_smart_media(int mtd_fd, mtd_info_t* info)
+{
char* cis_buffer = malloc(SM_SECTOR_SIZE);
+
if (!cis_buffer)
return;