summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-12-09 14:11:15 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-12-09 14:11:15 -0600
commitc0658f766fa3731fc2f0191d42fa9f6c41d36691 (patch)
tree282e5296409d9cb0edfc637769fe0731099ee493 /nuttx/include
parent246ab986d67e177bb4e60046ad486947e1624774 (diff)
downloadnuttx-c0658f766fa3731fc2f0191d42fa9f6c41d36691.tar.gz
nuttx-c0658f766fa3731fc2f0191d42fa9f6c41d36691.tar.bz2
nuttx-c0658f766fa3731fc2f0191d42fa9f6c41d36691.zip
SmartFS: Implements wear-leveling in the SmartFS. From Ken Pettit
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/fs/ioctl.h6
-rw-r--r--nuttx/include/nuttx/fs/smart.h14
-rw-r--r--nuttx/include/nuttx/mtd/smart.h16
3 files changed, 36 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/fs/ioctl.h b/nuttx/include/nuttx/fs/ioctl.h
index 491aed3c5..6a55d7975 100644
--- a/nuttx/include/nuttx/fs/ioctl.h
+++ b/nuttx/include/nuttx/fs/ioctl.h
@@ -200,6 +200,12 @@
* ProcFS data.
* OUT: None (ioctl return value provides
* success/failure indication). */
+#define BIOC_DEBUGCMD _BIOC(0x000B) /* Send driver specific debug command /
+ * data to the block device.
+ * IN: Pointer to a struct defined for
+ * the block with specific debug
+ * command and data.
+ * OUT: None. */
/* NuttX MTD driver ioctl definitions ***************************************/
diff --git a/nuttx/include/nuttx/fs/smart.h b/nuttx/include/nuttx/fs/smart.h
index 50ae2c038..2621dd77f 100644
--- a/nuttx/include/nuttx/fs/smart.h
+++ b/nuttx/include/nuttx/fs/smart.h
@@ -89,6 +89,20 @@ struct smart_read_write_s
const uint8_t *buffer; /* Pointer to the data to write */
};
+/* The following defines the procfs data exchange interface between the
+ * SMART MTD and FS layers.
+ */
+
+#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_SMARTFS)
+struct smart_procfs_data_s
+{
+#ifdef CONFIG_MTD_SMART_ERASE_DEBUG
+ const uint16_t *erasecounts; /* Pointer to the erase counts array */
+ uint16_t erasesize; /* Number of entries in the erase counts array */
+#endif
+};
+#endif
+
/****************************************************************************
* Public Data
****************************************************************************/
diff --git a/nuttx/include/nuttx/mtd/smart.h b/nuttx/include/nuttx/mtd/smart.h
index b2239b99e..4bdcecd31 100644
--- a/nuttx/include/nuttx/mtd/smart.h
+++ b/nuttx/include/nuttx/mtd/smart.h
@@ -50,6 +50,9 @@
* Pre-Processor Definitions
****************************************************************************/
+#define SMART_DEBUG_CMD_SET_DEBUG_LEVEL 1
+#define SMART_DEBUG_CMD_SHOW_LOGMAP 2
+
/****************************************************************************
* Public Types
****************************************************************************/
@@ -91,6 +94,19 @@ struct mtd_smart_procfs_data_s
FAR const struct smart_alloc_s *allocs; /* Array of allocations */
uint16_t alloccount; /* Number of items in the array */
#endif
+#ifdef CONFIG_MTD_SMART_WEAR_LEVEL
+ uint32_t uneven_wearcount; /* Number of uneven block erases */
+#endif
+};
+
+/* The following defines debug command data passed from the procfs layer to
+ the SMART MTD layer for debug purposes.
+ */
+
+struct mtd_smart_debug_data_s
+{
+ uint8_t debugcmd; /* Debug command */
+ uint32_t debugdata; /* Debug data */
};
/****************************************************************************