From e17881c91b33740c65da4655b8ae4e29a48191b5 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 11 May 2011 16:29:26 -0300 Subject: [PATCH] tools/dirtpan/dirtpan.c (rx_pck): break tie if both sides are in s_tx Note that we still waste at least one perfectly good frame. However, instead of implementing some fancy arbitration, it's better if we just make the whole thing bidirectional in the future. --- tools/dirtpan/dirtpan.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/dirtpan/dirtpan.c b/tools/dirtpan/dirtpan.c index 8809265..39a5781 100644 --- a/tools/dirtpan/dirtpan.c +++ b/tools/dirtpan/dirtpan.c @@ -263,6 +263,14 @@ static void rx_pck(void *buf, int size) send_ack(seq); switch (state) { case s_tx: + if (type == pt_first) { + /* + * @@@ Not optimal - we break the tie but lose a + * perfectly good frame. + */ + state = s_idle; + return; + } if (type != pt_ack) return; if (seq != my_seq)