aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
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/mac80211.c
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/mac80211.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c71
1 files changed, 22 insertions, 49 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;