aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-17 12:57:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-17 12:57:45 -0400
commit2a3a028fc61d03e80ac57091330eb514280bd5be (patch)
treec0f98d752faa37fed4d11231f08d368dce120786 /drivers/net/wireless/intel/iwlwifi/mvm
parent444fe991353987c1c9bc5ab1f903d01f1b4ad415 (diff)
parente6986423d28362aafe64d3757bbbc493f2687f8f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Handle init flow failures properly in iwlwifi driver, from Shahar S Matityahu. 2) mac80211 TXQs need to be unscheduled on powersave start, from Felix Fietkau. 3) SKB memory accounting fix in A-MDSU aggregation, from Felix Fietkau. 4) Increase RCU lock hold time in mlx5 FPGA code, from Saeed Mahameed. 5) Avoid checksum complete with XDP in mlx5, also from Saeed. 6) Fix netdev feature clobbering in ibmvnic driver, from Thomas Falcon. 7) Partial sent TLS record leak fix from Jakub Kicinski. 8) Reject zero size iova range in vhost, from Jason Wang. 9) Allow pending work to complete before clcsock release from Karsten Graul. 10) Fix XDP handling max MTU in thunderx, from Matteo Croce. 11) A lot of protocols look at the sa_family field of a sockaddr before validating it's length is large enough, from Tetsuo Handa. 12) Don't write to free'd pointer in qede ptp error path, from Colin Ian King. 13) Have to recompile IP options in ipv4_link_failure because it can be invoked from ARP, from Stephen Suryaputra. 14) Doorbell handling fixes in qed from Denis Bolotin. 15) Revert net-sysfs kobject register leak fix, it causes new problems. From Wang Hai. 16) Spectre v1 fix in ATM code, from Gustavo A. R. Silva. 17) Fix put of BROPT_VLAN_STATS_PER_PORT in bridging code, from Nikolay Aleksandrov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (111 commits) socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW tcp: tcp_grow_window() needs to respect tcp_space() ocelot: Clean up stats update deferred work ocelot: Don't sleep in atomic context (irqs_disabled()) net: bridge: fix netlink export of vlan_stats_per_port option qed: fix spelling mistake "faspath" -> "fastpath" tipc: set sysctl_tipc_rmem and named_timeout right range tipc: fix link established but not in session net: Fix missing meta data in skb with vlan packet net: atm: Fix potential Spectre v1 vulnerabilities net/core: work around section mismatch warning for ptp_classifier net: bridge: fix per-port af_packet sockets bnx2x: fix spelling mistake "dicline" -> "decline" route: Avoid crash from dereferencing NULL rt->from MAINTAINERS: normalize Woojung Huh's email address bonding: fix event handling for stacked bonds Revert "net-sysfs: Fix memory leak in netdev_register_kobject" rtnetlink: fix rtnl_valid_stats_req() nlmsg_len check qed: Fix the DORQ's attentions handling qed: Fix missing DORQ attentions ...
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c71
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mvm.h1
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/sta.c43
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/sta.h7
4 files changed, 28 insertions, 94 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 3a92c09d4692..6a3b11dd2edf 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -2714,9 +2714,6 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
2714 2714
2715 iwl_mvm_mac_ctxt_remove(mvm, vif); 2715 iwl_mvm_mac_ctxt_remove(mvm, vif);
2716 2716
2717 kfree(mvmvif->ap_wep_key);
2718 mvmvif->ap_wep_key = NULL;
2719
2720 mutex_unlock(&mvm->mutex); 2717 mutex_unlock(&mvm->mutex);
2721} 2718}
2722 2719
@@ -3183,24 +3180,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
3183 ret = iwl_mvm_update_sta(mvm, vif, sta); 3180 ret = iwl_mvm_update_sta(mvm, vif, sta);
3184 } else if (old_state == IEEE80211_STA_ASSOC && 3181 } else if (old_state == IEEE80211_STA_ASSOC &&
3185 new_state == IEEE80211_STA_AUTHORIZED) { 3182 new_state == IEEE80211_STA_AUTHORIZED) {
3186 /* if wep is used, need to set the key for the station now */ 3183 ret = 0;
3187 if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) {
3188 mvm_sta->wep_key =
3189 kmemdup(mvmvif->ap_wep_key,
3190 sizeof(*mvmvif->ap_wep_key) +
3191 mvmvif->ap_wep_key->keylen,
3192 GFP_KERNEL);
3193 if (!mvm_sta->wep_key) {
3194 ret = -ENOMEM;
3195 goto out_unlock;
3196 }
3197
3198 ret = iwl_mvm_set_sta_key(mvm, vif, sta,
3199 mvm_sta->wep_key,
3200 STA_KEY_IDX_INVALID);
3201 } else {
3202 ret = 0;
3203 }
3204 3184
3205 /* we don't support TDLS during DCM */ 3185 /* we don't support TDLS during DCM */
3206 if (iwl_mvm_phy_ctx_count(mvm) > 1) 3186 if (iwl_mvm_phy_ctx_count(mvm) > 1)
@@ -3242,17 +3222,6 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
3242 NL80211_TDLS_DISABLE_LINK); 3222 NL80211_TDLS_DISABLE_LINK);
3243 } 3223 }
3244 3224
3245 /* Remove STA key if this is an AP using WEP */
3246 if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) {
3247 int rm_ret = iwl_mvm_remove_sta_key(mvm, vif, sta,
3248 mvm_sta->wep_key);
3249
3250 if (!ret)
3251 ret = rm_ret;
3252 kfree(mvm_sta->wep_key);
3253 mvm_sta->wep_key = NULL;
3254 }
3255
3256 if (unlikely(ret && 3225 if (unlikely(ret &&
3257 test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, 3226 test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
3258 &mvm->status))) 3227 &mvm->status)))
@@ -3289,6 +3258,13 @@ static void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw,
3289 struct ieee80211_sta *sta, u32 changed) 3258 struct ieee80211_sta *sta, u32 changed)
3290{ 3259{
3291 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 3260 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
3261 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
3262
3263 if (changed & (IEEE80211_RC_BW_CHANGED |
3264 IEEE80211_RC_SUPP_RATES_CHANGED |
3265 IEEE80211_RC_NSS_CHANGED))
3266 iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band,
3267 true);
3292 3268
3293 if (vif->type == NL80211_IFTYPE_STATION && 3269 if (vif->type == NL80211_IFTYPE_STATION &&
3294 changed & IEEE80211_RC_NSS_CHANGED) 3270 changed & IEEE80211_RC_NSS_CHANGED)
@@ -3439,20 +3415,12 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3439 break; 3415 break;
3440 case WLAN_CIPHER_SUITE_WEP40: 3416 case WLAN_CIPHER_SUITE_WEP40:
3441 case WLAN_CIPHER_SUITE_WEP104: 3417 case WLAN_CIPHER_SUITE_WEP104:
3442 if (vif->type == NL80211_IFTYPE_AP) { 3418 if (vif->type == NL80211_IFTYPE_STATION)
3443 struct iwl_mvm_vif *mvmvif = 3419 break;
3444 iwl_mvm_vif_from_mac80211(vif); 3420 if (iwl_mvm_has_new_tx_api(mvm))
3445 3421 return -EOPNOTSUPP;
3446 mvmvif->ap_wep_key = kmemdup(key, 3422 /* support HW crypto on TX */
3447 sizeof(*key) + key->keylen, 3423 return 0;
3448 GFP_KERNEL);
3449 if (!mvmvif->ap_wep_key)
3450 return -ENOMEM;
3451 }
3452
3453 if (vif->type != NL80211_IFTYPE_STATION)
3454 return 0;
3455 break;
3456 default: 3424 default:
3457 /* currently FW supports only one optional cipher scheme */ 3425 /* currently FW supports only one optional cipher scheme */
3458 if (hw->n_cipher_schemes && 3426 if (hw->n_cipher_schemes &&
@@ -3540,12 +3508,17 @@ static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
3540 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset); 3508 ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset);
3541 if (ret) { 3509 if (ret) {
3542 IWL_WARN(mvm, "set key failed\n"); 3510 IWL_WARN(mvm, "set key failed\n");
3511 key->hw_key_idx = STA_KEY_IDX_INVALID;
3543 /* 3512 /*
3544 * can't add key for RX, but we don't need it 3513 * can't add key for RX, but we don't need it
3545 * in the device for TX so still return 0 3514 * in the device for TX so still return 0,
3515 * unless we have new TX API where we cannot
3516 * put key material into the TX_CMD
3546 */ 3517 */
3547 key->hw_key_idx = STA_KEY_IDX_INVALID; 3518 if (iwl_mvm_has_new_tx_api(mvm))
3548 ret = 0; 3519 ret = -EOPNOTSUPP;
3520 else
3521 ret = 0;
3549 } 3522 }
3550 3523
3551 break; 3524 break;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index bca6f6b536d9..a50dc53df086 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -498,7 +498,6 @@ struct iwl_mvm_vif {
498 netdev_features_t features; 498 netdev_features_t features;
499 499
500 struct iwl_probe_resp_data __rcu *probe_resp_data; 500 struct iwl_probe_resp_data __rcu *probe_resp_data;
501 struct ieee80211_key_conf *ap_wep_key;
502}; 501};
503 502
504static inline struct iwl_mvm_vif * 503static inline struct iwl_mvm_vif *
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 498c315291cf..98d123dd7177 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -8,7 +8,7 @@
8 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 Intel Corporation 11 * Copyright(c) 2018 - 2019 Intel Corporation
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as 14 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
31 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. 31 * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 Intel Corporation 34 * Copyright(c) 2018 - 2019 Intel Corporation
35 * All rights reserved. 35 * All rights reserved.
36 * 36 *
37 * Redistribution and use in source and binary forms, with or without 37 * Redistribution and use in source and binary forms, with or without
@@ -1399,7 +1399,9 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk)
1399 1399
1400 iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid); 1400 iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid);
1401 list_del_init(&mvmtxq->list); 1401 list_del_init(&mvmtxq->list);
1402 local_bh_disable();
1402 iwl_mvm_mac_itxq_xmit(mvm->hw, txq); 1403 iwl_mvm_mac_itxq_xmit(mvm->hw, txq);
1404 local_bh_enable();
1403 } 1405 }
1404 1406
1405 mutex_unlock(&mvm->mutex); 1407 mutex_unlock(&mvm->mutex);
@@ -2333,21 +2335,6 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
2333 iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, 2335 iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg,
2334 timeout); 2336 timeout);
2335 2337
2336 if (mvmvif->ap_wep_key) {
2337 u8 key_offset = iwl_mvm_set_fw_key_idx(mvm);
2338
2339 __set_bit(key_offset, mvm->fw_key_table);
2340
2341 if (key_offset == STA_KEY_IDX_INVALID)
2342 return -ENOSPC;
2343
2344 ret = iwl_mvm_send_sta_key(mvm, mvmvif->mcast_sta.sta_id,
2345 mvmvif->ap_wep_key, true, 0, NULL, 0,
2346 key_offset, 0);
2347 if (ret)
2348 return ret;
2349 }
2350
2351 return 0; 2338 return 0;
2352} 2339}
2353 2340
@@ -2419,28 +2406,6 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
2419 2406
2420 iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0); 2407 iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0);
2421 2408
2422 if (mvmvif->ap_wep_key) {
2423 int i;
2424
2425 if (!__test_and_clear_bit(mvmvif->ap_wep_key->hw_key_idx,
2426 mvm->fw_key_table)) {
2427 IWL_ERR(mvm, "offset %d not used in fw key table.\n",
2428 mvmvif->ap_wep_key->hw_key_idx);
2429 return -ENOENT;
2430 }
2431
2432 /* track which key was deleted last */
2433 for (i = 0; i < STA_KEY_MAX_NUM; i++) {
2434 if (mvm->fw_key_deleted[i] < U8_MAX)
2435 mvm->fw_key_deleted[i]++;
2436 }
2437 mvm->fw_key_deleted[mvmvif->ap_wep_key->hw_key_idx] = 0;
2438 ret = __iwl_mvm_remove_sta_key(mvm, mvmvif->mcast_sta.sta_id,
2439 mvmvif->ap_wep_key, true);
2440 if (ret)
2441 return ret;
2442 }
2443
2444 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id); 2409 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id);
2445 if (ret) 2410 if (ret)
2446 IWL_WARN(mvm, "Failed sending remove station\n"); 2411 IWL_WARN(mvm, "Failed sending remove station\n");
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
index 79700c7310a1..b4d4071b865d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
@@ -8,7 +8,7 @@
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH 10 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
11 * Copyright(c) 2018 Intel Corporation 11 * Copyright(c) 2018 - 2019 Intel Corporation
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as 14 * it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH 33 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
34 * Copyright(c) 2018 Intel Corporation 34 * Copyright(c) 2018 - 2019 Intel Corporation
35 * All rights reserved. 35 * All rights reserved.
36 * 36 *
37 * Redistribution and use in source and binary forms, with or without 37 * Redistribution and use in source and binary forms, with or without
@@ -394,7 +394,6 @@ struct iwl_mvm_rxq_dup_data {
394 * the BA window. To be used for UAPSD only. 394 * the BA window. To be used for UAPSD only.
395 * @ptk_pn: per-queue PTK PN data structures 395 * @ptk_pn: per-queue PTK PN data structures
396 * @dup_data: per queue duplicate packet detection data 396 * @dup_data: per queue duplicate packet detection data
397 * @wep_key: used in AP mode. Is a duplicate of the WEP key.
398 * @deferred_traffic_tid_map: indication bitmap of deferred traffic per-TID 397 * @deferred_traffic_tid_map: indication bitmap of deferred traffic per-TID
399 * @tx_ant: the index of the antenna to use for data tx to this station. Only 398 * @tx_ant: the index of the antenna to use for data tx to this station. Only
400 * used during connection establishment (e.g. for the 4 way handshake 399 * used during connection establishment (e.g. for the 4 way handshake
@@ -426,8 +425,6 @@ struct iwl_mvm_sta {
426 struct iwl_mvm_key_pn __rcu *ptk_pn[4]; 425 struct iwl_mvm_key_pn __rcu *ptk_pn[4];
427 struct iwl_mvm_rxq_dup_data *dup_data; 426 struct iwl_mvm_rxq_dup_data *dup_data;
428 427
429 struct ieee80211_key_conf *wep_key;
430
431 u8 reserved_queue; 428 u8 reserved_queue;
432 429
433 /* Temporary, until the new TLC will control the Tx protection */ 430 /* Temporary, until the new TLC will control the Tx protection */