nl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log

This makes it easier to understand what happened with PS configuration.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2018-04-23 13:44:06 +03:00 committed by Jouni Malinen
parent 24b5b786e6
commit 1baa130bd0

View file

@ -8051,6 +8051,7 @@ static void nl80211_poll_client(void *priv, const u8 *own_addr, const u8 *addr,
static int nl80211_set_power_save(struct i802_bss *bss, int enabled)
{
struct nl_msg *msg;
int ret;
if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_POWER_SAVE)) ||
nla_put_u32(msg, NL80211_ATTR_PS_STATE,
@ -8058,7 +8059,15 @@ static int nl80211_set_power_save(struct i802_bss *bss, int enabled)
nlmsg_free(msg);
return -ENOBUFS;
}
return send_and_recv_msgs(bss->drv, msg, NULL, NULL);
ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL);
if (ret < 0) {
wpa_printf(MSG_DEBUG,
"nl80211: Setting PS state %s failed: %d (%s)",
enabled ? "enabled" : "disabled",
ret, strerror(-ret));
}
return ret;
}