Skip to content

Commit 64d4790

Browse files
committed
Merge tag 'mac80211-for-davem-2018-12-05' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
Johannes Berg: ==================== As it's been a while, we have various fixes for * hwsim * AP mode (client powersave related) * CSA/FTM interaction * a busy loop in IE handling * and similar ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 0fb628f + 312ca38 commit 64d4790

11 files changed

Lines changed: 44 additions & 23 deletions

File tree

‎drivers/net/wireless/mac80211_hwsim.c‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,6 +2884,10 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
28842884

28852885
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
28862886

2887+
tasklet_hrtimer_init(&data->beacon_timer,
2888+
mac80211_hwsim_beacon,
2889+
CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
2890+
28872891
err = ieee80211_register_hw(hw);
28882892
if (err < 0) {
28892893
pr_debug("mac80211_hwsim: ieee80211_register_hw failed (%d)\n",
@@ -2908,10 +2912,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
29082912
data->debugfs,
29092913
data, &hwsim_simulate_radar);
29102914

2911-
tasklet_hrtimer_init(&data->beacon_timer,
2912-
mac80211_hwsim_beacon,
2913-
CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
2914-
29152915
spin_lock_bh(&hwsim_radio_lock);
29162916
err = rhashtable_insert_fast(&hwsim_radios_rht, &data->rht,
29172917
hwsim_rht_params);
@@ -3703,16 +3703,16 @@ static int __init init_mac80211_hwsim(void)
37033703
if (err)
37043704
goto out_unregister_pernet;
37053705

3706+
err = hwsim_init_netlink();
3707+
if (err)
3708+
goto out_unregister_driver;
3709+
37063710
hwsim_class = class_create(THIS_MODULE, "mac80211_hwsim");
37073711
if (IS_ERR(hwsim_class)) {
37083712
err = PTR_ERR(hwsim_class);
3709-
goto out_unregister_driver;
3713+
goto out_exit_netlink;
37103714
}
37113715

3712-
err = hwsim_init_netlink();
3713-
if (err < 0)
3714-
goto out_unregister_driver;
3715-
37163716
for (i = 0; i < radios; i++) {
37173717
struct hwsim_new_radio_params param = { 0 };
37183718

@@ -3818,6 +3818,8 @@ static int __init init_mac80211_hwsim(void)
38183818
free_netdev(hwsim_mon);
38193819
out_free_radios:
38203820
mac80211_hwsim_free();
3821+
out_exit_netlink:
3822+
hwsim_exit_netlink();
38213823
out_unregister_driver:
38223824
platform_driver_unregister(&mac80211_hwsim_driver);
38233825
out_unregister_pernet:

‎net/mac80211/cfg.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,7 +2891,7 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
28912891

28922892
len = beacon->head_len + beacon->tail_len + beacon->beacon_ies_len +
28932893
beacon->proberesp_ies_len + beacon->assocresp_ies_len +
2894-
beacon->probe_resp_len;
2894+
beacon->probe_resp_len + beacon->lci_len + beacon->civicloc_len;
28952895

28962896
new_beacon = kzalloc(sizeof(*new_beacon) + len, GFP_KERNEL);
28972897
if (!new_beacon)
@@ -2934,8 +2934,9 @@ cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
29342934
memcpy(pos, beacon->probe_resp, beacon->probe_resp_len);
29352935
pos += beacon->probe_resp_len;
29362936
}
2937-
if (beacon->ftm_responder)
2938-
new_beacon->ftm_responder = beacon->ftm_responder;
2937+
2938+
/* might copy -1, meaning no changes requested */
2939+
new_beacon->ftm_responder = beacon->ftm_responder;
29392940
if (beacon->lci) {
29402941
new_beacon->lci_len = beacon->lci_len;
29412942
new_beacon->lci = pos;

‎net/mac80211/iface.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
10151015
if (local->open_count == 0)
10161016
ieee80211_clear_tx_pending(local);
10171017

1018+
sdata->vif.bss_conf.beacon_int = 0;
1019+
10181020
/*
10191021
* If the interface goes down while suspended, presumably because
10201022
* the device was unplugged and that happens before our resume,

‎net/mac80211/mlme.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,6 +2766,7 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
27662766
{
27672767
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
27682768
struct sta_info *sta;
2769+
bool result = true;
27692770

27702771
sdata_info(sdata, "authenticated\n");
27712772
ifmgd->auth_data->done = true;
@@ -2778,15 +2779,18 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
27782779
sta = sta_info_get(sdata, bssid);
27792780
if (!sta) {
27802781
WARN_ONCE(1, "%s: STA %pM not found", sdata->name, bssid);
2781-
return false;
2782+
result = false;
2783+
goto out;
27822784
}
27832785
if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
27842786
sdata_info(sdata, "failed moving %pM to auth\n", bssid);
2785-
return false;
2787+
result = false;
2788+
goto out;
27862789
}
2787-
mutex_unlock(&sdata->local->sta_mtx);
27882790

2789-
return true;
2791+
out:
2792+
mutex_unlock(&sdata->local->sta_mtx);
2793+
return result;
27902794
}
27912795

27922796
static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,

‎net/mac80211/rx.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,7 @@ ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx)
14031403
return RX_CONTINUE;
14041404

14051405
if (ieee80211_is_ctl(hdr->frame_control) ||
1406+
ieee80211_is_nullfunc(hdr->frame_control) ||
14061407
ieee80211_is_qos_nullfunc(hdr->frame_control) ||
14071408
is_multicast_ether_addr(hdr->addr1))
14081409
return RX_CONTINUE;
@@ -3063,7 +3064,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
30633064
cfg80211_sta_opmode_change_notify(sdata->dev,
30643065
rx->sta->addr,
30653066
&sta_opmode,
3066-
GFP_KERNEL);
3067+
GFP_ATOMIC);
30673068
goto handled;
30683069
}
30693070
case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: {
@@ -3100,7 +3101,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
31003101
cfg80211_sta_opmode_change_notify(sdata->dev,
31013102
rx->sta->addr,
31023103
&sta_opmode,
3103-
GFP_KERNEL);
3104+
GFP_ATOMIC);
31043105
goto handled;
31053106
}
31063107
default:

‎net/mac80211/status.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,8 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw,
964964
/* Track when last TDLS packet was ACKed */
965965
if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH))
966966
sta->status_stats.last_tdls_pkt_time = jiffies;
967+
} else if (test_sta_flag(sta, WLAN_STA_PS_STA)) {
968+
return;
967969
} else {
968970
ieee80211_lost_packet(sta, info);
969971
}

‎net/mac80211/tx.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)
439439
if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL))
440440
info->hw_queue = tx->sdata->vif.cab_queue;
441441

442-
/* no stations in PS mode */
443-
if (!atomic_read(&ps->num_sta_ps))
442+
/* no stations in PS mode and no buffered packets */
443+
if (!atomic_read(&ps->num_sta_ps) && skb_queue_empty(&ps->bc_buf))
444444
return TX_CONTINUE;
445445

446446
info->flags |= IEEE80211_TX_CTL_SEND_AFTER_DTIM;

‎net/wireless/mlme.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ void cfg80211_oper_and_ht_capa(struct ieee80211_ht_cap *ht_capa,
272272

273273
p1 = (u8*)(ht_capa);
274274
p2 = (u8*)(ht_capa_mask);
275-
for (i = 0; i<sizeof(*ht_capa); i++)
275+
for (i = 0; i < sizeof(*ht_capa); i++)
276276
p1[i] &= p2[i];
277277
}
278278

279-
/* Do a logical ht_capa &= ht_capa_mask. */
279+
/* Do a logical vht_capa &= vht_capa_mask. */
280280
void cfg80211_oper_and_vht_capa(struct ieee80211_vht_cap *vht_capa,
281281
const struct ieee80211_vht_cap *vht_capa_mask)
282282
{

‎net/wireless/nl80211.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7870,6 +7870,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
78707870
}
78717871

78727872
memset(&params, 0, sizeof(params));
7873+
params.beacon_csa.ftm_responder = -1;
78737874

78747875
if (!info->attrs[NL80211_ATTR_WIPHY_FREQ] ||
78757876
!info->attrs[NL80211_ATTR_CH_SWITCH_COUNT])

‎net/wireless/sme.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,15 @@ static bool cfg80211_is_all_idle(void)
642642
* All devices must be idle as otherwise if you are actively
643643
* scanning some new beacon hints could be learned and would
644644
* count as new regulatory hints.
645+
* Also if there is any other active beaconing interface we
646+
* need not issue a disconnect hint and reset any info such
647+
* as chan dfs state, etc.
645648
*/
646649
list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
647650
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
648651
wdev_lock(wdev);
649-
if (wdev->conn || wdev->current_bss)
652+
if (wdev->conn || wdev->current_bss ||
653+
cfg80211_beaconing_iface_active(wdev))
650654
is_all_idle = false;
651655
wdev_unlock(wdev);
652656
}
@@ -1171,6 +1175,8 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
11711175

11721176
cfg80211_oper_and_ht_capa(&connect->ht_capa_mask,
11731177
rdev->wiphy.ht_capa_mod_mask);
1178+
cfg80211_oper_and_vht_capa(&connect->vht_capa_mask,
1179+
rdev->wiphy.vht_capa_mod_mask);
11741180

11751181
if (connkeys && connkeys->def >= 0) {
11761182
int idx;

0 commit comments

Comments
 (0)