From 9569519bbe933b3d33ab7ab027cde6222efe6616 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sat, 12 May 2018 11:20:14 -0700 Subject: [PATCH] TSCH: burst mode is in the standard, remove custom link option --- os/net/mac/tsch/tsch-conf.h | 11 +++-------- os/net/mac/tsch/tsch-const.h | 1 - os/net/mac/tsch/tsch-schedule.c | 3 +-- os/net/mac/tsch/tsch-slot-operation.c | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/os/net/mac/tsch/tsch-conf.h b/os/net/mac/tsch/tsch-conf.h index afd90aaef..8613eb0e3 100644 --- a/os/net/mac/tsch/tsch-conf.h +++ b/os/net/mac/tsch/tsch-conf.h @@ -317,14 +317,9 @@ #define TSCH_SCHEDULE_WITH_6TISCH_MINIMAL (!(BUILD_WITH_ORCHESTRA)) #endif -/* Add burst mode to 6TiSCH minimal schedule */ -#ifdef TSCH_CONF_WITH_6TISCH_MINIMAL_WITH_BURST -#define TSCH_WITH_6TISCH_MINIMAL_WITH_BURST TSCH_CONF_WITH_6TISCH_MINIMAL_WITH_BURST -#else -#define TSCH_WITH_6TISCH_MINIMAL_WITH_BURST 0 -#endif - -/* Set an upper bound on burst length */ +/* Set an upper bound on burst length. Set to 0 to never set the frame pending + * bit, i.e., never trigger a burst. Note that receiver-side support for burst + * is always enabled, as it is part of IEEE 802.1.5.4-2015 (Section 7.2.1.3)*/ #ifdef TSCH_CONF_BURST_MAX_LEN #define TSCH_BURST_MAX_LEN TSCH_CONF_BURST_MAX_LEN #else diff --git a/os/net/mac/tsch/tsch-const.h b/os/net/mac/tsch/tsch-const.h index 51e7d0625..81ca7ffa8 100644 --- a/os/net/mac/tsch/tsch-const.h +++ b/os/net/mac/tsch/tsch-const.h @@ -53,7 +53,6 @@ #define LINK_OPTION_RX 2 #define LINK_OPTION_SHARED 4 #define LINK_OPTION_TIME_KEEPING 8 -#define LINK_OPTION_BURST 16 /* Default IEEE 802.15.4e hopping sequences, obtained from https://gist.github.com/twatteyne/2e22ee3c1a802b685695 */ /* 16 channels, sequence length 16 */ diff --git a/os/net/mac/tsch/tsch-schedule.c b/os/net/mac/tsch/tsch-schedule.c index a03363eb9..4f94b8e30 100644 --- a/os/net/mac/tsch/tsch-schedule.c +++ b/os/net/mac/tsch/tsch-schedule.c @@ -423,8 +423,7 @@ tsch_schedule_create_minimal(void) * but is required according to 802.15.4e if also used for EB transmission. * Timeslot: 0, channel offset: 0. */ tsch_schedule_add_link(sf_min, - LINK_OPTION_RX | LINK_OPTION_TX | LINK_OPTION_SHARED | LINK_OPTION_TIME_KEEPING - | (TSCH_WITH_6TISCH_MINIMAL_WITH_BURST ? LINK_OPTION_BURST : 0), + (LINK_OPTION_RX | LINK_OPTION_TX | LINK_OPTION_SHARED | LINK_OPTION_TIME_KEEPING), LINK_TYPE_ADVERTISING, &tsch_broadcast_address, 0, 0); } diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index bc76b526e..de4dec676 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -477,7 +477,7 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t)) is_broadcast = current_neighbor->is_broadcast; /* Unicast. More packets in queue for the neighbor? */ burst_link_requested = 0; - if(!is_broadcast && (current_link->link_options & LINK_OPTION_BURST) + if(!is_broadcast && tsch_current_burst_count + 1 < TSCH_BURST_MAX_LEN && tsch_queue_packet_count(¤t_neighbor->addr) > 1) { burst_link_requested = 1;