diff options
Diffstat (limited to 'net/mac80211/mlme.c')
| -rw-r--r-- | net/mac80211/mlme.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e714ed8bb198..1b7eed252fe9 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -3099,22 +3099,32 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, | |||
| 3099 | ht_cfreq, ht_oper->primary_chan, | 3099 | ht_cfreq, ht_oper->primary_chan, |
| 3100 | cbss->channel->band); | 3100 | cbss->channel->band); |
| 3101 | ht_oper = NULL; | 3101 | ht_oper = NULL; |
| 3102 | } else { | ||
| 3103 | channel_type = NL80211_CHAN_HT20; | ||
| 3102 | } | 3104 | } |
| 3103 | } | 3105 | } |
| 3104 | 3106 | ||
| 3105 | if (ht_oper) { | 3107 | if (ht_oper && sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { |
| 3106 | channel_type = NL80211_CHAN_HT20; | 3108 | /* |
| 3109 | * cfg80211 already verified that the channel itself can | ||
| 3110 | * be used, but it didn't check that we can do the right | ||
| 3111 | * HT type, so do that here as well. If HT40 isn't allowed | ||
| 3112 | * on this channel, disable 40 MHz operation. | ||
| 3113 | */ | ||
| 3107 | 3114 | ||
| 3108 | if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) { | 3115 | switch (ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
| 3109 | switch (ht_oper->ht_param & | 3116 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: |
| 3110 | IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { | 3117 | if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40PLUS) |
| 3111 | case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: | 3118 | ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; |
| 3119 | else | ||
| 3112 | channel_type = NL80211_CHAN_HT40PLUS; | 3120 | channel_type = NL80211_CHAN_HT40PLUS; |
| 3113 | break; | 3121 | break; |
| 3114 | case IEEE80211_HT_PARAM_CHA_SEC_BELOW: | 3122 | case IEEE80211_HT_PARAM_CHA_SEC_BELOW: |
| 3123 | if (cbss->channel->flags & IEEE80211_CHAN_NO_HT40MINUS) | ||
| 3124 | ifmgd->flags |= IEEE80211_STA_DISABLE_40MHZ; | ||
| 3125 | else | ||
| 3115 | channel_type = NL80211_CHAN_HT40MINUS; | 3126 | channel_type = NL80211_CHAN_HT40MINUS; |
| 3116 | break; | 3127 | break; |
| 3117 | } | ||
| 3118 | } | 3128 | } |
| 3119 | } | 3129 | } |
| 3120 | 3130 | ||
| @@ -3549,6 +3559,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
| 3549 | { | 3559 | { |
| 3550 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 3560 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
| 3551 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; | 3561 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; |
| 3562 | bool tx = !req->local_state_change; | ||
| 3552 | 3563 | ||
| 3553 | mutex_lock(&ifmgd->mtx); | 3564 | mutex_lock(&ifmgd->mtx); |
| 3554 | 3565 | ||
| @@ -3565,12 +3576,12 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
| 3565 | if (ifmgd->associated && | 3576 | if (ifmgd->associated && |
| 3566 | ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { | 3577 | ether_addr_equal(ifmgd->associated->bssid, req->bssid)) { |
| 3567 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, | 3578 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, |
| 3568 | req->reason_code, true, frame_buf); | 3579 | req->reason_code, tx, frame_buf); |
| 3569 | } else { | 3580 | } else { |
| 3570 | drv_mgd_prepare_tx(sdata->local, sdata); | 3581 | drv_mgd_prepare_tx(sdata->local, sdata); |
| 3571 | ieee80211_send_deauth_disassoc(sdata, req->bssid, | 3582 | ieee80211_send_deauth_disassoc(sdata, req->bssid, |
| 3572 | IEEE80211_STYPE_DEAUTH, | 3583 | IEEE80211_STYPE_DEAUTH, |
| 3573 | req->reason_code, true, | 3584 | req->reason_code, tx, |
| 3574 | frame_buf); | 3585 | frame_buf); |
| 3575 | } | 3586 | } |
| 3576 | 3587 | ||
