From c2cdbbafd723545da3b0789f4f8c3ef475c62d03 Mon Sep 17 00:00:00 2001 From: Gil Pitney Date: Fri, 5 Oct 2018 14:37:37 -0700 Subject: [PATCH] net: sockets: Get socket offload to build after net logging overhaul. Also, defines one LOG_MODULE_NAME for the simplelink WiFi driver, and uses the same name for all files in this driver (module). Signed-off-by: Gil Pitney --- drivers/wifi/simplelink/simplelink.c | 5 +--- drivers/wifi/simplelink/simplelink_log.h | 23 +++++++++++++++++++ drivers/wifi/simplelink/simplelink_sockets.c | 3 +++ drivers/wifi/simplelink/simplelink_support.c | 10 ++++---- .../echo/boards/cc3220sf_launchxl.conf | 1 - subsys/net/lib/sockets/socket_offload.c | 3 +++ 6 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 drivers/wifi/simplelink/simplelink_log.h diff --git a/drivers/wifi/simplelink/simplelink.c b/drivers/wifi/simplelink/simplelink.c index 8ff08c7b832..257095d3717 100644 --- a/drivers/wifi/simplelink/simplelink.c +++ b/drivers/wifi/simplelink/simplelink.c @@ -4,10 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -#define LOG_MODULE_NAME wifi_simplelink -#define LOG_LEVEL CONFIG_WIFI_LOG_LEVEL - -#include +#include "simplelink_log.h" LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include diff --git a/drivers/wifi/simplelink/simplelink_log.h b/drivers/wifi/simplelink/simplelink_log.h new file mode 100644 index 00000000000..b069d26ca59 --- /dev/null +++ b/drivers/wifi/simplelink/simplelink_log.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2018 Linaro Limited. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_LOG_H_ +#define ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_LOG_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOG_MODULE_NAME wifi_simplelink +#define LOG_LEVEL CONFIG_WIFI_LOG_LEVEL + +#include + +#ifdef __cplusplus +} +#endif + +#endif /* ZEPHYR_DRIVERS_WIFI_SIMPLELINK_SIMPLELINK_LOG_H_ */ diff --git a/drivers/wifi/simplelink/simplelink_sockets.c b/drivers/wifi/simplelink/simplelink_sockets.c index f939b450d80..15e69a54323 100644 --- a/drivers/wifi/simplelink/simplelink_sockets.c +++ b/drivers/wifi/simplelink/simplelink_sockets.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "simplelink_log.h" +LOG_MODULE_DECLARE(LOG_MODULE_NAME); + #include /* Define sockaddr, etc, before simplelink.h */ #include diff --git a/drivers/wifi/simplelink/simplelink_support.c b/drivers/wifi/simplelink/simplelink_support.c index a10c6d89207..cb1bb602966 100644 --- a/drivers/wifi/simplelink/simplelink_support.c +++ b/drivers/wifi/simplelink/simplelink_support.c @@ -5,14 +5,12 @@ * */ -#define LOG_MODULE_NAME wifi_simplelink_support -#define LOG_LEVEL CONFIG_WIFI_LOG_LEVEL - -#include -LOG_MODULE_REGISTER(LOG_MODULE_NAME); - #include #include + +#include "simplelink_log.h" +LOG_MODULE_DECLARE(LOG_MODULE_NAME); + #include #include diff --git a/samples/net/sockets/echo/boards/cc3220sf_launchxl.conf b/samples/net/sockets/echo/boards/cc3220sf_launchxl.conf index ca57e614501..20ef27c3a0c 100644 --- a/samples/net/sockets/echo/boards/cc3220sf_launchxl.conf +++ b/samples/net/sockets/echo/boards/cc3220sf_launchxl.conf @@ -19,5 +19,4 @@ CONFIG_NET_CONFIG_PEER_IPV4_ADDR="" CONFIG_NET_LOG=y CONFIG_WIFI_LOG_LEVEL_DBG=y CONFIG_DEBUG=y -#CONFIG_SYS_LOG=y #CONFIG_ASSERT=y diff --git a/subsys/net/lib/sockets/socket_offload.c b/subsys/net/lib/sockets/socket_offload.c index 1fbeb1f6474..51fbbf5f8c9 100644 --- a/subsys/net/lib/sockets/socket_offload.c +++ b/subsys/net/lib/sockets/socket_offload.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#define LOG_MODULE_NAME net_socket_offload +#define NET_LOG_LEVEL CONFIG_NET_SOCKETS_LOG_LEVEL + #include /* Only one provider may register socket operations upon boot. */