aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-11-19 15:38:48 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-11-19 15:38:48 -0500
commitab1f5a532c9d33b49b039660c5ecbc0ab53e7133 (patch)
treea1c1d820f2280535978632c5935462efcf5a4c7f /net/mac80211
parentf48ecb19bc0443a4272dd0934e7bee4480610df9 (diff)
parent4e6ce4dc7ce71d0886908d55129d5d6482a27ff9 (diff)
Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/aes_ccm.c3
-rw-r--r--net/mac80211/ibss.c2
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/iface.c18
-rw-r--r--net/mac80211/mesh.c2
-rw-r--r--net/mac80211/mlme.c5
-rw-r--r--net/mac80211/rx.c14
-rw-r--r--net/mac80211/spectmgmt.c18
8 files changed, 34 insertions, 31 deletions
diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c
index ec24378caaaf..09d9caaec591 100644
--- a/net/mac80211/aes_ccm.c
+++ b/net/mac80211/aes_ccm.c
@@ -53,6 +53,9 @@ int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
53 __aligned(__alignof__(struct aead_request)); 53 __aligned(__alignof__(struct aead_request));
54 struct aead_request *aead_req = (void *) aead_req_data; 54 struct aead_request *aead_req = (void *) aead_req_data;
55 55
56 if (data_len == 0)
57 return -EINVAL;
58
56 memset(aead_req, 0, sizeof(aead_req_data)); 59 memset(aead_req, 0, sizeof(aead_req_data));
57 60
58 sg_init_one(&pt, data, data_len); 61 sg_init_one(&pt, data, data_len);
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 56b53571c807..509bc157ce55 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -805,7 +805,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
805 805
806 memset(&params, 0, sizeof(params)); 806 memset(&params, 0, sizeof(params));
807 memset(&csa_ie, 0, sizeof(csa_ie)); 807 memset(&csa_ie, 0, sizeof(csa_ie));
808 err = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, 808 err = ieee80211_parse_ch_switch_ie(sdata, elems,
809 ifibss->chandef.chan->band, 809 ifibss->chandef.chan->band,
810 sta_flags, ifibss->bssid, &csa_ie); 810 sta_flags, ifibss->bssid, &csa_ie);
811 /* can't switch to destination channel, fail */ 811 /* can't switch to destination channel, fail */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a51c993ece73..842e0661fb57 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1705,7 +1705,6 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
1705 * ieee80211_parse_ch_switch_ie - parses channel switch IEs 1705 * ieee80211_parse_ch_switch_ie - parses channel switch IEs
1706 * @sdata: the sdata of the interface which has received the frame 1706 * @sdata: the sdata of the interface which has received the frame
1707 * @elems: parsed 802.11 elements received with the frame 1707 * @elems: parsed 802.11 elements received with the frame
1708 * @beacon: indicates if the frame was a beacon or probe response
1709 * @current_band: indicates the current band 1708 * @current_band: indicates the current band
1710 * @sta_flags: contains information about own capabilities and restrictions 1709 * @sta_flags: contains information about own capabilities and restrictions
1711 * to decide which channel switch announcements can be accepted. Only the 1710 * to decide which channel switch announcements can be accepted. Only the
@@ -1719,7 +1718,7 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
1719 * Return: 0 on success, <0 on error and >0 if there is nothing to parse. 1718 * Return: 0 on success, <0 on error and >0 if there is nothing to parse.
1720 */ 1719 */
1721int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, 1720int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
1722 struct ieee802_11_elems *elems, bool beacon, 1721 struct ieee802_11_elems *elems,
1723 enum ieee80211_band current_band, 1722 enum ieee80211_band current_band,
1724 u32 sta_flags, u8 *bssid, 1723 u32 sta_flags, u8 *bssid,
1725 struct ieee80211_csa_ie *csa_ie); 1724 struct ieee80211_csa_ie *csa_ie);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 6b631c049eba..9df26adb864a 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -777,10 +777,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
777 int i, flushed; 777 int i, flushed;
778 struct ps_data *ps; 778 struct ps_data *ps;
779 struct cfg80211_chan_def chandef; 779 struct cfg80211_chan_def chandef;
780 bool cancel_scan;
780 781
781 clear_bit(SDATA_STATE_RUNNING, &sdata->state); 782 clear_bit(SDATA_STATE_RUNNING, &sdata->state);
782 783
783 if (rcu_access_pointer(local->scan_sdata) == sdata) 784 cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
785 if (cancel_scan)
784 ieee80211_scan_cancel(local); 786 ieee80211_scan_cancel(local);
785 787
786 /* 788 /*
@@ -911,6 +913,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
911 list_del(&sdata->u.vlan.list); 913 list_del(&sdata->u.vlan.list);
912 mutex_unlock(&local->mtx); 914 mutex_unlock(&local->mtx);
913 RCU_INIT_POINTER(sdata->vif.chanctx_conf, NULL); 915 RCU_INIT_POINTER(sdata->vif.chanctx_conf, NULL);
916 /* see comment in the default case below */
917 ieee80211_free_keys(sdata, true);
914 /* no need to tell driver */ 918 /* no need to tell driver */
915 break; 919 break;
916 case NL80211_IFTYPE_MONITOR: 920 case NL80211_IFTYPE_MONITOR:
@@ -936,17 +940,16 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
936 /* 940 /*
937 * When we get here, the interface is marked down. 941 * When we get here, the interface is marked down.
938 * Free the remaining keys, if there are any 942 * Free the remaining keys, if there are any
939 * (shouldn't be, except maybe in WDS mode?) 943 * (which can happen in AP mode if userspace sets
944 * keys before the interface is operating, and maybe
945 * also in WDS mode)
940 * 946 *
941 * Force the key freeing to always synchronize_net() 947 * Force the key freeing to always synchronize_net()
942 * to wait for the RX path in case it is using this 948 * to wait for the RX path in case it is using this
943 * interface enqueuing frames * at this very time on 949 * interface enqueuing frames at this very time on
944 * another CPU. 950 * another CPU.
945 */ 951 */
946 ieee80211_free_keys(sdata, true); 952 ieee80211_free_keys(sdata, true);
947
948 /* fall through */
949 case NL80211_IFTYPE_AP:
950 skb_queue_purge(&sdata->skb_queue); 953 skb_queue_purge(&sdata->skb_queue);
951 } 954 }
952 955
@@ -1004,6 +1007,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
1004 1007
1005 ieee80211_recalc_ps(local, -1); 1008 ieee80211_recalc_ps(local, -1);
1006 1009
1010 if (cancel_scan)
1011 flush_delayed_work(&local->scan_work);
1012
1007 if (local->open_count == 0) { 1013 if (local->open_count == 0) {
1008 ieee80211_stop_device(local); 1014 ieee80211_stop_device(local);
1009 1015
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index e9f99c1e3fad..0c8b2a77d312 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -874,7 +874,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata,
874 874
875 memset(&params, 0, sizeof(params)); 875 memset(&params, 0, sizeof(params));
876 memset(&csa_ie, 0, sizeof(csa_ie)); 876 memset(&csa_ie, 0, sizeof(csa_ie));
877 err = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, band, 877 err = ieee80211_parse_ch_switch_ie(sdata, elems, band,
878 sta_flags, sdata->vif.addr, 878 sta_flags, sdata->vif.addr,
879 &csa_ie); 879 &csa_ie);
880 if (err < 0) 880 if (err < 0)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 213a420704a6..0d166e766dad 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1117,7 +1117,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1117 1117
1118 current_band = cbss->channel->band; 1118 current_band = cbss->channel->band;
1119 memset(&csa_ie, 0, sizeof(csa_ie)); 1119 memset(&csa_ie, 0, sizeof(csa_ie));
1120 res = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, current_band, 1120 res = ieee80211_parse_ch_switch_ie(sdata, elems, current_band,
1121 ifmgd->flags, 1121 ifmgd->flags,
1122 ifmgd->associated->bssid, &csa_ie); 1122 ifmgd->associated->bssid, &csa_ie);
1123 if (res < 0) 1123 if (res < 0)
@@ -1216,7 +1216,8 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1216 ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work); 1216 ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work);
1217 else 1217 else
1218 mod_timer(&ifmgd->chswitch_timer, 1218 mod_timer(&ifmgd->chswitch_timer,
1219 TU_TO_EXP_TIME(csa_ie.count * cbss->beacon_interval)); 1219 TU_TO_EXP_TIME((csa_ie.count - 1) *
1220 cbss->beacon_interval));
1220} 1221}
1221 1222
1222static bool 1223static bool
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index bc63aa0c5401..a726bb169302 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1685,11 +1685,14 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1685 sc = le16_to_cpu(hdr->seq_ctrl); 1685 sc = le16_to_cpu(hdr->seq_ctrl);
1686 frag = sc & IEEE80211_SCTL_FRAG; 1686 frag = sc & IEEE80211_SCTL_FRAG;
1687 1687
1688 if (likely((!ieee80211_has_morefrags(fc) && frag == 0) || 1688 if (likely(!ieee80211_has_morefrags(fc) && frag == 0))
1689 is_multicast_ether_addr(hdr->addr1))) { 1689 goto out;
1690 /* not fragmented */ 1690
1691 if (is_multicast_ether_addr(hdr->addr1)) {
1692 rx->local->dot11MulticastReceivedFrameCount++;
1691 goto out; 1693 goto out;
1692 } 1694 }
1695
1693 I802_DEBUG_INC(rx->local->rx_handlers_fragments); 1696 I802_DEBUG_INC(rx->local->rx_handlers_fragments);
1694 1697
1695 if (skb_linearize(rx->skb)) 1698 if (skb_linearize(rx->skb))
@@ -1782,10 +1785,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1782 out: 1785 out:
1783 if (rx->sta) 1786 if (rx->sta)
1784 rx->sta->rx_packets++; 1787 rx->sta->rx_packets++;
1785 if (is_multicast_ether_addr(hdr->addr1)) 1788 ieee80211_led_rx(rx->local);
1786 rx->local->dot11MulticastReceivedFrameCount++;
1787 else
1788 ieee80211_led_rx(rx->local);
1789 return RX_CONTINUE; 1789 return RX_CONTINUE;
1790} 1790}
1791 1791
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 6ab009070084..efeba56c913b 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -22,7 +22,7 @@
22#include "wme.h" 22#include "wme.h"
23 23
24int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, 24int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
25 struct ieee802_11_elems *elems, bool beacon, 25 struct ieee802_11_elems *elems,
26 enum ieee80211_band current_band, 26 enum ieee80211_band current_band,
27 u32 sta_flags, u8 *bssid, 27 u32 sta_flags, u8 *bssid,
28 struct ieee80211_csa_ie *csa_ie) 28 struct ieee80211_csa_ie *csa_ie)
@@ -91,19 +91,13 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
91 return -EINVAL; 91 return -EINVAL;
92 } 92 }
93 93
94 if (!beacon && sec_chan_offs) { 94 if (sec_chan_offs) {
95 secondary_channel_offset = sec_chan_offs->sec_chan_offs; 95 secondary_channel_offset = sec_chan_offs->sec_chan_offs;
96 } else if (beacon && ht_oper) {
97 secondary_channel_offset =
98 ht_oper->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET;
99 } else if (!(sta_flags & IEEE80211_STA_DISABLE_HT)) { 96 } else if (!(sta_flags & IEEE80211_STA_DISABLE_HT)) {
100 /* If it's not a beacon, HT is enabled and the IE not present, 97 /* If the secondary channel offset IE is not present,
101 * it's 20 MHz, 802.11-2012 8.5.2.6: 98 * we can't know what's the post-CSA offset, so the
102 * This element [the Secondary Channel Offset Element] is 99 * best we can do is use 20MHz.
103 * present when switching to a 40 MHz channel. It may be 100 */
104 * present when switching to a 20 MHz channel (in which
105 * case the secondary channel offset is set to SCN).
106 */
107 secondary_channel_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE; 101 secondary_channel_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
108 } 102 }
109 103