net: Add debug configuration for 802.15.4 network driver
User can toggle 802.15.4 network driver debugging from Kconfig. Change-Id: I63f8e319172bce0561123416d18397468da671bf Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
978b880e48
commit
2ec63ec481
2 changed files with 15 additions and 1 deletions
|
@ -93,6 +93,13 @@ config NETWORK_IP_STACK_DEBUG_IPV6_ROUTE
|
|||
help
|
||||
Enables IPv6 route code part to output debug messages
|
||||
|
||||
config NETWORK_IP_STACK_DEBUG_15_4_NET_DRIVER
|
||||
bool "Debug 802.15.4 network driver"
|
||||
depends on NETWORKING_WITH_15_4
|
||||
default n
|
||||
help
|
||||
Enables 802.15.4 network driver output debug messages
|
||||
|
||||
config NETWORK_IP_STACK_DEBUG_15_4_MAC
|
||||
bool "Debug 802.15.4 MAC layer"
|
||||
depends on NETWORKING_WITH_15_4
|
||||
|
|
|
@ -39,6 +39,11 @@
|
|||
#include "contiki/netstack.h"
|
||||
#include <net_driver_15_4.h>
|
||||
|
||||
#if !defined(CONFIG_NETWORK_IP_STACK_DEBUG_15_4_NET_DRIVER)
|
||||
#undef NET_DBG
|
||||
#define NET_DBG(...)
|
||||
#endif
|
||||
|
||||
/* Stacks for the tx & rx fibers.
|
||||
* FIXME: stack size needs fine-tuning
|
||||
*/
|
||||
|
@ -65,7 +70,7 @@ static int net_driver_15_4_open(void)
|
|||
|
||||
static int net_driver_15_4_send(struct net_buf *buf)
|
||||
{
|
||||
#ifdef CONFIG_NETWORKING_WITH_LOGGING
|
||||
#if defined(CONFIG_NETWORK_IP_STACK_DEBUG_15_4_NET_DRIVER)
|
||||
int orig_len = ip_buf_len(buf);
|
||||
#endif
|
||||
|
||||
|
@ -131,6 +136,8 @@ static void net_rx_15_4_fiber(void)
|
|||
byte_count = uip_pkt_buflen(buf);
|
||||
#endif
|
||||
if (!NETSTACK_RDC.input(buf)) {
|
||||
NET_DBG("802.15.4 RDC input failed, "
|
||||
"buf %p discarded\n", buf);
|
||||
l2_buf_unref(buf);
|
||||
} else {
|
||||
#if NET_MAC_CONF_STATS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue