From 43a15440cbc5ae58875dc81edb0f2e952f79f027 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se>
Date: Tue, 19 Sep 2017 13:55:18 +0200
Subject: [PATCH] netopt: Add NETOPT_MAC_NO_SLEEP

---
 sys/include/net/netopt.h           | 10 ++++++++++
 sys/net/crosslayer/netopt/netopt.c |  1 +
 2 files changed, 11 insertions(+)

diff --git a/sys/include/net/netopt.h b/sys/include/net/netopt.h
index fd56b81fee..55d9c3ef81 100644
--- a/sys/include/net/netopt.h
+++ b/sys/include/net/netopt.h
@@ -193,6 +193,16 @@ typedef enum {
      */
     NETOPT_CSMA_MINBE,
 
+    /**
+     * @brief en/disable blocking of radio sleep when running a duty cycling MAC layer
+     *
+     * (netopt_enable_t) Enabling this option tells the MAC layer to never put
+     * the radio to sleep. Useful in gateways and routers not running on
+     * batteries to improve responsiveness and allow battery powered nodes on
+     * the same network to sleep more often.
+     */
+    NETOPT_MAC_NO_SLEEP,
+
     /**
      * @brief read-only check for a wired interface.
      *
diff --git a/sys/net/crosslayer/netopt/netopt.c b/sys/net/crosslayer/netopt/netopt.c
index f91adf2977..33cb235265 100644
--- a/sys/net/crosslayer/netopt/netopt.c
+++ b/sys/net/crosslayer/netopt/netopt.c
@@ -51,6 +51,7 @@ static const char *_netopt_strmap[] = {
     [NETOPT_CSMA_RETRIES]          = "NETOPT_CSMA_RETRIES",
     [NETOPT_CSMA_MAXBE]            = "NETOPT_CSMA_MAXBE",
     [NETOPT_CSMA_MINBE]            = "NETOPT_CSMA_MINBE",
+    [NETOPT_MAC_NO_SLEEP]          = "NETOPT_MAC_NO_SLEEP",
     [NETOPT_IS_WIRED]              = "NETOPT_IS_WIRED",
     [NETOPT_DEVICE_TYPE]           = "NETOPT_DEVICE_TYPE",
     [NETOPT_CHANNEL_PAGE]          = "NETOPT_CHANNEL_PAGE",
-- 
GitLab