powerpc/eeh: Fix PE#0 check in eeh_add_to_parent_pe()
[linux/fpc-iii.git] / drivers / net / wireless / iwlwifi / iwl-fw-error-dump.h
blob919a2548a92c5dca064258c437cdb8e59ade42db
1 /******************************************************************************
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
6 * GPL LICENSE SUMMARY
8 * Copyright(c) 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2014 Intel Mobile Communications GmbH
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
23 * USA
25 * The full GNU General Public License is included in this distribution
26 * in the file called COPYING.
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 * BSD LICENSE
34 * Copyright(c) 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2014 Intel Mobile Communications GmbH
36 * All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
47 * distribution.
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 *****************************************************************************/
65 #ifndef __fw_error_dump_h__
66 #define __fw_error_dump_h__
68 #include <linux/types.h>
70 #define IWL_FW_ERROR_DUMP_BARKER 0x14789632
72 /**
73 * enum iwl_fw_error_dump_type - types of data in the dump file
74 * @IWL_FW_ERROR_DUMP_CSR: Control Status Registers - from offset 0
75 * @IWL_FW_ERROR_DUMP_RXF:
76 * @IWL_FW_ERROR_DUMP_TXCMD: last TX command data, structured as
77 * &struct iwl_fw_error_dump_txcmd packets
78 * @IWL_FW_ERROR_DUMP_DEV_FW_INFO: struct %iwl_fw_error_dump_info
79 * info on the device / firmware.
80 * @IWL_FW_ERROR_DUMP_FW_MONITOR: firmware monitor
81 * @IWL_FW_ERROR_DUMP_PRPH: range of periphery registers - there can be several
82 * sections like this in a single file.
83 * @IWL_FW_ERROR_DUMP_FH_REGS: range of FH registers
84 * @IWL_FW_ERROR_DUMP_MEM: chunk of memory
86 enum iwl_fw_error_dump_type {
87 /* 0 is deprecated */
88 IWL_FW_ERROR_DUMP_CSR = 1,
89 IWL_FW_ERROR_DUMP_RXF = 2,
90 IWL_FW_ERROR_DUMP_TXCMD = 3,
91 IWL_FW_ERROR_DUMP_DEV_FW_INFO = 4,
92 IWL_FW_ERROR_DUMP_FW_MONITOR = 5,
93 IWL_FW_ERROR_DUMP_PRPH = 6,
94 IWL_FW_ERROR_DUMP_TXF = 7,
95 IWL_FW_ERROR_DUMP_FH_REGS = 8,
96 IWL_FW_ERROR_DUMP_MEM = 9,
98 IWL_FW_ERROR_DUMP_MAX,
102 * struct iwl_fw_error_dump_data - data for one type
103 * @type: %enum iwl_fw_error_dump_type
104 * @len: the length starting from %data
105 * @data: the data itself
107 struct iwl_fw_error_dump_data {
108 __le32 type;
109 __le32 len;
110 __u8 data[];
111 } __packed;
114 * struct iwl_fw_error_dump_file - the layout of the header of the file
115 * @barker: must be %IWL_FW_ERROR_DUMP_BARKER
116 * @file_len: the length of all the file starting from %barker
117 * @data: array of %struct iwl_fw_error_dump_data
119 struct iwl_fw_error_dump_file {
120 __le32 barker;
121 __le32 file_len;
122 u8 data[0];
123 } __packed;
126 * struct iwl_fw_error_dump_txcmd - TX command data
127 * @cmdlen: original length of command
128 * @caplen: captured length of command (may be less)
129 * @data: captured command data, @caplen bytes
131 struct iwl_fw_error_dump_txcmd {
132 __le32 cmdlen;
133 __le32 caplen;
134 u8 data[];
135 } __packed;
138 * struct iwl_fw_error_dump_fifo - RX/TX FIFO data
139 * @fifo_num: number of FIFO (starting from 0)
140 * @available_bytes: num of bytes available in FIFO (may be less than FIFO size)
141 * @wr_ptr: position of write pointer
142 * @rd_ptr: position of read pointer
143 * @fence_ptr: position of fence pointer
144 * @fence_mode: the current mode of the fence (before locking) -
145 * 0=follow RD pointer ; 1 = freeze
146 * @data: all of the FIFO's data
148 struct iwl_fw_error_dump_fifo {
149 __le32 fifo_num;
150 __le32 available_bytes;
151 __le32 wr_ptr;
152 __le32 rd_ptr;
153 __le32 fence_ptr;
154 __le32 fence_mode;
155 u8 data[];
156 } __packed;
158 enum iwl_fw_error_dump_family {
159 IWL_FW_ERROR_DUMP_FAMILY_7 = 7,
160 IWL_FW_ERROR_DUMP_FAMILY_8 = 8,
164 * struct iwl_fw_error_dump_info - info on the device / firmware
165 * @device_family: the family of the device (7 / 8)
166 * @hw_step: the step of the device
167 * @fw_human_readable: human readable FW version
168 * @dev_human_readable: name of the device
169 * @bus_human_readable: name of the bus used
171 struct iwl_fw_error_dump_info {
172 __le32 device_family;
173 __le32 hw_step;
174 u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ];
175 u8 dev_human_readable[64];
176 u8 bus_human_readable[8];
177 } __packed;
180 * struct iwl_fw_error_dump_fw_mon - FW monitor data
181 * @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer
182 * @fw_mon_base_ptr: base pointer of the data
183 * @fw_mon_cycle_cnt: number of wrap arounds
184 * @reserved: for future use
185 * @data: captured data
187 struct iwl_fw_error_dump_fw_mon {
188 __le32 fw_mon_wr_ptr;
189 __le32 fw_mon_base_ptr;
190 __le32 fw_mon_cycle_cnt;
191 __le32 reserved[3];
192 u8 data[];
193 } __packed;
196 * struct iwl_fw_error_dump_prph - periphery registers data
197 * @prph_start: address of the first register in this chunk
198 * @data: the content of the registers
200 struct iwl_fw_error_dump_prph {
201 __le32 prph_start;
202 __le32 data[];
205 enum iwl_fw_error_dump_mem_type {
206 IWL_FW_ERROR_DUMP_MEM_SRAM,
207 IWL_FW_ERROR_DUMP_MEM_SMEM,
211 * struct iwl_fw_error_dump_mem - chunk of memory
212 * @type: %enum iwl_fw_error_dump_mem_type
213 * @offset: the offset from which the memory was read
214 * @data: the content of the memory
216 struct iwl_fw_error_dump_mem {
217 __le32 type;
218 __le32 offset;
219 u8 data[];
223 * iwl_fw_error_next_data - advance fw error dump data pointer
224 * @data: previous data block
225 * Returns: next data block
227 static inline struct iwl_fw_error_dump_data *
228 iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data)
230 return (void *)(data->data + le32_to_cpu(data->len));
233 #endif /* __fw_error_dump_h__ */