diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index ef378b9a32ec..1da3d6be8e11 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3325,10 +3325,6 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3325 | if (WARN_ON_ONCE(!auth_data)) | 3325 | if (WARN_ON_ONCE(!auth_data)) |
3326 | return -EINVAL; | 3326 | return -EINVAL; |
3327 | 3327 | ||
3328 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
3329 | tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | | ||
3330 | IEEE80211_TX_INTFL_MLME_CONN_TX; | ||
3331 | |||
3332 | auth_data->tries++; | 3328 | auth_data->tries++; |
3333 | 3329 | ||
3334 | if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { | 3330 | if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { |
@@ -3362,6 +3358,10 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3362 | auth_data->expected_transaction = trans; | 3358 | auth_data->expected_transaction = trans; |
3363 | } | 3359 | } |
3364 | 3360 | ||
3361 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
3362 | tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS | | ||
3363 | IEEE80211_TX_INTFL_MLME_CONN_TX; | ||
3364 | |||
3365 | ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, | 3365 | ieee80211_send_auth(sdata, trans, auth_data->algorithm, status, |
3366 | auth_data->data, auth_data->data_len, | 3366 | auth_data->data, auth_data->data_len, |
3367 | auth_data->bss->bssid, | 3367 | auth_data->bss->bssid, |
@@ -3385,12 +3385,12 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata) | |||
3385 | * will not answer to direct packet in unassociated state. | 3385 | * will not answer to direct packet in unassociated state. |
3386 | */ | 3386 | */ |
3387 | ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], | 3387 | ieee80211_send_probe_req(sdata, NULL, ssidie + 2, ssidie[1], |
3388 | NULL, 0, (u32) -1, true, tx_flags, | 3388 | NULL, 0, (u32) -1, true, 0, |
3389 | auth_data->bss->channel, false); | 3389 | auth_data->bss->channel, false); |
3390 | rcu_read_unlock(); | 3390 | rcu_read_unlock(); |
3391 | } | 3391 | } |
3392 | 3392 | ||
3393 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { | 3393 | if (tx_flags == 0) { |
3394 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; | 3394 | auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; |
3395 | ifmgd->auth_data->timeout_started = true; | 3395 | ifmgd->auth_data->timeout_started = true; |
3396 | run_again(ifmgd, auth_data->timeout); | 3396 | run_again(ifmgd, auth_data->timeout); |
@@ -3643,6 +3643,31 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | |||
3643 | } | 3643 | } |
3644 | } | 3644 | } |
3645 | 3645 | ||
3646 | #ifdef CONFIG_PM | ||
3647 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) | ||
3648 | { | ||
3649 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
3650 | |||
3651 | mutex_lock(&ifmgd->mtx); | ||
3652 | if (!ifmgd->associated) { | ||
3653 | mutex_unlock(&ifmgd->mtx); | ||
3654 | return; | ||
3655 | } | ||
3656 | |||
3657 | if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) { | ||
3658 | sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; | ||
3659 | mlme_dbg(sdata, "driver requested disconnect after resume\n"); | ||
3660 | ieee80211_sta_connection_lost(sdata, | ||
3661 | ifmgd->associated->bssid, | ||
3662 | WLAN_REASON_UNSPECIFIED, | ||
3663 | true); | ||
3664 | mutex_unlock(&ifmgd->mtx); | ||
3665 | return; | ||
3666 | } | ||
3667 | mutex_unlock(&ifmgd->mtx); | ||
3668 | } | ||
3669 | #endif | ||
3670 | |||
3646 | /* interface setup */ | 3671 | /* interface setup */ |
3647 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) | 3672 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) |
3648 | { | 3673 | { |
@@ -4349,7 +4374,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
4349 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 4374 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
4350 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; | 4375 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; |
4351 | bool tx = !req->local_state_change; | 4376 | bool tx = !req->local_state_change; |
4352 | bool sent_frame = false; | 4377 | bool report_frame = false; |
4353 | 4378 | ||
4354 | mutex_lock(&ifmgd->mtx); | 4379 | mutex_lock(&ifmgd->mtx); |
4355 | 4380 | ||
@@ -4366,7 +4391,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
4366 | ieee80211_destroy_auth_data(sdata, false); | 4391 | ieee80211_destroy_auth_data(sdata, false); |
4367 | mutex_unlock(&ifmgd->mtx); | 4392 | mutex_unlock(&ifmgd->mtx); |
4368 | 4393 | ||
4369 | sent_frame = tx; | 4394 | report_frame = true; |
4370 | goto out; | 4395 | goto out; |
4371 | } | 4396 | } |
4372 | 4397 | ||
@@ -4374,12 +4399,12 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
4374 | ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { | 4399 | ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { |
4375 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, | 4400 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, |
4376 | req->reason_code, tx, frame_buf); | 4401 | req->reason_code, tx, frame_buf); |
4377 | sent_frame = tx; | 4402 | report_frame = true; |
4378 | } | 4403 | } |
4379 | mutex_unlock(&ifmgd->mtx); | 4404 | mutex_unlock(&ifmgd->mtx); |
4380 | 4405 | ||
4381 | out: | 4406 | out: |
4382 | if (sent_frame) | 4407 | if (report_frame) |
4383 | __cfg80211_send_deauth(sdata->dev, frame_buf, | 4408 | __cfg80211_send_deauth(sdata->dev, frame_buf, |
4384 | IEEE80211_DEAUTH_FRAME_LEN); | 4409 | IEEE80211_DEAUTH_FRAME_LEN); |
4385 | 4410 | ||