From 45dd5d2f7cbf05c3a3df82bf01a3f39a57c59fd6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 21 Apr 2021 11:03:55 -0500 Subject: [PATCH] frame-xchg: Make debugs a bit more useful - Make sure to print the cookie information - Don't print messages for frames we're not interested in. This is particularly helpful when running auto-tests since frame acks from hostapd pollute the iwd log. --- src/frame-xchg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frame-xchg.c b/src/frame-xchg.c index e0174732..4a4db561 100644 --- a/src/frame-xchg.c +++ b/src/frame-xchg.c @@ -906,8 +906,6 @@ static void frame_xchg_tx_cb(struct l_genl_msg *msg, void *user_data) fx->tx_cmd_id = 0; - l_debug("err %i", -error); - if (error < 0) { if (error == -EBUSY) { fx->timeout = l_timeout_create_ms(fx->retry_interval, @@ -926,6 +924,8 @@ static void frame_xchg_tx_cb(struct l_genl_msg *msg, void *user_data) goto error; } + l_debug("Frame sent, cookie: %"PRIu64" obtained", cookie); + early_status = fx->early_status && cookie == fx->cookie; fx->tx_acked = early_status && fx->tx_acked; fx->have_cookie = true; @@ -1269,13 +1269,14 @@ static void frame_xchg_mlme_notify(struct l_genl_msg *msg, void *user_data) NL80211_ATTR_UNSPEC) < 0) return; - l_debug("Received %s", ack ? "an ACK" : "no ACK"); - fx = l_queue_find(frame_xchgs, frame_xchg_match_running, &wdev_id); if (!fx) return; + l_debug("Received %s for cookie: %"PRIu64, + ack ? "an ACK" : "no ACK", cookie); + if (fx->have_cookie && cookie == fx->cookie && !fx->tx_acked) frame_xchg_tx_status(fx, ack); else if (!fx->have_cookie && !fx->tx_acked) {