3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

frame-xchg: Improve search for current frame in MLME notify

Since there may now be multiple frames-xchg record for each wdev, when
we receive the TX Status event, make sure we find the record who's radio
work has started, as indicated by fx->retry_cnt > 0.  Otherwise we're
relying on the ordering of the frames in the "frame_xchgs" queue and
constant priority.
This commit is contained in:
Andrew Zaborowski 2020-07-31 03:31:25 +02:00 committed by Denis Kenzior
parent 736aadc75f
commit 28d3eed32e

View File

@ -1057,12 +1057,12 @@ static void frame_xchg_resp_cb(const struct mmpdu_header *mpdu,
frame_xchg_resp_handle(mpdu, body, body_len, rssi, user_data);
}
static bool frame_xchg_match(const void *a, const void *b)
static bool frame_xchg_match_running(const void *a, const void *b)
{
const struct frame_xchg_data *fx = a;
const uint64_t *wdev_id = b;
return fx->wdev_id == *wdev_id;
return fx->retry_cnt > 0 && fx->wdev_id == *wdev_id;
}
/*
@ -1225,7 +1225,8 @@ static void frame_xchg_mlme_notify(struct l_genl_msg *msg, void *user_data)
l_debug("Received %s", ack ? "an ACK" : "no ACK");
fx = l_queue_find(frame_xchgs, frame_xchg_match, &wdev_id);
fx = l_queue_find(frame_xchgs, frame_xchg_match_running,
&wdev_id);
if (!fx)
return;