diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-12-06 09:50:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-12-06 09:50:45 -0500 |
commit | e08fd975bf26aa8063cadd245817e042f570472d (patch) | |
tree | 2b2a705710e6374cc037f89bcc7bfc25047485ba /net | |
parent | 251c9ba19143caa5eb5b6ec52c77c70c9d7b3d8f (diff) | |
parent | a59b40b30f3f51bf5c56c15a7dc4da11b424a34b (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
drivers/net/wireless/brcm80211/Kconfig
net/mac80211/util.c
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/cfg.c | 15 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 4 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/iface.c | 1 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 20 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 2 | ||||
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 7 | ||||
-rw-r--r-- | net/mac80211/rx.c | 3 | ||||
-rw-r--r-- | net/mac80211/scan.c | 2 | ||||
-rw-r--r-- | net/mac80211/spectmgmt.c | 2 | ||||
-rw-r--r-- | net/mac80211/util.c | 11 | ||||
-rw-r--r-- | net/wireless/core.c | 9 | ||||
-rw-r--r-- | net/wireless/ibss.c | 18 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 60 |
15 files changed, 99 insertions, 59 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 754069cbb756..f80e8c4c6bcd 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1394,7 +1394,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
1394 | changed |= | 1394 | changed |= |
1395 | ieee80211_mps_set_sta_local_pm(sta, | 1395 | ieee80211_mps_set_sta_local_pm(sta, |
1396 | params->local_pm); | 1396 | params->local_pm); |
1397 | ieee80211_bss_info_change_notify(sdata, changed); | 1397 | ieee80211_mbss_info_change_notify(sdata, changed); |
1398 | #endif | 1398 | #endif |
1399 | } | 1399 | } |
1400 | 1400 | ||
@@ -2514,8 +2514,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
2514 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 2514 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
2515 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 2515 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
2516 | 2516 | ||
2517 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | 2517 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
2518 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
2519 | return -EOPNOTSUPP; | 2518 | return -EOPNOTSUPP; |
2520 | 2519 | ||
2521 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) | 2520 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) |
@@ -3156,9 +3155,17 @@ static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, | |||
3156 | params->chandef.chan->band) | 3155 | params->chandef.chan->band) |
3157 | return -EINVAL; | 3156 | return -EINVAL; |
3158 | 3157 | ||
3158 | ifmsh->chsw_init = true; | ||
3159 | if (!ifmsh->pre_value) | ||
3160 | ifmsh->pre_value = 1; | ||
3161 | else | ||
3162 | ifmsh->pre_value++; | ||
3163 | |||
3159 | err = ieee80211_mesh_csa_beacon(sdata, params, true); | 3164 | err = ieee80211_mesh_csa_beacon(sdata, params, true); |
3160 | if (err < 0) | 3165 | if (err < 0) { |
3166 | ifmsh->chsw_init = false; | ||
3161 | return err; | 3167 | return err; |
3168 | } | ||
3162 | break; | 3169 | break; |
3163 | #endif | 3170 | #endif |
3164 | default: | 3171 | default: |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 0f1fb5db4bdb..2eda7b13124a 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -823,6 +823,10 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata, | |||
823 | if (err) | 823 | if (err) |
824 | return false; | 824 | return false; |
825 | 825 | ||
826 | /* channel switch is not supported, disconnect */ | ||
827 | if (!(sdata->local->hw.wiphy->flags & WIPHY_FLAG_HAS_CHANNEL_SWITCH)) | ||
828 | goto disconnect; | ||
829 | |||
826 | params.count = csa_ie.count; | 830 | params.count = csa_ie.count; |
827 | params.chandef = csa_ie.chandef; | 831 | params.chandef = csa_ie.chandef; |
828 | 832 | ||
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 32bae218d6e5..ed5bf8b4b5c2 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1256,6 +1256,7 @@ struct ieee80211_csa_ie { | |||
1256 | u8 mode; | 1256 | u8 mode; |
1257 | u8 count; | 1257 | u8 count; |
1258 | u8 ttl; | 1258 | u8 ttl; |
1259 | u16 pre_value; | ||
1259 | }; | 1260 | }; |
1260 | 1261 | ||
1261 | /* Parsed Information Elements */ | 1262 | /* Parsed Information Elements */ |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index d226751ba63a..7aa9f9dea9df 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1327,7 +1327,6 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
1327 | sdata->vif.bss_conf.bssid = NULL; | 1327 | sdata->vif.bss_conf.bssid = NULL; |
1328 | break; | 1328 | break; |
1329 | case NL80211_IFTYPE_AP_VLAN: | 1329 | case NL80211_IFTYPE_AP_VLAN: |
1330 | break; | ||
1331 | case NL80211_IFTYPE_P2P_DEVICE: | 1330 | case NL80211_IFTYPE_P2P_DEVICE: |
1332 | sdata->vif.bss_conf.bssid = sdata->vif.addr; | 1331 | sdata->vif.bss_conf.bssid = sdata->vif.addr; |
1333 | break; | 1332 | break; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 8af75f0eed6d..fa34cd2344b9 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -995,6 +995,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
995 | wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", | 995 | wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", |
996 | result); | 996 | result); |
997 | 997 | ||
998 | local->hw.conf.flags = IEEE80211_CONF_IDLE; | ||
999 | |||
998 | ieee80211_led_init(local); | 1000 | ieee80211_led_init(local); |
999 | 1001 | ||
1000 | rtnl_lock(); | 1002 | rtnl_lock(); |
@@ -1102,6 +1104,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw) | |||
1102 | 1104 | ||
1103 | cancel_work_sync(&local->restart_work); | 1105 | cancel_work_sync(&local->restart_work); |
1104 | cancel_work_sync(&local->reconfig_filter); | 1106 | cancel_work_sync(&local->reconfig_filter); |
1107 | flush_work(&local->sched_scan_stopped_work); | ||
1105 | 1108 | ||
1106 | ieee80211_clear_tx_pending(local); | 1109 | ieee80211_clear_tx_pending(local); |
1107 | rate_control_deinitialize(local); | 1110 | rate_control_deinitialize(local); |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 330d1f71c0c9..89df62b2b689 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -940,14 +940,19 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, | |||
940 | params.chandef.chan->center_freq); | 940 | params.chandef.chan->center_freq); |
941 | 941 | ||
942 | params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT; | 942 | params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT; |
943 | if (beacon) | 943 | if (beacon) { |
944 | ifmsh->chsw_ttl = csa_ie.ttl - 1; | 944 | ifmsh->chsw_ttl = csa_ie.ttl - 1; |
945 | else | 945 | if (ifmsh->pre_value >= csa_ie.pre_value) |
946 | ifmsh->chsw_ttl = 0; | 946 | return false; |
947 | ifmsh->pre_value = csa_ie.pre_value; | ||
948 | } | ||
947 | 949 | ||
948 | if (ifmsh->chsw_ttl > 0) | 950 | if (ifmsh->chsw_ttl < ifmsh->mshcfg.dot11MeshTTL) { |
949 | if (ieee80211_mesh_csa_beacon(sdata, ¶ms, false) < 0) | 951 | if (ieee80211_mesh_csa_beacon(sdata, ¶ms, false) < 0) |
950 | return false; | 952 | return false; |
953 | } else { | ||
954 | return false; | ||
955 | } | ||
951 | 956 | ||
952 | sdata->csa_radar_required = params.radar_required; | 957 | sdata->csa_radar_required = params.radar_required; |
953 | 958 | ||
@@ -1160,7 +1165,6 @@ static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
1160 | offset_ttl = (len < 42) ? 7 : 10; | 1165 | offset_ttl = (len < 42) ? 7 : 10; |
1161 | *(pos + offset_ttl) -= 1; | 1166 | *(pos + offset_ttl) -= 1; |
1162 | *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; | 1167 | *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; |
1163 | sdata->u.mesh.chsw_ttl = *(pos + offset_ttl); | ||
1164 | 1168 | ||
1165 | memcpy(mgmt_fwd, mgmt, len); | 1169 | memcpy(mgmt_fwd, mgmt, len); |
1166 | eth_broadcast_addr(mgmt_fwd->da); | 1170 | eth_broadcast_addr(mgmt_fwd->da); |
@@ -1179,7 +1183,7 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
1179 | u16 pre_value; | 1183 | u16 pre_value; |
1180 | bool fwd_csa = true; | 1184 | bool fwd_csa = true; |
1181 | size_t baselen; | 1185 | size_t baselen; |
1182 | u8 *pos, ttl; | 1186 | u8 *pos; |
1183 | 1187 | ||
1184 | if (mgmt->u.action.u.measurement.action_code != | 1188 | if (mgmt->u.action.u.measurement.action_code != |
1185 | WLAN_ACTION_SPCT_CHL_SWITCH) | 1189 | WLAN_ACTION_SPCT_CHL_SWITCH) |
@@ -1190,8 +1194,8 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
1190 | u.action.u.chan_switch.variable); | 1194 | u.action.u.chan_switch.variable); |
1191 | ieee802_11_parse_elems(pos, len - baselen, false, &elems); | 1195 | ieee802_11_parse_elems(pos, len - baselen, false, &elems); |
1192 | 1196 | ||
1193 | ttl = elems.mesh_chansw_params_ie->mesh_ttl; | 1197 | ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl; |
1194 | if (!--ttl) | 1198 | if (!--ifmsh->chsw_ttl) |
1195 | fwd_csa = false; | 1199 | fwd_csa = false; |
1196 | 1200 | ||
1197 | pre_value = le16_to_cpu(elems.mesh_chansw_params_ie->mesh_pre_value); | 1201 | pre_value = le16_to_cpu(elems.mesh_chansw_params_ie->mesh_pre_value); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 33bcf8018d8e..900ead344f5b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1915,6 +1915,8 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata, | |||
1915 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) | 1915 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) |
1916 | already = true; | 1916 | already = true; |
1917 | 1917 | ||
1918 | ifmgd->flags |= IEEE80211_STA_CONNECTION_POLL; | ||
1919 | |||
1918 | mutex_unlock(&sdata->local->mtx); | 1920 | mutex_unlock(&sdata->local->mtx); |
1919 | 1921 | ||
1920 | if (already) | 1922 | if (already) |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index b91655a0d8f0..d2ed18d82fe1 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -226,7 +226,7 @@ minstrel_ht_calc_tp(struct minstrel_ht_sta *mi, int group, int rate) | |||
226 | nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len); | 226 | nsecs = 1000 * mi->overhead / MINSTREL_TRUNC(mi->avg_ampdu_len); |
227 | 227 | ||
228 | nsecs += minstrel_mcs_groups[group].duration[rate]; | 228 | nsecs += minstrel_mcs_groups[group].duration[rate]; |
229 | tp = 1000000 * ((mr->probability * 1000) / nsecs); | 229 | tp = 1000000 * ((prob * 1000) / nsecs); |
230 | 230 | ||
231 | mr->cur_tp = MINSTREL_TRUNC(tp); | 231 | mr->cur_tp = MINSTREL_TRUNC(tp); |
232 | } | 232 | } |
@@ -277,13 +277,15 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
277 | if (!(mg->supported & BIT(i))) | 277 | if (!(mg->supported & BIT(i))) |
278 | continue; | 278 | continue; |
279 | 279 | ||
280 | index = MCS_GROUP_RATES * group + i; | ||
281 | |||
280 | /* initialize rates selections starting indexes */ | 282 | /* initialize rates selections starting indexes */ |
281 | if (!mg_rates_valid) { | 283 | if (!mg_rates_valid) { |
282 | mg->max_tp_rate = mg->max_tp_rate2 = | 284 | mg->max_tp_rate = mg->max_tp_rate2 = |
283 | mg->max_prob_rate = i; | 285 | mg->max_prob_rate = i; |
284 | if (!mi_rates_valid) { | 286 | if (!mi_rates_valid) { |
285 | mi->max_tp_rate = mi->max_tp_rate2 = | 287 | mi->max_tp_rate = mi->max_tp_rate2 = |
286 | mi->max_prob_rate = i; | 288 | mi->max_prob_rate = index; |
287 | mi_rates_valid = true; | 289 | mi_rates_valid = true; |
288 | } | 290 | } |
289 | mg_rates_valid = true; | 291 | mg_rates_valid = true; |
@@ -291,7 +293,6 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
291 | 293 | ||
292 | mr = &mg->rates[i]; | 294 | mr = &mg->rates[i]; |
293 | mr->retry_updated = false; | 295 | mr->retry_updated = false; |
294 | index = MCS_GROUP_RATES * group + i; | ||
295 | minstrel_calc_rate_ewma(mr); | 296 | minstrel_calc_rate_ewma(mr); |
296 | minstrel_ht_calc_tp(mi, group, i); | 297 | minstrel_ht_calc_tp(mi, group, i); |
297 | 298 | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 30ac6099da06..2dfa75522733 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -924,7 +924,8 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, | |||
924 | u16 sc; | 924 | u16 sc; |
925 | u8 tid, ack_policy; | 925 | u8 tid, ack_policy; |
926 | 926 | ||
927 | if (!ieee80211_is_data_qos(hdr->frame_control)) | 927 | if (!ieee80211_is_data_qos(hdr->frame_control) || |
928 | is_multicast_ether_addr(hdr->addr1)) | ||
928 | goto dont_reorder; | 929 | goto dont_reorder; |
929 | 930 | ||
930 | /* | 931 | /* |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index c22cbb57b49d..4d73c46df862 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -1088,6 +1088,6 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw) | |||
1088 | 1088 | ||
1089 | trace_api_sched_scan_stopped(local); | 1089 | trace_api_sched_scan_stopped(local); |
1090 | 1090 | ||
1091 | ieee80211_queue_work(&local->hw, &local->sched_scan_stopped_work); | 1091 | schedule_work(&local->sched_scan_stopped_work); |
1092 | } | 1092 | } |
1093 | EXPORT_SYMBOL(ieee80211_sched_scan_stopped); | 1093 | EXPORT_SYMBOL(ieee80211_sched_scan_stopped); |
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c index a40da20b32e0..6ab009070084 100644 --- a/net/mac80211/spectmgmt.c +++ b/net/mac80211/spectmgmt.c | |||
@@ -78,6 +78,8 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, | |||
78 | if (elems->mesh_chansw_params_ie) { | 78 | if (elems->mesh_chansw_params_ie) { |
79 | csa_ie->ttl = elems->mesh_chansw_params_ie->mesh_ttl; | 79 | csa_ie->ttl = elems->mesh_chansw_params_ie->mesh_ttl; |
80 | csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags; | 80 | csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags; |
81 | csa_ie->pre_value = le16_to_cpu( | ||
82 | elems->mesh_chansw_params_ie->mesh_pre_value); | ||
81 | } | 83 | } |
82 | 84 | ||
83 | new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band); | 85 | new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band); |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 06265d7f8cc3..875e172c001c 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2301,17 +2301,15 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work) | |||
2301 | { | 2301 | { |
2302 | struct ieee80211_local *local = | 2302 | struct ieee80211_local *local = |
2303 | container_of(work, struct ieee80211_local, radar_detected_work); | 2303 | container_of(work, struct ieee80211_local, radar_detected_work); |
2304 | struct cfg80211_chan_def chandef; | 2304 | struct cfg80211_chan_def chandef = local->hw.conf.chandef; |
2305 | 2305 | ||
2306 | ieee80211_dfs_cac_cancel(local); | 2306 | ieee80211_dfs_cac_cancel(local); |
2307 | 2307 | ||
2308 | if (local->use_chanctx) | 2308 | if (local->use_chanctx) |
2309 | /* currently not handled */ | 2309 | /* currently not handled */ |
2310 | WARN_ON(1); | 2310 | WARN_ON(1); |
2311 | else { | 2311 | else |
2312 | chandef = local->hw.conf.chandef; | ||
2313 | cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); | 2312 | cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); |
2314 | } | ||
2315 | } | 2313 | } |
2316 | 2314 | ||
2317 | void ieee80211_radar_detected(struct ieee80211_hw *hw) | 2315 | void ieee80211_radar_detected(struct ieee80211_hw *hw) |
@@ -2481,13 +2479,8 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, | |||
2481 | WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00; | 2479 | WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00; |
2482 | put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */ | 2480 | put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */ |
2483 | pos += 2; | 2481 | pos += 2; |
2484 | if (!ifmsh->pre_value) | ||
2485 | ifmsh->pre_value = 1; | ||
2486 | else | ||
2487 | ifmsh->pre_value++; | ||
2488 | put_unaligned_le16(ifmsh->pre_value, pos);/* Precedence Value */ | 2482 | put_unaligned_le16(ifmsh->pre_value, pos);/* Precedence Value */ |
2489 | pos += 2; | 2483 | pos += 2; |
2490 | ifmsh->chsw_init = true; | ||
2491 | } | 2484 | } |
2492 | 2485 | ||
2493 | ieee80211_tx_skb(sdata, skb); | 2486 | ieee80211_tx_skb(sdata, skb); |
diff --git a/net/wireless/core.c b/net/wireless/core.c index fc968c861ee4..06db6eb5258a 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -449,6 +449,15 @@ int wiphy_register(struct wiphy *wiphy) | |||
449 | int i; | 449 | int i; |
450 | u16 ifmodes = wiphy->interface_modes; | 450 | u16 ifmodes = wiphy->interface_modes; |
451 | 451 | ||
452 | /* support for 5/10 MHz is broken due to nl80211 API mess - disable */ | ||
453 | wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_5_10_MHZ; | ||
454 | |||
455 | /* | ||
456 | * There are major locking problems in nl80211/mac80211 for CSA, | ||
457 | * disable for all drivers until this has been reworked. | ||
458 | */ | ||
459 | wiphy->flags &= ~WIPHY_FLAG_HAS_CHANNEL_SWITCH; | ||
460 | |||
452 | #ifdef CONFIG_PM | 461 | #ifdef CONFIG_PM |
453 | if (WARN_ON(wiphy->wowlan && | 462 | if (WARN_ON(wiphy->wowlan && |
454 | (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && | 463 | (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && |
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index f79105712949..730147ed8e65 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -262,7 +262,7 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, | |||
262 | 262 | ||
263 | /* try to find an IBSS channel if none requested ... */ | 263 | /* try to find an IBSS channel if none requested ... */ |
264 | if (!wdev->wext.ibss.chandef.chan) { | 264 | if (!wdev->wext.ibss.chandef.chan) { |
265 | wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; | 265 | struct ieee80211_channel *new_chan = NULL; |
266 | 266 | ||
267 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 267 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
268 | struct ieee80211_supported_band *sband; | 268 | struct ieee80211_supported_band *sband; |
@@ -278,18 +278,19 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, | |||
278 | continue; | 278 | continue; |
279 | if (chan->flags & IEEE80211_CHAN_DISABLED) | 279 | if (chan->flags & IEEE80211_CHAN_DISABLED) |
280 | continue; | 280 | continue; |
281 | wdev->wext.ibss.chandef.chan = chan; | 281 | new_chan = chan; |
282 | wdev->wext.ibss.chandef.center_freq1 = | ||
283 | chan->center_freq; | ||
284 | break; | 282 | break; |
285 | } | 283 | } |
286 | 284 | ||
287 | if (wdev->wext.ibss.chandef.chan) | 285 | if (new_chan) |
288 | break; | 286 | break; |
289 | } | 287 | } |
290 | 288 | ||
291 | if (!wdev->wext.ibss.chandef.chan) | 289 | if (!new_chan) |
292 | return -EINVAL; | 290 | return -EINVAL; |
291 | |||
292 | cfg80211_chandef_create(&wdev->wext.ibss.chandef, new_chan, | ||
293 | NL80211_CHAN_NO_HT); | ||
293 | } | 294 | } |
294 | 295 | ||
295 | /* don't join -- SSID is not there */ | 296 | /* don't join -- SSID is not there */ |
@@ -363,9 +364,8 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | |||
363 | return err; | 364 | return err; |
364 | 365 | ||
365 | if (chan) { | 366 | if (chan) { |
366 | wdev->wext.ibss.chandef.chan = chan; | 367 | cfg80211_chandef_create(&wdev->wext.ibss.chandef, chan, |
367 | wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; | 368 | NL80211_CHAN_NO_HT); |
368 | wdev->wext.ibss.chandef.center_freq1 = freq; | ||
369 | wdev->wext.ibss.channel_fixed = true; | 369 | wdev->wext.ibss.channel_fixed = true; |
370 | } else { | 370 | } else { |
371 | /* cfg80211_ibss_wext_join will pick one if needed */ | 371 | /* cfg80211_ibss_wext_join will pick one if needed */ |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index efaa23e562b4..a693f86e5970 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2688,7 +2688,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
2688 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 2688 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
2689 | NL80211_CMD_NEW_KEY); | 2689 | NL80211_CMD_NEW_KEY); |
2690 | if (!hdr) | 2690 | if (!hdr) |
2691 | return -ENOBUFS; | 2691 | goto nla_put_failure; |
2692 | 2692 | ||
2693 | cookie.msg = msg; | 2693 | cookie.msg = msg; |
2694 | cookie.idx = key_idx; | 2694 | cookie.idx = key_idx; |
@@ -5365,6 +5365,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) | |||
5365 | err = -EINVAL; | 5365 | err = -EINVAL; |
5366 | goto out_free; | 5366 | goto out_free; |
5367 | } | 5367 | } |
5368 | |||
5369 | if (!wiphy->bands[band]) | ||
5370 | continue; | ||
5371 | |||
5368 | err = ieee80211_get_ratemask(wiphy->bands[band], | 5372 | err = ieee80211_get_ratemask(wiphy->bands[band], |
5369 | nla_data(attr), | 5373 | nla_data(attr), |
5370 | nla_len(attr), | 5374 | nla_len(attr), |
@@ -9649,8 +9653,9 @@ static int nl80211_add_scan_req(struct sk_buff *msg, | |||
9649 | nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) | 9653 | nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) |
9650 | goto nla_put_failure; | 9654 | goto nla_put_failure; |
9651 | 9655 | ||
9652 | if (req->flags) | 9656 | if (req->flags && |
9653 | nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags); | 9657 | nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags)) |
9658 | goto nla_put_failure; | ||
9654 | 9659 | ||
9655 | return 0; | 9660 | return 0; |
9656 | nla_put_failure: | 9661 | nla_put_failure: |
@@ -11106,6 +11111,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
11106 | struct nlattr *reasons; | 11111 | struct nlattr *reasons; |
11107 | 11112 | ||
11108 | reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); | 11113 | reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); |
11114 | if (!reasons) | ||
11115 | goto free_msg; | ||
11109 | 11116 | ||
11110 | if (wakeup->disconnect && | 11117 | if (wakeup->disconnect && |
11111 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) | 11118 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) |
@@ -11131,16 +11138,18 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
11131 | wakeup->pattern_idx)) | 11138 | wakeup->pattern_idx)) |
11132 | goto free_msg; | 11139 | goto free_msg; |
11133 | 11140 | ||
11134 | if (wakeup->tcp_match) | 11141 | if (wakeup->tcp_match && |
11135 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH); | 11142 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH)) |
11143 | goto free_msg; | ||
11136 | 11144 | ||
11137 | if (wakeup->tcp_connlost) | 11145 | if (wakeup->tcp_connlost && |
11138 | nla_put_flag(msg, | 11146 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST)) |
11139 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST); | 11147 | goto free_msg; |
11140 | 11148 | ||
11141 | if (wakeup->tcp_nomoretokens) | 11149 | if (wakeup->tcp_nomoretokens && |
11142 | nla_put_flag(msg, | 11150 | nla_put_flag(msg, |
11143 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS); | 11151 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS)) |
11152 | goto free_msg; | ||
11144 | 11153 | ||
11145 | if (wakeup->packet) { | 11154 | if (wakeup->packet) { |
11146 | u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; | 11155 | u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; |
@@ -11276,24 +11285,29 @@ void cfg80211_ft_event(struct net_device *netdev, | |||
11276 | return; | 11285 | return; |
11277 | 11286 | ||
11278 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); | 11287 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); |
11279 | if (!hdr) { | 11288 | if (!hdr) |
11280 | nlmsg_free(msg); | 11289 | goto out; |
11281 | return; | ||
11282 | } | ||
11283 | 11290 | ||
11284 | nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); | 11291 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
11285 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); | 11292 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || |
11286 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap); | 11293 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap)) |
11287 | if (ft_event->ies) | 11294 | goto out; |
11288 | nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies); | 11295 | |
11289 | if (ft_event->ric_ies) | 11296 | if (ft_event->ies && |
11290 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, | 11297 | nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies)) |
11291 | ft_event->ric_ies); | 11298 | goto out; |
11299 | if (ft_event->ric_ies && | ||
11300 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, | ||
11301 | ft_event->ric_ies)) | ||
11302 | goto out; | ||
11292 | 11303 | ||
11293 | genlmsg_end(msg, hdr); | 11304 | genlmsg_end(msg, hdr); |
11294 | 11305 | ||
11295 | genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, | 11306 | genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, |
11296 | NL80211_MCGRP_MLME, GFP_KERNEL); | 11307 | NL80211_MCGRP_MLME, GFP_KERNEL); |
11308 | return; | ||
11309 | out: | ||
11310 | nlmsg_free(msg); | ||
11297 | } | 11311 | } |
11298 | EXPORT_SYMBOL(cfg80211_ft_event); | 11312 | EXPORT_SYMBOL(cfg80211_ft_event); |
11299 | 11313 | ||