From df368e8094cf2b88b94110971860421cbccb1195 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Fri, 28 Feb 2020 15:03:55 +0100 Subject: [PATCH] samples/net: Adding relevant parts to test PM on echo server Just to get something to test for PM, via frdm_k64f board. So only this board will get PM enabled. Signed-off-by: Tomasz Bursztyka --- drivers/ethernet/eth_mcux.c | 5 +++++ samples/net/sockets/echo_server/boards/frdm_k64f.conf | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 samples/net/sockets/echo_server/boards/frdm_k64f.conf diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index d35f0b25fe2..fcefb550d47 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -198,6 +198,11 @@ static int eth_mcux_device_pm_control(struct device *dev, u32_t command, if (*(u32_t *)context == DEVICE_PM_SUSPEND_STATE) { LOG_DBG("Suspending"); + ret = net_if_suspend(eth_ctx->iface); + if (ret == -EBUSY) { + goto out; + } + eth_mcux_phy_enter_reset(eth_ctx); eth_mcux_phy_stop(eth_ctx); diff --git a/samples/net/sockets/echo_server/boards/frdm_k64f.conf b/samples/net/sockets/echo_server/boards/frdm_k64f.conf new file mode 100644 index 00000000000..cc912863a01 --- /dev/null +++ b/samples/net/sockets/echo_server/boards/frdm_k64f.conf @@ -0,0 +1,2 @@ +CONFIG_SYS_POWER_MANAGEMENT=y +CONFIG_DEVICE_POWER_MANAGEMENT=y