Networking: Move where the local loopback device is initialized from board_app_intiialize() to up_intiialize() so that it will happen automatically

This commit is contained in:
Gregory Nutt 2015-08-24 14:25:49 -06:00
parent 0732914d09
commit 01cfe8c315
9 changed files with 56 additions and 14 deletions

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
#include <nuttx/crypto/crypto.h>
@ -254,6 +255,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB -- device and/or host */
up_usbinitialize();

View File

@ -43,6 +43,7 @@
#include <nuttx/arch.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -268,6 +269,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB */
up_usbinitialize();

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -192,6 +193,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB */
up_usbinitialize();

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -194,6 +195,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB -- device and/or host */
up_usbinitialize();

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -182,6 +183,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB */
up_usbinitialize();

View File

@ -42,7 +42,6 @@
#include <debug.h>
#include <nuttx/board.h>
#include <nuttx/net/loopback.h>
/***************************************************************************
* Public Functions
@ -61,19 +60,6 @@
#ifdef CONFIG_LIB_BOARDCTL
int board_app_initialize(void)
{
#ifdef CONFIG_NETDEV_LOOPBACK
int ret;
/* Initialize the local loopback device */
ret = localhost_initialize();
if (ret < 0)
{
ndbg("ERROR: localhost_initialize() failed: %d\n", ret);
}
#endif /* CONFIG_NETDEV_LOOPBACK */
return 0;
}
#endif /* CONFIG_LIB_BOARDCTL */

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/fs/fs.h>
#include <nuttx/fs/ioctl.h>
#include <nuttx/net/loopback.h>
#include <nuttx/mtd/mtd.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -165,6 +166,12 @@ void up_initialize(void)
netdriver_init(); /* Our "real" network driver */
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
#if defined(CONFIG_FS_SMARTFS) && defined(CONFIG_SIM_SPIFLASH)
up_init_smartfs();
#endif

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -194,6 +195,12 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
/* Initialize USB -- device and/or host */
up_usbinitialize();

View File

@ -44,6 +44,7 @@
#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <nuttx/fs/fs.h>
#include <nuttx/net/loopback.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h>
@ -198,5 +199,11 @@ void up_initialize(void)
up_netinitialize();
#endif
#ifdef CONFIG_NETDEV_LOOPBACK
/* Initialize the local loopback device */
(void)localhost_initialize();
#endif
board_led_on(LED_IRQSENABLED);
}