From: Jouni Malinen Date: Mon, 23 Apr 2018 10:44:06 +0000 (+0300) Subject: nl80211: Print NL80211_CMD_SET_POWER_SAVE errors in debug log X-Git-Tag: hostap_2_7~409 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1baa130bd01fdb95419fa32759d1a90024ec8f33;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 66b69892b..340034764 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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; }