Don't initialise the queuebuf unconditionally

Currently, it is only used by 6LoWPAN when fragmentation is enabled, by TSCH and by CSMA. Platforms that disable fragmentation and choose a different MAC layer (e.g. NULLMAC) will unnecessarily end up with the module linked in the image, wasting flash and/or RAM space.
This commit is contained in:
George Oikonomou 2017-10-15 21:12:44 +01:00 committed by George Oikonomou
parent adbe10881f
commit 8de3ffbc2e
5 changed files with 8 additions and 5 deletions

View File

@ -206,8 +206,6 @@ contiki_init()
longaddr[4], longaddr[5], longaddr[6], longaddr[7]);
}
queuebuf_init();
/* Initialize communication stack */
netstack_init();
printf("%s/%s\n",

View File

@ -43,7 +43,6 @@
#include "contiki.h"
#include "contiki-net.h"
#include "sys/platform.h"
#include "net/queuebuf.h"
#include "dev/watchdog.h"
#if BUILD_WITH_ORCHESTRA
@ -92,7 +91,6 @@ main(void)
#if NETSTACK_CONF_WITH_IPV6
memcpy(&uip_lladdr.addr, &linkaddr_node_addr, sizeof(uip_lladdr.addr));
queuebuf_init();
process_start(&tcpip_process, NULL);
#endif /* NETSTACK_CONF_WITH_IPV6 */

View File

@ -1983,6 +1983,11 @@ sicslowpan_init(void)
#endif /* SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS > 1 */
#endif /* SICSLOWPAN_COMPRESSION == SICSLOWPAN_COMPRESSION_IPHC */
/* We use the queuebuf module if fragmentation is enabled */
#if SICSLOWPAN_CONF_FRAG
queuebuf_init();
#endif
}
/*--------------------------------------------------------------------*/
int

View File

@ -549,4 +549,5 @@ csma_output_init(void)
memb_init(&packet_memb);
memb_init(&metadata_memb);
memb_init(&neighbor_memb);
queuebuf_init();
}

View File

@ -921,7 +921,8 @@ tsch_init(void)
LOG_ERR("! TSCH_HOPPING_SEQUENCE_MAX_LEN < sizeof(TSCH_DEFAULT_HOPPING_SEQUENCE). Abort init.\n");
}
/* Init TSCH sub-modules */
/* Init the queuebuf and TSCH sub-modules */
queuebuf_init();
tsch_reset();
tsch_queue_init();
tsch_schedule_init();