mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-10 11:29:38 +00:00
The CSMA driver no longer throttles queued packets
Fix for #1166 Updated the CSMA driver so it no longer applies a time delay for sending queued packets which were sent without error.
This commit is contained in:
parent
32e668ae2a
commit
467f28286c
@ -171,8 +171,10 @@ transmit_packet_list(void *ptr)
|
|||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
free_packet(struct neighbor_queue *n, struct rdc_buf_list *p)
|
free_packet(struct neighbor_queue *n, struct rdc_buf_list *p, int status)
|
||||||
{
|
{
|
||||||
|
clock_time_t tx_delay;
|
||||||
|
|
||||||
if(p != NULL) {
|
if(p != NULL) {
|
||||||
/* Remove packet from list and deallocate */
|
/* Remove packet from list and deallocate */
|
||||||
list_remove(n->queued_packet_list, p);
|
list_remove(n->queued_packet_list, p);
|
||||||
@ -188,8 +190,8 @@ free_packet(struct neighbor_queue *n, struct rdc_buf_list *p)
|
|||||||
n->collisions = 0;
|
n->collisions = 0;
|
||||||
n->deferrals = 0;
|
n->deferrals = 0;
|
||||||
/* Set a timer for next transmissions */
|
/* Set a timer for next transmissions */
|
||||||
ctimer_set(&n->transmit_timer, default_timebase(),
|
tx_delay = (status == MAC_TX_OK) ? 0 : default_timebase();
|
||||||
transmit_packet_list, n);
|
ctimer_set(&n->transmit_timer, tx_delay, transmit_packet_list, n);
|
||||||
} else {
|
} else {
|
||||||
/* This was the last packet in the queue, we free the neighbor */
|
/* This was the last packet in the queue, we free the neighbor */
|
||||||
ctimer_stop(&n->transmit_timer);
|
ctimer_stop(&n->transmit_timer);
|
||||||
@ -293,7 +295,7 @@ packet_sent(void *ptr, int status, int num_transmissions)
|
|||||||
} else {
|
} else {
|
||||||
PRINTF("csma: drop with status %d after %d transmissions, %d collisions\n",
|
PRINTF("csma: drop with status %d after %d transmissions, %d collisions\n",
|
||||||
status, n->transmissions, n->collisions);
|
status, n->transmissions, n->collisions);
|
||||||
free_packet(n, q);
|
free_packet(n, q, status);
|
||||||
mac_call_sent_callback(sent, cptr, status, num_tx);
|
mac_call_sent_callback(sent, cptr, status, num_tx);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -302,7 +304,7 @@ packet_sent(void *ptr, int status, int num_transmissions)
|
|||||||
} else {
|
} else {
|
||||||
PRINTF("csma: rexmit failed %d: %d\n", n->transmissions, status);
|
PRINTF("csma: rexmit failed %d: %d\n", n->transmissions, status);
|
||||||
}
|
}
|
||||||
free_packet(n, q);
|
free_packet(n, q, status);
|
||||||
mac_call_sent_callback(sent, cptr, status, num_tx);
|
mac_call_sent_callback(sent, cptr, status, num_tx);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user