diff options
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 38bd294734a7..4bd708c8716c 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -387,11 +387,25 @@ static int wil_cfg80211_connect(struct wiphy *wiphy, | |||
387 | int ch; | 387 | int ch; |
388 | int rc = 0; | 388 | int rc = 0; |
389 | 389 | ||
390 | wil_print_connect_params(wil, sme); | ||
391 | |||
390 | if (test_bit(wil_status_fwconnecting, wil->status) || | 392 | if (test_bit(wil_status_fwconnecting, wil->status) || |
391 | test_bit(wil_status_fwconnected, wil->status)) | 393 | test_bit(wil_status_fwconnected, wil->status)) |
392 | return -EALREADY; | 394 | return -EALREADY; |
393 | 395 | ||
394 | wil_print_connect_params(wil, sme); | 396 | if (sme->ie_len > WMI_MAX_IE_LEN) { |
397 | wil_err(wil, "IE too large (%td bytes)\n", sme->ie_len); | ||
398 | return -ERANGE; | ||
399 | } | ||
400 | |||
401 | rsn_eid = sme->ie ? | ||
402 | cfg80211_find_ie(WLAN_EID_RSN, sme->ie, sme->ie_len) : | ||
403 | NULL; | ||
404 | |||
405 | if (sme->privacy && !rsn_eid) { | ||
406 | wil_err(wil, "Missing RSN IE for secure connection\n"); | ||
407 | return -EINVAL; | ||
408 | } | ||
395 | 409 | ||
396 | bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid, | 410 | bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid, |
397 | sme->ssid, sme->ssid_len, | 411 | sme->ssid, sme->ssid_len, |
@@ -407,17 +421,9 @@ static int wil_cfg80211_connect(struct wiphy *wiphy, | |||
407 | rc = -ENOENT; | 421 | rc = -ENOENT; |
408 | goto out; | 422 | goto out; |
409 | } | 423 | } |
424 | wil->privacy = sme->privacy; | ||
410 | 425 | ||
411 | rsn_eid = sme->ie ? | 426 | if (wil->privacy) { |
412 | cfg80211_find_ie(WLAN_EID_RSN, sme->ie, sme->ie_len) : | ||
413 | NULL; | ||
414 | if (rsn_eid) { | ||
415 | if (sme->ie_len > WMI_MAX_IE_LEN) { | ||
416 | rc = -ERANGE; | ||
417 | wil_err(wil, "IE too large (%td bytes)\n", | ||
418 | sme->ie_len); | ||
419 | goto out; | ||
420 | } | ||
421 | /* For secure assoc, send WMI_DELETE_CIPHER_KEY_CMD */ | 427 | /* For secure assoc, send WMI_DELETE_CIPHER_KEY_CMD */ |
422 | rc = wmi_del_cipher_key(wil, 0, bss->bssid); | 428 | rc = wmi_del_cipher_key(wil, 0, bss->bssid); |
423 | if (rc) { | 429 | if (rc) { |
@@ -450,7 +456,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy, | |||
450 | bss->capability); | 456 | bss->capability); |
451 | goto out; | 457 | goto out; |
452 | } | 458 | } |
453 | if (rsn_eid) { | 459 | if (wil->privacy) { |
454 | conn.dot11_auth_mode = WMI_AUTH11_SHARED; | 460 | conn.dot11_auth_mode = WMI_AUTH11_SHARED; |
455 | conn.auth_mode = WMI_AUTH_WPA2_PSK; | 461 | conn.auth_mode = WMI_AUTH_WPA2_PSK; |
456 | conn.pairwise_crypto_type = WMI_CRYPT_AES_GCMP; | 462 | conn.pairwise_crypto_type = WMI_CRYPT_AES_GCMP; |