1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-29 03:16:47 +02:00

tools/dirtpan/dirtpan.c (rx_pck): immediately ack all data packets

We basically take care of the acking the 802.15.4 layer should do.
This commit is contained in:
Werner Almesberger 2011-05-11 16:24:12 -03:00
parent 354789da8d
commit 2c7d06f6f2

View File

@ -259,6 +259,8 @@ static void rx_pck(void *buf, int size)
type = ctrl & PT_MASK;
seq = !!(ctrl & SEQ);
if (type == pt_first || type == pt_next)
send_ack(seq);
switch (state) {
case s_tx:
if (type != pt_ack)
@ -283,18 +285,14 @@ static void rx_pck(void *buf, int size)
}
if (type != pt_next)
return;
if (seq == peer_seq) {
send_ack(seq); /* retransmission */
return;
}
if (seq == peer_seq)
return; /* retransmission */
goto recv_more;
case s_idle:
if (type == pt_first)
break;
if (type == pt_next) {
send_ack(seq); /* get rid of it */
if (type == pt_next)
return;
}
return;
default:
abort();
@ -310,7 +308,6 @@ static void rx_pck(void *buf, int size)
recv_more:
if (left < size-1) {
send_ack(seq); /* get rid of it */
state = s_idle;
return;
}
@ -318,7 +315,6 @@ recv_more:
pos += size-1;
left -= size-1;
peer_seq = seq;
send_ack(seq);
if (!left) {
debug_ip("<-", packet, pos-(void *) packet);