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

This commit is contained in:
Gregory Nutt 2015-03-31 12:14:16 -06:00
parent 22c7d705a3
commit 9fcd34f1c4
4 changed files with 8 additions and 34 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */