diff options
Diffstat (limited to 'nuttx')
27 files changed, 166 insertions, 124 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 9ebb96cce..90ed1ba08 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -868,3 +868,7 @@ removing the check should improve write throughput * Add DEBUG configuration option to enable debug console output without disabling optimization (and vice versa) + * Changed lots of occurrents of debug macro dbg() to lldbg(). dbg() uses + stdout to output debug data. That works fine unless (1) the dbg() macro + is interrupt logic and the interrupted task has redirected stdout! Most + changes were in uIP. diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index dd13cb799..121ba36a5 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -1529,6 +1529,9 @@ nuttx-0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> removing the check should improve write throughput * Add DEBUG configuration option to enable debug console output without disabling optimization (and vice versa) + * Changed lots of occurrents of debug macro dbg() to lldbg(). dbg() uses + stdout to output debug data. That works fine unless (1) the dbg() macro + is interrupt logic and the interrupted task has redirected stdout! Most pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c index 21adc236a..5d9e4b711 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c @@ -1306,7 +1306,7 @@ static inline int lm3s_ethinitialize(int intf) /* Check if the Ethernet module is present */ - nlldbg("Setting up eth%d\n", intf); + ndbg("Setting up eth%d\n", intf); #if LM3S_NETHCONTROLLERS > 1 # error "This debug check only works with one interface" diff --git a/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig index 1e49fabfe..e6a65f5cd 100644 --- a/nuttx/configs/eagle100/thttpd/defconfig +++ b/nuttx/configs/eagle100/thttpd/defconfig @@ -263,7 +263,6 @@ CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n CONFIG_DEBUG_NET=y -CONFIG_DEBUG_BINFMT=y CONFIG_MM_REGIONS=1 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 diff --git a/nuttx/include/debug.h b/nuttx/include/debug.h index f7dce775e..c4f8ea346 100644 --- a/nuttx/include/debug.h +++ b/nuttx/include/debug.h @@ -48,7 +48,42 @@ * Definitions ****************************************************************************/ -/* Debug macros to runtime filter the opsys debug messages */ +/* Debug macros to runtime filter the debug messages sent to the console. In + * general, there are four forms of the debug macros: + * + * [a-z]dbg() -- Outputs messages to the console similar to printf() except + * that the output is not buffered. The first character indicates the + * system system (e.g., n=network, f=filesystm, etc.). If the first + * character is missing (i.e., dbg()), then it is common. The common + * dbg() macro is enabled by CONFIG_DEBUG. Subystem debug requires an + * additional configuration setting to enable it (e.g., CONFIG_DEBUG_NET + * for the network, CONFIG_DEBUG_FS for the file syste, etc). + * + * In general, error messages and output of importance use [a-z]dbg(). + * [a-z]dbg() is implementation dependent but usually uses file descriptors. + * (that is a problem only because the interrupt task may have re- + * directed stdout). Therefore [a-z]dbg() should not be used in interrupt + * handlers. + * + * [a-z]vdbg() -- Identifcal to [a-z]dbg() except that it also requires that + * CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug + * output that you would normally want to suppress. + * + * [a-z]lldbg() -- Identical to [a-z]dbg() except this is uses special + * interfaces provided by architecture-specific logic to talk directly + * to the underlying console hardware. If the architecture provides such + * logic, it should define CONFIG_ARCH_LOWPUTC. + * + * [a-z]lldbg() should not be used in normal code because the implementation + * probably disables interrupts and does things that are not consistent with + * good real-time performance. However, [a-z]lldbg() is particularly useful + * in low-level code where it is inappropriate to use file descriptors. For + * example, only [a-z]lldbg() should be used in interrupt handlers. + * + * [a-z]llvdbg() -- Identifcal to [a-z]lldbg() except that it also requires that + * CONFIG_DEBUG_VERBOSE be defined. This is intended for general debug + * output that you would normally want to suppress. + */ #ifdef CONFIG_HAVE_FUNCTIONNAME # define EXTRA_FMT "%s: " @@ -177,9 +212,9 @@ #endif #ifdef CONFIG_DEBUG_BINFMT -# define bdbg(format, arg...) lldbg(format, ##arg) +# define bdbg(format, arg...) dbg(format, ##arg) # define blldbg(format, arg...) lldbg(format, ##arg) -# define bvdbg(format, arg...) llvdbg(format, ##arg) +# define bvdbg(format, arg...) vdbg(format, ##arg) # define bllvdbg(format, arg...) llvdbg(format, ##arg) #else # define bdbg(x...) @@ -298,9 +333,9 @@ #endif #ifdef CONFIG_DEBUG_BINFMT -# define bdbg lldbg +# define bdbg dbg # define blldbg lldbg -# define bvdbg llvdbg +# define bvdbg vdbg # define bllvdbg llvdbg #else # define bdbg (void) diff --git a/nuttx/net/connect.c b/nuttx/net/connect.c index b530fd4d8..16f3e3583 100644 --- a/nuttx/net/connect.c +++ b/nuttx/net/connect.c @@ -113,7 +113,7 @@ static void connection_event(struct uip_conn *conn, uint16 flags) if (psock) { - nvdbg("flags: %04x s_flags: %02x\n", flags, psock->s_flags); + nllvdbg("flags: %04x s_flags: %02x\n", flags, psock->s_flags); /* UIP_CLOSE: The remote host has closed the connection * UIP_ABORT: The remote host has aborted the connection @@ -227,7 +227,7 @@ static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn, { struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* 'priv' might be null in some race conditions (?) */ @@ -283,7 +283,7 @@ static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn, return flags & ~UIP_NEWDATA; } - nvdbg("Resuming: %d\n", pstate->tc_result); + nllvdbg("Resuming: %d\n", pstate->tc_result); /* Stop further callbacks */ diff --git a/nuttx/net/net_close.c b/nuttx/net/net_close.c index b05fc338f..6dc160aca 100644 --- a/nuttx/net/net_close.c +++ b/nuttx/net/net_close.c @@ -92,7 +92,7 @@ static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn, { struct tcp_close_s *pstate = (struct tcp_close_s *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); if (pstate) { @@ -108,7 +108,7 @@ static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn, pstate->cl_cb->priv = NULL; pstate->cl_cb->event = NULL; sem_post(&pstate->cl_sem); - nvdbg("Resuming\n"); + nllvdbg("Resuming\n"); } else { diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index 0c5e5c75d..b982f6ae6 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -106,7 +106,7 @@ static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn, { FAR struct pollfd *fds = (FAR struct pollfd *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* 'priv' might be null in some race conditions (?) */ diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index 2eaba9f13..5e6325659 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -129,7 +129,7 @@ static void recvfrom_newdata(struct uip_driver_s *dev, struct recvfrom_s *pstate /* Copy the new appdata into the user buffer */ memcpy(pstate->rf_buffer, dev->d_appdata, recvlen); - nvdbg("Received %d bytes (of %d)\n", (int)recvlen, (int)dev->d_len); + nllvdbg("Received %d bytes (of %d)\n", (int)recvlen, (int)dev->d_len); /* Update the accumulated size of the data read */ @@ -199,7 +199,7 @@ static inline void recvfrom_readahead(struct recvfrom_s *pstate) /* Copy the read-ahead data into the user buffer */ memcpy(pstate->rf_buffer, readahead->rh_buffer, recvlen); - nvdbg("Received %d bytes (of %d)\n", recvlen, readahead->rh_nbytes); + nllvdbg("Received %d bytes (of %d)\n", recvlen, readahead->rh_nbytes); /* Update the accumulated size of the data read */ @@ -363,7 +363,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, { struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* 'priv' might be null in some race conditions (?) */ @@ -391,7 +391,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, if (pstate->rf_buflen == 0) { - nvdbg("TCP resume\n"); + nllvdbg("TCP resume\n"); /* The TCP receive buffer is full. Return now, perhaps truncating * the received data (need to fix that). @@ -423,7 +423,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, else if ((flags & (UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT)) != 0) { - nvdbg("error\n"); + nllvdbg("error\n"); /* Stop further callbacks */ @@ -451,7 +451,7 @@ static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn, * callbacks */ - nvdbg("TCP timeout\n"); + nllvdbg("TCP timeout\n"); pstate->rf_cb->flags = 0; pstate->rf_cb->priv = NULL; @@ -546,7 +546,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, { struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* 'priv' might be null in some race conditions (?) */ @@ -562,7 +562,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, /* We are finished. */ - nvdbg("UDP done\n"); + nllvdbg("UDP done\n"); /* Don't allow any further UDP call backs. */ @@ -589,7 +589,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, else if ((flags & (UIP_CLOSE|UIP_ABORT|UIP_TIMEDOUT)) != 0) { - nvdbg("error\n"); + nllvdbg("error\n"); /* Stop further callbacks */ @@ -617,7 +617,7 @@ static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn, * callbacks */ - nvdbg("UDP timeout\n"); + nllvdbg("UDP timeout\n"); /* Stop further callbacks */ diff --git a/nuttx/net/send.c b/nuttx/net/send.c index f3d04c1a5..0ebc864f8 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -201,7 +201,8 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, struct uip_conn *conn = (struct uip_conn*)pvconn; struct send_s *pstate = (struct send_s *)pvpriv; - nvdbg("flags: %04x acked: %d sent: %d\n", flags, pstate->snd_acked, pstate->snd_sent); + nllvdbg("flags: %04x acked: %d sent: %d\n", + flags, pstate->snd_acked, pstate->snd_sent); /* If this packet contains an acknowledgement, then update the count of * acknowldged bytes. @@ -216,8 +217,8 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, */ pstate->snd_acked = send_getackno(dev) - pstate->snd_isn; - nvdbg("ACK: acked=%d sent=%d buflen=%d\n", - pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen); + nllvdbg("ACK: acked=%d sent=%d buflen=%d\n", + pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen); /* Have all of the bytes in the buffer been sent and ACKed? */ @@ -252,7 +253,7 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, { /* Report not connected */ - nvdbg("Lost connection\n"); + nllvdbg("Lost connection\n"); pstate->snd_sent = -ENOTCONN; goto end_wait; } @@ -295,8 +296,8 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, /* And update the amount of data sent (but not necessarily ACKed) */ pstate->snd_sent += sndlen; - nvdbg("SEND: acked=%d sent=%d buflen=%d\n", - pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen); + nllvdbg("SEND: acked=%d sent=%d buflen=%d\n", + pstate->snd_acked, pstate->snd_sent, pstate->snd_buflen); /* Update the send time */ @@ -314,7 +315,7 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn, { /* Yes.. report the timeout */ - nvdbg("TCP timeout\n"); + nllvdbg("TCP timeout\n"); pstate->snd_sent = -EAGAIN; goto end_wait; } diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index d74275ae7..e85ca0156 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -98,7 +98,7 @@ static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpri { struct sendto_s *pstate = (struct sendto_s *)pvpriv; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); if (pstate) { /* Check if the connection was rejected */ diff --git a/nuttx/net/uip/uip_arp.c b/nuttx/net/uip/uip_arp.c index 2f2c729d3..1b9cbe120 100644 --- a/nuttx/net/uip/uip_arp.c +++ b/nuttx/net/uip/uip_arp.c @@ -152,20 +152,20 @@ static const ubyte g_multicast_ethaddr[3] = {0x01, 0x00, 0x5e}; #if defined(CONFIG_NET_DUMPARP) && defined(CONFIG_DEBUG) static void uip_arp_dump(struct arp_hdr *arp) { - ndbg(" HW type: %04x Protocol: %04x\n", - arp->ah_hwtype, arp->ah_protocol);\ - ndbg(" HW len: %02x Proto len: %02x Operation: %04x\n", - arp->ah_hwlen, arp->ah_protolen, arp->ah_opcode); - ndbg(" Sender MAC: %02x:%02x:%02x:%02x:%02x:%02x IP: %d.%d.%d.%d\n", - arp->ah_shwaddr[0], arp->ah_shwaddr[1], arp->ah_shwaddr[2], - arp->ah_shwaddr[3], arp->ah_shwaddr[4], arp->ah_shwaddr[5], - arp->ah_sipaddr[0] & 0xff, arp->ah_sipaddr[0] >> 8, - arp->ah_sipaddr[1] & 0xff, arp->ah_sipaddr[1] >> 8); - ndbg(" Dest MAC: %02x:%02x:%02x:%02x:%02x:%02x IP: %d.%d.%d.%d\n", - arp->ah_dhwaddr[0], arp->ah_dhwaddr[1], arp->ah_dhwaddr[2], - arp->ah_dhwaddr[3], arp->ah_dhwaddr[4], arp->ah_dhwaddr[5], - arp->ah_dipaddr[0] & 0xff, arp->ah_dipaddr[0] >> 8, - arp->ah_dipaddr[1] & 0xff, arp->ah_dipaddr[1] >> 8); + nlldbg(" HW type: %04x Protocol: %04x\n", + arp->ah_hwtype, arp->ah_protocol);\ + nlldbg(" HW len: %02x Proto len: %02x Operation: %04x\n", + arp->ah_hwlen, arp->ah_protolen, arp->ah_opcode); + nlldbg(" Sender MAC: %02x:%02x:%02x:%02x:%02x:%02x IP: %d.%d.%d.%d\n", + arp->ah_shwaddr[0], arp->ah_shwaddr[1], arp->ah_shwaddr[2], + arp->ah_shwaddr[3], arp->ah_shwaddr[4], arp->ah_shwaddr[5], + arp->ah_sipaddr[0] & 0xff, arp->ah_sipaddr[0] >> 8, + arp->ah_sipaddr[1] & 0xff, arp->ah_sipaddr[1] >> 8); + nlldbg(" Dest MAC: %02x:%02x:%02x:%02x:%02x:%02x IP: %d.%d.%d.%d\n", + arp->ah_dhwaddr[0], arp->ah_dhwaddr[1], arp->ah_dhwaddr[2], + arp->ah_dhwaddr[3], arp->ah_dhwaddr[4], arp->ah_dhwaddr[5], + arp->ah_dipaddr[0] & 0xff, arp->ah_dipaddr[0] >> 8, + arp->ah_dipaddr[1] & 0xff, arp->ah_dipaddr[1] >> 8); } #else # define uip_arp_dump(arp) @@ -203,7 +203,7 @@ void uip_arp_arpin(struct uip_driver_s *dev) if (dev->d_len < (sizeof(struct arp_hdr) + UIP_LLH_LEN)) { - ndbg("Too small\n"); + nlldbg("Too small\n"); dev->d_len = 0; return; } @@ -213,7 +213,7 @@ void uip_arp_arpin(struct uip_driver_s *dev) switch(parp->ah_opcode) { case HTONS(ARP_REQUEST): - nvdbg("ARP request for IP %04lx\n", (long)ipaddr); + nllvdbg("ARP request for IP %04lx\n", (long)ipaddr); /* ARP request. If it asked for our address, we send out a reply. */ @@ -245,7 +245,7 @@ void uip_arp_arpin(struct uip_driver_s *dev) break; case HTONS(ARP_REPLY): - nvdbg("ARP reply for IP %04lx\n", (long)ipaddr); + nllvdbg("ARP reply for IP %04lx\n", (long)ipaddr); /* ARP reply. We insert or update the ARP table if it was meant * for us. @@ -356,7 +356,7 @@ void uip_arp_out(struct uip_driver_s *dev) tabptr = uip_arp_find(ipaddr); if (!tabptr) { - nvdbg("ARP request for IP %04lx\n", (long)ipaddr); + nllvdbg("ARP request for IP %04lx\n", (long)ipaddr); /* The destination address was not in our ARP table, so we * overwrite the IP packet with an ARP request. diff --git a/nuttx/net/uip/uip_callback.c b/nuttx/net/uip/uip_callback.c index 690ef47be..6d2652de8 100644 --- a/nuttx/net/uip/uip_callback.c +++ b/nuttx/net/uip/uip_callback.c @@ -132,7 +132,7 @@ FAR struct uip_callback_s *uip_callbackalloc(FAR struct uip_callback_s **list) #ifdef CONFIG_DEBUG else { - dbg("Failed to allocate callback\n"); + nlldbg("Failed to allocate callback\n"); } #endif @@ -235,7 +235,7 @@ uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn, uint16 fl * beginning of the list (which will be ignored on this pass) */ - nvdbg("Call event=%p with flags=%04x\n", list->event, flags); + nllvdbg("Call event=%p with flags=%04x\n", list->event, flags); flags = list->event(dev, pvconn, list->priv, flags); } diff --git a/nuttx/net/uip/uip_icmpinput.c b/nuttx/net/uip/uip_icmpinput.c index e9b7a9367..2f2b2db9d 100644 --- a/nuttx/net/uip/uip_icmpinput.c +++ b/nuttx/net/uip/uip_icmpinput.c @@ -166,8 +166,8 @@ void uip_icmpinput(struct uip_driver_s *dev) } #endif - nvdbg("Outgoing ICMP packet length: %d (%d)\n", - dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); + nllvdbg("Outgoing ICMP packet length: %d (%d)\n", + dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); #ifdef CONFIG_NET_STATISTICS uip_stat.icmp.sent++; @@ -190,7 +190,7 @@ void uip_icmpinput(struct uip_driver_s *dev) else { - ndbg("Unknown ICMP cmd: %d\n", picmp->type); + nlldbg("Unknown ICMP cmd: %d\n", picmp->type); goto typeerr; } @@ -286,12 +286,12 @@ typeerr: else { - ndbg("Unknown ICMP6 cmd: %d\n", picmp->type); + nlldbg("Unknown ICMP6 cmd: %d\n", picmp->type); goto typeerr; } - nvdbg("Outgoing ICMP6 packet length: %d (%d)\n", - dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); + nllvdbg("Outgoing ICMP6 packet length: %d (%d)\n", + dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); #ifdef CONFIG_NET_STATISTICS uip_stat.icmp.sent++; diff --git a/nuttx/net/uip/uip_icmpping.c b/nuttx/net/uip/uip_icmpping.c index 00c6a7905..c1af6b5d1 100644 --- a/nuttx/net/uip/uip_icmpping.c +++ b/nuttx/net/uip/uip_icmpping.c @@ -153,7 +153,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, int failcode = -ETIMEDOUT; int i; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); if (pstate) { /* Check if this device is on the same network as the destination device. */ @@ -165,7 +165,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, * that the destination address is not reachable. */ - nvdbg("Not reachable\n"); + nllvdbg("Not reachable\n"); failcode = -ENETUNREACH; } else @@ -179,7 +179,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, if ((flags & UIP_ECHOREPLY) != 0 && conn != NULL) { struct uip_icmpip_hdr *icmp = (struct uip_icmpip_hdr *)conn; - ndbg("ECHO reply: id=%d seqno=%d\n", ntohs(icmp->id), ntohs(icmp->seqno)); + nlldbg("ECHO reply: id=%d seqno=%d\n", ntohs(icmp->id), ntohs(icmp->seqno)); if (ntohs(icmp->id) == pstate->png_id) { @@ -240,7 +240,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, * of the ICMP header. */ - ndbg("Send ECHO request: seqno=%d\n", pstate->png_seqno); + nlldbg("Send ECHO request: seqno=%d\n", pstate->png_seqno); dev->d_sndlen= pstate->png_datlen + 4; uip_icmpsend(dev, &pstate->png_addr); pstate->png_sent = TRUE; @@ -254,7 +254,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, { /* Yes.. report the timeout */ - ndbg("Ping timeout\n"); + nlldbg("Ping timeout\n"); pstate->png_result = failcode; goto end_wait; } @@ -264,7 +264,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn, return flags; end_wait: - nvdbg("Resuming\n"); + nllvdbg("Resuming\n"); /* Do not allow any further callbacks */ @@ -349,7 +349,7 @@ int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dse * re-enabled when the task restarts. */ - ndbg("Start time: 0x%08x seqno: %d\n", state.png_time, seqno); + nlldbg("Start time: 0x%08x seqno: %d\n", state.png_time, seqno); sem_wait(&state.png_sem); uip_icmpcallbackfree(state.png_cb); @@ -362,12 +362,12 @@ int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dse if (!state.png_result) { - ndbg("Return seqno=%d\n", state.png_seqno); + nlldbg("Return seqno=%d\n", state.png_seqno); return (int)state.png_seqno; } else { - ndbg("Return error=%d\n", -state.png_result); + nlldbg("Return error=%d\n", -state.png_result); return state.png_result; } } diff --git a/nuttx/net/uip/uip_icmpsend.c b/nuttx/net/uip/uip_icmpsend.c index 0c3784e95..21d8587bc 100644 --- a/nuttx/net/uip/uip_icmpsend.c +++ b/nuttx/net/uip/uip_icmpsend.c @@ -156,8 +156,8 @@ void uip_icmpsend(struct uip_driver_s *dev, uip_ipaddr_t *destaddr) picmp->icmpchksum = 0xffff; } - nvdbg("Outgoing ICMP packet length: %d (%d)\n", - dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); + nllvdbg("Outgoing ICMP packet length: %d (%d)\n", + dev->d_len, (picmp->len[0] << 8) | picmp->len[1]); #ifdef CONFIG_NET_STATISTICS uip_stat.icmp.sent++; diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c index fe5302644..38b388332 100644 --- a/nuttx/net/uip/uip_input.c +++ b/nuttx/net/uip/uip_input.c @@ -318,7 +318,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.vhlerr++; #endif - ndbg("Invalid IPv6 version: %d\n", pbuf->vtc >> 4); + nlldbg("Invalid IPv6 version: %d\n", pbuf->vtc >> 4); goto drop; } #else /* CONFIG_NET_IPv6 */ @@ -332,7 +332,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.vhlerr++; #endif - ndbg("Invalid IP version or header length: %02x\n", pbuf->vhl); + nlldbg("Invalid IP version or header length: %02x\n", pbuf->vhl); goto drop; } #endif /* CONFIG_NET_IPv6 */ @@ -361,7 +361,7 @@ void uip_input(struct uip_driver_s *dev) } else { - ndbg("IP packet shorter than length in IP header\n"); + nlldbg("IP packet shorter than length in IP header\n"); goto drop; } @@ -381,7 +381,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.fragerr++; #endif - ndbg("IP fragment dropped\n"); + nlldbg("IP fragment dropped\n"); goto drop; #endif /* UIP_REASSEMBLY */ } @@ -423,14 +423,14 @@ void uip_input(struct uip_driver_s *dev) #if defined(CONFIG_NET_PINGADDRCONF) && !defined(CONFIG_NET_IPv6) if (pbuf->proto == UIP_PROTO_ICMP) { - ndbg("Possible ping config packet received\n"); + nlldbg("Possible ping config packet received\n"); uip_icmpinput(dev); goto done; } else #endif { - ndbg("No IP address assigned\n"); + nlldbg("No IP address assigned\n"); goto drop; } } @@ -476,7 +476,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.drop++; uip_stat.ip.chkerr++; #endif - ndbg("Bad IP checksum\n"); + nlldbg("Bad IP checksum\n"); goto drop; } #endif /* CONFIG_NET_IPv6 */ @@ -517,7 +517,7 @@ void uip_input(struct uip_driver_s *dev) uip_stat.ip.protoerr++; #endif - ndbg("Unrecognized IP protocol\n"); + nlldbg("Unrecognized IP protocol\n"); goto drop; } diff --git a/nuttx/net/uip/uip_neighbor.c b/nuttx/net/uip/uip_neighbor.c index 4091ace41..88f80da84 100644 --- a/nuttx/net/uip/uip_neighbor.c +++ b/nuttx/net/uip/uip_neighbor.c @@ -81,10 +81,10 @@ void uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr) int i, oldest; uint8 oldest_time; - ndbg("Add neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - addr->addr.ether_addr_octet[0], addr->addr.ether_addr_octet[1], - addr->addr.ether_addr_octet[2], addr->addr.ether_addr_octet[3], - addr->addr.ether_addr_octet[4], addr->addr.ether_addr_octet[5]); + nlldbg("Add neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", + addr->addr.ether_addr_octet[0], addr->addr.ether_addr_octet[1], + addr->addr.ether_addr_octet[2], addr->addr.ether_addr_octet[3], + addr->addr.ether_addr_octet[4], addr->addr.ether_addr_octet[5]); /* Find the first unused entry or the oldest used entry. */ @@ -150,10 +150,10 @@ struct uip_neighbor_addr *uip_neighbor_lookup(uip_ipaddr_t ipaddr) e = find_entry(ipaddr); if (e != NULL) { - ndbg("Lookup neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", - e->addr.addr.ether_addr_octet[0], e->addr.addr.ether_addr_octet[1], - e->addr.addr.ether_addr_octet[2], e->addr.addr.ether_addr_octet[3], - e->addr.addr.ether_addr_octet[4], e->addr.addr.ether_addr_octet[5]); + nlldbg("Lookup neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n", + e->addr.addr.ether_addr_octet[0], e->addr.addr.ether_addr_octet[1], + e->addr.addr.ether_addr_octet[2], e->addr.addr.ether_addr_octet[3], + e->addr.addr.ether_addr_octet[4], e->addr.addr.ether_addr_octet[5]); return &e->addr; } diff --git a/nuttx/net/uip/uip_tcpappsend.c b/nuttx/net/uip/uip_tcpappsend.c index 786ea7081..b5facfccf 100644 --- a/nuttx/net/uip/uip_tcpappsend.c +++ b/nuttx/net/uip/uip_tcpappsend.c @@ -96,7 +96,7 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 resu { /* Handle the result based on the application response */ - nvdbg("result: %04x\n", result); + nllvdbg("result: %04x\n", result); /* Check for connection aborted */ @@ -104,7 +104,7 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 resu { dev->d_sndlen = 0; conn->tcpstateflags = UIP_CLOSED; - nvdbg("TCP state: UIP_CLOSED\n"); + nllvdbg("TCP state: UIP_CLOSED\n"); uip_tcpsend(dev, conn, TCP_RST | TCP_ACK, UIP_IPTCPH_LEN); } @@ -116,7 +116,7 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 resu conn->tcpstateflags = UIP_FIN_WAIT_1; conn->len = 1; conn->nrtx = 0; - nvdbg("TCP state: UIP_FIN_WAIT_1\n"); + nllvdbg("TCP state: UIP_FIN_WAIT_1\n"); dev->d_sndlen = 0; uip_tcpsend(dev, conn, TCP_FIN | TCP_ACK, UIP_IPTCPH_LEN); @@ -202,7 +202,7 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 resu void uip_tcprexmit(struct uip_driver_s *dev, struct uip_conn *conn, uint16 result) { - nvdbg("result: %04x\n", result); + nllvdbg("result: %04x\n", result); dev->d_appdata = dev->d_snddata; diff --git a/nuttx/net/uip/uip_tcpbacklog.c b/nuttx/net/uip/uip_tcpbacklog.c index d97acde9c..7e2b6ede4 100644 --- a/nuttx/net/uip/uip_tcpbacklog.c +++ b/nuttx/net/uip/uip_tcpbacklog.c @@ -84,7 +84,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg) int offset; int i; - nvdbg("conn=%p nblg=%d\n", conn, nblg); + nllvdbg("conn=%p nblg=%d\n", conn, nblg); #ifdef CONFIG_DEBUG if (!conn) @@ -116,7 +116,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg) bls = (FAR struct uip_backlog_s *)zalloc(size); if (!bls) { - ndbg("Failed to allocate backlog\n"); + nlldbg("Failed to allocate backlog\n"); return -ENOMEM; } @@ -167,7 +167,7 @@ int uip_backlogdestroy(FAR struct uip_conn *conn) FAR struct uip_blcontainer_s *blc; FAR struct uip_conn *blconn; - nvdbg("conn=%p\n", conn); + nllvdbg("conn=%p\n", conn); #ifdef CONFIG_DEBUG if (!conn) @@ -227,7 +227,7 @@ int uip_backlogadd(FAR struct uip_conn *conn, FAR struct uip_conn *blconn) FAR struct uip_blcontainer_s *blc; int ret = -EINVAL; - nvdbg("conn=%p blconn=%p\n", conn, blconn); + nllvdbg("conn=%p blconn=%p\n", conn, blconn); #ifdef CONFIG_DEBUG if (!conn) @@ -244,7 +244,7 @@ int uip_backlogadd(FAR struct uip_conn *conn, FAR struct uip_conn *blconn) blc = (FAR struct uip_blcontainer_s *)sq_remfirst(&bls->bl_free); if (!blc) { - ndbg("Failed to allocate container\n"); + nlldbg("Failed to allocate container\n"); ret = -ENOMEM; } else @@ -325,7 +325,7 @@ struct uip_conn *uip_backlogremove(FAR struct uip_conn *conn) } } - nvdbg("conn=%p, returning %p\n", conn, blconn); + nllvdbg("conn=%p, returning %p\n", conn, blconn); return blconn; } @@ -348,7 +348,7 @@ int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn) FAR struct uip_blcontainer_s *blc; FAR struct uip_blcontainer_s *prev; - nvdbg("conn=%p blconn=%p\n", conn, blconn); + nllvdbg("conn=%p blconn=%p\n", conn, blconn); #ifdef CONFIG_DEBUG if (!conn) @@ -393,7 +393,7 @@ int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn) } } - ndbg("Failed to find pending connection\n"); + nlldbg("Failed to find pending connection\n"); return -EINVAL; } return OK; diff --git a/nuttx/net/uip/uip_tcpcallback.c b/nuttx/net/uip/uip_tcpcallback.c index 600000043..e6983c971 100644 --- a/nuttx/net/uip/uip_tcpcallback.c +++ b/nuttx/net/uip/uip_tcpcallback.c @@ -136,7 +136,7 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags) int buflen = dev->d_len; #endif - nvdbg("No listener on connection\n"); + nllvdbg("No listener on connection\n"); #if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 /* First, we need to determine if we have space to buffer the data. This @@ -181,7 +181,7 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags) sq_addlast(&readahead2->rh_node, &conn->readahead); } - nvdbg("Buffered %d bytes\n", dev->d_len); + nllvdbg("Buffered %d bytes\n", dev->d_len); } else #endif @@ -190,7 +190,7 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags) * read-ahead buffers to retain the data -- drop the packet. */ - nvdbg("Dropped %d bytes\n", dev->d_len); + nllvdbg("Dropped %d bytes\n", dev->d_len); #ifdef CONFIG_NET_STATISTICS uip_stat.tcp.syndrop++; @@ -233,7 +233,7 @@ uint16 uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn, uint16 f uint16 ret = flags; - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* Perform the data callback. When a data callback is executed from 'list', * the input flags are normally returned, however, the implementation diff --git a/nuttx/net/uip/uip_tcpinput.c b/nuttx/net/uip/uip_tcpinput.c index f417c2c7b..b1885a093 100644 --- a/nuttx/net/uip/uip_tcpinput.c +++ b/nuttx/net/uip/uip_tcpinput.c @@ -122,7 +122,7 @@ void uip_tcpinput(struct uip_driver_s *dev) uip_stat.tcp.drop++; uip_stat.tcp.chkerr++; #endif - ndbg("Bad TCP checksum\n"); + nlldbg("Bad TCP checksum\n"); goto drop; } @@ -187,7 +187,7 @@ void uip_tcpinput(struct uip_driver_s *dev) #ifdef CONFIG_NET_STATISTICS uip_stat.tcp.syndrop++; #endif - ndbg("No free TCP connections\n"); + nlldbg("No free TCP connections\n"); goto drop; } @@ -282,7 +282,7 @@ found: if (pbuf->flags & TCP_RST) { conn->tcpstateflags = UIP_CLOSED; - ndbg("RESET - TCP state: UIP_CLOSED\n"); + nlldbg("RESET - TCP state: UIP_CLOSED\n"); (void)uip_tcpcallback(dev, conn, UIP_ABORT); goto drop; @@ -392,7 +392,7 @@ found: { conn->tcpstateflags = UIP_ESTABLISHED; conn->len = 0; - nvdbg("TCP state: UIP_ESTABLISHED\n"); + nllvdbg("TCP state: UIP_ESTABLISHED\n"); flags = UIP_CONNECTED; @@ -474,7 +474,7 @@ found: conn->tcpstateflags = UIP_ESTABLISHED; memcpy(conn->rcv_nxt, pbuf->seqno, 4); - nvdbg("TCP state: UIP_ESTABLISHED\n"); + nllvdbg("TCP state: UIP_ESTABLISHED\n"); uip_incr32(conn->rcv_nxt, 1); conn->len = 0; @@ -492,7 +492,7 @@ found: /* The connection is closed after we send the RST */ conn->tcpstateflags = UIP_CLOSED; - nvdbg("Connection failed - TCP state: UIP_CLOSED\n"); + nllvdbg("Connection failed - TCP state: UIP_CLOSED\n"); /* We do not send resets in response to resets. */ @@ -536,7 +536,7 @@ found: conn->tcpstateflags = UIP_LAST_ACK; conn->len = 1; conn->nrtx = 0; - nvdbg("TCP state: UIP_LAST_ACK\n"); + nllvdbg("TCP state: UIP_LAST_ACK\n"); uip_tcpsend(dev, conn, TCP_FIN | TCP_ACK, UIP_IPTCPH_LEN); return; @@ -641,7 +641,7 @@ found: if (flags & UIP_ACKDATA) { conn->tcpstateflags = UIP_CLOSED; - nvdbg("UIP_LAST_ACK TCP state: UIP_CLOSED\n"); + nllvdbg("UIP_LAST_ACK TCP state: UIP_CLOSED\n"); (void)uip_tcpcallback(dev, conn, UIP_CLOSE); } @@ -664,12 +664,12 @@ found: conn->tcpstateflags = UIP_TIME_WAIT; conn->timer = 0; conn->len = 0; - nvdbg("TCP state: UIP_TIME_WAIT\n"); + nllvdbg("TCP state: UIP_TIME_WAIT\n"); } else { conn->tcpstateflags = UIP_CLOSING; - nvdbg("TCP state: UIP_CLOSING\n"); + nllvdbg("TCP state: UIP_CLOSING\n"); } uip_incr32(conn->rcv_nxt, 1); @@ -681,7 +681,7 @@ found: { conn->tcpstateflags = UIP_FIN_WAIT_2; conn->len = 0; - nvdbg("TCP state: UIP_FIN_WAIT_2\n"); + nllvdbg("TCP state: UIP_FIN_WAIT_2\n"); goto drop; } @@ -702,7 +702,7 @@ found: { conn->tcpstateflags = UIP_TIME_WAIT; conn->timer = 0; - nvdbg("TCP state: UIP_TIME_WAIT\n"); + nllvdbg("TCP state: UIP_TIME_WAIT\n"); uip_incr32(conn->rcv_nxt, 1); (void)uip_tcpcallback(dev, conn, UIP_CLOSE); @@ -726,7 +726,7 @@ found: { conn->tcpstateflags = UIP_TIME_WAIT; conn->timer = 0; - nvdbg("TCP state: UIP_TIME_WAIT\n"); + nllvdbg("TCP state: UIP_TIME_WAIT\n"); } default: diff --git a/nuttx/net/uip/uip_tcpsend.c b/nuttx/net/uip/uip_tcpsend.c index a5bb1d715..474797ff5 100644 --- a/nuttx/net/uip/uip_tcpsend.c +++ b/nuttx/net/uip/uip_tcpsend.c @@ -142,8 +142,8 @@ static void uip_tcpsendcomplete(struct uip_driver_s *dev) #endif /* CONFIG_NET_IPv6 */ - nvdbg("Outgoing TCP packet length: %d (%d)\n", - dev->d_len, (pbuf->len[0] << 8) | pbuf->len[1]); + nllvdbg("Outgoing TCP packet length: %d (%d)\n", + dev->d_len, (pbuf->len[0] << 8) | pbuf->len[1]); #ifdef CONFIG_NET_STATISTICS uip_stat.tcp.sent++; diff --git a/nuttx/net/uip/uip_tcptimer.c b/nuttx/net/uip/uip_tcptimer.c index 29cad8009..32d213ad6 100644 --- a/nuttx/net/uip/uip_tcptimer.c +++ b/nuttx/net/uip/uip_tcptimer.c @@ -2,7 +2,7 @@ * net/uip/uip_tcptimer.c * Poll for the availability of TCP TX data * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Adapted for NuttX from logic in uIP which also has a BSD-like license: @@ -123,7 +123,7 @@ void uip_tcptimer(struct uip_driver_s *dev, struct uip_conn *conn, int hsec) if (conn->timer >= UIP_TIME_WAIT_TIMEOUT) { conn->tcpstateflags = UIP_CLOSED; - nvdbg("TCP state: UIP_CLOSED\n"); + nllvdbg("TCP state: UIP_CLOSED\n"); } } else if (conn->tcpstateflags != UIP_CLOSED) @@ -157,7 +157,7 @@ void uip_tcptimer(struct uip_driver_s *dev, struct uip_conn *conn, int hsec) conn->nrtx == UIP_MAXSYNRTX)) { conn->tcpstateflags = UIP_CLOSED; - nvdbg("TCP state: UIP_CLOSED\n"); + nllvdbg("TCP state: UIP_CLOSED\n"); /* We call uip_tcpcallback() with UIP_TIMEDOUT to * inform the application that the connection has diff --git a/nuttx/net/uip/uip_udpcallback.c b/nuttx/net/uip/uip_udpcallback.c index 1f980ae2f..c3b3551b7 100644 --- a/nuttx/net/uip/uip_udpcallback.c +++ b/nuttx/net/uip/uip_udpcallback.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_udpcallback.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -75,7 +75,7 @@ void uip_udpcallback(struct uip_driver_s *dev, struct uip_udp_conn *conn, uint16 flags) { - nvdbg("flags: %04x\n", flags); + nllvdbg("flags: %04x\n", flags); /* Some sanity checking */ diff --git a/nuttx/net/uip/uip_udpinput.c b/nuttx/net/uip/uip_udpinput.c index 3e431bca9..ecf8abac1 100644 --- a/nuttx/net/uip/uip_udpinput.c +++ b/nuttx/net/uip/uip_udpinput.c @@ -112,7 +112,7 @@ void uip_udpinput(struct uip_driver_s *dev) uip_stat.udp.drop++; uip_stat.udp.chkerr++; #endif - ndbg("Bad UDP checksum\n"); + nlldbg("Bad UDP checksum\n"); dev->d_len = 0; } else @@ -142,7 +142,7 @@ void uip_udpinput(struct uip_driver_s *dev) } else { - ndbg("No listener on UDP port\n"); + nlldbg("No listener on UDP port\n"); dev->d_len = 0; } } diff --git a/nuttx/net/uip/uip_udpsend.c b/nuttx/net/uip/uip_udpsend.c index af02a3069..d7b7c5741 100644 --- a/nuttx/net/uip/uip_udpsend.c +++ b/nuttx/net/uip/uip_udpsend.c @@ -165,8 +165,8 @@ void uip_udpsend(struct uip_driver_s *dev, struct uip_udp_conn *conn) pudpbuf->udpchksum = 0; #endif - nvdbg("Outgoing UDP packet length: %d (%d)\n", - dev->d_len, (pudpbuf->len[0] << 8) | pudpbuf->len[1]); + nllvdbg("Outgoing UDP packet length: %d (%d)\n", + dev->d_len, (pudpbuf->len[0] << 8) | pudpbuf->len[1]); #ifdef CONFIG_NET_STATISTICS uip_stat.udp.sent++; |