1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
4 <http://rt2x00.serialmonkey.com>
11 Data structures for the rt2x00debug & userspace.
13 The declarations in this file can be used by both rt2x00
14 and userspace and therefore should be kept together in
24 * This header is intended to be exported to userspace,
25 * to make the structures and enumerations available to userspace
26 * applications. This means that all data types should be exportable.
28 * When rt2x00 is compiled with debugfs support enabled,
29 * it is possible to capture all data coming in and out of the device
30 * by reading the frame dump file. This file can have only a single reader.
31 * The following frames will be reported:
32 * - All incoming frames (rx)
33 * - All outgoing frames (tx, including beacon and atim)
34 * - All completed frames (txdone including atim)
36 * The data is send to the file using the following format:
38 * [rt2x00dump header][hardware descriptor][ieee802.11 frame]
40 * rt2x00dump header: The description of the dumped frame, as well as
41 * additional information useful for debugging. See &rt2x00dump_hdr.
42 * hardware descriptor: Descriptor that was used to receive or transmit
44 * ieee802.11 frame: The actual frame that was received or transmitted.
48 * enum rt2x00_dump_type - Frame type
50 * These values are used for the @type member of &rt2x00dump_hdr.
51 * @DUMP_FRAME_RXDONE: This frame has been received by the hardware.
52 * @DUMP_FRAME_TX: This frame is queued for transmission to the hardware.
53 * @DUMP_FRAME_TXDONE: This frame indicates the device has handled
54 * the tx event which has either succeeded or failed. A frame
55 * with this type should also have been reported with as a
56 * %DUMP_FRAME_TX frame.
57 * @DUMP_FRAME_BEACON: This beacon frame is queued for transmission to the
60 enum rt2x00_dump_type
{
61 DUMP_FRAME_RXDONE
= 1,
63 DUMP_FRAME_TXDONE
= 3,
64 DUMP_FRAME_BEACON
= 4,
68 * struct rt2x00dump_hdr - Dump frame header
70 * Each frame dumped to the debugfs file starts with this header
71 * attached. This header contains the description of the actual
72 * frame which was dumped.
74 * New fields inside the structure must be appended to the end of
75 * the structure. This way userspace tools compiled for earlier
76 * header versions can still correctly handle the frame dump
77 * (although they will not handle all data passed to them in the dump).
79 * @version: Header version should always be set to %DUMP_HEADER_VERSION.
80 * This field must be checked by userspace to determine if it can
82 * @header_length: The length of the &rt2x00dump_hdr structure. This is
83 * used for compatibility reasons so userspace can easily determine
84 * the location of the next field in the dump.
85 * @desc_length: The length of the device descriptor.
86 * @data_length: The length of the frame data (including the ieee802.11 header.
87 * @chip_rt: RT chipset
88 * @chip_rf: RF chipset
89 * @chip_rev: Chipset revision
90 * @type: The frame type (&rt2x00_dump_type)
91 * @queue_index: The index number of the data queue.
92 * @entry_index: The index number of the entry inside the data queue.
93 * @timestamp_sec: Timestamp - seconds
94 * @timestamp_usec: Timestamp - microseconds
96 struct rt2x00dump_hdr
{
98 #define DUMP_HEADER_VERSION 3
100 __le32 header_length
;
112 __le32 timestamp_sec
;
113 __le32 timestamp_usec
;
116 #endif /* RT2X00DUMP_H */