diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2017-09-18 07:08:43 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-09-18 07:08:43 -0400 |
commit | 4c707c04f622a7a8570a8db6389e5a2310b92195 (patch) | |
tree | e4f30c02ed7cd642bb0d6a061a18b434c1d2b695 | |
parent | 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff) | |
parent | 5f90472c00ddf1e64c2865f71cced297bd5f80a2 (diff) |
Merge tag 'iwlwifi-for-kalle-2017-09-15' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
First set of fixes for 4.14
* A couple of bugzilla bugs related to multicast handling;
* Two fixes for WoWLAN bugs that were causing queue hangs and
re-initialization problems;
* Two fixes for potential uninitialized variable use reported by Dan
Carpenter in relation to a recently introduced patch;
* A fix for buffer reordering in the newly supported 9000 device
family;
* Fix a race when starting aggregation;
* Small fix for a recent patch to wake mac80211 queues;
* Send non-bufferable management frames in the generic queue so they
are not sent on queues that are under power-save;
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 10 |
9 files changed, 80 insertions, 17 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 5de19ea10575..b205a7bfb828 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c | |||
@@ -2167,7 +2167,7 @@ out: | |||
2167 | * 1. We are not using a unified image | 2167 | * 1. We are not using a unified image |
2168 | * 2. We are using a unified image but had an error while exiting D3 | 2168 | * 2. We are using a unified image but had an error while exiting D3 |
2169 | */ | 2169 | */ |
2170 | set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); | 2170 | set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); |
2171 | set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status); | 2171 | set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status); |
2172 | /* | 2172 | /* |
2173 | * When switching images we return 1, which causes mac80211 | 2173 | * When switching images we return 1, which causes mac80211 |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 15f2d826bb4b..3bcaa82f59b2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | |||
@@ -1546,6 +1546,11 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac, | |||
1546 | struct iwl_mvm_mc_iter_data *data = _data; | 1546 | struct iwl_mvm_mc_iter_data *data = _data; |
1547 | struct iwl_mvm *mvm = data->mvm; | 1547 | struct iwl_mvm *mvm = data->mvm; |
1548 | struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; | 1548 | struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; |
1549 | struct iwl_host_cmd hcmd = { | ||
1550 | .id = MCAST_FILTER_CMD, | ||
1551 | .flags = CMD_ASYNC, | ||
1552 | .dataflags[0] = IWL_HCMD_DFL_NOCOPY, | ||
1553 | }; | ||
1549 | int ret, len; | 1554 | int ret, len; |
1550 | 1555 | ||
1551 | /* if we don't have free ports, mcast frames will be dropped */ | 1556 | /* if we don't have free ports, mcast frames will be dropped */ |
@@ -1560,7 +1565,10 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac, | |||
1560 | memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN); | 1565 | memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN); |
1561 | len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4); | 1566 | len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4); |
1562 | 1567 | ||
1563 | ret = iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_ASYNC, len, cmd); | 1568 | hcmd.len[0] = len; |
1569 | hcmd.data[0] = cmd; | ||
1570 | |||
1571 | ret = iwl_mvm_send_cmd(mvm, &hcmd); | ||
1564 | if (ret) | 1572 | if (ret) |
1565 | IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); | 1573 | IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); |
1566 | } | 1574 | } |
@@ -1635,6 +1643,12 @@ static void iwl_mvm_configure_filter(struct ieee80211_hw *hw, | |||
1635 | if (!cmd) | 1643 | if (!cmd) |
1636 | goto out; | 1644 | goto out; |
1637 | 1645 | ||
1646 | if (changed_flags & FIF_ALLMULTI) | ||
1647 | cmd->pass_all = !!(*total_flags & FIF_ALLMULTI); | ||
1648 | |||
1649 | if (cmd->pass_all) | ||
1650 | cmd->count = 0; | ||
1651 | |||
1638 | iwl_mvm_recalc_multicast(mvm); | 1652 | iwl_mvm_recalc_multicast(mvm); |
1639 | out: | 1653 | out: |
1640 | mutex_unlock(&mvm->mutex); | 1654 | mutex_unlock(&mvm->mutex); |
@@ -2563,7 +2577,7 @@ static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm, | |||
2563 | * queues, so we should never get a second deferred | 2577 | * queues, so we should never get a second deferred |
2564 | * frame for the RA/TID. | 2578 | * frame for the RA/TID. |
2565 | */ | 2579 | */ |
2566 | iwl_mvm_start_mac_queues(mvm, info->hw_queue); | 2580 | iwl_mvm_start_mac_queues(mvm, BIT(info->hw_queue)); |
2567 | ieee80211_free_txskb(mvm->hw, skb); | 2581 | ieee80211_free_txskb(mvm->hw, skb); |
2568 | } | 2582 | } |
2569 | } | 2583 | } |
@@ -3975,6 +3989,43 @@ out_unlock: | |||
3975 | return ret; | 3989 | return ret; |
3976 | } | 3990 | } |
3977 | 3991 | ||
3992 | static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) | ||
3993 | { | ||
3994 | if (drop) { | ||
3995 | if (iwl_mvm_has_new_tx_api(mvm)) | ||
3996 | /* TODO new tx api */ | ||
3997 | WARN_ONCE(1, | ||
3998 | "Need to implement flush TX queue\n"); | ||
3999 | else | ||
4000 | iwl_mvm_flush_tx_path(mvm, | ||
4001 | iwl_mvm_flushable_queues(mvm) & queues, | ||
4002 | 0); | ||
4003 | } else { | ||
4004 | if (iwl_mvm_has_new_tx_api(mvm)) { | ||
4005 | struct ieee80211_sta *sta; | ||
4006 | int i; | ||
4007 | |||
4008 | mutex_lock(&mvm->mutex); | ||
4009 | |||
4010 | for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { | ||
4011 | sta = rcu_dereference_protected( | ||
4012 | mvm->fw_id_to_mac_id[i], | ||
4013 | lockdep_is_held(&mvm->mutex)); | ||
4014 | if (IS_ERR_OR_NULL(sta)) | ||
4015 | continue; | ||
4016 | |||
4017 | iwl_mvm_wait_sta_queues_empty(mvm, | ||
4018 | iwl_mvm_sta_from_mac80211(sta)); | ||
4019 | } | ||
4020 | |||
4021 | mutex_unlock(&mvm->mutex); | ||
4022 | } else { | ||
4023 | iwl_trans_wait_tx_queues_empty(mvm->trans, | ||
4024 | queues); | ||
4025 | } | ||
4026 | } | ||
4027 | } | ||
4028 | |||
3978 | static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, | 4029 | static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, |
3979 | struct ieee80211_vif *vif, u32 queues, bool drop) | 4030 | struct ieee80211_vif *vif, u32 queues, bool drop) |
3980 | { | 4031 | { |
@@ -3985,7 +4036,12 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, | |||
3985 | int i; | 4036 | int i; |
3986 | u32 msk = 0; | 4037 | u32 msk = 0; |
3987 | 4038 | ||
3988 | if (!vif || vif->type != NL80211_IFTYPE_STATION) | 4039 | if (!vif) { |
4040 | iwl_mvm_flush_no_vif(mvm, queues, drop); | ||
4041 | return; | ||
4042 | } | ||
4043 | |||
4044 | if (vif->type != NL80211_IFTYPE_STATION) | ||
3989 | return; | 4045 | return; |
3990 | 4046 | ||
3991 | /* Make sure we're done with the deferred traffic before flushing */ | 4047 | /* Make sure we're done with the deferred traffic before flushing */ |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c index ba7bd049d3d4..0fe723ca844e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c | |||
@@ -661,7 +661,8 @@ static void rs_tl_turn_on_agg(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, | |||
661 | (lq_sta->tx_agg_tid_en & BIT(tid)) && | 661 | (lq_sta->tx_agg_tid_en & BIT(tid)) && |
662 | (tid_data->tx_count_last >= IWL_MVM_RS_AGG_START_THRESHOLD)) { | 662 | (tid_data->tx_count_last >= IWL_MVM_RS_AGG_START_THRESHOLD)) { |
663 | IWL_DEBUG_RATE(mvm, "try to aggregate tid %d\n", tid); | 663 | IWL_DEBUG_RATE(mvm, "try to aggregate tid %d\n", tid); |
664 | rs_tl_turn_on_agg_for_tid(mvm, lq_sta, tid, sta); | 664 | if (rs_tl_turn_on_agg_for_tid(mvm, lq_sta, tid, sta) == 0) |
665 | tid_data->state = IWL_AGG_QUEUED; | ||
665 | } | 666 | } |
666 | } | 667 | } |
667 | 668 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 67ffd9774712..77f77bc5d083 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | |||
@@ -672,11 +672,12 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm, | |||
672 | * If there was a significant jump in the nssn - adjust. | 672 | * If there was a significant jump in the nssn - adjust. |
673 | * If the SN is smaller than the NSSN it might need to first go into | 673 | * If the SN is smaller than the NSSN it might need to first go into |
674 | * the reorder buffer, in which case we just release up to it and the | 674 | * the reorder buffer, in which case we just release up to it and the |
675 | * rest of the function will take of storing it and releasing up to the | 675 | * rest of the function will take care of storing it and releasing up to |
676 | * nssn | 676 | * the nssn |
677 | */ | 677 | */ |
678 | if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size, | 678 | if (!iwl_mvm_is_sn_less(nssn, buffer->head_sn + buffer->buf_size, |
679 | buffer->buf_size)) { | 679 | buffer->buf_size) || |
680 | !ieee80211_sn_less(sn, buffer->head_sn + buffer->buf_size)) { | ||
680 | u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn; | 681 | u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn; |
681 | 682 | ||
682 | iwl_mvm_release_frames(mvm, sta, napi, buffer, min_sn); | 683 | iwl_mvm_release_frames(mvm, sta, napi, buffer, min_sn); |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 50983615dce6..774122fed454 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c | |||
@@ -555,7 +555,7 @@ static int iwl_mvm_lmac_scan_abort(struct iwl_mvm *mvm) | |||
555 | struct iwl_host_cmd cmd = { | 555 | struct iwl_host_cmd cmd = { |
556 | .id = SCAN_OFFLOAD_ABORT_CMD, | 556 | .id = SCAN_OFFLOAD_ABORT_CMD, |
557 | }; | 557 | }; |
558 | u32 status; | 558 | u32 status = CAN_ABORT_STATUS; |
559 | 559 | ||
560 | ret = iwl_mvm_send_cmd_status(mvm, &cmd, &status); | 560 | ret = iwl_mvm_send_cmd_status(mvm, &cmd, &status); |
561 | if (ret) | 561 | if (ret) |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 411a2055dc45..c4a343534c5e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c | |||
@@ -1285,7 +1285,7 @@ static int iwl_mvm_add_int_sta_common(struct iwl_mvm *mvm, | |||
1285 | { | 1285 | { |
1286 | struct iwl_mvm_add_sta_cmd cmd; | 1286 | struct iwl_mvm_add_sta_cmd cmd; |
1287 | int ret; | 1287 | int ret; |
1288 | u32 status; | 1288 | u32 status = ADD_STA_SUCCESS; |
1289 | 1289 | ||
1290 | lockdep_assert_held(&mvm->mutex); | 1290 | lockdep_assert_held(&mvm->mutex); |
1291 | 1291 | ||
@@ -2385,8 +2385,10 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
2385 | if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) | 2385 | if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) |
2386 | return -EINVAL; | 2386 | return -EINVAL; |
2387 | 2387 | ||
2388 | if (mvmsta->tid_data[tid].state != IWL_AGG_OFF) { | 2388 | if (mvmsta->tid_data[tid].state != IWL_AGG_QUEUED && |
2389 | IWL_ERR(mvm, "Start AGG when state is not IWL_AGG_OFF %d!\n", | 2389 | mvmsta->tid_data[tid].state != IWL_AGG_OFF) { |
2390 | IWL_ERR(mvm, | ||
2391 | "Start AGG when state is not IWL_AGG_QUEUED or IWL_AGG_OFF %d!\n", | ||
2390 | mvmsta->tid_data[tid].state); | 2392 | mvmsta->tid_data[tid].state); |
2391 | return -ENXIO; | 2393 | return -ENXIO; |
2392 | } | 2394 | } |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h index d13893806513..aedabe101cf0 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h | |||
@@ -281,6 +281,7 @@ struct iwl_mvm_vif; | |||
281 | * These states relate to a specific RA / TID. | 281 | * These states relate to a specific RA / TID. |
282 | * | 282 | * |
283 | * @IWL_AGG_OFF: aggregation is not used | 283 | * @IWL_AGG_OFF: aggregation is not used |
284 | * @IWL_AGG_QUEUED: aggregation start work has been queued | ||
284 | * @IWL_AGG_STARTING: aggregation are starting (between start and oper) | 285 | * @IWL_AGG_STARTING: aggregation are starting (between start and oper) |
285 | * @IWL_AGG_ON: aggregation session is up | 286 | * @IWL_AGG_ON: aggregation session is up |
286 | * @IWL_EMPTYING_HW_QUEUE_ADDBA: establishing a BA session - waiting for the | 287 | * @IWL_EMPTYING_HW_QUEUE_ADDBA: establishing a BA session - waiting for the |
@@ -290,6 +291,7 @@ struct iwl_mvm_vif; | |||
290 | */ | 291 | */ |
291 | enum iwl_mvm_agg_state { | 292 | enum iwl_mvm_agg_state { |
292 | IWL_AGG_OFF = 0, | 293 | IWL_AGG_OFF = 0, |
294 | IWL_AGG_QUEUED, | ||
293 | IWL_AGG_STARTING, | 295 | IWL_AGG_STARTING, |
294 | IWL_AGG_ON, | 296 | IWL_AGG_ON, |
295 | IWL_EMPTYING_HW_QUEUE_ADDBA, | 297 | IWL_EMPTYING_HW_QUEUE_ADDBA, |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c index 8876c2abc440..4d907f60bce9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c | |||
@@ -529,6 +529,7 @@ int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 state) | |||
529 | 529 | ||
530 | lockdep_assert_held(&mvm->mutex); | 530 | lockdep_assert_held(&mvm->mutex); |
531 | 531 | ||
532 | status = 0; | ||
532 | ret = iwl_mvm_send_cmd_pdu_status(mvm, WIDE_ID(PHY_OPS_GROUP, | 533 | ret = iwl_mvm_send_cmd_pdu_status(mvm, WIDE_ID(PHY_OPS_GROUP, |
533 | CTDP_CONFIG_CMD), | 534 | CTDP_CONFIG_CMD), |
534 | sizeof(cmd), &cmd, &status); | 535 | sizeof(cmd), &cmd, &status); |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index 172b5e63d3fb..6f2e2af23219 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c | |||
@@ -564,8 +564,8 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, | |||
564 | case NL80211_IFTYPE_AP: | 564 | case NL80211_IFTYPE_AP: |
565 | case NL80211_IFTYPE_ADHOC: | 565 | case NL80211_IFTYPE_ADHOC: |
566 | /* | 566 | /* |
567 | * Handle legacy hostapd as well, where station will be added | 567 | * Non-bufferable frames use the broadcast station, thus they |
568 | * only just before sending the association response. | 568 | * use the probe queue. |
569 | * Also take care of the case where we send a deauth to a | 569 | * Also take care of the case where we send a deauth to a |
570 | * station that we don't have, or similarly an association | 570 | * station that we don't have, or similarly an association |
571 | * response (with non-success status) for a station we can't | 571 | * response (with non-success status) for a station we can't |
@@ -573,9 +573,9 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, | |||
573 | * Also, disassociate frames might happen, particular with | 573 | * Also, disassociate frames might happen, particular with |
574 | * reason 7 ("Class 3 frame received from nonassociated STA"). | 574 | * reason 7 ("Class 3 frame received from nonassociated STA"). |
575 | */ | 575 | */ |
576 | if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc) || | 576 | if (ieee80211_is_mgmt(fc) && |
577 | ieee80211_is_deauth(fc) || ieee80211_is_assoc_resp(fc) || | 577 | (!ieee80211_is_bufferable_mmpdu(fc) || |
578 | ieee80211_is_disassoc(fc)) | 578 | ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) |
579 | return mvm->probe_queue; | 579 | return mvm->probe_queue; |
580 | if (info->hw_queue == info->control.vif->cab_queue) | 580 | if (info->hw_queue == info->control.vif->cab_queue) |
581 | return mvmvif->cab_queue; | 581 | return mvmvif->cab_queue; |