mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
net/gnrc/sixlowpan/frag/rb:Move del. timer macro to 'CONFIG_' namespace
This commit is contained in:
parent
811facfa15
commit
582779a7a0
@ -132,8 +132,8 @@ extern "C" {
|
||||
* immediately. Use this value to prevent re-creation of a reassembly buffer
|
||||
* entry on late arriving link-layer duplicates.
|
||||
*/
|
||||
#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER
|
||||
#define GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER (0U)
|
||||
#ifndef CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER
|
||||
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER (0U)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@ -364,7 +364,7 @@ static bool _rbuf_update_ints(gnrc_sixlowpan_frag_rb_base_t *entry,
|
||||
|
||||
static void _gc_pkt(gnrc_sixlowpan_frag_rb_t *rbuf)
|
||||
{
|
||||
#if GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0
|
||||
#if CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0
|
||||
if (rbuf->super.current_size == 0) {
|
||||
/* packet is scheduled for deletion, but was complete, i.e. pkt is
|
||||
* already handed up to other layer, i.e. no need to release */
|
||||
@ -433,7 +433,7 @@ static int _rbuf_get(const void *src, size_t src_len,
|
||||
rbuf[i].super.dst_len,
|
||||
l2addr_str),
|
||||
(unsigned)rbuf[i].super.datagram_size, rbuf[i].super.tag);
|
||||
#if GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0
|
||||
#if CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0
|
||||
if (rbuf[i].super.current_size == 0) {
|
||||
/* ensure that only empty reassembly buffer entries and entries
|
||||
* scheduled for deletion have `current_size == 0` */
|
||||
@ -563,21 +563,21 @@ void gnrc_sixlowpan_frag_rb_base_rm(gnrc_sixlowpan_frag_rb_base_t *entry)
|
||||
|
||||
static void _tmp_rm(gnrc_sixlowpan_frag_rb_t *rbuf)
|
||||
{
|
||||
#if GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0U
|
||||
#if CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER > 0U
|
||||
/* use garbage-collection to leave the entry for at least
|
||||
* GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER in the reassembly buffer by
|
||||
* CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER in the reassembly buffer by
|
||||
* setting the arrival time to
|
||||
* (CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US - GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER)
|
||||
* (CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US - CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER)
|
||||
* microseconds in the past */
|
||||
rbuf->super.arrival = xtimer_now_usec() -
|
||||
(CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US -
|
||||
GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER);
|
||||
CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER);
|
||||
/* reset current size to prevent late duplicates to trigger another
|
||||
* dispatch */
|
||||
rbuf->super.current_size = 0;
|
||||
#else /* GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER == 0U */
|
||||
#else /* CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER == 0U */
|
||||
gnrc_sixlowpan_frag_rb_remove(rbuf);
|
||||
#endif /* GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER */
|
||||
#endif /* CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER */
|
||||
}
|
||||
|
||||
int gnrc_sixlowpan_frag_rb_dispatch_when_complete(gnrc_sixlowpan_frag_rb_t *rbuf,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user