aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-08-02 13:20:29 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:50:17 -0400
commitc7fdf26995d5d6ebf1c3314ad001b9a4983c3f04 (patch)
tree170ca9900a6b667cf032ed6f84f30ea1d803ecfc /drivers/net/wireless
parent5612c0140ac58b51209a24c8fd6a92ceb472aabe (diff)
[PATCH] libertas: better descriptions for association errors
Describe the association response status code the firmware returns, based on mail to libertas-dev from Ronak. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/libertas/join.c53
1 files changed, 49 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/join.c b/drivers/net/wireless/libertas/join.c
index ccb0df1967fb..ce49d3f25613 100644
--- a/drivers/net/wireless/libertas/join.c
+++ b/drivers/net/wireless/libertas/join.c
@@ -700,6 +700,7 @@ int libertas_ret_80211_associate(wlan_private * priv,
700 union iwreq_data wrqu; 700 union iwreq_data wrqu;
701 struct ieeetypes_assocrsp *passocrsp; 701 struct ieeetypes_assocrsp *passocrsp;
702 struct bss_descriptor * bss; 702 struct bss_descriptor * bss;
703 u16 status_code;
703 704
704 lbs_deb_enter(LBS_DEB_JOIN); 705 lbs_deb_enter(LBS_DEB_JOIN);
705 706
@@ -712,12 +713,56 @@ int libertas_ret_80211_associate(wlan_private * priv,
712 713
713 passocrsp = (struct ieeetypes_assocrsp *) & resp->params; 714 passocrsp = (struct ieeetypes_assocrsp *) & resp->params;
714 715
715 if (le16_to_cpu(passocrsp->statuscode)) { 716 /*
716 libertas_mac_event_disconnected(priv); 717 * Older FW versions map the IEEE 802.11 Status Code in the association
718 * response to the following values returned in passocrsp->statuscode:
719 *
720 * IEEE Status Code Marvell Status Code
721 * 0 -> 0x0000 ASSOC_RESULT_SUCCESS
722 * 13 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
723 * 14 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
724 * 15 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
725 * 16 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
726 * others -> 0x0003 ASSOC_RESULT_REFUSED
727 *
728 * Other response codes:
729 * 0x0001 -> ASSOC_RESULT_INVALID_PARAMETERS (unused)
730 * 0x0002 -> ASSOC_RESULT_TIMEOUT (internal timer expired waiting for
731 * association response from the AP)
732 */
717 733
718 lbs_deb_join("ASSOC_RESP: Association failed, status code = %d\n", 734 status_code = le16_to_cpu(passocrsp->statuscode);
719 le16_to_cpu(passocrsp->statuscode)); 735 switch (status_code) {
736 case 0x00:
737 lbs_deb_join("ASSOC_RESP: Association succeeded\n");
738 break;
739 case 0x01:
740 lbs_deb_join("ASSOC_RESP: Association failed; invalid "
741 "parameters (status code %d)\n", status_code);
742 break;
743 case 0x02:
744 lbs_deb_join("ASSOC_RESP: Association failed; internal timer "
745 "expired while waiting for the AP (status code %d)"
746 "\n", status_code);
747 break;
748 case 0x03:
749 lbs_deb_join("ASSOC_RESP: Association failed; association "
750 "was refused by the AP (status code %d)\n",
751 status_code);
752 break;
753 case 0x04:
754 lbs_deb_join("ASSOC_RESP: Association failed; authentication "
755 "was refused by the AP (status code %d)\n",
756 status_code);
757 break;
758 default:
759 lbs_deb_join("ASSOC_RESP: Association failed; reason unknown "
760 "(status code %d)\n", status_code);
761 break;
762 }
720 763
764 if (status_code) {
765 libertas_mac_event_disconnected(priv);
721 ret = -1; 766 ret = -1;
722 goto done; 767 goto done;
723 } 768 }