aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-12-02 03:57:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-14 08:00:16 -0400
commit948634492b4069a208934a64781b85cfa70e198b (patch)
treeb18f4c2d3538d7f5db2571307cf6e3ec2b271b57
parent45dad03aca5596cc8c1ba71b7644b5859377b823 (diff)
iwlwifi: mvm: overwrite skb info later
commit bd05a5bd6b11d7fd26a668de83c5cb996de05f8f upstream. We don't really need clear the skb's status area nor store the dev_cmd into it until we really commit to the frame by handing it to the transport - defer those operations until just before we do that. This doesn't entirely fix the bug with frames not getting sent out after having been deferred due to DQA, because it doesn't restore the info->driver_data[0] place that was already set to zero (or another value) by the A-MSDU logic. Fixes: 24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/tx.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 66957ac12ca4..95b2ec1517e5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -459,7 +459,6 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
459 struct ieee80211_sta *sta, u8 sta_id) 459 struct ieee80211_sta *sta, u8 sta_id)
460{ 460{
461 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 461 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
462 struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
463 struct iwl_device_cmd *dev_cmd; 462 struct iwl_device_cmd *dev_cmd;
464 struct iwl_tx_cmd *tx_cmd; 463 struct iwl_tx_cmd *tx_cmd;
465 464
@@ -479,12 +478,18 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
479 478
480 iwl_mvm_set_tx_cmd_rate(mvm, tx_cmd, info, sta, hdr->frame_control); 479 iwl_mvm_set_tx_cmd_rate(mvm, tx_cmd, info, sta, hdr->frame_control);
481 480
481 return dev_cmd;
482}
483
484static void iwl_mvm_skb_prepare_status(struct sk_buff *skb,
485 struct iwl_device_cmd *cmd)
486{
487 struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
488
482 memset(&skb_info->status, 0, sizeof(skb_info->status)); 489 memset(&skb_info->status, 0, sizeof(skb_info->status));
483 memset(skb_info->driver_data, 0, sizeof(skb_info->driver_data)); 490 memset(skb_info->driver_data, 0, sizeof(skb_info->driver_data));
484 491
485 skb_info->driver_data[1] = dev_cmd; 492 skb_info->driver_data[1] = cmd;
486
487 return dev_cmd;
488} 493}
489 494
490static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, 495static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm,
@@ -598,6 +603,9 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
598 if (!dev_cmd) 603 if (!dev_cmd)
599 return -1; 604 return -1;
600 605
606 /* From now on, we cannot access info->control */
607 iwl_mvm_skb_prepare_status(skb, dev_cmd);
608
601 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload; 609 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload;
602 610
603 /* Copy MAC header from skb into command buffer */ 611 /* Copy MAC header from skb into command buffer */
@@ -908,7 +916,6 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
908 goto drop; 916 goto drop;
909 917
910 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload; 918 tx_cmd = (struct iwl_tx_cmd *)dev_cmd->payload;
911 /* From now on, we cannot access info->control */
912 919
913 /* 920 /*
914 * we handle that entirely ourselves -- for uAPSD the firmware 921 * we handle that entirely ourselves -- for uAPSD the firmware
@@ -1015,6 +1022,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
1015 IWL_DEBUG_TX(mvm, "TX to [%d|%d] Q:%d - seq: 0x%x\n", mvmsta->sta_id, 1022 IWL_DEBUG_TX(mvm, "TX to [%d|%d] Q:%d - seq: 0x%x\n", mvmsta->sta_id,
1016 tid, txq_id, IEEE80211_SEQ_TO_SN(seq_number)); 1023 tid, txq_id, IEEE80211_SEQ_TO_SN(seq_number));
1017 1024
1025 /* From now on, we cannot access info->control */
1026 iwl_mvm_skb_prepare_status(skb, dev_cmd);
1027
1018 if (iwl_trans_tx(mvm->trans, skb, dev_cmd, txq_id)) 1028 if (iwl_trans_tx(mvm->trans, skb, dev_cmd, txq_id))
1019 goto drop_unlock_sta; 1029 goto drop_unlock_sta;
1020 1030