diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 12:14:16 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 12:14:16 -0600 |
commit | 50cbc253bcd8a77ebcbd225855f3b2ccb31f6c21 (patch) | |
tree | d294f42bc878ea47a5787a8cab0ac96480407a55 /apps/nshlib | |
parent | 73a89efed06a03f2733c14e42553ad23223f5cad (diff) | |
download | px4-nuttx-50cbc253bcd8a77ebcbd225855f3b2ccb31f6c21.tar.gz px4-nuttx-50cbc253bcd8a77ebcbd225855f3b2ccb31f6c21.tar.bz2 px4-nuttx-50cbc253bcd8a77ebcbd225855f3b2ccb31f6c21.zip |
NSH initialization now calls boardctl(BOARDIOC_INIT) instead of board_app_initaliaze. Modify all configurations: Make sure that CONFIG_LIB_BOARDCTL=y appears wherever CONFIG_NSH_ARCHINIT=y appears. Remove support for CONFIG_NSH_ARCHMAC. It is not used and there are better ways to do that operation
Diffstat (limited to 'apps/nshlib')
-rw-r--r-- | apps/nshlib/Kconfig | 13 | ||||
-rw-r--r-- | apps/nshlib/nsh.h | 15 | ||||
-rw-r--r-- | apps/nshlib/nsh_init.c | 7 | ||||
-rw-r--r-- | apps/nshlib/nsh_netinit.c | 7 |
4 files changed, 8 insertions, 34 deletions
diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index f149055b0..45f56be29 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -1243,19 +1243,6 @@ config NSH_SWMAC With this choice, you can assign a fixed MAC address determined by a NuttX configuration option. -config NSH_ARCHMAC - bool "Platform-specific" - ---help--- - This selection will enable a call to an interface exported by - platform-specific code to determine the MAC address. If this option - is selected, the the platform-specific code must provide the - function nsh_arch_macaddress() that will be called by the NSH - initialize logic to obtain the MAC address. - - This option might be useful, as an example, if MAC addresses are - retained in Serial FLASH. Such address might be assigned during the - manufacturing process so that each board has a unique MAC address. - endchoice # MAC address selection config NSH_MACADDR diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index f9f5e1468..4d612a490 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -128,10 +128,6 @@ # define CONFIG_NSH_MACADDR 0x00e0deadbeef #endif -#ifndef CONFIG_NET -# undef CONFIG_NSH_ARCHMAC -#endif - #if !defined(CONFIG_NSH_NETINIT_THREAD) || !defined(CONFIG_ARCH_PHY_INTERRUPT) || \ !defined(CONFIG_NETDEV_PHY_IOCTL) || !defined(CONFIG_NET_UDP) || \ defined(CONFIG_DISABLE_SIGNALS) @@ -772,14 +768,9 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl); /* Architecture-specific initialization */ -#ifdef CONFIG_NSH_ARCHINIT -int board_app_initialize(void); -#else -# define board_app_initialize() (-ENOSYS) -#endif - -#ifdef CONFIG_NSH_ARCHMAC -int nsh_arch_macaddress(uint8_t *mac); +#if defined(CONFIG_NSH_ARCHINIT) && !defined(CONFIG_LIB_BOARDCTL) +# warning CONFIG_NSH_ARCHINIT is set, but CONFIG_LIB_BOARDCTL is not +# undef CONFIG_NSH_ARCHINIT #endif /* Basic session and message handling */ diff --git a/apps/nshlib/nsh_init.c b/apps/nshlib/nsh_init.c index ac1863f11..a59c5b323 100644 --- a/apps/nshlib/nsh_init.c +++ b/apps/nshlib/nsh_init.c @@ -39,6 +39,7 @@ #include <nuttx/config.h> +#include <sys/boardctl.h> #include <apps/nsh.h> #include "nsh.h" @@ -93,9 +94,11 @@ void nsh_initialize(void) (void)nsh_romfsetc(); - /* Perform architecture-specific initialization (if available) */ +#ifdef CONFIG_NSH_ARCHINIT + /* Perform architecture-specific initialization (if configured) */ - (void)board_app_initialize(); + (void)boardctl(BOARDIOC_INIT, 0); +#endif /* Bring up the network */ diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index 11e924f72..27d378618 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -219,12 +219,6 @@ static void nsh_netinit_configure(void) /* Many embedded network interfaces must have a software assigned MAC */ #if defined(CONFIG_NSH_NOMAC) && defined(CONFIG_NET_ETHERNET) -#ifdef CONFIG_NSH_ARCHMAC - /* Let platform-specific logic assign the MAC address. */ - - (void)nsh_arch_macaddress(mac); - -#else /* Use the configured, fixed MAC address */ mac[0] = (CONFIG_NSH_MACADDR >> (8 * 5)) & 0xff; @@ -233,7 +227,6 @@ static void nsh_netinit_configure(void) mac[3] = (CONFIG_NSH_MACADDR >> (8 * 2)) & 0xff; mac[4] = (CONFIG_NSH_MACADDR >> (8 * 1)) & 0xff; mac[5] = (CONFIG_NSH_MACADDR >> (8 * 0)) & 0xff; -#endif /* Set the MAC address */ |