aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cfg.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-07-30 02:14:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 15:26:36 -0400
commit86df5f7284ffdea9923153764691e490abf36081 (patch)
tree1920d54fa7538434c2e40c6c5ed46d82345094d3 /drivers/net/wireless/libertas/cfg.c
parent4083858c8b309068024ba43672d831999d69ba3f (diff)
libertas: better association request debugging
Bring back the comment about FW v5 status codes from the pre-cfg80211 driver, and let through status codes that aren't remapped by the firmware. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cfg.c')
-rw-r--r--drivers/net/wireless/libertas/cfg.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 8bf88fa43690..08487a848e05 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -1117,7 +1117,7 @@ static int lbs_associate(struct lbs_private *priv,
1117 lbs_deb_hex(LBS_DEB_ASSOC, "Common Rates", tmp, pos - tmp); 1117 lbs_deb_hex(LBS_DEB_ASSOC, "Common Rates", tmp, pos - tmp);
1118 1118
1119 /* add auth type TLV */ 1119 /* add auth type TLV */
1120 if (priv->fwrelease >= 0x09000000) 1120 if (MRVL_FW_MAJOR_REV(priv->fwrelease) >= 9)
1121 pos += lbs_add_auth_type_tlv(pos, sme->auth_type); 1121 pos += lbs_add_auth_type_tlv(pos, sme->auth_type);
1122 1122
1123 /* add WPA/WPA2 TLV */ 1123 /* add WPA/WPA2 TLV */
@@ -1128,6 +1128,9 @@ static int lbs_associate(struct lbs_private *priv,
1128 (u16)(pos - (u8 *) &cmd->iebuf); 1128 (u16)(pos - (u8 *) &cmd->iebuf);
1129 cmd->hdr.size = cpu_to_le16(len); 1129 cmd->hdr.size = cpu_to_le16(len);
1130 1130
1131 lbs_deb_hex(LBS_DEB_ASSOC, "ASSOC_CMD", (u8 *) cmd,
1132 le16_to_cpu(cmd->hdr.size));
1133
1131 /* store for later use */ 1134 /* store for later use */
1132 memcpy(priv->assoc_bss, bss->bssid, ETH_ALEN); 1135 memcpy(priv->assoc_bss, bss->bssid, ETH_ALEN);
1133 1136
@@ -1135,14 +1138,28 @@ static int lbs_associate(struct lbs_private *priv,
1135 if (ret) 1138 if (ret)
1136 goto done; 1139 goto done;
1137 1140
1138
1139 /* generate connect message to cfg80211 */ 1141 /* generate connect message to cfg80211 */
1140 1142
1141 resp = (void *) cmd; /* recast for easier field access */ 1143 resp = (void *) cmd; /* recast for easier field access */
1142 status = le16_to_cpu(resp->statuscode); 1144 status = le16_to_cpu(resp->statuscode);
1143 1145
1144 /* Convert statis code of old firmware */ 1146 /* Older FW versions map the IEEE 802.11 Status Code in the association
1145 if (priv->fwrelease < 0x09000000) 1147 * response to the following values returned in resp->statuscode:
1148 *
1149 * IEEE Status Code Marvell Status Code
1150 * 0 -> 0x0000 ASSOC_RESULT_SUCCESS
1151 * 13 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
1152 * 14 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
1153 * 15 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
1154 * 16 -> 0x0004 ASSOC_RESULT_AUTH_REFUSED
1155 * others -> 0x0003 ASSOC_RESULT_REFUSED
1156 *
1157 * Other response codes:
1158 * 0x0001 -> ASSOC_RESULT_INVALID_PARAMETERS (unused)
1159 * 0x0002 -> ASSOC_RESULT_TIMEOUT (internal timer expired waiting for
1160 * association response from the AP)
1161 */
1162 if (MRVL_FW_MAJOR_REV(priv->fwrelease) <= 8) {
1146 switch (status) { 1163 switch (status) {
1147 case 0: 1164 case 0:
1148 break; 1165 break;
@@ -1164,11 +1181,16 @@ static int lbs_associate(struct lbs_private *priv,
1164 break; 1181 break;
1165 default: 1182 default:
1166 lbs_deb_assoc("association failure %d\n", status); 1183 lbs_deb_assoc("association failure %d\n", status);
1167 status = WLAN_STATUS_UNSPECIFIED_FAILURE; 1184 /* v5 OLPC firmware does return the AP status code if
1185 * it's not one of the values above. Let that through.
1186 */
1187 break;
1188 }
1168 } 1189 }
1169 1190
1170 lbs_deb_assoc("status %d, capability 0x%04x\n", status, 1191 lbs_deb_assoc("status %d, statuscode 0x%04x, capability 0x%04x, "
1171 le16_to_cpu(resp->capability)); 1192 "aid 0x%04x\n", status, le16_to_cpu(resp->statuscode),
1193 le16_to_cpu(resp->capability), le16_to_cpu(resp->aid));
1172 1194
1173 resp_ie_len = le16_to_cpu(resp->hdr.size) 1195 resp_ie_len = le16_to_cpu(resp->hdr.size)
1174 - sizeof(resp->hdr) 1196 - sizeof(resp->hdr)
@@ -1188,7 +1210,6 @@ static int lbs_associate(struct lbs_private *priv,
1188 netif_tx_wake_all_queues(priv->dev); 1210 netif_tx_wake_all_queues(priv->dev);
1189 } 1211 }
1190 1212
1191
1192done: 1213done:
1193 lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret); 1214 lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
1194 return ret; 1215 return ret;