net: openthread: Remove remaining SYS_LOG usage

Remove the last SYS_LOG reference from OpenThread code as SYS_LOG is
being deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2018-10-19 16:17:45 +03:00
parent be092a607a
commit fb73aee36f
4 changed files with 37 additions and 54 deletions

View File

@ -24,7 +24,7 @@ CONFIG_NET_L2_OPENTHREAD=y
CONFIG_OPENTHREAD_DEBUG=y
CONFIG_OPENTHREAD_L2_DEBUG=y
CONFIG_OPENTHREAD_L2_LOG_LEVEL_INFO=y
CONFIG_OPENTHREAD_L2_LOG_LEVEL_INF=y
CONFIG_OPENTHREAD_CHANNEL=26

View File

@ -24,7 +24,7 @@ CONFIG_NET_L2_OPENTHREAD=y
CONFIG_OPENTHREAD_DEBUG=y
CONFIG_OPENTHREAD_L2_DEBUG=y
CONFIG_OPENTHREAD_L2_LOG_LEVEL_INFO=y
CONFIG_OPENTHREAD_L2_LOG_LEVEL_INF=y
CONFIG_OPENTHREAD_CHANNEL=26

View File

@ -53,7 +53,7 @@ endif
endif
config OPENTHREAD_LOG_LEVEL
config OPENTHREAD_LOG_LEVEL
int
default 1 if OPENTHREAD_LOG_LEVEL_ERROR
default 2 if OPENTHREAD_LOG_LEVEL_WARNING
@ -67,22 +67,6 @@ menuconfig OPENTHREAD_L2_DEBUG
This option enables log support for OpenThread
if OPENTHREAD_L2_DEBUG
choice
prompt "OpenThread L2 log level"
depends on OPENTHREAD_L2_DEBUG
help
This option selects log level for OpenThread driver.
config OPENTHREAD_L2_LOG_LEVEL_ERROR
bool "Error"
config OPENTHREAD_L2_LOG_LEVEL_WARNING
bool "Warning"
config OPENTHREAD_L2_LOG_LEVEL_INFO
bool "Info"
config OPENTHREAD_L2_LOG_LEVEL_DEBUG
bool "Debug"
endchoice
config OPENTHREAD_L2_DEBUG_DUMP_15_4
bool "Dump 802.15.4 packets"
help
@ -95,13 +79,11 @@ config OPENTHREAD_L2_DEBUG_DUMP_IPV6
endif
config OPENTHREAD_L2_LOG_LEVEL
int
default 1 if OPENTHREAD_L2_LOG_LEVEL_ERROR
default 2 if OPENTHREAD_L2_LOG_LEVEL_WARNING
default 3 if OPENTHREAD_L2_LOG_LEVEL_INFO
default 4 if OPENTHREAD_L2_LOG_LEVEL_DEBUG
default 0
module = OPENTHREAD_L2
module-dep = NET_LOG
module-str = Log level for OpenThread driver
module-help = Enables OpenThread driver to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
config OPENTHREAD_THREAD_PRIORITY
int "OpenThread thread priority"

View File

@ -70,14 +70,15 @@ void add_ipv6_addr_to_zephyr(struct openthread_context *context)
for (address = otIp6GetUnicastAddresses(context->instance);
address; address = address->mNext) {
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
char buf[NET_IPV6_ADDR_LEN];
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Adding %s",
log_strdup(net_addr_ntop(AF_INET6,
NET_DBG("Adding %s",
log_strdup(net_addr_ntop(AF_INET6,
(struct in6_addr *)(&address->mAddress),
buf, sizeof(buf))));
#endif
}
net_if_ipv6_addr_add(context->iface,
(struct in6_addr *)(&address->mAddress),
NET_ADDR_ANY, 0);
@ -114,8 +115,7 @@ void add_ipv6_addr_to_ot(struct openthread_context *context)
otIp6AddUnicastAddress(context->instance, &addr);
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
{
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Added %s",
@ -123,7 +123,6 @@ void add_ipv6_addr_to_ot(struct openthread_context *context)
&addr.mAddress, buf,
sizeof(buf))));
}
#endif
}
void add_ipv6_maddr_to_ot(struct openthread_context *context)
@ -149,15 +148,13 @@ void add_ipv6_maddr_to_ot(struct openthread_context *context)
otIp6SubscribeMulticastAddress(context->instance, &addr);
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
{
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Added multicast %s",
log_strdup(net_addr_ntop(AF_INET6, &addr,
buf, sizeof(buf))));
}
#endif
}
void add_ipv6_maddr_to_zephyr(struct openthread_context *context)
@ -172,14 +169,16 @@ void add_ipv6_maddr_to_zephyr(struct openthread_context *context)
continue;
}
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
char buf[NET_IPV6_ADDR_LEN];
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Adding multicast %s",
log_strdup(net_addr_ntop(AF_INET6,
(struct in6_addr *)
(&maddress->mAddress),
buf, sizeof(buf))));
}
NET_DBG("Adding multicast %s",
log_strdup(net_addr_ntop(AF_INET6,
(struct in6_addr *)(&maddress->mAddress),
buf, sizeof(buf))));
#endif
net_if_ipv6_maddr_add(context->iface,
(struct in6_addr *)(&maddress->mAddress));
}
@ -218,14 +217,15 @@ void rm_ipv6_addr_from_zephyr(struct openthread_context *context)
}
}
if (!used) {
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
char buf[NET_IPV6_ADDR_LEN];
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Removing %s",
log_strdup(net_addr_ntop(AF_INET6,
NET_DBG("Removing %s",
log_strdup(net_addr_ntop(AF_INET6,
&zephyr_addr->address.in6_addr,
buf, sizeof(buf))));
#endif
}
net_if_ipv6_addr_rm(context->iface,
&zephyr_addr->address.in6_addr);
}
@ -265,14 +265,15 @@ void rm_ipv6_maddr_from_zephyr(struct openthread_context *context)
}
}
if (!used) {
#if CONFIG_OPENTHREAD_L2_LOG_LEVEL == SYS_LOG_LEVEL_DEBUG
char buf[NET_IPV6_ADDR_LEN];
if (CONFIG_OPENTHREAD_L2_LOG_LEVEL == LOG_LEVEL_DBG) {
char buf[NET_IPV6_ADDR_LEN];
NET_DBG("Removing multicast %s",
log_strdup(net_addr_ntop(AF_INET6,
NET_DBG("Removing multicast %s",
log_strdup(net_addr_ntop(AF_INET6,
&zephyr_addr->address.in6_addr,
buf, sizeof(buf))));
#endif
}
net_if_ipv6_maddr_rm(context->iface,
&zephyr_addr->address.in6_addr);
}