| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved. |
|---|
| 4 | | - * Copyright(C) 2016 Intel Deutschland GmbH |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of version 2 of the GNU General Public License as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 11 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 12 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 13 | | - * more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 16 | | - * this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 17 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
|---|
| 18 | | - * |
|---|
| 19 | | - * The full GNU General Public License is included in this distribution in the |
|---|
| 20 | | - * file called LICENSE. |
|---|
| 5 | + * Copyright(C) 2016 Intel Deutschland GmbH |
|---|
| 6 | + * Copyright(c) 2018 Intel Corporation |
|---|
| 21 | 7 | * |
|---|
| 22 | 8 | * Contact Information: |
|---|
| 23 | 9 | * Intel Linux Wireless <linuxwifi@intel.com> |
|---|
| .. | .. |
|---|
| 60 | 46 | } |
|---|
| 61 | 47 | |
|---|
| 62 | 48 | static inline size_t iwl_rx_trace_len(const struct iwl_trans *trans, |
|---|
| 63 | | - void *rxbuf, size_t len) |
|---|
| 49 | + void *rxbuf, size_t len, |
|---|
| 50 | + size_t *out_hdr_offset) |
|---|
| 64 | 51 | { |
|---|
| 65 | 52 | struct iwl_cmd_header *cmd = (void *)((u8 *)rxbuf + sizeof(__le32)); |
|---|
| 66 | | - struct ieee80211_hdr *hdr; |
|---|
| 53 | + struct ieee80211_hdr *hdr = NULL; |
|---|
| 54 | + size_t hdr_offset; |
|---|
| 67 | 55 | |
|---|
| 68 | 56 | if (cmd->cmd != trans->rx_mpdu_cmd) |
|---|
| 69 | 57 | return len; |
|---|
| 70 | 58 | |
|---|
| 71 | | - hdr = (void *)((u8 *)cmd + sizeof(struct iwl_cmd_header) + |
|---|
| 72 | | - trans->rx_mpdu_cmd_hdr_size); |
|---|
| 59 | + hdr_offset = sizeof(struct iwl_cmd_header) + |
|---|
| 60 | + trans->rx_mpdu_cmd_hdr_size; |
|---|
| 61 | + |
|---|
| 62 | + if (out_hdr_offset) |
|---|
| 63 | + *out_hdr_offset = hdr_offset; |
|---|
| 64 | + |
|---|
| 65 | + hdr = (void *)((u8 *)cmd + hdr_offset); |
|---|
| 73 | 66 | if (!ieee80211_is_data(hdr->frame_control)) |
|---|
| 74 | 67 | return len; |
|---|
| 75 | 68 | /* maybe try to identify EAPOL frames? */ |
|---|
| .. | .. |
|---|
| 82 | 75 | |
|---|
| 83 | 76 | #include <linux/tracepoint.h> |
|---|
| 84 | 77 | #include <linux/device.h> |
|---|
| 85 | | -#include "iwl-trans.h" |
|---|
| 86 | 78 | |
|---|
| 87 | 79 | |
|---|
| 88 | 80 | #if !defined(CONFIG_IWLWIFI_DEVICE_TRACING) || defined(__CHECKER__) |
|---|