From f79aa2174e1c9b9f17042e85cb01c7432f1db793 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Wed, 17 May 2017 22:00:16 +0200 Subject: [PATCH] All MAC layers as distinct modules --- core/net/mac/{ => csma}/csma-output.c | 2 +- core/net/mac/{ => csma}/csma-output.h | 0 core/net/mac/{ => csma}/csma.c | 4 ++-- core/net/mac/{ => csma}/csma.h | 0 core/net/mac/{ => nullmac}/nullmac.c | 2 +- core/net/mac/{ => nullmac}/nullmac.h | 0 drivers/cpu/nrf52832/ble/ble-mac.c | 2 +- drivers/platform/cc2538dk/Makefile.cc2538dk | 3 ++- drivers/platform/cooja/Makefile.cooja | 3 ++- drivers/platform/jn516x/Makefile.jn516x | 3 ++- drivers/platform/native/Makefile.native | 3 ++- drivers/platform/nrf52dk/Makefile.nrf52dk | 3 ++- drivers/platform/openmote-cc2538/Makefile.openmote-cc2538 | 3 ++- drivers/platform/sky/Makefile.sky | 1 + drivers/platform/srf06-cc26xx/Makefile.srf06-cc26xx | 3 ++- drivers/platform/zoul/Makefile.zoul | 3 ++- 16 files changed, 22 insertions(+), 13 deletions(-) rename core/net/mac/{ => csma}/csma-output.c (99%) rename core/net/mac/{ => csma}/csma-output.h (100%) rename core/net/mac/{ => csma}/csma.c (98%) rename core/net/mac/{ => csma}/csma.h (100%) rename core/net/mac/{ => nullmac}/nullmac.c (98%) rename core/net/mac/{ => nullmac}/nullmac.h (100%) diff --git a/core/net/mac/csma-output.c b/core/net/mac/csma/csma-output.c similarity index 99% rename from core/net/mac/csma-output.c rename to core/net/mac/csma/csma-output.c index e224825ed..17160600e 100644 --- a/core/net/mac/csma-output.c +++ b/core/net/mac/csma/csma-output.c @@ -39,7 +39,7 @@ * Simon Duquennoy */ -#include "net/mac/csma.h" +#include "net/mac/csma/csma.h" #include "net/packetbuf.h" #include "net/queuebuf.h" #include "dev/watchdog.h" diff --git a/core/net/mac/csma-output.h b/core/net/mac/csma/csma-output.h similarity index 100% rename from core/net/mac/csma-output.h rename to core/net/mac/csma/csma-output.h diff --git a/core/net/mac/csma.c b/core/net/mac/csma/csma.c similarity index 98% rename from core/net/mac/csma.c rename to core/net/mac/csma/csma.c index 6f327546e..19c6f9e01 100644 --- a/core/net/mac/csma.c +++ b/core/net/mac/csma/csma.c @@ -38,8 +38,8 @@ * Simon Duquennoy */ -#include "net/mac/csma.h" -#include "net/mac/csma-output.h" +#include "net/mac/csma/csma.h" +#include "net/mac/csma/csma-output.h" #include "net/mac/mac-sequence.h" #include "net/packetbuf.h" #include "net/netstack.h" diff --git a/core/net/mac/csma.h b/core/net/mac/csma/csma.h similarity index 100% rename from core/net/mac/csma.h rename to core/net/mac/csma/csma.h diff --git a/core/net/mac/nullmac.c b/core/net/mac/nullmac/nullmac.c similarity index 98% rename from core/net/mac/nullmac.c rename to core/net/mac/nullmac/nullmac.c index 9af54b2d8..d0ef37bb0 100644 --- a/core/net/mac/nullmac.c +++ b/core/net/mac/nullmac/nullmac.c @@ -37,7 +37,7 @@ * Adam Dunkels */ -#include "net/mac/nullmac.h" +#include "net/mac/nullmac/nullmac.h" #include "net/netstack.h" #include "net/ip/uip.h" #include "net/ip/tcpip.h" diff --git a/core/net/mac/nullmac.h b/core/net/mac/nullmac/nullmac.h similarity index 100% rename from core/net/mac/nullmac.h rename to core/net/mac/nullmac/nullmac.h diff --git a/drivers/cpu/nrf52832/ble/ble-mac.c b/drivers/cpu/nrf52832/ble/ble-mac.c index 17bccdcc6..94f7d62a9 100644 --- a/drivers/cpu/nrf52832/ble/ble-mac.c +++ b/drivers/cpu/nrf52832/ble/ble-mac.c @@ -44,7 +44,7 @@ #include "nrf_soc.h" #include "iot_defines.h" -#include "net/mac/nullmac.h" +#include "net/mac/nullmac/nullmac.h" #include "net/netstack.h" #include "net/ip/uip.h" #include "net/ip/tcpip.h" diff --git a/drivers/platform/cc2538dk/Makefile.cc2538dk b/drivers/platform/cc2538dk/Makefile.cc2538dk index 0bb5794fc..2de77c5fc 100644 --- a/drivers/platform/cc2538dk/Makefile.cc2538dk +++ b/drivers/platform/cc2538dk/Makefile.cc2538dk @@ -19,7 +19,8 @@ CLEAN += *.cc2538dk CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538 include $(CONTIKI_CPU)/Makefile.cc2538 -MODULES += core/net core/net/mac core/net/mac/framer +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac PYTHON = python BSL_FLAGS += -e -w -v diff --git a/drivers/platform/cooja/Makefile.cooja b/drivers/platform/cooja/Makefile.cooja index b8ee9528d..cdcfd8aad 100644 --- a/drivers/platform/cooja/Makefile.cooja +++ b/drivers/platform/cooja/Makefile.cooja @@ -74,7 +74,8 @@ CONTIKI_CPU=$(CONTIKI)/drivers/cpu/x86 CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include -DCLASSNAME=$(CLASSNAME) CFLAGS += $(CFLAGSNO) -MODULES += core/net core/net/mac core/net/mac/framer core/net/ip64-addr +MODULES += core/net core/net/mac core/net/mac/framer core/net/ip64-addr \ + core/net/mac/csma core/net/mac/nullmac ## Copied from Makefile.include, since Cooja overrides CFLAGS et al HAS_STACK = 0 diff --git a/drivers/platform/jn516x/Makefile.jn516x b/drivers/platform/jn516x/Makefile.jn516x index fda8da217..df927dc95 100644 --- a/drivers/platform/jn516x/Makefile.jn516x +++ b/drivers/platform/jn516x/Makefile.jn516x @@ -143,7 +143,8 @@ endif CLEAN += *.jn516x CLEAN += *.jn516x.bin -MODULES += core/net core/net/mac core/net/mac/framer +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac CONTIKI_TARGET_SOURCEFILES += $(ARCH) CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES) diff --git a/drivers/platform/native/Makefile.native b/drivers/platform/native/Makefile.native index 328f0ca6d..17b45a134 100644 --- a/drivers/platform/native/Makefile.native +++ b/drivers/platform/native/Makefile.native @@ -42,4 +42,5 @@ CURSES_LIBS ?= -lncurses TARGET_LIBFILES += $(CURSES_LIBS) -MODULES+=core/net core/net/mac core/net/mac/framer core/net/ip64-addr/ +MODULES+=core/net core/net/mac core/net/mac/framer core/net/ip64-addr/ \ + core/net/mac/csma core/net/mac/nullmac diff --git a/drivers/platform/nrf52dk/Makefile.nrf52dk b/drivers/platform/nrf52dk/Makefile.nrf52dk index 2ec3e7db2..c091a5776 100644 --- a/drivers/platform/nrf52dk/Makefile.nrf52dk +++ b/drivers/platform/nrf52dk/Makefile.nrf52dk @@ -28,4 +28,5 @@ SMALL ?= 0 CONTIKI_CPU=$(CONTIKI)/drivers/cpu/nrf52832 include $(CONTIKI_CPU)/Makefile.nrf52832 -MODULES += core/net core/net/mac core/net/mac/framer +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac diff --git a/drivers/platform/openmote-cc2538/Makefile.openmote-cc2538 b/drivers/platform/openmote-cc2538/Makefile.openmote-cc2538 index f9ee674f4..d3d1f1968 100644 --- a/drivers/platform/openmote-cc2538/Makefile.openmote-cc2538 +++ b/drivers/platform/openmote-cc2538/Makefile.openmote-cc2538 @@ -26,7 +26,8 @@ CLEAN += *.openmote-cc2538 CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538 include $(CONTIKI_CPU)/Makefile.cc2538 -MODULES += core/net core/net/mac core/net/mac/framer +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac PYTHON = python BSL_FLAGS += -e --bootloader-invert-lines -w -v -b 450000 diff --git a/drivers/platform/sky/Makefile.sky b/drivers/platform/sky/Makefile.sky index 67af65633..35a6901b8 100644 --- a/drivers/platform/sky/Makefile.sky +++ b/drivers/platform/sky/Makefile.sky @@ -7,4 +7,5 @@ CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c \ include $(CONTIKI)/drivers/platform/sky/Makefile.common MODULES += core/net/mac core/net/mac/framer core/net \ + core/net/mac/csma core/net/mac/nullmac \ drivers/dev/cc2420 drivers/dev/sht11 drivers/dev/ds2411 diff --git a/drivers/platform/srf06-cc26xx/Makefile.srf06-cc26xx b/drivers/platform/srf06-cc26xx/Makefile.srf06-cc26xx index 761a4c14c..c3a431152 100644 --- a/drivers/platform/srf06-cc26xx/Makefile.srf06-cc26xx +++ b/drivers/platform/srf06-cc26xx/Makefile.srf06-cc26xx @@ -32,4 +32,5 @@ SMALL ?= 0 CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc26xx-cc13xx include $(CONTIKI_CPU)/Makefile.$(CPU_FAMILY) -MODULES += core/net core/net/mac core/net/mac/framer +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac diff --git a/drivers/platform/zoul/Makefile.zoul b/drivers/platform/zoul/Makefile.zoul index 95b35bf92..599fc2568 100644 --- a/drivers/platform/zoul/Makefile.zoul +++ b/drivers/platform/zoul/Makefile.zoul @@ -45,7 +45,8 @@ CLEAN += *.zoul CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538 include $(CONTIKI_CPU)/Makefile.cc2538 -MODULES += core/net core/net/mac core/net/mac/framer core/net/ip \ +MODULES += core/net core/net/mac core/net/mac/framer \ + core/net/mac/csma core/net/mac/nullmac \ drivers/dev/cc1200 ifeq ($(WITH_IP64),1)