/* Flush all neighbor queues */ void tsch_queue_flush_all(void) { /* Deallocate unneeded neighbors */ if(!tsch_is_locked()) { struct tsch_neighbor *n = list_head(neighbor_list); while(n != NULL) { struct tsch_neighbor *next_n = list_item_next(n); tsch_queue_flush_nbr_queue(n); n = next_n; } } }
/* Flush all neighbor queues */ void tsch_queue_reset(void) { /* Deallocate unneeded neighbors */ if(!tsch_is_locked()) { struct tsch_neighbor *n = list_head(neighbor_list); while(n != NULL) { struct tsch_neighbor *next_n = list_item_next(n); /* Flush queue */ tsch_queue_flush_nbr_queue(n); /* Reset backoff exponent */ tsch_queue_backoff_reset(n); n = next_n; } } }
/* Remove TSCH neighbor queue */ static void tsch_queue_remove_nbr(struct tsch_neighbor *n) { if(n != NULL) { if(tsch_get_lock()) { /* Remove neighbor from list */ list_remove(neighbor_list, n); tsch_release_lock(); /* Flush queue */ tsch_queue_flush_nbr_queue(n); /* Free neighbor */ memb_free(&neighbor_memb, n); } } }