0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef __IWLWIFI_DEVICE_TRACE
0010 #include <linux/skbuff.h>
0011 #include <linux/ieee80211.h>
0012 #include <net/cfg80211.h>
0013 #include "iwl-trans.h"
0014 #if !defined(__IWLWIFI_DEVICE_TRACE)
0015 static inline bool iwl_trace_data(struct sk_buff *skb)
0016 {
0017 struct ieee80211_hdr *hdr = (void *)skb->data;
0018 __le16 fc = hdr->frame_control;
0019 int offs = 24;
0020
0021 if (!ieee80211_is_data(fc))
0022 return false;
0023
0024
0025
0026
0027
0028
0029
0030 if (ieee80211_has_a4(fc))
0031 offs += 6;
0032 if (ieee80211_is_data_qos(fc))
0033 offs += 2;
0034
0035
0036
0037 offs += 6;
0038
0039 return skb->len <= offs + 2 ||
0040 *(__be16 *)(skb->data + offs) != cpu_to_be16(ETH_P_PAE);
0041 }
0042
0043 static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans,
0044 void *rxbuf, size_t len,
0045 size_t *out_hdr_offset)
0046 {
0047 struct iwl_cmd_header *cmd = (void *)((u8 *)rxbuf + sizeof(__le32));
0048 struct ieee80211_hdr *hdr = NULL;
0049 size_t hdr_offset;
0050
0051 if (cmd->cmd != trans->rx_mpdu_cmd)
0052 return len;
0053
0054 hdr_offset = sizeof(struct iwl_cmd_header) +
0055 trans->rx_mpdu_cmd_hdr_size;
0056
0057 if (out_hdr_offset)
0058 *out_hdr_offset = hdr_offset;
0059
0060 hdr = (void *)((u8 *)cmd + hdr_offset);
0061 if (!ieee80211_is_data(hdr->frame_control))
0062 return len;
0063
0064 return sizeof(__le32) + sizeof(*cmd) + trans->rx_mpdu_cmd_hdr_size +
0065 ieee80211_hdrlen(hdr->frame_control);
0066 }
0067 #endif
0068
0069 #define __IWLWIFI_DEVICE_TRACE
0070
0071 #include <linux/tracepoint.h>
0072 #include <linux/device.h>
0073
0074
0075 #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
0076 #undef TRACE_EVENT
0077 #define TRACE_EVENT(name, proto, ...) \
0078 static inline void trace_ ## name(proto) {}
0079 #undef DECLARE_EVENT_CLASS
0080 #define DECLARE_EVENT_CLASS(...)
0081 #undef DEFINE_EVENT
0082 #define DEFINE_EVENT(evt_class, name, proto, ...) \
0083 static inline void trace_ ## name(proto) {}
0084 #endif
0085
0086 #define DEV_ENTRY __string(dev, dev_name(dev))
0087 #define DEV_ASSIGN __assign_str(dev, dev_name(dev))
0088
0089 #include "iwl-devtrace-io.h"
0090 #include "iwl-devtrace-ucode.h"
0091 #include "iwl-devtrace-msg.h"
0092 #include "iwl-devtrace-data.h"
0093 #include "iwl-devtrace-iwlwifi.h"
0094
0095 #endif