diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-10-19 13:55:42 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 13:55:42 -0400 |
commit | 06f40a41b80e25e88a2b612ea3b2a94f93c94f72 (patch) | |
tree | fa3bc4d691d7024425183bfc1be75a36c4e1d3f3 /net | |
parent | db0fe0b2f6bba2fda939737d063db2ae14c58d71 (diff) | |
parent | 290eddc4b3661dc4dfa95d199e0be5788928b3b1 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/smp.c | 6 | ||||
-rw-r--r-- | net/mac80211/iface.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 35 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 4 | ||||
-rw-r--r-- | net/mac80211/util.c | 4 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 14 | ||||
-rw-r--r-- | net/wireless/mlme.c | 12 |
7 files changed, 45 insertions, 32 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 8c225ef349c..2ac8d50861e 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -32,6 +32,8 @@ | |||
32 | 32 | ||
33 | #define SMP_TIMEOUT msecs_to_jiffies(30000) | 33 | #define SMP_TIMEOUT msecs_to_jiffies(30000) |
34 | 34 | ||
35 | #define AUTH_REQ_MASK 0x07 | ||
36 | |||
35 | static inline void swap128(u8 src[16], u8 dst[16]) | 37 | static inline void swap128(u8 src[16], u8 dst[16]) |
36 | { | 38 | { |
37 | int i; | 39 | int i; |
@@ -230,7 +232,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn, | |||
230 | req->max_key_size = SMP_MAX_ENC_KEY_SIZE; | 232 | req->max_key_size = SMP_MAX_ENC_KEY_SIZE; |
231 | req->init_key_dist = 0; | 233 | req->init_key_dist = 0; |
232 | req->resp_key_dist = dist_keys; | 234 | req->resp_key_dist = dist_keys; |
233 | req->auth_req = authreq; | 235 | req->auth_req = (authreq & AUTH_REQ_MASK); |
234 | return; | 236 | return; |
235 | } | 237 | } |
236 | 238 | ||
@@ -239,7 +241,7 @@ static void build_pairing_cmd(struct l2cap_conn *conn, | |||
239 | rsp->max_key_size = SMP_MAX_ENC_KEY_SIZE; | 241 | rsp->max_key_size = SMP_MAX_ENC_KEY_SIZE; |
240 | rsp->init_key_dist = 0; | 242 | rsp->init_key_dist = 0; |
241 | rsp->resp_key_dist = req->resp_key_dist & dist_keys; | 243 | rsp->resp_key_dist = req->resp_key_dist & dist_keys; |
242 | rsp->auth_req = authreq; | 244 | rsp->auth_req = (authreq & AUTH_REQ_MASK); |
243 | } | 245 | } |
244 | 246 | ||
245 | static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size) | 247 | static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size) |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 6f8a73c64fb..7de7717ad67 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -853,7 +853,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, | |||
853 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 853 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
854 | if (info->control.vif == &sdata->vif) { | 854 | if (info->control.vif == &sdata->vif) { |
855 | __skb_unlink(skb, &local->pending[i]); | 855 | __skb_unlink(skb, &local->pending[i]); |
856 | dev_kfree_skb_irq(skb); | 856 | ieee80211_free_txskb(&local->hw, skb); |
857 | } | 857 | } |
858 | } | 858 | } |
859 | } | 859 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e714ed8bb19..1b7eed252fe 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 | ||
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 797dd36a220..0a4e4c04db8 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -650,7 +650,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, | |||
650 | */ | 650 | */ |
651 | if (!skb) | 651 | if (!skb) |
652 | break; | 652 | break; |
653 | dev_kfree_skb(skb); | 653 | ieee80211_free_txskb(&local->hw, skb); |
654 | } | 654 | } |
655 | 655 | ||
656 | /* | 656 | /* |
@@ -679,7 +679,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local, | |||
679 | local->total_ps_buffered--; | 679 | local->total_ps_buffered--; |
680 | ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", | 680 | ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", |
681 | sta->sta.addr); | 681 | sta->sta.addr); |
682 | dev_kfree_skb(skb); | 682 | ieee80211_free_txskb(&local->hw, skb); |
683 | } | 683 | } |
684 | 684 | ||
685 | /* | 685 | /* |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 22ca35054dd..94e58687397 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -406,7 +406,7 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local, | |||
406 | int queue = info->hw_queue; | 406 | int queue = info->hw_queue; |
407 | 407 | ||
408 | if (WARN_ON(!info->control.vif)) { | 408 | if (WARN_ON(!info->control.vif)) { |
409 | kfree_skb(skb); | 409 | ieee80211_free_txskb(&local->hw, skb); |
410 | return; | 410 | return; |
411 | } | 411 | } |
412 | 412 | ||
@@ -431,7 +431,7 @@ void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local, | |||
431 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 431 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
432 | 432 | ||
433 | if (WARN_ON(!info->control.vif)) { | 433 | if (WARN_ON(!info->control.vif)) { |
434 | kfree_skb(skb); | 434 | ieee80211_free_txskb(&local->hw, skb); |
435 | continue; | 435 | continue; |
436 | } | 436 | } |
437 | 437 | ||
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index bdb53aba888..8bd2f5c6a56 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -106,7 +106,8 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx) | |||
106 | if (status->flag & RX_FLAG_MMIC_ERROR) | 106 | if (status->flag & RX_FLAG_MMIC_ERROR) |
107 | goto mic_fail; | 107 | goto mic_fail; |
108 | 108 | ||
109 | if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key) | 109 | if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key && |
110 | rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP) | ||
110 | goto update_iv; | 111 | goto update_iv; |
111 | 112 | ||
112 | return RX_CONTINUE; | 113 | return RX_CONTINUE; |
@@ -545,14 +546,19 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx) | |||
545 | 546 | ||
546 | static void bip_aad(struct sk_buff *skb, u8 *aad) | 547 | static void bip_aad(struct sk_buff *skb, u8 *aad) |
547 | { | 548 | { |
549 | __le16 mask_fc; | ||
550 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
551 | |||
548 | /* BIP AAD: FC(masked) || A1 || A2 || A3 */ | 552 | /* BIP AAD: FC(masked) || A1 || A2 || A3 */ |
549 | 553 | ||
550 | /* FC type/subtype */ | 554 | /* FC type/subtype */ |
551 | aad[0] = skb->data[0]; | ||
552 | /* Mask FC Retry, PwrMgt, MoreData flags to zero */ | 555 | /* Mask FC Retry, PwrMgt, MoreData flags to zero */ |
553 | aad[1] = skb->data[1] & ~(BIT(4) | BIT(5) | BIT(6)); | 556 | mask_fc = hdr->frame_control; |
557 | mask_fc &= ~cpu_to_le16(IEEE80211_FCTL_RETRY | IEEE80211_FCTL_PM | | ||
558 | IEEE80211_FCTL_MOREDATA); | ||
559 | put_unaligned(mask_fc, (__le16 *) &aad[0]); | ||
554 | /* A1 || A2 || A3 */ | 560 | /* A1 || A2 || A3 */ |
555 | memcpy(aad + 2, skb->data + 4, 3 * ETH_ALEN); | 561 | memcpy(aad + 2, &hdr->addr1, 3 * ETH_ALEN); |
556 | } | 562 | } |
557 | 563 | ||
558 | 564 | ||
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c index 8016fee0752..904a7f36832 100644 --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c | |||
@@ -457,20 +457,14 @@ int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev, | |||
457 | .reason_code = reason, | 457 | .reason_code = reason, |
458 | .ie = ie, | 458 | .ie = ie, |
459 | .ie_len = ie_len, | 459 | .ie_len = ie_len, |
460 | .local_state_change = local_state_change, | ||
460 | }; | 461 | }; |
461 | 462 | ||
462 | ASSERT_WDEV_LOCK(wdev); | 463 | ASSERT_WDEV_LOCK(wdev); |
463 | 464 | ||
464 | if (local_state_change) { | 465 | if (local_state_change && (!wdev->current_bss || |
465 | if (wdev->current_bss && | 466 | !ether_addr_equal(wdev->current_bss->pub.bssid, bssid))) |
466 | ether_addr_equal(wdev->current_bss->pub.bssid, bssid)) { | ||
467 | cfg80211_unhold_bss(wdev->current_bss); | ||
468 | cfg80211_put_bss(&wdev->current_bss->pub); | ||
469 | wdev->current_bss = NULL; | ||
470 | } | ||
471 | |||
472 | return 0; | 467 | return 0; |
473 | } | ||
474 | 468 | ||
475 | return rdev->ops->deauth(&rdev->wiphy, dev, &req); | 469 | return rdev->ops->deauth(&rdev->wiphy, dev, &req); |
476 | } | 470 | } |