Patchwork nl80211: Make MLME failure messages unique.

login
register
mail settings
Submitter Ben Greear
Date Nov. 14, 2011, 6:42 p.m.
Message ID <1321296150-9260-1-git-send-email-greearb@candelatech.com>
Download mbox | patch
Permalink /patch/125589/
State Accepted
Commit 3b7ea880475dbf42caccf84676cc922ce59e4633
Headers show

Comments

Ben Greear - Nov. 14, 2011, 6:42 p.m.
From: Ben Greear <greearb@candelatech.com>

Without this, it is impossible to tell exactly which
MLME code returned the error.

Also, convert to wpa_dbg so that we get device names
in the messages.

Signed-hostap: Ben Greear <greearb@candelatech.com>
---
:100644 100644 0f7447b... f9682bf... M	src/drivers/driver_nl80211.c
 src/drivers/driver_nl80211.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
Jouni Malinen - Nov. 18, 2011, 9:42 p.m.
On Mon, Nov 14, 2011 at 10:42:30AM -0800, greearb@candelatech.com wrote:
> Without this, it is impossible to tell exactly which
> MLME code returned the error.
> 
> Also, convert to wpa_dbg so that we get device names
> in the messages.

Thanks, applied.

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 0f7447b..f9682bf 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3552,8 +3552,9 @@  static int wpa_driver_nl80211_mlme(struct wpa_driver_nl80211_data *drv,
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	msg = NULL;
 	if (ret) {
-		wpa_printf(MSG_DEBUG, "nl80211: MLME command failed: ret=%d "
-			   "(%s)", ret, strerror(-ret));
+		wpa_dbg(drv->ctx, MSG_DEBUG,
+			"nl80211: MLME command failed: reason=%hu ret=%d (%s)",
+			reason_code, ret, strerror(-ret));
 		goto nla_put_failure;
 	}
 	ret = 0;
@@ -3692,8 +3693,9 @@  retry:
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	msg = NULL;
 	if (ret) {
-		wpa_printf(MSG_DEBUG, "nl80211: MLME command failed: ret=%d "
-			   "(%s)", ret, strerror(-ret));
+		wpa_dbg(drv->ctx, MSG_DEBUG,
+			"nl80211: MLME command failed (auth): ret=%d (%s)",
+			ret, strerror(-ret));
 		count++;
 		if (ret == -EALREADY && count == 1 && params->bssid &&
 		    !params->local_state_change) {
@@ -5738,8 +5740,9 @@  static int wpa_driver_nl80211_associate(
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	msg = NULL;
 	if (ret) {
-		wpa_printf(MSG_DEBUG, "nl80211: MLME command failed: ret=%d "
-			   "(%s)", ret, strerror(-ret));
+		wpa_dbg(drv->ctx, MSG_DEBUG,
+			"nl80211: MLME command failed (assoc): ret=%d (%s)",
+			ret, strerror(-ret));
 		nl80211_dump_scan(drv);
 		goto nla_put_failure;
 	}