From 35c00972da41e12f4fb0590f4b4d45be91a31bfa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 6 Aug 2014 11:59:41 -0600 Subject: NSH networking: There is now a configuration option that will bring up the network on an separate thread. Since the network bring-up is asynchronous, there are not serial console start-up delays due to the network negotiation time. --- apps/nshlib/Kconfig | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'apps/nshlib/Kconfig') diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index f710969f5..36839a736 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -777,6 +777,49 @@ config NSH_ARCHINIT menu "Networking Configuration" depends on NET +config NSH_NETINIT_THREAD + bool "Network initialization thread" + default n + depends on !DISABLE_PTHREAD + ---help--- + NSH is brought up through a series of sequential initialization + steps. This includes networking. If the network is available on + reset, then there is really no issue. Negotiating the link will + take only a second or so and the delay to the NSH prompt is + normally acceptable. + + But if there is no network connected, then the start-up delay can + be very long depending upon things like the particular PHY, driver + timeout delay times, and numbers of retries. A failed negotiation + can potentially take a very long time, perhaps as much as a + minute... Long enough that you might think that the board would + never come up! + + One solution is to enabled by this option. If NSH_NETINIT_THREAD + is selected, the network bring-up will all occur in parallel with + NSH on a separate thread. In this case, the NSH prompt will occur + immediately with the network becoming available some time layer (if + if all). This thread will terminate once it successfully initializes + the network + + NOTES: If no network is connected, the network bring-up will fail + and the network initialization thread will simply exit. There are + no retries and no mechanism to know if the network initialization + was successful. Furthermore, there is currently no support for + detecting loss of network connection. Lots of things to do! + +if NSH_NETINIT_THREAD + +config NSH_NETINIT_THREAD_STACKSIZE + int "Network initialization thread stack size" + default 1568 + +config NSH_NETINIT_THREAD_PRIORITY + int "Network initialization thread priority" + default 100 + +endif # NSH_NETINIT_THREAD + config NSH_DHCPC bool "Use DHCP to get IP address" default n -- cgit v1.2.3