diff options
-rw-r--r-- | drivers/net/wireless/libertas/assoc.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c index 2c6ddb1f0072..b61b176e9d07 100644 --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c | |||
@@ -374,15 +374,40 @@ static int assoc_helper_wpa_keys(wlan_private *priv, | |||
374 | struct assoc_request * assoc_req) | 374 | struct assoc_request * assoc_req) |
375 | { | 375 | { |
376 | int ret = 0; | 376 | int ret = 0; |
377 | unsigned int flags = assoc_req->flags; | ||
377 | 378 | ||
378 | lbs_deb_enter(LBS_DEB_ASSOC); | 379 | lbs_deb_enter(LBS_DEB_ASSOC); |
379 | 380 | ||
380 | ret = libertas_prepare_and_send_command(priv, | 381 | /* Work around older firmware bug where WPA unicast and multicast |
381 | CMD_802_11_KEY_MATERIAL, | 382 | * keys must be set independently. Seen in SDIO parts with firmware |
382 | CMD_ACT_SET, | 383 | * version 5.0.11p0. |
383 | CMD_OPTION_WAITFORRSP, | 384 | */ |
384 | 0, assoc_req); | ||
385 | 385 | ||
386 | if (test_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags)) { | ||
387 | clear_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags); | ||
388 | ret = libertas_prepare_and_send_command(priv, | ||
389 | CMD_802_11_KEY_MATERIAL, | ||
390 | CMD_ACT_SET, | ||
391 | CMD_OPTION_WAITFORRSP, | ||
392 | 0, assoc_req); | ||
393 | assoc_req->flags = flags; | ||
394 | } | ||
395 | |||
396 | if (ret) | ||
397 | goto out; | ||
398 | |||
399 | if (test_bit(ASSOC_FLAG_WPA_MCAST_KEY, &assoc_req->flags)) { | ||
400 | clear_bit(ASSOC_FLAG_WPA_UCAST_KEY, &assoc_req->flags); | ||
401 | |||
402 | ret = libertas_prepare_and_send_command(priv, | ||
403 | CMD_802_11_KEY_MATERIAL, | ||
404 | CMD_ACT_SET, | ||
405 | CMD_OPTION_WAITFORRSP, | ||
406 | 0, assoc_req); | ||
407 | assoc_req->flags = flags; | ||
408 | } | ||
409 | |||
410 | out: | ||
386 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); | 411 | lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); |
387 | return ret; | 412 | return ret; |
388 | } | 413 | } |