# HG changeset patch # User gthomas # Date 1052069848 0 # Node ID fb41b6cf251307404d89f432b87609150e204ed5 # Parent bd56b4799886f7d15d24a129d867bc36cf3884b3 Add control to force use of serial port during initialization diff --git a/packages/net/bsd_tcpip/current/ChangeLog b/packages/net/bsd_tcpip/current/ChangeLog --- a/packages/net/bsd_tcpip/current/ChangeLog +++ b/packages/net/bsd_tcpip/current/ChangeLog @@ -1,3 +1,11 @@ +2003-05-04 Gary Thomas + + * src/ecos/support.c: + * cdl/freebsd_net.cdl: Add option to force initialization [debug] + messages to go to a serial console. This seems to be necessary + on some hardware as the init sequence can totally foul up a + network [debug] connection. + 2003-04-11 Michael Checky * cdl/freebsd_net.cdl: Deleted the 'CYGPKG_NET_FREEBSD_STACK_BUILD_TESTS' diff --git a/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl b/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl --- a/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl +++ b/packages/net/bsd_tcpip/current/cdl/freebsd_net.cdl @@ -197,6 +197,18 @@ cdl_package CYGPKG_NET_FREEBSD_STACK { " } + cdl_option CYGPKG_NET_FORCE_SERIAL_CONSOLE { + display "Force use of serial console during initialization" + flavor bool + default_value 0 + description " + Trying to print initialization messages can fail if the + console channel is a network connection (via RedBoot). + Use of this option forces the stack to use a serial + port during this phase for safety. It can be used + if the network drivers are unstable at this point." + } + cdl_option CYGPKG_NET_MEM_USAGE { display "Memory designated for networking buffers." flavor data diff --git a/packages/net/bsd_tcpip/current/src/ecos/support.c b/packages/net/bsd_tcpip/current/src/ecos/support.c --- a/packages/net/bsd_tcpip/current/src/ecos/support.c +++ b/packages/net/bsd_tcpip/current/src/ecos/support.c @@ -14,7 +14,7 @@ // Portions created by Red Hat are // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. // -// Copyright (C) 2002 Gary Thomas +// Copyright (C) 2002, 2003 Gary Thomas // Copyright (C) 2003 Andrew Lunn // ------------------------------------------- // @@ -69,7 +69,7 @@ #include #include #include - +#include #include #if !CYGPKG_NET_DRIVER_FRAMEWORK // Interface @@ -832,9 +832,20 @@ cyg_net_init(void) { static int _init = false; struct init_tab_entry *init_entry; +#ifdef CYGPKG_NET_FORCE_SERIAL_CONSOLE + int orig_console = + CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT); +#endif if (_init) return; +#ifdef CYGPKG_NET_FORCE_SERIAL_CONSOLE + // Force default serial console during system initialization + // This avoids problems with debug messages occurring while the + // networking subsystem is being setup. + CYGACC_CALL_IF_SET_CONSOLE_COMM(0); +#endif + cyg_do_net_init(); // Just forces linking in the initializer/constructor // Initialize interrupt "flags" cyg_flag_init(&netint_flags); @@ -867,6 +878,11 @@ cyg_net_init(void) // Done _init = true; + +#ifdef CYGPKG_NET_FORCE_SERIAL_CONSOLE + // Revert to the original console, which might be a network connection + CYGACC_CALL_IF_SET_CONSOLE_COMM(orig_console); +#endif }