2010-01-16 05:42:59 +08:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
2013-12-30 19:15:54 +08:00
|
|
|
* Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
|
2010-01-16 05:42:59 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of version 2 of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
|
|
|
*
|
|
|
|
* The full GNU General Public License is included in this distribution in the
|
|
|
|
* file called LICENSE.
|
|
|
|
*
|
|
|
|
* Contact Information:
|
|
|
|
* Intel Linux Wireless <ilw@linux.intel.com>
|
|
|
|
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2015-04-07 23:25:14 +08:00
|
|
|
#ifndef __IWLWIFI_DEVICE_TRACE
|
2012-09-06 04:34:44 +08:00
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/ieee80211.h>
|
|
|
|
#include <net/cfg80211.h>
|
|
|
|
#include "iwl-trans.h"
|
|
|
|
#if !defined(__IWLWIFI_DEVICE_TRACE)
|
|
|
|
static inline bool iwl_trace_data(struct sk_buff *skb)
|
|
|
|
{
|
|
|
|
struct ieee80211_hdr *hdr = (void *)skb->data;
|
2013-07-03 00:09:12 +08:00
|
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
2012-09-06 04:34:44 +08:00
|
|
|
|
2013-07-03 00:09:12 +08:00
|
|
|
if (!ieee80211_is_data(hdr->frame_control))
|
|
|
|
return false;
|
|
|
|
return !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO);
|
2012-09-06 04:34:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans,
|
|
|
|
void *rxbuf, size_t len)
|
|
|
|
{
|
|
|
|
struct iwl_cmd_header *cmd = (void *)((u8 *)rxbuf + sizeof(__le32));
|
|
|
|
struct ieee80211_hdr *hdr;
|
|
|
|
|
|
|
|
if (cmd->cmd != trans->rx_mpdu_cmd)
|
|
|
|
return len;
|
|
|
|
|
|
|
|
hdr = (void *)((u8 *)cmd + sizeof(struct iwl_cmd_header) +
|
|
|
|
trans->rx_mpdu_cmd_hdr_size);
|
|
|
|
if (!ieee80211_is_data(hdr->frame_control))
|
|
|
|
return len;
|
|
|
|
/* maybe try to identify EAPOL frames? */
|
|
|
|
return sizeof(__le32) + sizeof(*cmd) + trans->rx_mpdu_cmd_hdr_size +
|
|
|
|
ieee80211_hdrlen(hdr->frame_control);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-10-03 04:44:02 +08:00
|
|
|
#define __IWLWIFI_DEVICE_TRACE
|
|
|
|
|
|
|
|
#include <linux/tracepoint.h>
|
2012-05-15 18:16:34 +08:00
|
|
|
#include <linux/device.h>
|
2012-09-05 06:33:53 +08:00
|
|
|
#include "iwl-trans.h"
|
2009-10-03 04:44:02 +08:00
|
|
|
|
2011-08-26 14:11:14 +08:00
|
|
|
|
2009-10-03 04:44:02 +08:00
|
|
|
#if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__)
|
|
|
|
#undef TRACE_EVENT
|
|
|
|
#define TRACE_EVENT(name, proto, ...) \
|
|
|
|
static inline void trace_ ## name(proto) {}
|
2012-02-01 13:08:37 +08:00
|
|
|
#undef DECLARE_EVENT_CLASS
|
|
|
|
#define DECLARE_EVENT_CLASS(...)
|
|
|
|
#undef DEFINE_EVENT
|
|
|
|
#define DEFINE_EVENT(evt_class, name, proto, ...) \
|
|
|
|
static inline void trace_ ## name(proto) {}
|
2009-10-03 04:44:02 +08:00
|
|
|
#endif
|
|
|
|
|
2012-03-07 05:30:48 +08:00
|
|
|
#define DEV_ENTRY __string(dev, dev_name(dev))
|
|
|
|
#define DEV_ASSIGN __assign_str(dev, dev_name(dev))
|
2009-10-03 04:44:02 +08:00
|
|
|
|
2015-04-07 23:25:14 +08:00
|
|
|
#include "iwl-devtrace-io.h"
|
|
|
|
#include "iwl-devtrace-ucode.h"
|
|
|
|
#include "iwl-devtrace-msg.h"
|
|
|
|
#include "iwl-devtrace-data.h"
|
|
|
|
#include "iwl-devtrace-iwlwifi.h"
|
2009-10-03 04:44:02 +08:00
|
|
|
|
|
|
|
#endif /* __IWLWIFI_DEVICE_TRACE */
|