From f6547ca194c5a2140e6ca32990b79cbefe8d8f17 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 7 Nov 2007 23:26:29 +0000 Subject: [PATCH] Remove uIP logging git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@377 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttxPortingGuide.html | 3 --- configs/README.txt | 1 - configs/c5471evm/defconfig | 2 -- configs/m68332evb/defconfig | 2 -- configs/mcu123-lpc214x/defconfig | 2 -- configs/ntosd-dm320/defconfig | 4 +--- configs/ntosd-dm320/netconfig | 4 +--- configs/pjrc-8051/defconfig | 2 -- configs/sim/defconfig | 2 -- configs/sim/netconfig | 2 -- examples/nettest/nettest.c | 13 ------------- examples/uip/main.c | 9 --------- include/net/uip/uip.h | 8 -------- net/uip/uip-icmpinput.c | 4 ++-- net/uip/uip-input.c | 16 ++++++++-------- net/uip/uip-internal.h | 12 ------------ net/uip/uip-tcpinput.c | 7 +++---- net/uip/uip-udpinput.c | 4 ++-- 18 files changed, 17 insertions(+), 80 deletions(-) diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index e97b6c69f5..923f08e847 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -1364,9 +1364,6 @@ The system can be re-made subsequently by just typing make.
  • CONFIG_NET_BUFFER_SIZE: uIP buffer size
  • -
  • - CONFIG_NET_LOGGING: Logging on or off -
  • CONFIG_NET_UDP: UDP support on or off
  • diff --git a/configs/README.txt b/configs/README.txt index 0a1b423104..cc8643068e 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -218,7 +218,6 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_NET_SOCKOPTS - Enable or disable support for socket options CONFIG_NET_BUFFER_SIZE - uIP buffer size - CONFIG_NET_LOGGING - Logging on or off CONFIG_NET_UDP - UDP support on or off CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP diff --git a/configs/c5471evm/defconfig b/configs/c5471evm/defconfig index 86c8126ecc..db582e93bc 100644 --- a/configs/c5471evm/defconfig +++ b/configs/c5471evm/defconfig @@ -258,7 +258,6 @@ CONFIG_PREALLOC_TIMERS=8 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -276,7 +275,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/configs/m68332evb/defconfig b/configs/m68332evb/defconfig index 4e6d224413..700bcbb0f8 100644 --- a/configs/m68332evb/defconfig +++ b/configs/m68332evb/defconfig @@ -247,7 +247,6 @@ CONFIG_PREALLOC_TIMERS=8 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -265,7 +264,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/configs/mcu123-lpc214x/defconfig b/configs/mcu123-lpc214x/defconfig index e9ac4317fb..aa6352420d 100644 --- a/configs/mcu123-lpc214x/defconfig +++ b/configs/mcu123-lpc214x/defconfig @@ -271,7 +271,6 @@ CONFIG_PREALLOC_TIMERS=8 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -289,7 +288,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/configs/ntosd-dm320/defconfig b/configs/ntosd-dm320/defconfig index 23dd476929..0679f5dd8e 100644 --- a/configs/ntosd-dm320/defconfig +++ b/configs/ntosd-dm320/defconfig @@ -256,7 +256,6 @@ CONFIG_PREALLOC_TIMERS=8 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -274,7 +273,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 @@ -304,7 +302,7 @@ CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1) # DM90x0 Driver Settings CONFIG_NET_DM90x0=n CONFIG_DM9X_NINTERFACES=1 -CONFIG_DM9X_STATS=1 +CONFIG_DM9X_STATS=n CONFIG_DM9X_BASE=0xd0000300 CONFIG_DM9X_IRQ=27 CONFIG_DM9X_BUSWIDTH8=n diff --git a/configs/ntosd-dm320/netconfig b/configs/ntosd-dm320/netconfig index 10cca587f8..e77eb15eda 100644 --- a/configs/ntosd-dm320/netconfig +++ b/configs/ntosd-dm320/netconfig @@ -257,7 +257,6 @@ CONFIG_PREALLOC_TIMERS=8 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -275,7 +274,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 @@ -305,7 +303,7 @@ CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1) # DM90x0 Driver Settings CONFIG_NET_DM90x0=y CONFIG_DM9X_NINTERFACES=1 -CONFIG_DM9X_STATS=1 +CONFIG_DM9X_STATS=n CONFIG_DM9X_BASE=0xd0000300 CONFIG_DM9X_IRQ=27 CONFIG_DM9X_BUSWIDTH8=n diff --git a/configs/pjrc-8051/defconfig b/configs/pjrc-8051/defconfig index 437972266e..61ad5c12cc 100644 --- a/configs/pjrc-8051/defconfig +++ b/configs/pjrc-8051/defconfig @@ -244,7 +244,6 @@ CONFIG_PREALLOC_TIMERS=0 # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -262,7 +261,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/configs/sim/defconfig b/configs/sim/defconfig index 9bfe03c9dd..ecb96f2248 100644 --- a/configs/sim/defconfig +++ b/configs/sim/defconfig @@ -218,7 +218,6 @@ CONFIG_FS_FAT=y # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -236,7 +235,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=n CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/configs/sim/netconfig b/configs/sim/netconfig index c7fb10aa2e..5c4f09fbcb 100644 --- a/configs/sim/netconfig +++ b/configs/sim/netconfig @@ -219,7 +219,6 @@ CONFIG_FS_FAT=y # CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) # CONFIG_NET_SOCKOPTS - Enable or disable support for socket options # CONFIG_NET_BUFFER_SIZE - uIP buffer size -# CONFIG_NET_LOGGING - Logging on or off # CONFIG_NET_UDP - UDP support on or off # CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off # CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections @@ -237,7 +236,6 @@ CONFIG_NET_MAX_CONNECTIONS=40 CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_BUFFER_SIZE=420 -CONFIG_NET_LOGGING=y CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y #CONFIG_NET_UDP_CONNS=10 diff --git a/examples/nettest/nettest.c b/examples/nettest/nettest.c index 9bcee01ff0..c015696f1d 100644 --- a/examples/nettest/nettest.c +++ b/examples/nettest/nettest.c @@ -102,16 +102,3 @@ int user_start(int argc, char *argv[]) return 0; } - -/**************************************************************************** - * uip_log - ****************************************************************************/ - -void uip_log(char *m) -{ - /* Since uip_log is called from interrupt handling logic, it cannot use - * or other standard I/O. This should work from an interrupt handler: - */ - - lib_rawprintf("uIP log message: %s\n", m); -} diff --git a/examples/uip/main.c b/examples/uip/main.c index eaac73a997..e78634a5a9 100644 --- a/examples/uip/main.c +++ b/examples/uip/main.c @@ -208,15 +208,6 @@ int user_start(int argc, char *argv[]) return 0; } -void uip_log(char *m) -{ - /* Since uip_log is called from interrupt handling logic, it cannot use - * or other standard I/O. This should work from an interrupt handler: - */ - - lib_rawprintf("uIP log message: %s\n", m); -} - #if defined(CONFIG_EXAMPLE_UIP_WEBCLIENT) void webclient_closed(void) { diff --git a/include/net/uip/uip.h b/include/net/uip/uip.h index 4a3afd3249..15c72b22c4 100644 --- a/include/net/uip/uip.h +++ b/include/net/uip/uip.h @@ -960,12 +960,4 @@ extern void uip_udpdisable(struct uip_udp_conn *conn); (in_addr_t)(dest) = (in_addr_t)(src) & (in_addr_t)(mask); \ } while(0) -/* Print out a uIP log message. - * - * This function must be implemented by the module that uses uIP, and - * is called by uIP whenever a log message is generated. - */ - -extern void uip_log(char *msg); - #endif /* __NET_UIP_UIP_H */ diff --git a/net/uip/uip-icmpinput.c b/net/uip/uip-icmpinput.c index c3d30dd4e1..b6eace7721 100644 --- a/net/uip/uip-icmpinput.c +++ b/net/uip/uip-icmpinput.c @@ -110,7 +110,7 @@ void uip_icmpinput(struct uip_driver_s *dev) if (ICMPBUF->type != ICMP_ECHO) { - uip_log("icmp: not ICMP echo."); + dbg("Unknown ICMP cmd: %d\n", ICMPBUF->type); goto typeerr; } @@ -213,7 +213,7 @@ typeerr: } else { - uip_log("icmp: unknown ICMP6 message."); + dbg("Unknown ICMP6 cmd: %d\n", ICMPBUF->type); goto typeerr; } diff --git a/net/uip/uip-input.c b/net/uip/uip-input.c index 660927d38a..1c3de79e65 100644 --- a/net/uip/uip-input.c +++ b/net/uip/uip-input.c @@ -316,7 +316,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.vhlerr++; #endif - uip_log("ipv6: invalid version."); + dbg("Invalid IPv6 version: %d\n", BUF->vtc >> 4); goto drop; } #else /* CONFIG_NET_IPv6 */ @@ -330,7 +330,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.vhlerr++; #endif - uip_log("ip: invalid version or header length."); + dbg("Invalid IP version or header length: %02x\n", BUF->vhl); goto drop; } #endif /* CONFIG_NET_IPv6 */ @@ -359,7 +359,7 @@ void uip_input(struct uip_driver_s *dev) } else { - uip_log("ip: packet shorter than reported in IP header."); + dbg("IP packet shorter than length in IP header\n"); goto drop; } @@ -379,7 +379,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.fragerr++; #endif - uip_log("ip: fragment dropped."); + dbg("IP fragment dropped\n"); goto drop; #endif /* UIP_REASSEMBLY */ } @@ -395,14 +395,14 @@ void uip_input(struct uip_driver_s *dev) #if UIP_PINGADDRCONF && !CONFIG_NET_IPv6 if (BUF->proto == UIP_PROTO_ICMP) { - uip_log("ip: possible ping config packet received."); + dbg("Possible ping config packet received\n"); uip_icmpinput(dev); goto done; } else #endif /* UIP_PINGADDRCONF */ { - uip_log("ip: packet dropped since no address assigned."); + dbg("No IP address assigned\n"); goto drop; } } @@ -457,7 +457,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.chkerr++; #endif - uip_log("ip: bad checksum."); + dbg("Bad IP checksum\n"); goto drop; } #endif /* CONFIG_NET_IPv6 */ @@ -494,7 +494,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.protoerr++; #endif - uip_log("ip: Unrecognized IP protocol."); + dbg("Unrecognized IP protocol\n"); goto drop; } diff --git a/net/uip/uip-internal.h b/net/uip/uip-internal.h index c463d6ae02..4d7309f298 100644 --- a/net/uip/uip-internal.h +++ b/net/uip/uip-internal.h @@ -192,18 +192,6 @@ EXTERN void uip_udpcallback(struct uip_driver_s *dev); EXTERN void uip_icmpinput(struct uip_driver_s *dev); -/* UIP logging **************************************************************/ - -/* This function must be provided by the application if CONFIG_NET_LOGGING - * is defined. - */ - -#ifdef CONFIG_NET_LOGGING -EXTERN void uip_log(char *msg); -#else -# define uip_log(m) -#endif - #undef EXTERN #ifdef __cplusplus } diff --git a/net/uip/uip-tcpinput.c b/net/uip/uip-tcpinput.c index b8a225dbce..71cd54d9e1 100644 --- a/net/uip/uip-tcpinput.c +++ b/net/uip/uip-tcpinput.c @@ -115,7 +115,7 @@ void uip_tcpinput(struct uip_driver_s *dev) uip_stat.tcp.drop++; uip_stat.tcp.chkerr++; #endif - uip_log("tcp: bad checksum."); + dbg("Bad TCP checksum\n"); goto drop; } @@ -179,7 +179,7 @@ void uip_tcpinput(struct uip_driver_s *dev) #ifdef CONFIG_NET_STATISTICS uip_stat.tcp.syndrop++; #endif - uip_log("tcp: found no unused connections."); + dbg("No free TCP connections\n"); goto drop; } @@ -276,8 +276,7 @@ found: if (BUF->flags & TCP_RST) { uip_connr->tcpstateflags = UIP_CLOSED; - vdbg("TCP state: UIP_CLOSED\n"); - uip_log("tcp: got reset, aborting connection."); + dbg("Recvd reset - TCP state: UIP_CLOSED\n"); uip_flags = UIP_ABORT; uip_tcpcallback(dev); diff --git a/net/uip/uip-udpinput.c b/net/uip/uip-udpinput.c index d3b1aa2d8b..6bd347355d 100644 --- a/net/uip/uip-udpinput.c +++ b/net/uip/uip-udpinput.c @@ -109,7 +109,7 @@ void uip_udpinput(struct uip_driver_s *dev) uip_stat.udp.drop++; uip_stat.udp.chkerr++; #endif - uip_log("udp: bad checksum."); + dbg("Bad UDP checksum\n"); dev->d_len = 0; } else @@ -145,7 +145,7 @@ void uip_udpinput(struct uip_driver_s *dev) } else { - uip_log("udp: no matching connection found"); + dbg("No listener on UDP port\n"); dev->d_len = 0; } }