diff options
| -rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 16 | ||||
| -rw-r--r-- | net/mac80211/cfg.c | 15 | ||||
| -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 | 3 | ||||
| -rw-r--r-- | net/wireless/ibss.c | 18 | ||||
| -rw-r--r-- | net/wireless/nl80211.c | 60 |
15 files changed, 101 insertions, 63 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 9df7bc91a26f..c72438bb2faf 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -383,6 +383,14 @@ struct hwsim_radiotap_hdr { | |||
| 383 | __le16 rt_chbitmask; | 383 | __le16 rt_chbitmask; |
| 384 | } __packed; | 384 | } __packed; |
| 385 | 385 | ||
| 386 | struct hwsim_radiotap_ack_hdr { | ||
| 387 | struct ieee80211_radiotap_header hdr; | ||
| 388 | u8 rt_flags; | ||
| 389 | u8 pad; | ||
| 390 | __le16 rt_channel; | ||
| 391 | __le16 rt_chbitmask; | ||
| 392 | } __packed; | ||
| 393 | |||
| 386 | /* MAC80211_HWSIM netlinf family */ | 394 | /* MAC80211_HWSIM netlinf family */ |
| 387 | static struct genl_family hwsim_genl_family = { | 395 | static struct genl_family hwsim_genl_family = { |
| 388 | .id = GENL_ID_GENERATE, | 396 | .id = GENL_ID_GENERATE, |
| @@ -500,7 +508,7 @@ static void mac80211_hwsim_monitor_ack(struct ieee80211_channel *chan, | |||
| 500 | const u8 *addr) | 508 | const u8 *addr) |
| 501 | { | 509 | { |
| 502 | struct sk_buff *skb; | 510 | struct sk_buff *skb; |
| 503 | struct hwsim_radiotap_hdr *hdr; | 511 | struct hwsim_radiotap_ack_hdr *hdr; |
| 504 | u16 flags; | 512 | u16 flags; |
| 505 | struct ieee80211_hdr *hdr11; | 513 | struct ieee80211_hdr *hdr11; |
| 506 | 514 | ||
| @@ -511,14 +519,14 @@ static void mac80211_hwsim_monitor_ack(struct ieee80211_channel *chan, | |||
| 511 | if (skb == NULL) | 519 | if (skb == NULL) |
| 512 | return; | 520 | return; |
| 513 | 521 | ||
| 514 | hdr = (struct hwsim_radiotap_hdr *) skb_put(skb, sizeof(*hdr)); | 522 | hdr = (struct hwsim_radiotap_ack_hdr *) skb_put(skb, sizeof(*hdr)); |
| 515 | hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION; | 523 | hdr->hdr.it_version = PKTHDR_RADIOTAP_VERSION; |
| 516 | hdr->hdr.it_pad = 0; | 524 | hdr->hdr.it_pad = 0; |
| 517 | hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr)); | 525 | hdr->hdr.it_len = cpu_to_le16(sizeof(*hdr)); |
| 518 | hdr->hdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) | | 526 | hdr->hdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) | |
| 519 | (1 << IEEE80211_RADIOTAP_CHANNEL)); | 527 | (1 << IEEE80211_RADIOTAP_CHANNEL)); |
| 520 | hdr->rt_flags = 0; | 528 | hdr->rt_flags = 0; |
| 521 | hdr->rt_rate = 0; | 529 | hdr->pad = 0; |
| 522 | hdr->rt_channel = cpu_to_le16(chan->center_freq); | 530 | hdr->rt_channel = cpu_to_le16(chan->center_freq); |
| 523 | flags = IEEE80211_CHAN_2GHZ; | 531 | flags = IEEE80211_CHAN_2GHZ; |
| 524 | hdr->rt_chbitmask = cpu_to_le16(flags); | 532 | hdr->rt_chbitmask = cpu_to_le16(flags); |
| @@ -1230,7 +1238,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw, | |||
| 1230 | HRTIMER_MODE_REL); | 1238 | HRTIMER_MODE_REL); |
| 1231 | } else if (!info->enable_beacon) { | 1239 | } else if (!info->enable_beacon) { |
| 1232 | unsigned int count = 0; | 1240 | unsigned int count = 0; |
| 1233 | ieee80211_iterate_active_interfaces( | 1241 | ieee80211_iterate_active_interfaces_atomic( |
| 1234 | data->hw, IEEE80211_IFACE_ITER_NORMAL, | 1242 | data->hw, IEEE80211_IFACE_ITER_NORMAL, |
| 1235 | mac80211_hwsim_bcn_en_iter, &count); | 1243 | mac80211_hwsim_bcn_en_iter, &count); |
| 1236 | wiphy_debug(hw->wiphy, " beaconing vifs remaining: %u", | 1244 | wiphy_debug(hw->wiphy, " beaconing vifs remaining: %u", |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 95667b088c5b..364ce0c5962f 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
| @@ -1368,7 +1368,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, | |||
| 1368 | changed |= | 1368 | changed |= |
| 1369 | ieee80211_mps_set_sta_local_pm(sta, | 1369 | ieee80211_mps_set_sta_local_pm(sta, |
| 1370 | params->local_pm); | 1370 | params->local_pm); |
| 1371 | ieee80211_bss_info_change_notify(sdata, changed); | 1371 | ieee80211_mbss_info_change_notify(sdata, changed); |
| 1372 | #endif | 1372 | #endif |
| 1373 | } | 1373 | } |
| 1374 | 1374 | ||
| @@ -2488,8 +2488,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
| 2488 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 2488 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
| 2489 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 2489 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
| 2490 | 2490 | ||
| 2491 | if (sdata->vif.type != NL80211_IFTYPE_STATION && | 2491 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
| 2492 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT) | ||
| 2493 | return -EOPNOTSUPP; | 2492 | return -EOPNOTSUPP; |
| 2494 | 2493 | ||
| 2495 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) | 2494 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) |
| @@ -3120,9 +3119,17 @@ static int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, | |||
| 3120 | params->chandef.chan->band) | 3119 | params->chandef.chan->band) |
| 3121 | return -EINVAL; | 3120 | return -EINVAL; |
| 3122 | 3121 | ||
| 3122 | ifmsh->chsw_init = true; | ||
| 3123 | if (!ifmsh->pre_value) | ||
| 3124 | ifmsh->pre_value = 1; | ||
| 3125 | else | ||
| 3126 | ifmsh->pre_value++; | ||
| 3127 | |||
| 3123 | err = ieee80211_mesh_csa_beacon(sdata, params, true); | 3128 | err = ieee80211_mesh_csa_beacon(sdata, params, true); |
| 3124 | if (err < 0) | 3129 | if (err < 0) { |
| 3130 | ifmsh->chsw_init = false; | ||
| 3125 | return err; | 3131 | return err; |
| 3132 | } | ||
| 3126 | break; | 3133 | break; |
| 3127 | #endif | 3134 | #endif |
| 3128 | default: | 3135 | default: |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 29dc505be125..4aea4e791113 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -1228,6 +1228,7 @@ struct ieee80211_csa_ie { | |||
| 1228 | u8 mode; | 1228 | u8 mode; |
| 1229 | u8 count; | 1229 | u8 count; |
| 1230 | u8 ttl; | 1230 | u8 ttl; |
| 1231 | u16 pre_value; | ||
| 1231 | }; | 1232 | }; |
| 1232 | 1233 | ||
| 1233 | /* Parsed Information Elements */ | 1234 | /* Parsed Information Elements */ |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index ff101ea1d9ae..36c3a4cbcabf 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
| @@ -1325,7 +1325,6 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
| 1325 | sdata->vif.bss_conf.bssid = NULL; | 1325 | sdata->vif.bss_conf.bssid = NULL; |
| 1326 | break; | 1326 | break; |
| 1327 | case NL80211_IFTYPE_AP_VLAN: | 1327 | case NL80211_IFTYPE_AP_VLAN: |
| 1328 | break; | ||
| 1329 | case NL80211_IFTYPE_P2P_DEVICE: | 1328 | case NL80211_IFTYPE_P2P_DEVICE: |
| 1330 | sdata->vif.bss_conf.bssid = sdata->vif.addr; | 1329 | sdata->vif.bss_conf.bssid = sdata->vif.addr; |
| 1331 | break; | 1330 | break; |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 21d5d44444d0..7d1c3ac48ed9 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
| @@ -940,6 +940,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
| 940 | wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", | 940 | wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", |
| 941 | result); | 941 | result); |
| 942 | 942 | ||
| 943 | local->hw.conf.flags = IEEE80211_CONF_IDLE; | ||
| 944 | |||
| 943 | ieee80211_led_init(local); | 945 | ieee80211_led_init(local); |
| 944 | 946 | ||
| 945 | rtnl_lock(); | 947 | rtnl_lock(); |
| @@ -1047,6 +1049,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw) | |||
| 1047 | 1049 | ||
| 1048 | cancel_work_sync(&local->restart_work); | 1050 | cancel_work_sync(&local->restart_work); |
| 1049 | cancel_work_sync(&local->reconfig_filter); | 1051 | cancel_work_sync(&local->reconfig_filter); |
| 1052 | flush_work(&local->sched_scan_stopped_work); | ||
| 1050 | 1053 | ||
| 1051 | ieee80211_clear_tx_pending(local); | 1054 | ieee80211_clear_tx_pending(local); |
| 1052 | rate_control_deinitialize(local); | 1055 | rate_control_deinitialize(local); |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 896fe3bd599e..ba105257d03f 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
| @@ -943,14 +943,19 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, | |||
| 943 | params.chandef.chan->center_freq); | 943 | params.chandef.chan->center_freq); |
| 944 | 944 | ||
| 945 | params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT; | 945 | params.block_tx = csa_ie.mode & WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT; |
| 946 | if (beacon) | 946 | if (beacon) { |
| 947 | ifmsh->chsw_ttl = csa_ie.ttl - 1; | 947 | ifmsh->chsw_ttl = csa_ie.ttl - 1; |
| 948 | else | 948 | if (ifmsh->pre_value >= csa_ie.pre_value) |
| 949 | ifmsh->chsw_ttl = 0; | 949 | return false; |
| 950 | ifmsh->pre_value = csa_ie.pre_value; | ||
| 951 | } | ||
| 950 | 952 | ||
| 951 | if (ifmsh->chsw_ttl > 0) | 953 | if (ifmsh->chsw_ttl < ifmsh->mshcfg.dot11MeshTTL) { |
| 952 | if (ieee80211_mesh_csa_beacon(sdata, ¶ms, false) < 0) | 954 | if (ieee80211_mesh_csa_beacon(sdata, ¶ms, false) < 0) |
| 953 | return false; | 955 | return false; |
| 956 | } else { | ||
| 957 | return false; | ||
| 958 | } | ||
| 954 | 959 | ||
| 955 | sdata->csa_radar_required = params.radar_required; | 960 | sdata->csa_radar_required = params.radar_required; |
| 956 | 961 | ||
| @@ -1163,7 +1168,6 @@ static int mesh_fwd_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
| 1163 | offset_ttl = (len < 42) ? 7 : 10; | 1168 | offset_ttl = (len < 42) ? 7 : 10; |
| 1164 | *(pos + offset_ttl) -= 1; | 1169 | *(pos + offset_ttl) -= 1; |
| 1165 | *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; | 1170 | *(pos + offset_ttl + 1) &= ~WLAN_EID_CHAN_SWITCH_PARAM_INITIATOR; |
| 1166 | sdata->u.mesh.chsw_ttl = *(pos + offset_ttl); | ||
| 1167 | 1171 | ||
| 1168 | memcpy(mgmt_fwd, mgmt, len); | 1172 | memcpy(mgmt_fwd, mgmt, len); |
| 1169 | eth_broadcast_addr(mgmt_fwd->da); | 1173 | eth_broadcast_addr(mgmt_fwd->da); |
| @@ -1182,7 +1186,7 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
| 1182 | u16 pre_value; | 1186 | u16 pre_value; |
| 1183 | bool fwd_csa = true; | 1187 | bool fwd_csa = true; |
| 1184 | size_t baselen; | 1188 | size_t baselen; |
| 1185 | u8 *pos, ttl; | 1189 | u8 *pos; |
| 1186 | 1190 | ||
| 1187 | if (mgmt->u.action.u.measurement.action_code != | 1191 | if (mgmt->u.action.u.measurement.action_code != |
| 1188 | WLAN_ACTION_SPCT_CHL_SWITCH) | 1192 | WLAN_ACTION_SPCT_CHL_SWITCH) |
| @@ -1193,8 +1197,8 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata, | |||
| 1193 | u.action.u.chan_switch.variable); | 1197 | u.action.u.chan_switch.variable); |
| 1194 | ieee802_11_parse_elems(pos, len - baselen, false, &elems); | 1198 | ieee802_11_parse_elems(pos, len - baselen, false, &elems); |
| 1195 | 1199 | ||
| 1196 | ttl = elems.mesh_chansw_params_ie->mesh_ttl; | 1200 | ifmsh->chsw_ttl = elems.mesh_chansw_params_ie->mesh_ttl; |
| 1197 | if (!--ttl) | 1201 | if (!--ifmsh->chsw_ttl) |
| 1198 | fwd_csa = false; | 1202 | fwd_csa = false; |
| 1199 | 1203 | ||
| 1200 | pre_value = le16_to_cpu(elems.mesh_chansw_params_ie->mesh_pre_value); | 1204 | 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 d7504ab61a34..b3a3ce316656 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
| @@ -1910,6 +1910,8 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata, | |||
| 1910 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) | 1910 | if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) |
| 1911 | already = true; | 1911 | already = true; |
| 1912 | 1912 | ||
| 1913 | ifmgd->flags |= IEEE80211_STA_CONNECTION_POLL; | ||
| 1914 | |||
| 1913 | mutex_unlock(&sdata->local->mtx); | 1915 | mutex_unlock(&sdata->local->mtx); |
| 1914 | 1916 | ||
| 1915 | if (already) | 1917 | if (already) |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5d60779a0c1b..4096ff6cc24f 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 caecef870c0e..2b0debb0422b 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -911,7 +911,8 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, | |||
| 911 | u16 sc; | 911 | u16 sc; |
| 912 | u8 tid, ack_policy; | 912 | u8 tid, ack_policy; |
| 913 | 913 | ||
| 914 | if (!ieee80211_is_data_qos(hdr->frame_control)) | 914 | if (!ieee80211_is_data_qos(hdr->frame_control) || |
| 915 | is_multicast_ether_addr(hdr->addr1)) | ||
| 915 | goto dont_reorder; | 916 | goto dont_reorder; |
| 916 | 917 | ||
| 917 | /* | 918 | /* |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 5ad66a83ef7f..bcc4833d7542 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 592a18171f95..9f9b9bd3fd44 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
| @@ -2278,17 +2278,15 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work) | |||
| 2278 | { | 2278 | { |
| 2279 | struct ieee80211_local *local = | 2279 | struct ieee80211_local *local = |
| 2280 | container_of(work, struct ieee80211_local, radar_detected_work); | 2280 | container_of(work, struct ieee80211_local, radar_detected_work); |
| 2281 | struct cfg80211_chan_def chandef; | 2281 | struct cfg80211_chan_def chandef = local->hw.conf.chandef; |
| 2282 | 2282 | ||
| 2283 | ieee80211_dfs_cac_cancel(local); | 2283 | ieee80211_dfs_cac_cancel(local); |
| 2284 | 2284 | ||
| 2285 | if (local->use_chanctx) | 2285 | if (local->use_chanctx) |
| 2286 | /* currently not handled */ | 2286 | /* currently not handled */ |
| 2287 | WARN_ON(1); | 2287 | WARN_ON(1); |
| 2288 | else { | 2288 | else |
| 2289 | chandef = local->hw.conf.chandef; | ||
| 2290 | cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); | 2289 | cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); |
| 2291 | } | ||
| 2292 | } | 2290 | } |
| 2293 | 2291 | ||
| 2294 | void ieee80211_radar_detected(struct ieee80211_hw *hw) | 2292 | void ieee80211_radar_detected(struct ieee80211_hw *hw) |
| @@ -2459,14 +2457,9 @@ int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, | |||
| 2459 | WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00; | 2457 | WLAN_EID_CHAN_SWITCH_PARAM_TX_RESTRICT : 0x00; |
| 2460 | put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */ | 2458 | put_unaligned_le16(WLAN_REASON_MESH_CHAN, pos); /* Reason Cd */ |
| 2461 | pos += 2; | 2459 | pos += 2; |
| 2462 | if (!ifmsh->pre_value) | ||
| 2463 | ifmsh->pre_value = 1; | ||
| 2464 | else | ||
| 2465 | ifmsh->pre_value++; | ||
| 2466 | pre_value = cpu_to_le16(ifmsh->pre_value); | 2460 | pre_value = cpu_to_le16(ifmsh->pre_value); |
| 2467 | memcpy(pos, &pre_value, 2); /* Precedence Value */ | 2461 | memcpy(pos, &pre_value, 2); /* Precedence Value */ |
| 2468 | pos += 2; | 2462 | pos += 2; |
| 2469 | ifmsh->chsw_init = true; | ||
| 2470 | } | 2463 | } |
| 2471 | 2464 | ||
| 2472 | ieee80211_tx_skb(sdata, skb); | 2465 | ieee80211_tx_skb(sdata, skb); |
diff --git a/net/wireless/core.c b/net/wireless/core.c index aff959e5a1b3..00a65ba3aeaa 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
| @@ -451,6 +451,9 @@ int wiphy_register(struct wiphy *wiphy) | |||
| 451 | int i; | 451 | int i; |
| 452 | u16 ifmodes = wiphy->interface_modes; | 452 | u16 ifmodes = wiphy->interface_modes; |
| 453 | 453 | ||
| 454 | /* support for 5/10 MHz is broken due to nl80211 API mess - disable */ | ||
| 455 | wiphy->flags &= ~WIPHY_FLAG_SUPPORTS_5_10_MHZ; | ||
| 456 | |||
| 454 | #ifdef CONFIG_PM | 457 | #ifdef CONFIG_PM |
| 455 | if (WARN_ON(wiphy->wowlan && | 458 | if (WARN_ON(wiphy->wowlan && |
| 456 | (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && | 459 | (wiphy->wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) && |
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 9d797df56649..89737ee2669a 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 a1eb21073176..138dc3bb8b67 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
| @@ -2687,7 +2687,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) | |||
| 2687 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, | 2687 | hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, |
| 2688 | NL80211_CMD_NEW_KEY); | 2688 | NL80211_CMD_NEW_KEY); |
| 2689 | if (!hdr) | 2689 | if (!hdr) |
| 2690 | return -ENOBUFS; | 2690 | goto nla_put_failure; |
| 2691 | 2691 | ||
| 2692 | cookie.msg = msg; | 2692 | cookie.msg = msg; |
| 2693 | cookie.idx = key_idx; | 2693 | cookie.idx = key_idx; |
| @@ -5349,6 +5349,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) | |||
| 5349 | err = -EINVAL; | 5349 | err = -EINVAL; |
| 5350 | goto out_free; | 5350 | goto out_free; |
| 5351 | } | 5351 | } |
| 5352 | |||
| 5353 | if (!wiphy->bands[band]) | ||
| 5354 | continue; | ||
| 5355 | |||
| 5352 | err = ieee80211_get_ratemask(wiphy->bands[band], | 5356 | err = ieee80211_get_ratemask(wiphy->bands[band], |
| 5353 | nla_data(attr), | 5357 | nla_data(attr), |
| 5354 | nla_len(attr), | 5358 | nla_len(attr), |
| @@ -9633,8 +9637,9 @@ static int nl80211_add_scan_req(struct sk_buff *msg, | |||
| 9633 | nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) | 9637 | nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) |
| 9634 | goto nla_put_failure; | 9638 | goto nla_put_failure; |
| 9635 | 9639 | ||
| 9636 | if (req->flags) | 9640 | if (req->flags && |
| 9637 | nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags); | 9641 | nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags)) |
| 9642 | goto nla_put_failure; | ||
| 9638 | 9643 | ||
| 9639 | return 0; | 9644 | return 0; |
| 9640 | nla_put_failure: | 9645 | nla_put_failure: |
| @@ -11093,6 +11098,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
| 11093 | struct nlattr *reasons; | 11098 | struct nlattr *reasons; |
| 11094 | 11099 | ||
| 11095 | reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); | 11100 | reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS); |
| 11101 | if (!reasons) | ||
| 11102 | goto free_msg; | ||
| 11096 | 11103 | ||
| 11097 | if (wakeup->disconnect && | 11104 | if (wakeup->disconnect && |
| 11098 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) | 11105 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT)) |
| @@ -11118,16 +11125,18 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
| 11118 | wakeup->pattern_idx)) | 11125 | wakeup->pattern_idx)) |
| 11119 | goto free_msg; | 11126 | goto free_msg; |
| 11120 | 11127 | ||
| 11121 | if (wakeup->tcp_match) | 11128 | if (wakeup->tcp_match && |
| 11122 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH); | 11129 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH)) |
| 11130 | goto free_msg; | ||
| 11123 | 11131 | ||
| 11124 | if (wakeup->tcp_connlost) | 11132 | if (wakeup->tcp_connlost && |
| 11125 | nla_put_flag(msg, | 11133 | nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST)) |
| 11126 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST); | 11134 | goto free_msg; |
| 11127 | 11135 | ||
| 11128 | if (wakeup->tcp_nomoretokens) | 11136 | if (wakeup->tcp_nomoretokens && |
| 11129 | nla_put_flag(msg, | 11137 | nla_put_flag(msg, |
| 11130 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS); | 11138 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS)) |
| 11139 | goto free_msg; | ||
| 11131 | 11140 | ||
| 11132 | if (wakeup->packet) { | 11141 | if (wakeup->packet) { |
| 11133 | u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; | 11142 | u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; |
| @@ -11263,24 +11272,29 @@ void cfg80211_ft_event(struct net_device *netdev, | |||
| 11263 | return; | 11272 | return; |
| 11264 | 11273 | ||
| 11265 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); | 11274 | hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT); |
| 11266 | if (!hdr) { | 11275 | if (!hdr) |
| 11267 | nlmsg_free(msg); | 11276 | goto out; |
| 11268 | return; | ||
| 11269 | } | ||
| 11270 | 11277 | ||
| 11271 | nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); | 11278 | if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || |
| 11272 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex); | 11279 | nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) || |
| 11273 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap); | 11280 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap)) |
| 11274 | if (ft_event->ies) | 11281 | goto out; |
| 11275 | nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies); | 11282 | |
| 11276 | if (ft_event->ric_ies) | 11283 | if (ft_event->ies && |
| 11277 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, | 11284 | nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies)) |
| 11278 | ft_event->ric_ies); | 11285 | goto out; |
| 11286 | if (ft_event->ric_ies && | ||
| 11287 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, | ||
| 11288 | ft_event->ric_ies)) | ||
| 11289 | goto out; | ||
| 11279 | 11290 | ||
| 11280 | genlmsg_end(msg, hdr); | 11291 | genlmsg_end(msg, hdr); |
| 11281 | 11292 | ||
| 11282 | genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, | 11293 | genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, |
| 11283 | NL80211_MCGRP_MLME, GFP_KERNEL); | 11294 | NL80211_MCGRP_MLME, GFP_KERNEL); |
| 11295 | return; | ||
| 11296 | out: | ||
| 11297 | nlmsg_free(msg); | ||
| 11284 | } | 11298 | } |
| 11285 | EXPORT_SYMBOL(cfg80211_ft_event); | 11299 | EXPORT_SYMBOL(cfg80211_ft_event); |
| 11286 | 11300 | ||
