Contiki-NG
|
Per-neighbor packet queues for TSCH MAC.More...
#include "contiki.h"
#include "lib/list.h"
#include "lib/memb.h"
#include "lib/random.h"
#include "net/queuebuf.h"
#include "net/mac/tsch/tsch.h"
#include <string.h>
#include "sys/log.h"
Go to the source code of this file.
Functions | |
struct tsch_neighbor * | tsch_queue_add_nbr (const linkaddr_t *addr) |
Add a TSCH neighbor queue. More... | |
struct tsch_neighbor * | tsch_queue_get_nbr (const linkaddr_t *addr) |
Get a TSCH neighbor. More... | |
struct tsch_neighbor * | tsch_queue_get_time_source (void) |
Get the TSCH time source (we currently assume there is only one) More... | |
int | tsch_queue_update_time_source (const linkaddr_t *new_addr) |
Update TSCH time source. More... | |
struct tsch_packet * | tsch_queue_add_packet (const linkaddr_t *addr, uint8_t max_transmissions, mac_callback_t sent, void *ptr) |
Add packet to neighbor queue. More... | |
int | tsch_queue_global_packet_count (void) |
Returns the number of packets currently in all TSCH queues. More... | |
int | tsch_queue_packet_count (const linkaddr_t *addr) |
Returns the number of packets currently a given neighbor queue. More... | |
struct tsch_packet * | tsch_queue_remove_packet_from_queue (struct tsch_neighbor *n) |
Remove first packet from a neighbor queue. More... | |
void | tsch_queue_free_packet (struct tsch_packet *p) |
Free a packet. More... | |
int | tsch_queue_packet_sent (struct tsch_neighbor *n, struct tsch_packet *p, struct tsch_link *link, uint8_t mac_tx_status) |
Updates neighbor queue state after a transmission. More... | |
void | tsch_queue_reset (void) |
Reset neighbor queues module. | |
void | tsch_queue_free_unused_neighbors (void) |
Deallocate all neighbors with empty queue. | |
int | tsch_queue_is_empty (const struct tsch_neighbor *n) |
Is the neighbor queue empty? More... | |
struct tsch_packet * | tsch_queue_get_packet_for_nbr (const struct tsch_neighbor *n, struct tsch_link *link) |
Returns the first packet that can be sent from a queue on a given link. More... | |
struct tsch_packet * | tsch_queue_get_packet_for_dest_addr (const linkaddr_t *addr, struct tsch_link *link) |
Returns the first packet that can be sent to a given address on a given link. More... | |
struct tsch_packet * | tsch_queue_get_unicast_packet_for_any (struct tsch_neighbor **n, struct tsch_link *link) |
Gets the head packet of any neighbor queue with zero backoff counter. More... | |
int | tsch_queue_backoff_expired (const struct tsch_neighbor *n) |
Is the neighbor backoff timer expired? More... | |
void | tsch_queue_backoff_reset (struct tsch_neighbor *n) |
Reset neighbor backoff. More... | |
void | tsch_queue_backoff_inc (struct tsch_neighbor *n) |
Increment backoff exponent of a given neighbor queue, pick a new window. More... | |
void | tsch_queue_update_all_backoff_windows (const linkaddr_t *dest_addr) |
Decrement backoff window for the queue(s) able to Tx to a given address. More... | |
void | tsch_queue_init (void) |
Initialize TSCH queue module. | |
Per-neighbor packet queues for TSCH MAC.
The list of neighbors uses the TSCH lock, but per-neighbor packet array are lock-free. Read-only operation on neighbor and packets are allowed from interrupts and outside of them. Other operations are allowed outside of interrupt only.
Definition in file tsch-queue.c.