From a826adb6799deafd0c62e2bb17829f24294dbda7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 29 Jul 2014 16:36:15 -0600 Subject: [PATCH] The SAMA5D4-EK NSH and NxWM configurations now have the auto-mounter configured to automatically mount the FAT file system on HSMCI0 at /mnt/sdcard --- configs/sama5d4-ek/nsh/defconfig | 7 +++++++ configs/sama5d4-ek/nxwm/defconfig | 6 ++++++ fs/fs_automount.c | 18 +++++++++--------- include/nuttx/fs/automount.h | 6 +++--- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/configs/sama5d4-ek/nsh/defconfig b/configs/sama5d4-ek/nsh/defconfig index bdd18e57e9..0e503c67c9 100644 --- a/configs/sama5d4-ek/nsh/defconfig +++ b/configs/sama5d4-ek/nsh/defconfig @@ -417,6 +417,12 @@ CONFIG_SAMA5D4_MB_REVC=y # CONFIG_SAMA5D4EK_396MHZ is not set CONFIG_SAMA5D4EK_528MHZ=y CONFIG_SAMA5D4EK_DRAM_BOOT=y +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT=y +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_FSTYPE="vfat" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_BLKDEV="/dev/mmcsd0" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_MOUNTPOINT="/mnt/sdcard" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY=1000 +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY=2000 CONFIG_SAMA5D4EK_MXT_I2CFREQUENCY=400000 CONFIG_SAMA5D4EK_MXT_DEVMINOR=0 @@ -811,6 +817,7 @@ CONFIG_NET_ETHERNET=y # File system configuration # # CONFIG_DISABLE_MOUNTPOINT is not set +CONFIG_FS_AUTOMOUNTER=y # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set CONFIG_FS_READABLE=y CONFIG_FS_WRITABLE=y diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index 6de02f3a8a..021ae2a29a 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -411,6 +411,11 @@ CONFIG_NSH_MMCSDSLOTNO=0 # CONFIG_SAMA5D4EK_396MHZ is not set CONFIG_SAMA5D4EK_528MHZ=y CONFIG_SAMA5D4EK_DRAM_BOOT=y +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_FSTYPE="vfat" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_BLKDEV="/dev/mmcsd0" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_MOUNTPOINT="/mnt/sdcard" +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_DDELAY=1000 +CONFIG_SAMA5D4EK_HSMCI0_AUTOMOUNT_UDELAY=2000 CONFIG_SAMA5D4EK_MXT_I2CFREQUENCY=400000 CONFIG_SAMA5D4EK_MXT_DEVMINOR=0 @@ -807,6 +812,7 @@ CONFIG_NET_ETHERNET=y # File system configuration # # CONFIG_DISABLE_MOUNTPOINT is not set +CONFIG_FS_AUTOMOUNTER=y # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set CONFIG_FS_READABLE=y CONFIG_FS_WRITABLE=y diff --git a/fs/fs_automount.c b/fs/fs_automount.c index 14b2420fcb..51ffe70ef7 100644 --- a/fs/fs_automount.c +++ b/fs/fs_automount.c @@ -397,7 +397,7 @@ static void automount_timeout(int argc, uint32_t arg1, ...) * Name: automount_worker * * Description: - * Performs automount actions on the worker thread. + * Performs auto-mount actions on the worker thread. * * Input Parameters: * arg - Work argument set by work_queue() @@ -450,7 +450,7 @@ static void automount_worker(FAR void *arg) * * Input Parameters: * lower - Persistent board configuration data - * arg - Data associated with the automounter + * arg - Data associated with the auto-mounter * inserted - True: Media has been inserted. False: media has been removed * * Returned Value: @@ -523,13 +523,13 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, * Name: automount_initialize * * Description: - * Configure the automounter. + * Configure the auto mounter. * * Input Parameters: * lower - Persistent board configuration data * * Returned Value: - * A void* handle. The only use for this handle is with auto_uninitialize(). + * A void* handle. The only use for this handle is with automount_uninitialize(). * NULL is returned on any failure. * ****************************************************************************/ @@ -542,7 +542,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) fvdbg("lower=%p\n", lower); DEBUGASSERT(lower); - /* Allocate an automounter state structure */ + /* Allocate an auto-mounter state structure */ priv = (FAR struct automounter_state_s *) kzalloc(sizeof(struct automounter_state_s)); @@ -563,7 +563,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) if (!priv->wdog) { fdbg("ERROR: Failed to create a timer\n"); - auto_uninitialize(priv); + automount_uninitialize(priv); return NULL; } @@ -590,7 +590,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) if (ret < 0) { fdbg("ERROR: Failed to attach automount interrupt: %d\n", ret); - auto_uninitialize(priv); + automount_uninitialize(priv); return NULL; } @@ -599,7 +599,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) } /**************************************************************************** - * Name: auto_uninitialize + * Name: automount_uninitialize * * Description: * Stop the automounter and free resources that it used. NOTE that the @@ -613,7 +613,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower) * ****************************************************************************/ -void auto_uninitialize(FAR void *handle) +void automount_uninitialize(FAR void *handle) { FAR struct automounter_state_s *priv = (FAR struct automounter_state_s *)handle; FAR const struct automount_lower_s *lower; diff --git a/include/nuttx/fs/automount.h b/include/nuttx/fs/automount.h index cfc9eb2d6f..3af62d5e03 100644 --- a/include/nuttx/fs/automount.h +++ b/include/nuttx/fs/automount.h @@ -161,7 +161,7 @@ extern "C" * lower - Persistent board configuration data * * Returned Value: - * A void* handle. The only use for this handle is with auto_uninitialize(). + * A void* handle. The only use for this handle is with automount_uninitialize(). * NULL is returned on any failure. * ****************************************************************************/ @@ -169,7 +169,7 @@ extern "C" FAR void *automount_initialize(FAR const struct automount_lower_s *lower); /**************************************************************************** - * Name: auto_uninitialize + * Name: automount_uninitialize * * Description: * Stop the automounter and free resources that it used. NOTE that the @@ -183,7 +183,7 @@ FAR void *automount_initialize(FAR const struct automount_lower_s *lower); * ****************************************************************************/ -void auto_uninitialize(FAR void *handle); +void automount_uninitialize(FAR void *handle); #undef EXTERN #ifdef __cplusplus