From 6689562e35dda7c16fa80fd4e288eb926f0a4ec7 Mon Sep 17 00:00:00 2001 From: Marcin K Szczodrak Date: Wed, 3 Sep 2014 18:47:41 -0400 Subject: [PATCH] cleaning doubleradio for ucprotonb --- support/make/platforms/ucprotonb.platform | 1 - .../chips/doubleradio/RF212DriverLayerC.nc | 127 ------- .../doubleradio/RF212MessageBufferLayerC.nc | 67 ---- .../chips/doubleradio/RF212NeighborhoodC.nc | 46 --- .../doubleradio/RF212NeighborhoodFlagC.nc | 46 --- .../chips/doubleradio/RF212NeighborhoodP.nc | 182 --------- .../chips/doubleradio/RF212RadioAlarmC.nc | 57 --- .../chips/doubleradio/RF212RadioC.nc | 347 ------------------ .../chips/doubleradio/RF212TaskletC.nc | 129 ------- .../chips/doubleradio/RF212UniqueLayerC.nc | 66 ---- .../chips/doubleradio/RFA1DriverLayerC.nc | 118 ------ .../doubleradio/RFA1MessageBufferLayerC.nc | 67 ---- .../chips/doubleradio/RFA1NeighborhoodC.nc | 46 --- .../doubleradio/RFA1NeighborhoodFlagC.nc | 46 --- .../chips/doubleradio/RFA1NeighborhoodP.nc | 182 --------- .../chips/doubleradio/RFA1RadioAlarmC.nc | 57 --- .../ucprotonb/chips/doubleradio/RFA1RadioC.nc | 315 ---------------- .../chips/doubleradio/RFA1TaskletC.nc | 129 ------- .../chips/doubleradio/RFA1UniqueLayerC.nc | 66 ---- 19 files changed, 2094 deletions(-) delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212DriverLayerC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212MessageBufferLayerC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodFlagC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodP.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212RadioAlarmC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212RadioC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212TaskletC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RF212UniqueLayerC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1DriverLayerC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1MessageBufferLayerC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodFlagC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodP.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioAlarmC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1TaskletC.nc delete mode 100644 tos/platforms/ucprotonb/chips/doubleradio/RFA1UniqueLayerC.nc diff --git a/support/make/platforms/ucprotonb.platform b/support/make/platforms/ucprotonb.platform index 846b84eedd..1ad5b07391 100644 --- a/support/make/platforms/ucprotonb.platform +++ b/support/make/platforms/ucprotonb.platform @@ -3,7 +3,6 @@ PFLAGS += -I%T/platforms/ucprotonb PFLAGS += -I%T/platforms/ucprotonb/chips/stm25p PFLAGS += -I%T/platforms/ucprotonb/chips/rf212 -PFLAGS += -I%T/platforms/ucprotonb/chips/doubleradio PFLAGS += -I%T/chips/atm128rfa1 PFLAGS += -I%T/chips/atm128rfa1/adc PFLAGS += -I%T/chips/atm128rfa1/pins diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212DriverLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212DriverLayerC.nc deleted file mode 100644 index b0db47db53..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212DriverLayerC.nc +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include -#include - -configuration RF212DriverLayerC -{ - provides - { - interface RadioState; - interface RadioSend; - interface RadioReceive; - interface RadioCCA; - interface RadioPacket; - - interface PacketField as PacketTransmitPower; - interface PacketField as PacketRSSI; - interface PacketField as PacketTimeSyncOffset; - interface PacketField as PacketLinkQuality; - interface LinkPacketMetadata; - - interface LocalTime as LocalTimeRadio; - interface Alarm; - } - - uses - { - interface RF212DriverConfig as Config; - interface PacketTimeStamp; - - interface PacketFlag as TransmitPowerFlag; - interface PacketFlag as RSSIFlag; - interface PacketFlag as TimeSyncFlag; - interface RadioAlarm; - } -} - -implementation -{ - components RF212DriverLayerP, HplRF212C, BusyWaitMicroC, RF212TaskletC as TaskletC, MainC; - - RadioState = RF212DriverLayerP; - RadioSend = RF212DriverLayerP; - RadioReceive = RF212DriverLayerP; - RadioCCA = RF212DriverLayerP; - RadioPacket = RF212DriverLayerP; - - LocalTimeRadio = HplRF212C; - - Config = RF212DriverLayerP; - - PacketTransmitPower = RF212DriverLayerP.PacketTransmitPower; - TransmitPowerFlag = RF212DriverLayerP.TransmitPowerFlag; - - PacketRSSI = RF212DriverLayerP.PacketRSSI; - RSSIFlag = RF212DriverLayerP.RSSIFlag; - - PacketTimeSyncOffset = RF212DriverLayerP.PacketTimeSyncOffset; - TimeSyncFlag = RF212DriverLayerP.TimeSyncFlag; - - PacketLinkQuality = RF212DriverLayerP.PacketLinkQuality; - PacketTimeStamp = RF212DriverLayerP.PacketTimeStamp; - LinkPacketMetadata = RF212DriverLayerP; - - RF212DriverLayerP.LocalTime -> HplRF212C; - - Alarm = HplRF212C.Alarm; - RadioAlarm = RF212DriverLayerP.RadioAlarm; - - RF212DriverLayerP.SELN -> HplRF212C.SELN; - RF212DriverLayerP.SpiResource -> HplRF212C.SpiResource; - RF212DriverLayerP.FastSpiByte -> HplRF212C; - - RF212DriverLayerP.SLP_TR -> HplRF212C.SLP_TR; - RF212DriverLayerP.RSTN -> HplRF212C.RSTN; - - RF212DriverLayerP.IRQ -> HplRF212C.IRQ; - RF212DriverLayerP.Tasklet -> TaskletC; - RF212DriverLayerP.BusyWait -> BusyWaitMicroC; - -#ifdef RADIO_DEBUG - components DiagMsgC; - RF212DriverLayerP.DiagMsg -> DiagMsgC; -#endif - -#ifdef RADIO_DEBUG_LEDS - components LedsC; - RF212DriverLayerP.Leds -> LedsC; -#endif - - MainC.SoftwareInit -> RF212DriverLayerP.SoftwareInit; - - components RealMainP; - RealMainP.PlatformInit -> RF212DriverLayerP.PlatformInit; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212MessageBufferLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212MessageBufferLayerC.nc deleted file mode 100644 index df3332e0a3..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212MessageBufferLayerC.nc +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RF212MessageBufferLayerC() -{ - provides - { - interface SplitControl; - interface BareSend as Send; - interface BareReceive as Receive; - interface RadioChannel; - } - uses - { - interface RadioState; - interface RadioSend; - interface RadioReceive; - } -} - -implementation -{ - components new MessageBufferLayerP(), MainC, RF212TaskletC as TaskletC; - - MainC.SoftwareInit -> MessageBufferLayerP; - - SplitControl = MessageBufferLayerP; - Send = MessageBufferLayerP; - Receive = MessageBufferLayerP; - RadioChannel = MessageBufferLayerP; - - RadioState = MessageBufferLayerP; - MessageBufferLayerP.Tasklet -> TaskletC; - RadioSend = MessageBufferLayerP; - RadioReceive = MessageBufferLayerP; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodC.nc deleted file mode 100644 index 2e576bf9c3..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodC.nc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -configuration RF212NeighborhoodC -{ - provides interface Neighborhood; -} - -implementation -{ - components RF212NeighborhoodP, MainC; - - Neighborhood = RF212NeighborhoodP; - MainC.SoftwareInit -> RF212NeighborhoodP; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodFlagC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodFlagC.nc deleted file mode 100644 index 7782d93217..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodFlagC.nc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RF212NeighborhoodFlagC() -{ - provides interface NeighborhoodFlag; -} - -implementation -{ - components RF212NeighborhoodP; - - // TODO: make sure that no more than 8 flags are used at a time - NeighborhoodFlag = RF212NeighborhoodP.NeighborhoodFlag[unique("NeighborhoodFlag")]; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodP.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodP.nc deleted file mode 100644 index 2a11e3b714..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212NeighborhoodP.nc +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include - -module RF212NeighborhoodP -{ - provides - { - interface Init; - interface Neighborhood; - interface NeighborhoodFlag[uint8_t bit]; - } -} - -implementation -{ - tasklet_norace am_addr_t nodes[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t ages[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t flags[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t time; - tasklet_norace uint8_t last; - - command error_t Init.init() - { - uint8_t i; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - nodes[i] = AM_BROADCAST_ADDR; - - return SUCCESS; - } - - inline tasklet_async command am_addr_t Neighborhood.getNode(uint8_t idx) - { - return nodes[idx]; - } - - inline tasklet_async command uint8_t Neighborhood.getAge(uint8_t idx) - { - return time - ages[idx]; - } - - tasklet_async uint8_t command Neighborhood.getIndex(am_addr_t node) - { - uint8_t i; - - if( nodes[last] == node ) - return last; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - if( nodes[i] == node ) - { - last = i; - break; - } - } - - return i; - } - - tasklet_async uint8_t command Neighborhood.insertNode(am_addr_t node) - { - uint8_t i; - uint8_t maxAge; - - if( nodes[last] == node ) - { - if( ages[last] == time ) - return last; - - ages[last] = ++time; - maxAge = 0x80; - } - else - { - uint8_t oldest = 0; - maxAge = 0; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - uint8_t age; - - if( nodes[i] == node ) - { - last = i; - if( ages[i] == time ) - return i; - - ages[i] = ++time; - maxAge = 0x80; - break; - } - - age = time - ages[i]; - if( age > maxAge ) - { - maxAge = age; - oldest = i; - } - } - - if( i == NEIGHBORHOOD_SIZE ) - { - signal Neighborhood.evicted(oldest); - - last = oldest; - nodes[oldest] = node; - ages[oldest] = ++time; - flags[oldest] = 0; - } - } - - if( (time & 0x7F) == 0x7F && maxAge >= 0x7F ) - { - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - if( (ages[i] | 0x7F) != time ) - ages[i] = time & 0x80; - } - } - - return last; - } - - inline tasklet_async command bool NeighborhoodFlag.get[uint8_t bit](uint8_t idx) - { - return flags[idx] & (1 << bit); - } - - inline tasklet_async command void NeighborhoodFlag.set[uint8_t bit](uint8_t idx) - { - flags[idx] |= (1 << bit); - } - - inline tasklet_async command void NeighborhoodFlag.clear[uint8_t bit](uint8_t idx) - { - flags[idx] &= ~(1 << bit); - } - - tasklet_async command void NeighborhoodFlag.clearAll[uint8_t bit]() - { - uint8_t i; - - bit = ~(1 << bit); - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - flags[i] &= bit; - } -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioAlarmC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioAlarmC.nc deleted file mode 100644 index 203e2a9dd0..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioAlarmC.nc +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include "RadioConfig.h" - -generic configuration RF212RadioAlarmC() -{ - provides - { - interface RadioAlarm[uint8_t id]; // use unique - } - - uses - { - interface Alarm @exactlyonce(); - } -} - -implementation -{ - components new RadioAlarmP(), RF212TaskletC; - - RadioAlarm = RadioAlarmP; - Alarm = RadioAlarmP; - RadioAlarmP.Tasklet -> RF212TaskletC; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioC.nc deleted file mode 100644 index 5b164b1e0b..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212RadioC.nc +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include - -configuration RF212RadioC -{ - provides - { - interface SplitControl; - -#ifndef IEEE154FRAMES_ENABLED - interface AMSend[am_id_t id]; - interface Receive[am_id_t id]; - interface Receive as Snoop[am_id_t id]; - interface SendNotifier[am_id_t id]; - - // for TOSThreads - interface Receive as ReceiveDefault[am_id_t id]; - interface Receive as SnoopDefault[am_id_t id]; - - interface AMPacket; - interface Packet as PacketForActiveMessage; -#endif - -#ifndef TFRAMES_ENABLED - interface Ieee154Send; - interface Receive as Ieee154Receive; - interface SendNotifier as Ieee154Notifier; - - interface Resource as SendResource[uint8_t clint]; - - interface Ieee154Packet; - interface Packet as PacketForIeee154Message; -#endif - - interface PacketAcknowledgements; - interface LowPowerListening; - interface PacketLink; - -#ifdef TRAFFIC_MONITOR - interface TrafficMonitor; -#endif - - interface RadioChannel; - - interface PacketField as PacketLinkQuality; - interface PacketField as PacketTransmitPower; - interface PacketField as PacketRSSI; - interface LinkPacketMetadata; - - interface LocalTime as LocalTimeRadio; - interface PacketTimeStamp as PacketTimeStampRadio; - interface PacketTimeStamp as PacketTimeStampMilli; - -#ifdef RF212_DATA_ACK - interface DataAck; -#endif - } -} - -implementation -{ - #define UQ_METADATA_FLAGS "UQ_RF212_METADATA_FLAGS" - #define UQ_RADIO_ALARM "UQ_RF212_RADIO_ALARM" - -// -------- RadioP - - components RF212RadioP as RadioP; - -#ifdef RADIO_DEBUG - components AssertC; -#endif - - RadioP.Ieee154PacketLayer -> Ieee154PacketLayerC; - RadioP.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - RadioP.PacketTimeStamp -> TimeStampingLayerC; - RadioP.RF212Packet -> RadioDriverLayerC; - -// -------- RadioAlarm - - components new RF212RadioAlarmC() as RadioAlarmC; - RadioAlarmC.Alarm -> RadioDriverLayerC; - -// -------- Active Message - -#ifndef IEEE154FRAMES_ENABLED - components new ActiveMessageLayerC(); - ActiveMessageLayerC.Config -> RadioP; - ActiveMessageLayerC.SubSend -> AutoResourceAcquireLayerC; - ActiveMessageLayerC.SubReceive -> TinyosNetworkLayerC.TinyosReceive; - ActiveMessageLayerC.SubPacket -> TinyosNetworkLayerC.TinyosPacket; - - AMSend = ActiveMessageLayerC; - Receive = ActiveMessageLayerC.Receive; - Snoop = ActiveMessageLayerC.Snoop; - SendNotifier = ActiveMessageLayerC; - AMPacket = ActiveMessageLayerC; - PacketForActiveMessage = ActiveMessageLayerC; - - ReceiveDefault = ActiveMessageLayerC.ReceiveDefault; - SnoopDefault = ActiveMessageLayerC.SnoopDefault; -#endif - -// -------- Automatic RadioSend Resource - -#ifndef IEEE154FRAMES_ENABLED -#ifndef TFRAMES_ENABLED - components new AutoResourceAcquireLayerC(); - AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique(RADIO_SEND_RESOURCE)]; -#else - components new DummyLayerC() as AutoResourceAcquireLayerC; -#endif - AutoResourceAcquireLayerC -> TinyosNetworkLayerC.TinyosSend; -#endif - -// -------- RadioSend Resource - -#ifndef TFRAMES_ENABLED - components new SimpleFcfsArbiterC(RADIO_SEND_RESOURCE) as SendResourceC; - SendResource = SendResourceC; - -// -------- Ieee154 Message - - components new Ieee154MessageLayerC(); - Ieee154MessageLayerC.Ieee154PacketLayer -> Ieee154PacketLayerC; - Ieee154MessageLayerC.SubSend -> TinyosNetworkLayerC.Ieee154Send; - Ieee154MessageLayerC.SubReceive -> TinyosNetworkLayerC.Ieee154Receive; - Ieee154MessageLayerC.RadioPacket -> TinyosNetworkLayerC.Ieee154Packet; - - Ieee154Send = Ieee154MessageLayerC; - Ieee154Receive = Ieee154MessageLayerC; - Ieee154Notifier = Ieee154MessageLayerC; - Ieee154Packet = Ieee154PacketLayerC; - PacketForIeee154Message = Ieee154MessageLayerC; -#endif - -// -------- Tinyos Network - - components new TinyosNetworkLayerC(); - - TinyosNetworkLayerC.SubSend -> UniqueLayerC; - TinyosNetworkLayerC.SubReceive -> PacketLinkLayerC; - TinyosNetworkLayerC.SubPacket -> Ieee154PacketLayerC; - -// -------- IEEE 802.15.4 Packet - - components new Ieee154PacketLayerC(); - Ieee154PacketLayerC.SubPacket -> PacketLinkLayerC; - -// -------- UniqueLayer Send part (wired twice) - - components new RF212UniqueLayerC() as UniqueLayerC; - UniqueLayerC.Config -> RadioP; - UniqueLayerC.SubSend -> PacketLinkLayerC; - -// -------- Packet Link - - components new PacketLinkLayerC(); - PacketLink = PacketLinkLayerC; - PacketLinkLayerC.PacketAcknowledgements -> SoftwareAckLayerC; - PacketLinkLayerC -> SyncLowPowerListeningLayerC.BareSend; - PacketLinkLayerC -> LowPowerListeningLayerC.Receive; - PacketLinkLayerC -> LowPowerListeningLayerC.RadioPacket; - -// -------- Sync Low Power Listening - -#ifdef SYNC_LOW_POWER_LISTENING - -#if defined(RF212_HARDWARE_ACK) || !defined(RF212_DATA_ACK) -#error "CANNOT USE SYNC LOW POWER LISTENING WITHOUT DATA ACKNOWLEDGEMENTS" -#endif - -#if !defined(LOW_POWER_LISTENING) || !defined(PERIODIC_LOW_POWER_LISTENING) -#error "CANNOT USE SYNC LOW POWER LISTENING WITHOUT PERIDIC LOW POWER LISTENING" -#endif - - #warning "*** USING SYNC LOW POWER LISTENING LAYER" - - components - new SyncLowPowerListeningLayerC(), - RF212NeighborhoodC as NeighborhoodC, - new AckDataP(synclpl_ack_t, uniqueN(UQ_RF212_ACKDATA_BYTES, - sizeof(synclpl_ack_t)), uniqueCount(UQ_RF212_ACKDATA_BYTES)); - - AckDataP.DataAck -> SoftwareAckLayerC; - - SyncLowPowerListeningLayerC.AckData -> AckDataP; - SyncLowPowerListeningLayerC.SleepTimer -> LowPowerListeningLayerC.SleepTimer; - SyncLowPowerListeningLayerC.Neighborhood -> NeighborhoodC; - SyncLowPowerListeningLayerC.Config -> RadioP; - SyncLowPowerListeningLayerC.LowPowerListening -> LowPowerListeningLayerC; - -#else - components new DummyLayerC() as SyncLowPowerListeningLayerC; -#endif - SyncLowPowerListeningLayerC.SubBareSend -> LowPowerListeningLayerC; - -// -------- Low Power Listening - -#ifdef LOW_POWER_LISTENING - #warning "*** USING LOW POWER LISTENING LAYER" - components new LowPowerListeningLayerC(); - LowPowerListeningLayerC.Config -> RadioP; - LowPowerListeningLayerC.PacketAcknowledgements -> SoftwareAckLayerC; -#else - components new LowPowerListeningDummyC() as LowPowerListeningLayerC; -#endif - LowPowerListeningLayerC.SubControl -> MessageBufferLayerC; - LowPowerListeningLayerC.SubSend -> MessageBufferLayerC; - LowPowerListeningLayerC.SubReceive -> MessageBufferLayerC; - LowPowerListeningLayerC.SubPacket -> TimeStampingLayerC; - SplitControl = LowPowerListeningLayerC; - LowPowerListening = LowPowerListeningLayerC; - -// -------- MessageBuffer - - components new RF212MessageBufferLayerC() as MessageBufferLayerC; - MessageBufferLayerC.RadioSend -> CollisionAvoidanceLayerC; - MessageBufferLayerC.RadioReceive -> UniqueLayerC; - MessageBufferLayerC.RadioState -> TrafficMonitorLayerC; - RadioChannel = MessageBufferLayerC; - -// -------- UniqueLayer receive part (wired twice) - - UniqueLayerC.SubReceive -> CollisionAvoidanceLayerC; - -// -------- CollisionAvoidance - -#ifdef SLOTTED_MAC - components new SlottedCollisionLayerC() as CollisionAvoidanceLayerC; -#else - components new RandomCollisionLayerC() as CollisionAvoidanceLayerC; -#endif - CollisionAvoidanceLayerC.Config -> RadioP; - CollisionAvoidanceLayerC.SubSend -> SoftwareAckLayerC; - CollisionAvoidanceLayerC.SubReceive -> SoftwareAckLayerC; - CollisionAvoidanceLayerC.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - -// -------- SoftwareAcknowledgement - -#ifdef RF212_DATA_ACK - #warning "*** USING DATA ACKNOWLEDGEMENTS ***" - components new DataAckLayerC() as SoftwareAckLayerC; - DataAck = SoftwareAckLayerC; -#else - components new SoftwareAckLayerC(); -#endif - SoftwareAckLayerC.AckReceivedFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - SoftwareAckLayerC.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - PacketAcknowledgements = SoftwareAckLayerC; - SoftwareAckLayerC.Config -> RadioP; - SoftwareAckLayerC.SubSend -> CsmaLayerC; - SoftwareAckLayerC.SubReceive -> SimulatedTopologyLayerC; - -//-------- Simulated Topology Layer -#ifdef SIMULATED_TOPOLOGY - #warning *** USING SIMULATED TOPOLOGY LAYER - components SimulatedTopologyLayerC; -#else - components new DummyLayerC() as SimulatedTopologyLayerC; -#endif - SimulatedTopologyLayerC.Config -> RadioP; - SimulatedTopologyLayerC -> CsmaLayerC.RadioReceive; - -// -------- Carrier Sense - - components new DummyLayerC() as CsmaLayerC; - CsmaLayerC.Config -> RadioP; - CsmaLayerC -> TrafficMonitorLayerC.RadioSend; - CsmaLayerC -> TrafficMonitorLayerC.RadioReceive; - CsmaLayerC -> RadioDriverLayerC.RadioCCA; - -// -------- TimeStamping - - components new TimeStampingLayerC(); - TimeStampingLayerC.LocalTimeRadio -> RadioDriverLayerC; - TimeStampingLayerC.SubPacket -> MetadataFlagsLayerC; - PacketTimeStampRadio = TimeStampingLayerC; - PacketTimeStampMilli = TimeStampingLayerC; - TimeStampingLayerC.TimeStampFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - -// -------- MetadataFlags - - components new MetadataFlagsLayerC(); - MetadataFlagsLayerC.SubPacket -> RadioDriverLayerC; - -// -------- Traffic Monitor - -#ifdef TRAFFIC_MONITOR - components new TrafficMonitorLayerC(); - TrafficMonitor = TrafficMonitorLayerC; -#else - components new DummyLayerC() as TrafficMonitorLayerC; -#endif - TrafficMonitorLayerC.Config -> RadioP; - TrafficMonitorLayerC -> RadioDriverLayerC.RadioSend; - TrafficMonitorLayerC -> RadioDriverLayerC.RadioReceive; - TrafficMonitorLayerC -> RadioDriverLayerC.RadioState; - -// -------- Driver - - components RF212DriverLayerC as RadioDriverLayerC; - RadioDriverLayerC.Config -> RadioP; - RadioDriverLayerC.PacketTimeStamp -> TimeStampingLayerC; - PacketTransmitPower = RadioDriverLayerC.PacketTransmitPower; - PacketLinkQuality = RadioDriverLayerC.PacketLinkQuality; - PacketRSSI = RadioDriverLayerC.PacketRSSI; - LinkPacketMetadata = RadioDriverLayerC; - LocalTimeRadio = RadioDriverLayerC; - - RadioDriverLayerC.TransmitPowerFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - RadioDriverLayerC.RSSIFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - RadioDriverLayerC.TimeSyncFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - RadioDriverLayerC.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212TaskletC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212TaskletC.nc deleted file mode 100644 index 874bdc2811..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212TaskletC.nc +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include -#include - -module RF212TaskletC -{ - provides interface Tasklet; -} - -implementation -{ -#ifdef TASKLET_IS_TASK - - task void tasklet() - { - signal Tasklet.run(); - } - - inline async command void Tasklet.schedule() - { - post tasklet(); - } - - inline command void Tasklet.suspend() - { - } - - inline command void Tasklet.resume() - { - } - -#else - - /** - * The lower 7 bits contain the number of suspends plus one if the run - * event is currently beeing executed. The highest bit is set if the run - * event needs to be called again when the suspend count goes down to zero. - */ - uint8_t state; - - void doit() - { - for(;;) - { - signal Tasklet.run(); - - atomic - { - if( state == 1 ) - { - state = 0; - return; - } - - RADIO_ASSERT( state == 0x81 ); - state = 1; - } - } - } - - inline command void Tasklet.suspend() - { - atomic ++state; - } - - command void Tasklet.resume() - { - atomic - { - if( --state != 0x80 ) - return; - - state = 1; - } - - doit(); - } - - async command void Tasklet.schedule() - { - atomic - { - if( state != 0 ) - { - state |= 0x80; - return; - } - - state = 1; - } - - doit(); - } - -#endif -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RF212UniqueLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RF212UniqueLayerC.nc deleted file mode 100644 index d9679796d2..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RF212UniqueLayerC.nc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RF212UniqueLayerC() -{ - provides - { - // NOTE, this is a combined layer, should be hooked up at two places - interface BareSend as Send; - interface RadioReceive; - } - uses - { - interface BareSend as SubSend; - interface RadioReceive as SubReceive; - - interface UniqueConfig as Config; - } -} - -implementation -{ - components new UniqueLayerP(), MainC, RF212NeighborhoodC as NeighborhoodC, new RF212NeighborhoodFlagC() as NeighborhoodFlagC; - - MainC.SoftwareInit -> UniqueLayerP; - UniqueLayerP.Neighborhood -> NeighborhoodC; - UniqueLayerP.NeighborhoodFlag -> NeighborhoodFlagC; - - Send = UniqueLayerP; - SubSend = UniqueLayerP; - - RadioReceive = UniqueLayerP; - SubReceive = UniqueLayerP; - Config = UniqueLayerP; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1DriverLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1DriverLayerC.nc deleted file mode 100644 index d3b311c9c3..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1DriverLayerC.nc +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - * Author: Andras Biro - */ - -#include -#include - -configuration RFA1DriverLayerC -{ - provides - { - interface RadioState; - interface RadioSend; - interface RadioReceive; - interface RadioCCA; - interface RadioPacket; - - interface PacketField as PacketTransmitPower; - interface PacketField as PacketRSSI; - interface PacketField as PacketTimeSyncOffset; - interface PacketField as PacketLinkQuality; - interface LinkPacketMetadata; - - interface LocalTime as LocalTimeRadio; - interface Alarm; - } - - uses - { - interface RFA1DriverConfig as Config; - interface PacketTimeStamp; - - interface PacketFlag as TransmitPowerFlag; - interface PacketFlag as RSSIFlag; - interface PacketFlag as TimeSyncFlag; - } -} - -implementation -{ - components RFA1DriverLayerP, BusyWaitMicroC, RFA1TaskletC as TaskletC, - LocalTime62khzC, new Alarm62khz32C(), HplAtmRfa1TimerMacC; - - RadioState = RFA1DriverLayerP; - RadioSend = RFA1DriverLayerP; - RadioReceive = RFA1DriverLayerP; - RadioCCA = RFA1DriverLayerP; - RadioPacket = RFA1DriverLayerP; - - LocalTimeRadio = LocalTime62khzC; - - Config = RFA1DriverLayerP; - - PacketTransmitPower = RFA1DriverLayerP.PacketTransmitPower; - TransmitPowerFlag = RFA1DriverLayerP.TransmitPowerFlag; - - PacketRSSI = RFA1DriverLayerP.PacketRSSI; - RSSIFlag = RFA1DriverLayerP.RSSIFlag; - - PacketTimeSyncOffset = RFA1DriverLayerP.PacketTimeSyncOffset; - TimeSyncFlag = RFA1DriverLayerP.TimeSyncFlag; - - PacketLinkQuality = RFA1DriverLayerP.PacketLinkQuality; - PacketTimeStamp = RFA1DriverLayerP.PacketTimeStamp; - LinkPacketMetadata = RFA1DriverLayerP; - - RFA1DriverLayerP.LocalTime -> LocalTime62khzC; - RFA1DriverLayerP.SfdCapture -> HplAtmRfa1TimerMacC.SfdCapture; - - Alarm = Alarm62khz32C; - - RFA1DriverLayerP.Tasklet -> TaskletC; - RFA1DriverLayerP.BusyWait -> BusyWaitMicroC; - -#ifdef RADIO_DEBUG - components DiagMsgC; - RFA1DriverLayerP.DiagMsg -> DiagMsgC; -#endif - - components MainC, RealMainP; - RealMainP.PlatformInit -> RFA1DriverLayerP.PlatformInit; - MainC.SoftwareInit -> RFA1DriverLayerP.SoftwareInit; - - components McuSleepC; - RFA1DriverLayerP.McuPowerState -> McuSleepC; - RFA1DriverLayerP.McuPowerOverride <- McuSleepC; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1MessageBufferLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1MessageBufferLayerC.nc deleted file mode 100644 index 83a4392b1f..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1MessageBufferLayerC.nc +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RFA1MessageBufferLayerC() -{ - provides - { - interface SplitControl; - interface BareSend as Send; - interface BareReceive as Receive; - interface RadioChannel; - } - uses - { - interface RadioState; - interface RadioSend; - interface RadioReceive; - } -} - -implementation -{ - components new MessageBufferLayerP(), MainC, RFA1TaskletC as TaskletC; - - MainC.SoftwareInit -> MessageBufferLayerP; - - SplitControl = MessageBufferLayerP; - Send = MessageBufferLayerP; - Receive = MessageBufferLayerP; - RadioChannel = MessageBufferLayerP; - - RadioState = MessageBufferLayerP; - MessageBufferLayerP.Tasklet -> TaskletC; - RadioSend = MessageBufferLayerP; - RadioReceive = MessageBufferLayerP; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodC.nc deleted file mode 100644 index aa58be2ccb..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodC.nc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -configuration RFA1NeighborhoodC -{ - provides interface Neighborhood; -} - -implementation -{ - components RFA1NeighborhoodP, MainC; - - Neighborhood = RFA1NeighborhoodP; - MainC.SoftwareInit -> RFA1NeighborhoodP; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodFlagC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodFlagC.nc deleted file mode 100644 index 6b072427f4..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodFlagC.nc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RFA1NeighborhoodFlagC() -{ - provides interface NeighborhoodFlag; -} - -implementation -{ - components RFA1NeighborhoodP; - - // TODO: make sure that no more than 8 flags are used at a time - NeighborhoodFlag = RFA1NeighborhoodP.NeighborhoodFlag[unique("NeighborhoodFlag")]; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodP.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodP.nc deleted file mode 100644 index 4276510713..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1NeighborhoodP.nc +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include - -module RFA1NeighborhoodP -{ - provides - { - interface Init; - interface Neighborhood; - interface NeighborhoodFlag[uint8_t bit]; - } -} - -implementation -{ - tasklet_norace am_addr_t nodes[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t ages[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t flags[NEIGHBORHOOD_SIZE]; - tasklet_norace uint8_t time; - tasklet_norace uint8_t last; - - command error_t Init.init() - { - uint8_t i; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - nodes[i] = AM_BROADCAST_ADDR; - - return SUCCESS; - } - - inline tasklet_async command am_addr_t Neighborhood.getNode(uint8_t idx) - { - return nodes[idx]; - } - - inline tasklet_async command uint8_t Neighborhood.getAge(uint8_t idx) - { - return time - ages[idx]; - } - - tasklet_async uint8_t command Neighborhood.getIndex(am_addr_t node) - { - uint8_t i; - - if( nodes[last] == node ) - return last; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - if( nodes[i] == node ) - { - last = i; - break; - } - } - - return i; - } - - tasklet_async uint8_t command Neighborhood.insertNode(am_addr_t node) - { - uint8_t i; - uint8_t maxAge; - - if( nodes[last] == node ) - { - if( ages[last] == time ) - return last; - - ages[last] = ++time; - maxAge = 0x80; - } - else - { - uint8_t oldest = 0; - maxAge = 0; - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - uint8_t age; - - if( nodes[i] == node ) - { - last = i; - if( ages[i] == time ) - return i; - - ages[i] = ++time; - maxAge = 0x80; - break; - } - - age = time - ages[i]; - if( age > maxAge ) - { - maxAge = age; - oldest = i; - } - } - - if( i == NEIGHBORHOOD_SIZE ) - { - signal Neighborhood.evicted(oldest); - - last = oldest; - nodes[oldest] = node; - ages[oldest] = ++time; - flags[oldest] = 0; - } - } - - if( (time & 0x7F) == 0x7F && maxAge >= 0x7F ) - { - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - { - if( (ages[i] | 0x7F) != time ) - ages[i] = time & 0x80; - } - } - - return last; - } - - inline tasklet_async command bool NeighborhoodFlag.get[uint8_t bit](uint8_t idx) - { - return flags[idx] & (1 << bit); - } - - inline tasklet_async command void NeighborhoodFlag.set[uint8_t bit](uint8_t idx) - { - flags[idx] |= (1 << bit); - } - - inline tasklet_async command void NeighborhoodFlag.clear[uint8_t bit](uint8_t idx) - { - flags[idx] &= ~(1 << bit); - } - - tasklet_async command void NeighborhoodFlag.clearAll[uint8_t bit]() - { - uint8_t i; - - bit = ~(1 << bit); - - for(i = 0; i < NEIGHBORHOOD_SIZE; ++i) - flags[i] &= bit; - } -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioAlarmC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioAlarmC.nc deleted file mode 100644 index 9bbd07e0fc..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioAlarmC.nc +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include "RadioConfig.h" - -generic configuration RFA1RadioAlarmC() -{ - provides - { - interface RadioAlarm[uint8_t id]; // use unique - } - - uses - { - interface Alarm @exactlyonce(); - } -} - -implementation -{ - components new RadioAlarmP(), RFA1TaskletC; - - RadioAlarm = RadioAlarmP; - Alarm = RadioAlarmP; - RadioAlarmP.Tasklet -> RFA1TaskletC; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioC.nc deleted file mode 100644 index c3ed7a33cb..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1RadioC.nc +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - * Author: Andras Biro - */ - -#include - -configuration RFA1RadioC -{ - provides - { - interface SplitControl; - -#ifndef IEEE154FRAMES_ENABLED - interface AMSend[am_id_t id]; - interface Receive[am_id_t id]; - interface Receive as Snoop[am_id_t id]; - interface SendNotifier[am_id_t id]; - - // for TOSThreads - interface Receive as ReceiveDefault[am_id_t id]; - interface Receive as SnoopDefault[am_id_t id]; - - interface AMPacket; - interface Packet as PacketForActiveMessage; -#endif - -#ifndef TFRAMES_ENABLED - interface Ieee154Send; - interface Receive as Ieee154Receive; - interface SendNotifier as Ieee154Notifier; - - interface Resource as SendResource[uint8_t clint]; - - interface Ieee154Packet; - interface Packet as PacketForIeee154Message; -#endif - - interface PacketAcknowledgements; - interface LowPowerListening; - interface PacketLink; - -#ifdef TRAFFIC_MONITOR - interface TrafficMonitor; -#endif - - interface RadioChannel; - - interface PacketField as PacketLinkQuality; - interface PacketField as PacketTransmitPower; - interface PacketField as PacketRSSI; - interface LinkPacketMetadata; - - interface LocalTime as LocalTimeRadio; - interface PacketTimeStamp as PacketTimeStampRadio; - interface PacketTimeStamp as PacketTimeStampMilli; - } -} - -implementation -{ - #define UQ_METADATA_FLAGS "UQ_RFA1_METADATA_FLAGS" - #define UQ_RADIO_ALARM "UQ_RFA1_RADIO_ALARM" - -// -------- RadioP - - components RFA1RadioP as RadioP; - -#ifdef RADIO_DEBUG - components AssertC; -#endif - - RadioP.Ieee154PacketLayer -> Ieee154PacketLayerC; - RadioP.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - RadioP.PacketTimeStamp -> TimeStampingLayerC; - RadioP.RFA1Packet -> RadioDriverLayerC; - -// -------- RadioAlarm - - components new RFA1RadioAlarmC() as RadioAlarmC; - RadioAlarmC.Alarm -> RadioDriverLayerC; - -// -------- Active Message - -#ifndef IEEE154FRAMES_ENABLED - components new ActiveMessageLayerC(); - ActiveMessageLayerC.Config -> RadioP; - ActiveMessageLayerC.SubSend -> AutoResourceAcquireLayerC; - ActiveMessageLayerC.SubReceive -> TinyosNetworkLayerC.TinyosReceive; - ActiveMessageLayerC.SubPacket -> TinyosNetworkLayerC.TinyosPacket; - - AMSend = ActiveMessageLayerC; - Receive = ActiveMessageLayerC.Receive; - Snoop = ActiveMessageLayerC.Snoop; - SendNotifier = ActiveMessageLayerC; - AMPacket = ActiveMessageLayerC; - PacketForActiveMessage = ActiveMessageLayerC; - - ReceiveDefault = ActiveMessageLayerC.ReceiveDefault; - SnoopDefault = ActiveMessageLayerC.SnoopDefault; -#endif - -// -------- Automatic RadioSend Resource - -#ifndef IEEE154FRAMES_ENABLED -#ifndef TFRAMES_ENABLED - components new AutoResourceAcquireLayerC(); - AutoResourceAcquireLayerC.Resource -> SendResourceC.Resource[unique(RADIO_SEND_RESOURCE)]; -#else - components new DummyLayerC() as AutoResourceAcquireLayerC; -#endif - AutoResourceAcquireLayerC -> TinyosNetworkLayerC.TinyosSend; -#endif - -// -------- RadioSend Resource - -#ifndef TFRAMES_ENABLED - components new SimpleFcfsArbiterC(RADIO_SEND_RESOURCE) as SendResourceC; - SendResource = SendResourceC; - -// -------- Ieee154 Message - - components new Ieee154MessageLayerC(); - Ieee154MessageLayerC.Ieee154PacketLayer -> Ieee154PacketLayerC; - Ieee154MessageLayerC.SubSend -> TinyosNetworkLayerC.Ieee154Send; - Ieee154MessageLayerC.SubReceive -> TinyosNetworkLayerC.Ieee154Receive; - Ieee154MessageLayerC.RadioPacket -> TinyosNetworkLayerC.Ieee154Packet; - - Ieee154Send = Ieee154MessageLayerC; - Ieee154Receive = Ieee154MessageLayerC; - Ieee154Notifier = Ieee154MessageLayerC; - Ieee154Packet = Ieee154PacketLayerC; - PacketForIeee154Message = Ieee154MessageLayerC; -#endif - -// -------- Tinyos Network - - components new TinyosNetworkLayerC(); - - TinyosNetworkLayerC.SubSend -> UniqueLayerC; - TinyosNetworkLayerC.SubReceive -> PacketLinkLayerC; - TinyosNetworkLayerC.SubPacket -> Ieee154PacketLayerC; - -// -------- IEEE 802.15.4 Packet - - components new Ieee154PacketLayerC(); - Ieee154PacketLayerC.SubPacket -> PacketLinkLayerC; - -// -------- UniqueLayer Send part (wired twice) - - components new RFA1UniqueLayerC() as UniqueLayerC; - UniqueLayerC.Config -> RadioP; - UniqueLayerC.SubSend -> PacketLinkLayerC; - -// -------- Packet Link - - components new PacketLinkLayerC(); - PacketLink = PacketLinkLayerC; - PacketLinkLayerC.PacketAcknowledgements -> SoftwareAckLayerC; - PacketLinkLayerC -> LowPowerListeningLayerC.Send; - PacketLinkLayerC -> LowPowerListeningLayerC.Receive; - PacketLinkLayerC -> LowPowerListeningLayerC.RadioPacket; - -// -------- Low Power Listening - -#ifdef LOW_POWER_LISTENING - #warning "*** USING LOW POWER LISTENING LAYER" - components new LowPowerListeningLayerC(); - LowPowerListeningLayerC.Config -> RadioP; - LowPowerListeningLayerC.PacketAcknowledgements -> SoftwareAckLayerC; -#else - components new LowPowerListeningDummyC() as LowPowerListeningLayerC; -#endif - LowPowerListeningLayerC.SubControl -> MessageBufferLayerC; - LowPowerListeningLayerC.SubSend -> MessageBufferLayerC; - LowPowerListeningLayerC.SubReceive -> MessageBufferLayerC; - LowPowerListeningLayerC.SubPacket -> TimeStampingLayerC; - SplitControl = LowPowerListeningLayerC; - LowPowerListening = LowPowerListeningLayerC; - -// -------- MessageBuffer - - components new RFA1MessageBufferLayerC() as MessageBufferLayerC; - MessageBufferLayerC.RadioSend -> CollisionAvoidanceLayerC; - MessageBufferLayerC.RadioReceive -> UniqueLayerC; - MessageBufferLayerC.RadioState -> TrafficMonitorLayerC; - RadioChannel = MessageBufferLayerC; - -// -------- UniqueLayer receive part (wired twice) - - UniqueLayerC.SubReceive -> CollisionAvoidanceLayerC; - -// -------- CollisionAvoidance - -#ifdef SLOTTED_MAC - components new SlottedCollisionLayerC() as CollisionAvoidanceLayerC; -#else - components new RandomCollisionLayerC() as CollisionAvoidanceLayerC; -#endif - CollisionAvoidanceLayerC.Config -> RadioP; - CollisionAvoidanceLayerC.SubSend -> SoftwareAckLayerC; - CollisionAvoidanceLayerC.SubReceive -> SoftwareAckLayerC; - CollisionAvoidanceLayerC.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - -// -------- SoftwareAcknowledgement - - components new SoftwareAckLayerC(); - SoftwareAckLayerC.AckReceivedFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - SoftwareAckLayerC.RadioAlarm -> RadioAlarmC.RadioAlarm[unique(UQ_RADIO_ALARM)]; - PacketAcknowledgements = SoftwareAckLayerC; - SoftwareAckLayerC.Config -> RadioP; - SoftwareAckLayerC.SubSend -> CsmaLayerC; - SoftwareAckLayerC.SubReceive -> SimulatedTopologyLayerC; - -//-------- Simulated Topology Layer -#ifdef SIMULATED_TOPOLOGY - #warning *** USING SIMULATED TOPOLOGY LAYER - components SimulatedTopologyLayerC; -#else - components new DummyLayerC() as SimulatedTopologyLayerC; -#endif - SimulatedTopologyLayerC.Config -> RadioP; - SimulatedTopologyLayerC -> CsmaLayerC.RadioReceive; - - -// -------- Carrier Sense - - components new DummyLayerC() as CsmaLayerC; - CsmaLayerC.Config -> RadioP; - CsmaLayerC -> TrafficMonitorLayerC.RadioSend; - CsmaLayerC -> TrafficMonitorLayerC.RadioReceive; - CsmaLayerC -> RadioDriverLayerC.RadioCCA; - -// -------- TimeStamping - - components new TimeStampingLayerC(); - TimeStampingLayerC.LocalTimeRadio -> RadioDriverLayerC; - TimeStampingLayerC.SubPacket -> MetadataFlagsLayerC; - PacketTimeStampRadio = TimeStampingLayerC; - PacketTimeStampMilli = TimeStampingLayerC; - TimeStampingLayerC.TimeStampFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - -// -------- MetadataFlags - - components new MetadataFlagsLayerC(); - MetadataFlagsLayerC.SubPacket -> RadioDriverLayerC; - -// -------- Traffic Monitor - -#ifdef TRAFFIC_MONITOR - components new TrafficMonitorLayerC(); - TrafficMonitor = TrafficMonitorLayerC; -#else - components new DummyLayerC() as TrafficMonitorLayerC; -#endif - TrafficMonitorLayerC.Config -> RadioP; - TrafficMonitorLayerC -> RadioDriverDebugLayerC.RadioSend; - TrafficMonitorLayerC -> RadioDriverLayerC.RadioReceive; - TrafficMonitorLayerC -> RadioDriverDebugLayerC.RadioState; - -// -------- Debug - -#ifdef RADIO_DEBUG - components new DebugLayerC("driver") as RadioDriverDebugLayerC; -#else - components new DummyLayerC() as RadioDriverDebugLayerC; -#endif - RadioDriverDebugLayerC.SubState -> RadioDriverLayerC; - RadioDriverDebugLayerC.SubSend -> RadioDriverLayerC; - -// -------- Driver - - components RFA1DriverLayerC as RadioDriverLayerC; - RadioDriverLayerC.Config -> RadioP; - RadioDriverLayerC.PacketTimeStamp -> TimeStampingLayerC; - PacketTransmitPower = RadioDriverLayerC.PacketTransmitPower; - PacketLinkQuality = RadioDriverLayerC.PacketLinkQuality; - PacketRSSI = RadioDriverLayerC.PacketRSSI; - LinkPacketMetadata = RadioDriverLayerC; - LocalTimeRadio = RadioDriverLayerC; - - RadioDriverLayerC.TransmitPowerFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - RadioDriverLayerC.RSSIFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; - RadioDriverLayerC.TimeSyncFlag -> MetadataFlagsLayerC.PacketFlag[unique(UQ_METADATA_FLAGS)]; -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1TaskletC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1TaskletC.nc deleted file mode 100644 index c249c5cdcf..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1TaskletC.nc +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -#include -#include - -module RFA1TaskletC -{ - provides interface Tasklet; -} - -implementation -{ -#ifdef TASKLET_IS_TASK - - task void tasklet() - { - signal Tasklet.run(); - } - - inline async command void Tasklet.schedule() - { - post tasklet(); - } - - inline command void Tasklet.suspend() - { - } - - inline command void Tasklet.resume() - { - } - -#else - - /** - * The lower 7 bits contain the number of suspends plus one if the run - * event is currently beeing executed. The highest bit is set if the run - * event needs to be called again when the suspend count goes down to zero. - */ - uint8_t state; - - void doit() - { - for(;;) - { - signal Tasklet.run(); - - atomic - { - if( state == 1 ) - { - state = 0; - return; - } - - RADIO_ASSERT( state == 0x81 ); - state = 1; - } - } - } - - inline command void Tasklet.suspend() - { - atomic ++state; - } - - command void Tasklet.resume() - { - atomic - { - if( --state != 0x80 ) - return; - - state = 1; - } - - doit(); - } - - async command void Tasklet.schedule() - { - atomic - { - if( state != 0 ) - { - state |= 0x80; - return; - } - - state = 1; - } - - doit(); - } - -#endif -} diff --git a/tos/platforms/ucprotonb/chips/doubleradio/RFA1UniqueLayerC.nc b/tos/platforms/ucprotonb/chips/doubleradio/RFA1UniqueLayerC.nc deleted file mode 100644 index 0013fc047c..0000000000 --- a/tos/platforms/ucprotonb/chips/doubleradio/RFA1UniqueLayerC.nc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2007, Vanderbilt University - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - Neither the name of the copyright holder nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Author: Miklos Maroti - */ - -generic configuration RFA1UniqueLayerC() -{ - provides - { - // NOTE, this is a combined layer, should be hooked up at two places - interface BareSend as Send; - interface RadioReceive; - } - uses - { - interface BareSend as SubSend; - interface RadioReceive as SubReceive; - - interface UniqueConfig as Config; - } -} - -implementation -{ - components new UniqueLayerP(), MainC, RFA1NeighborhoodC as NeighborhoodC, new RFA1NeighborhoodFlagC() as NeighborhoodFlagC; - - MainC.SoftwareInit -> UniqueLayerP; - UniqueLayerP.Neighborhood -> NeighborhoodC; - UniqueLayerP.NeighborhoodFlag -> NeighborhoodFlagC; - - Send = UniqueLayerP; - SubSend = UniqueLayerP; - - RadioReceive = UniqueLayerP; - SubReceive = UniqueLayerP; - Config = UniqueLayerP; -}