aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
index f4d3cd010087..545d14b0bc92 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
@@ -1,6 +1,7 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. 3 * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(C) 2016 Intel Deutschland GmbH
4 * 5 *
5 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 7 * under the terms of version 2 of the GNU General Public License as
@@ -33,11 +34,29 @@
33static inline bool iwl_trace_data(struct sk_buff *skb) 34static inline bool iwl_trace_data(struct sk_buff *skb)
34{ 35{
35 struct ieee80211_hdr *hdr = (void *)skb->data; 36 struct ieee80211_hdr *hdr = (void *)skb->data;
36 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 37 __le16 fc = hdr->frame_control;
38 int offs = 24; /* start with normal header length */
37 39
38 if (!ieee80211_is_data(hdr->frame_control)) 40 if (!ieee80211_is_data(fc))
39 return false; 41 return false;
40 return !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO); 42
43 /* Try to determine if the frame is EAPOL. This might have false
44 * positives (if there's no RFC 1042 header and we compare to some
45 * payload instead) but since we're only doing tracing that's not
46 * a problem.
47 */
48
49 if (ieee80211_has_a4(fc))
50 offs += 6;
51 if (ieee80211_is_data_qos(fc))
52 offs += 2;
53 /* don't account for crypto - these are unencrypted */
54
55 /* also account for the RFC 1042 header, of course */
56 offs += 6;
57
58 return skb->len > offs + 2 &&
59 *(__be16 *)(skb->data + offs) == cpu_to_be16(ETH_P_PAE);
41} 60}
42 61
43static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans, 62static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans,