aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index aeb65b3d2295..d09f78bb2442 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -520,9 +520,9 @@ EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
520 */ 520 */
521static bool ieee80211_can_queue_work(struct ieee80211_local *local) 521static bool ieee80211_can_queue_work(struct ieee80211_local *local)
522{ 522{
523 if (WARN(local->suspended, "queueing ieee80211 work while " 523 if (WARN(local->suspended && !local->resuming,
524 "going to suspend\n")) 524 "queueing ieee80211 work while going to suspend\n"))
525 return false; 525 return false;
526 526
527 return true; 527 return true;
528} 528}
@@ -666,8 +666,8 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
666 elems->mesh_id_len = elen; 666 elems->mesh_id_len = elen;
667 break; 667 break;
668 case WLAN_EID_MESH_CONFIG: 668 case WLAN_EID_MESH_CONFIG:
669 elems->mesh_config = pos; 669 if (elen >= sizeof(struct ieee80211_meshconf_ie))
670 elems->mesh_config_len = elen; 670 elems->mesh_config = (void *)pos;
671 break; 671 break;
672 case WLAN_EID_PEER_LINK: 672 case WLAN_EID_PEER_LINK:
673 elems->peer_link = pos; 673 elems->peer_link = pos;
@@ -685,6 +685,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
685 elems->perr = pos; 685 elems->perr = pos;
686 elems->perr_len = elen; 686 elems->perr_len = elen;
687 break; 687 break;
688 case WLAN_EID_RANN:
689 if (elen >= sizeof(struct ieee80211_rann_ie))
690 elems->rann = (void *)pos;
691 break;
688 case WLAN_EID_CHANNEL_SWITCH: 692 case WLAN_EID_CHANNEL_SWITCH:
689 elems->ch_switch_elem = pos; 693 elems->ch_switch_elem = pos;
690 elems->ch_switch_elem_len = elen; 694 elems->ch_switch_elem_len = elen;
@@ -868,17 +872,19 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
868 WARN_ON(err); 872 WARN_ON(err);
869 } 873 }
870 874
871 ieee80211_tx_skb(sdata, skb, 0); 875 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
876 ieee80211_tx_skb(sdata, skb);
872} 877}
873 878
874int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 879int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
875 const u8 *ie, size_t ie_len) 880 const u8 *ie, size_t ie_len,
881 enum ieee80211_band band)
876{ 882{
877 struct ieee80211_supported_band *sband; 883 struct ieee80211_supported_band *sband;
878 u8 *pos, *supp_rates_len, *esupp_rates_len = NULL; 884 u8 *pos, *supp_rates_len, *esupp_rates_len = NULL;
879 int i; 885 int i;
880 886
881 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 887 sband = local->hw.wiphy->bands[band];
882 888
883 pos = buffer; 889 pos = buffer;
884 890
@@ -966,9 +972,11 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
966 memcpy(pos, ssid, ssid_len); 972 memcpy(pos, ssid, ssid_len);
967 pos += ssid_len; 973 pos += ssid_len;
968 974
969 skb_put(skb, ieee80211_build_preq_ies(local, pos, ie, ie_len)); 975 skb_put(skb, ieee80211_build_preq_ies(local, pos, ie, ie_len,
976 local->hw.conf.channel->band));
970 977
971 ieee80211_tx_skb(sdata, skb, 0); 978 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
979 ieee80211_tx_skb(sdata, skb);
972} 980}
973 981
974u32 ieee80211_sta_get_rates(struct ieee80211_local *local, 982u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
@@ -1025,13 +1033,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1025 struct sta_info *sta; 1033 struct sta_info *sta;
1026 unsigned long flags; 1034 unsigned long flags;
1027 int res; 1035 int res;
1028 bool from_suspend = local->suspended;
1029 1036
1030 /* 1037 if (local->suspended)
1031 * We're going to start the hardware, at that point 1038 local->resuming = true;
1032 * we are no longer suspended and can RX frames.
1033 */
1034 local->suspended = false;
1035 1039
1036 /* restart hardware */ 1040 /* restart hardware */
1037 if (local->open_count) { 1041 if (local->open_count) {
@@ -1129,11 +1133,14 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1129 * If this is for hw restart things are still running. 1133 * If this is for hw restart things are still running.
1130 * We may want to change that later, however. 1134 * We may want to change that later, however.
1131 */ 1135 */
1132 if (!from_suspend) 1136 if (!local->suspended)
1133 return 0; 1137 return 0;
1134 1138
1135#ifdef CONFIG_PM 1139#ifdef CONFIG_PM
1140 /* first set suspended false, then resuming */
1136 local->suspended = false; 1141 local->suspended = false;
1142 mb();
1143 local->resuming = false;
1137 1144
1138 list_for_each_entry(sdata, &local->interfaces, list) { 1145 list_for_each_entry(sdata, &local->interfaces, list) {
1139 switch(sdata->vif.type) { 1146 switch(sdata->vif.type) {