iwlwifi: mvm: add some debug data to TX path
authorSara Sharon <sara.sharon@intel.com>
Mon, 28 Jan 2019 13:12:08 +0000 (15:12 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 20 Feb 2019 18:47:59 +0000 (20:47 +0200)
This helps debugging when things go wrong.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c

index 24556a7..f8928ba 100644 (file)
@@ -941,8 +941,14 @@ void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
                               IWL_PLAT_PM_MODE_DISABLED))) {
                        skb = ieee80211_tx_dequeue(hw, txq);
 
-                       if (!skb)
+                       if (!skb) {
+                               if (txq->sta)
+                                       IWL_DEBUG_TX(mvm,
+                                                    "TXQ of sta %pM tid %d is now empty\n",
+                                                    txq->sta->addr,
+                                                    txq->tid);
                                break;
+                       }
 
                        if (!txq->sta)
                                iwl_mvm_tx_skb_non_sta(mvm, skb);
index d019988..0c2aabc 100644 (file)
@@ -1115,12 +1115,14 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
         */
        if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc)) {
                tid = ieee80211_get_tid(hdr);
-               if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT))
+               if (WARN_ONCE(tid >= IWL_MAX_TID_COUNT, "Invalid TID %d", tid))
                        goto drop_unlock_sta;
 
                is_ampdu = info->flags & IEEE80211_TX_CTL_AMPDU;
-               if (WARN_ON_ONCE(is_ampdu &&
-                                mvmsta->tid_data[tid].state != IWL_AGG_ON))
+               if (WARN_ONCE(is_ampdu &&
+                             mvmsta->tid_data[tid].state != IWL_AGG_ON,
+                             "Invalid internal agg state %d for TID %d",
+                              mvmsta->tid_data[tid].state, tid))
                        goto drop_unlock_sta;
 
                seq_number = mvmsta->tid_data[tid].seq_number;
@@ -1142,7 +1144,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
 
        WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM);
 
-       if (WARN_ON_ONCE(txq_id == IWL_MVM_INVALID_QUEUE)) {
+       if (WARN_ONCE(txq_id == IWL_MVM_INVALID_QUEUE, "Invalid TXQ id")) {
                iwl_trans_free_tx_cmd(mvm->trans, dev_cmd);
                spin_unlock(&mvmsta->lock);
                return 0;
@@ -1192,6 +1194,7 @@ drop_unlock_sta:
        iwl_trans_free_tx_cmd(mvm->trans, dev_cmd);
        spin_unlock(&mvmsta->lock);
 drop:
+       IWL_DEBUG_TX(mvm, "TX to [%d|%d] dropped\n", mvmsta->sta_id, tid);
        return -1;
 }