All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avinash Patil <patila@marvell.com>
To: <linux-wireless@vger.kernel.org>
Cc: <akarwar@marvell.com>, <cluo@marvell.com>, <huxm@marvell.com>,
	Avinash Patil <patila@marvell.com>
Subject: [PATCHv4 01/17] mwifiex: verbose logging for association failure messages
Date: Mon, 1 Jun 2015 23:31:59 +0530	[thread overview]
Message-ID: <1433181735-15712-2-git-send-email-patila@marvell.com> (raw)
In-Reply-To: <1433181735-15712-1-git-send-email-patila@marvell.com>

This patch adds more detailed information about association failures
- reason and states.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/mwifiex/fw.h   | 15 +++++++++++++--
 drivers/net/wireless/mwifiex/join.c | 30 +++++++++++++++++++++++++++---
 2 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h
index c404390..cf386bc 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -419,8 +419,12 @@ enum P2P_MODES {
 #define HS_CFG_COND_MAC_EVENT		0x00000004
 #define HS_CFG_COND_MULTICAST_DATA	0x00000008
 
-#define MWIFIEX_TIMEOUT_FOR_AP_RESP		0xfffc
-#define MWIFIEX_STATUS_CODE_AUTH_TIMEOUT	2
+#define CONNECT_ERR_AUTH_ERR_STA_FAILURE	0xFFFB
+#define CONNECT_ERR_ASSOC_ERR_TIMEOUT		0xFFFC
+#define CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED	0xFFFD
+#define CONNECT_ERR_AUTH_MSG_UNHANDLED		0xFFFE
+#define CONNECT_ERR_STA_FAILURE			0xFFFF
+
 
 #define CMD_F_HOSTCMD           (1 << 0)
 #define CMD_F_CANCELED          (1 << 1)
@@ -1151,6 +1155,13 @@ enum SNMP_MIB_INDEX {
 	DOT11H_I = 10,
 };
 
+enum mwifiex_assocmd_failurepoint {
+	MWIFIEX_ASSOC_CMD_SUCCESS = 0,
+	MWIFIEX_ASSOC_CMD_FAILURE_ASSOC,
+	MWIFIEX_ASSOC_CMD_FAILURE_AUTH,
+	MWIFIEX_ASSOC_CMD_FAILURE_JOIN
+};
+
 #define MAX_SNMP_BUF_SIZE   128
 
 struct host_cmd_ds_802_11_snmp_mib {
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 6208ef1..e233b04 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -556,6 +556,23 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv,
 	return 0;
 }
 
+static const char *assoc_failure_reason_to_str(u16 cap_info)
+{
+	switch (cap_info) {
+	case CONNECT_ERR_AUTH_ERR_STA_FAILURE:
+		return "CONNECT_ERR_AUTH_ERR_STA_FAILURE";
+	case CONNECT_ERR_AUTH_MSG_UNHANDLED:
+		return "CONNECT_ERR_AUTH_MSG_UNHANDLED";
+	case CONNECT_ERR_ASSOC_ERR_TIMEOUT:
+		return "CONNECT_ERR_ASSOC_ERR_TIMEOUT";
+	case CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED:
+		return "CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED";
+	case CONNECT_ERR_STA_FAILURE:
+		return "CONNECT_ERR_STA_FAILURE";
+	}
+
+	return "Unknown connect failure";
+}
 /*
  * Association firmware command response handler
  *
@@ -656,11 +673,18 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
 			    status_code, cap_info,
 			    le16_to_cpu(assoc_rsp->a_id));
 
-		if (cap_info == MWIFIEX_TIMEOUT_FOR_AP_RESP) {
-			if (status_code == MWIFIEX_STATUS_CODE_AUTH_TIMEOUT)
+		mwifiex_dbg(priv->adapter, ERROR, "assoc failure: reason %s\n",
+			    assoc_failure_reason_to_str(cap_info));
+		if (cap_info == CONNECT_ERR_ASSOC_ERR_TIMEOUT) {
+			if (status_code == MWIFIEX_ASSOC_CMD_FAILURE_AUTH) {
 				ret = WLAN_STATUS_AUTH_TIMEOUT;
-			else
+				mwifiex_dbg(priv->adapter, ERROR,
+					    "ASSOC_RESP: AUTH timeout\n");
+			} else {
 				ret = WLAN_STATUS_UNSPECIFIED_FAILURE;
+				mwifiex_dbg(priv->adapter, ERROR,
+					    "ASSOC_RESP: UNSPECIFIED failure\n");
+			}
 		} else {
 			ret = status_code;
 		}
-- 
1.8.1.4


  reply	other threads:[~2015-06-01 12:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 18:01 [PATCHv4 00/17] mwifiex patches Avinash Patil
2015-06-01 18:01 ` Avinash Patil [this message]
2015-06-01 19:06   ` [PATCHv4 01/17] mwifiex: verbose logging for association failure messages Joe Perches
2015-06-02  0:16     ` Julian Calaby
2015-06-01 18:02 ` [PATCHv4 02/17] mwifiex: correct bss_type assignment Avinash Patil
2015-06-01 18:02 ` [PATCHv4 03/17] mwifiex: support AP reset after bss_stop Avinash Patil
2015-06-01 18:02 ` [PATCHv4 04/17] mwifiex: enable 11d after bss reset Avinash Patil
2015-06-01 18:02 ` [PATCHv4 05/17] mwifiex: reset 11h active flag when chandef does not require dfs Avinash Patil
2015-06-01 18:02 ` [PATCHv4 06/17] mwifiex: disable CAC upon radar detection event Avinash Patil
2015-06-01 18:02 ` [PATCHv4 07/17] mwifiex: add cfg80211 get_channel handler Avinash Patil
2015-06-01 18:02 ` [PATCHv4 08/17] mwifiex: maintain station statistic in uap mode Avinash Patil
2015-06-01 18:02 ` [PATCHv4 09/17] mwifiex: add sta_list firmware command Avinash Patil
2015-06-01 18:02 ` [PATCHv4 10/17] mwifiex: dump station support in uap mode Avinash Patil
2015-06-01 18:02 ` [PATCHv4 11/17] mwifiex: parse power constraint IE from Tail Avinash Patil
2015-06-01 18:02 ` [PATCHv4 12/17] mwifiex: support downloading IEs from tail Avinash Patil
2015-06-01 18:02 ` [PATCHv4 13/17] mwifiex: drop block-ack action frames Avinash Patil
2015-06-01 18:02 ` [PATCHv4 14/17] mwifiex: advertise PS ON by default support to cfg80211 Avinash Patil
2015-06-01 18:02 ` [PATCHv4 15/17] mwifiex: update AP WMM settings from BSS_START event Avinash Patil
2015-06-01 18:02 ` [PATCHv4 16/17] mwifiex: using right tid for addressing ra_list Avinash Patil
2015-06-01 18:02 ` [PATCHv4 17/17] mwifiex: do not decrease tx_pending for AMSDU packet once more Avinash Patil
2015-06-02 13:40 ` [PATCHv4 00/17] mwifiex patches Kalle Valo
2015-06-02 13:46   ` Avinash Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433181735-15712-2-git-send-email-patila@marvell.com \
    --to=patila@marvell.com \
    --cc=akarwar@marvell.com \
    --cc=cluo@marvell.com \
    --cc=huxm@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.