changeset 2343:0550d98ae686

* src/dhcp_support.c: * cdl/net.cdl: Added CDL to control the size of the stack used by the DHCP management thread.
author asl
date Sun, 07 Jan 2007 14:46:54 +0000
parents 07b0f2be3596
children 72980acace2f
files packages/net/common/current/ChangeLog packages/net/common/current/cdl/net.cdl packages/net/common/current/src/dhcp_support.c
diffstat 3 files changed, 26 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/common/current/ChangeLog
+++ b/packages/net/common/current/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-07  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/dhcp_support.c: 
+	* cdl/net.cdl:
+	Added CDL to control the size of the stack used by
+	the DHCP management thread.
+
 2006-12-18  Sergei Gavrikov  <sg@sgs.gomel.by>
 
 	* tests/ga_server_test.c: Updated flags argument in call of
--- a/packages/net/common/current/cdl/net.cdl
+++ b/packages/net/common/current/cdl/net.cdl
@@ -271,6 +271,17 @@ cdl_package CYGPKG_NET {
             network thread itself."
         }
 
+        cdl_option CYGPKG_NET_DHCP_THREAD_STACK_SIZE {
+            display "Stack size for DHCP management threads."
+            flavor  data
+            default_value { "(CYGNUM_HAL_STACK_SIZE_TYPICAL+sizeof(struct bootp))" }
+            description   "
+               This option controls the size of the stack used for the
+               DHCP mamagement thread. The default should be
+               sufficient for most cases but some applications my
+               require bigger stacks when using for example diag_printf."
+        }
+
         cdl_option CYGOPT_NET_DHCP_PARM_REQ_LIST_REPLACE {
             display "Replace DHCP request options"
             flavor  booldata
--- a/packages/net/common/current/src/dhcp_support.c
+++ b/packages/net/common/current/src/dhcp_support.c
@@ -222,22 +222,21 @@ void dhcp_mgt_entry( cyg_addrword_t loop
 cyg_handle_t dhcp_mgt_thread_h = 0;
 cyg_thread   dhcp_mgt_thread;
 
-#define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL + sizeof(struct bootp))
-static cyg_uint8 dhcp_mgt_stack[ STACK_SIZE ];
+static cyg_uint8 dhcp_mgt_stack[ CYGPKG_NET_DHCP_THREAD_STACK_SIZE ];
 
 void dhcp_start_dhcp_mgt_thread( void )
 {
     if ( ! dhcp_mgt_thread_h ) {
         cyg_semaphore_init( &dhcp_needs_attention, 0 );
         cyg_thread_create(
-            CYGPKG_NET_DHCP_THREAD_PRIORITY, /* scheduling info (eg pri) */
-            dhcp_mgt_entry,             /* entry point function */
+            CYGPKG_NET_DHCP_THREAD_PRIORITY,   /* scheduling info (eg pri) */
+            dhcp_mgt_entry,                    /* entry point function */
             CYGOPT_NET_DHCP_DHCP_THREAD_PARAM, /* entry data */
-            "DHCP lease mgt",           /* optional thread name */
-            dhcp_mgt_stack,             /* stack base, NULL = alloc */
-            STACK_SIZE,                 /* stack size, 0 = default */
-            &dhcp_mgt_thread_h,         /* returned thread handle */
-            &dhcp_mgt_thread           /* put thread here */
+            "DHCP lease mgt",                  /* optional thread name */
+            dhcp_mgt_stack,                    /* stack base, NULL = alloc */
+            CYGPKG_NET_DHCP_THREAD_STACK_SIZE, /* stack size, 0 = default */
+            &dhcp_mgt_thread_h,                /* returned thread handle */
+            &dhcp_mgt_thread                   /* put thread here */
             );
 
         cyg_thread_resume(dhcp_mgt_thread_h);