Skip to content

Commit 4c707c0

Browse files
author
Kalle Valo
committed
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;
2 parents 2bd6bf0 + 5f90472 commit 4c707c0

File tree

9 files changed

+80
-17
lines changed

9 files changed

+80
-17
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/d3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test)
21672167
* 1. We are not using a unified image
21682168
* 2. We are using a unified image but had an error while exiting D3
21692169
*/
2170-
set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status);
2170+
set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status);
21712171
set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status);
21722172
/*
21732173
* When switching images we return 1, which causes mac80211

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,11 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
15461546
struct iwl_mvm_mc_iter_data *data = _data;
15471547
struct iwl_mvm *mvm = data->mvm;
15481548
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+
};
15491554
int ret, len;
15501555

15511556
/* 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,
15601565
memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN);
15611566
len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4);
15621567

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);
15641572
if (ret)
15651573
IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret);
15661574
}
@@ -1635,6 +1643,12 @@ static void iwl_mvm_configure_filter(struct ieee80211_hw *hw,
16351643
if (!cmd)
16361644
goto out;
16371645

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+
16381652
iwl_mvm_recalc_multicast(mvm);
16391653
out:
16401654
mutex_unlock(&mvm->mutex);
@@ -2563,7 +2577,7 @@ static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm,
25632577
* queues, so we should never get a second deferred
25642578
* frame for the RA/TID.
25652579
*/
2566-
iwl_mvm_start_mac_queues(mvm, info->hw_queue);
2580+
iwl_mvm_start_mac_queues(mvm, BIT(info->hw_queue));
25672581
ieee80211_free_txskb(mvm->hw, skb);
25682582
}
25692583
}
@@ -3975,6 +3989,43 @@ static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
39753989
return ret;
39763990
}
39773991

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+
39784029
static void iwl_mvm_mac_flush(struct ieee80211_hw *hw,
39794030
struct ieee80211_vif *vif, u32 queues, bool drop)
39804031
{
@@ -3985,7 +4036,12 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw,
39854036
int i;
39864037
u32 msk = 0;
39874038

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)
39894045
return;
39904046

39914047
/* Make sure we're done with the deferred traffic before flushing */

drivers/net/wireless/intel/iwlwifi/mvm/rs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,8 @@ static void rs_tl_turn_on_agg(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
661661
(lq_sta->tx_agg_tid_en & BIT(tid)) &&
662662
(tid_data->tx_count_last >= IWL_MVM_RS_AGG_START_THRESHOLD)) {
663663
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;
665666
}
666667
}
667668

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,12 @@ static bool iwl_mvm_reorder(struct iwl_mvm *mvm,
672672
* If there was a significant jump in the nssn - adjust.
673673
* If the SN is smaller than the NSSN it might need to first go into
674674
* 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
676-
* nssn
675+
* rest of the function will take care of storing it and releasing up to
676+
* the nssn
677677
*/
678678
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)) {
680681
u16 min_sn = ieee80211_sn_less(sn, nssn) ? sn : nssn;
681682

682683
iwl_mvm_release_frames(mvm, sta, napi, buffer, min_sn);

drivers/net/wireless/intel/iwlwifi/mvm/scan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static int iwl_mvm_lmac_scan_abort(struct iwl_mvm *mvm)
555555
struct iwl_host_cmd cmd = {
556556
.id = SCAN_OFFLOAD_ABORT_CMD,
557557
};
558-
u32 status;
558+
u32 status = CAN_ABORT_STATUS;
559559

560560
ret = iwl_mvm_send_cmd_status(mvm, &cmd, &status);
561561
if (ret)

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ static int iwl_mvm_add_int_sta_common(struct iwl_mvm *mvm,
12851285
{
12861286
struct iwl_mvm_add_sta_cmd cmd;
12871287
int ret;
1288-
u32 status;
1288+
u32 status = ADD_STA_SUCCESS;
12891289

12901290
lockdep_assert_held(&mvm->mutex);
12911291

@@ -2385,8 +2385,10 @@ int iwl_mvm_sta_tx_agg_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
23852385
if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT))
23862386
return -EINVAL;
23872387

2388-
if (mvmsta->tid_data[tid].state != IWL_AGG_OFF) {
2389-
IWL_ERR(mvm, "Start AGG when state is not IWL_AGG_OFF %d!\n",
2388+
if (mvmsta->tid_data[tid].state != IWL_AGG_QUEUED &&
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",
23902392
mvmsta->tid_data[tid].state);
23912393
return -ENXIO;
23922394
}

drivers/net/wireless/intel/iwlwifi/mvm/sta.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ struct iwl_mvm_vif;
281281
* These states relate to a specific RA / TID.
282282
*
283283
* @IWL_AGG_OFF: aggregation is not used
284+
* @IWL_AGG_QUEUED: aggregation start work has been queued
284285
* @IWL_AGG_STARTING: aggregation are starting (between start and oper)
285286
* @IWL_AGG_ON: aggregation session is up
286287
* @IWL_EMPTYING_HW_QUEUE_ADDBA: establishing a BA session - waiting for the
@@ -290,6 +291,7 @@ struct iwl_mvm_vif;
290291
*/
291292
enum iwl_mvm_agg_state {
292293
IWL_AGG_OFF = 0,
294+
IWL_AGG_QUEUED,
293295
IWL_AGG_STARTING,
294296
IWL_AGG_ON,
295297
IWL_EMPTYING_HW_QUEUE_ADDBA,

drivers/net/wireless/intel/iwlwifi/mvm/tt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ int iwl_mvm_ctdp_command(struct iwl_mvm *mvm, u32 op, u32 state)
529529

530530
lockdep_assert_held(&mvm->mutex);
531531

532+
status = 0;
532533
ret = iwl_mvm_send_cmd_pdu_status(mvm, WIDE_ID(PHY_OPS_GROUP,
533534
CTDP_CONFIG_CMD),
534535
sizeof(cmd), &cmd, &status);

drivers/net/wireless/intel/iwlwifi/mvm/tx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,18 @@ static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
564564
case NL80211_IFTYPE_AP:
565565
case NL80211_IFTYPE_ADHOC:
566566
/*
567-
* Handle legacy hostapd as well, where station will be added
568-
* only just before sending the association response.
567+
* Non-bufferable frames use the broadcast station, thus they
568+
* use the probe queue.
569569
* Also take care of the case where we send a deauth to a
570570
* station that we don't have, or similarly an association
571571
* response (with non-success status) for a station we can't
572572
* accept.
573573
* Also, disassociate frames might happen, particular with
574574
* reason 7 ("Class 3 frame received from nonassociated STA").
575575
*/
576-
if (ieee80211_is_probe_resp(fc) || ieee80211_is_auth(fc) ||
577-
ieee80211_is_deauth(fc) || ieee80211_is_assoc_resp(fc) ||
578-
ieee80211_is_disassoc(fc))
576+
if (ieee80211_is_mgmt(fc) &&
577+
(!ieee80211_is_bufferable_mmpdu(fc) ||
578+
ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc)))
579579
return mvm->probe_queue;
580580
if (info->hw_queue == info->control.vif->cab_queue)
581581
return mvmvif->cab_queue;

0 commit comments

Comments
 (0)