wifi: iwlwifi: trace full frames with TX status request
authorJohannes Berg <johannes.berg@intel.com>
Sun, 22 Oct 2023 14:55:52 +0000 (17:55 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 10:49:30 +0000 (12:49 +0200)
If upper layers requested a TX status, then the frames are
more important, so trace frames in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.0dfb60a2eaec.I3c3e46ed0eb05700a4d05d293f80d727354a402f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h

index 1455b578358bf87c1a994a5626462e1104428cab..01fb7b900a6d34367be6ecb4ebcb5848f0312049 100644 (file)
@@ -3,17 +3,19 @@
  *
  * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
  * Copyright(C) 2016        Intel Deutschland GmbH
- * Copyright(c) 2018        Intel Corporation
+ * Copyright(c) 2018, 2023  Intel Corporation
  *****************************************************************************/
 
 #ifndef __IWLWIFI_DEVICE_TRACE
 #include <linux/skbuff.h>
 #include <linux/ieee80211.h>
 #include <net/cfg80211.h>
+#include <net/mac80211.h>
 #include "iwl-trans.h"
 #if !defined(__IWLWIFI_DEVICE_TRACE)
 static inline bool iwl_trace_data(struct sk_buff *skb)
 {
+       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        struct ieee80211_hdr *hdr = (void *)skb->data;
        __le16 fc = hdr->frame_control;
        int offs = 24; /* start with normal header length */
@@ -21,6 +23,10 @@ static inline bool iwl_trace_data(struct sk_buff *skb)
        if (!ieee80211_is_data(fc))
                return false;
 
+       /* If upper layers wanted TX status it's an important frame */
+       if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS)
+               return false;
+
        /* Try to determine if the frame is EAPOL. This might have false
         * positives (if there's no RFC 1042 header and we compare to some
         * payload instead) but since we're only doing tracing that's not