From 2f778914963ce3f50213a901359ea2686b51f598 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 20 Mar 2021 00:15:53 +0200 Subject: [PATCH] nl80211: Debug print error from airtime weight configuration It is better to be able to determine whether the airtime weight configuration for a STA actually was accepted by the driver or not. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 35526fc2f..e7a28cae2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5789,6 +5789,7 @@ static int driver_nl80211_sta_set_airtime_weight(void *priv, const u8 *addr, { struct i802_bss *bss = priv; struct nl_msg *msg; + int ret; wpa_printf(MSG_DEBUG, "nl80211: Set STA airtime weight - ifname=%s addr=" MACSTR @@ -5799,7 +5800,13 @@ static int driver_nl80211_sta_set_airtime_weight(void *priv, const u8 *addr, nla_put_u16(msg, NL80211_ATTR_AIRTIME_WEIGHT, weight)) goto fail; - return send_and_recv_msgs(bss->drv, msg, NULL, NULL, NULL, NULL); + ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL, NULL, NULL); + if (ret) { + wpa_printf(MSG_DEBUG, + "nl80211: SET_STATION[AIRTIME_WEIGHT] failed: ret=%d (%s)", + ret, strerror(-ret)); + } + return ret; fail: nlmsg_free(msg); return -ENOBUFS;