Cleanups, Changelog additions, new release numbering scheme
[acx-mac80211.git] / acx_firmware.h
bloba49511cd2d52cf2b256a49d585bbbd92a4b83c2f
1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
3 * The ACX100 Open Source Project <acx100-devel@lists.sourceforge.net>
4 * Copyright (C) 2008 Francis Galiegue <fgaliegue@gmail.com> for the ACX100
5 * driver project.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * Firmware statistics
22 #ifndef _ACX_FIRMWARE_H_
23 #define _ACX_FIRMWARE_H_
25 /* Define a random 100 bytes more to catch firmware versions which
26 * provide a bigger struct */
27 #define FW_STATS_FUTURE_EXTENSION 100
29 typedef struct firmware_image {
30 u32 chksum;
31 u32 size;
32 u8 data[1]; /* the byte array of the actual firmware... */
33 } __attribute__ ((packed)) firmware_image_t;
35 typedef struct fw_stats_tx {
36 u32 tx_desc_of;
37 } __attribute__ ((packed)) fw_stats_tx_t;
39 typedef struct fw_stats_rx {
40 u32 rx_oom;
41 u32 rx_hdr_of;
42 u32 rx_hw_stuck; /* old: u32 rx_hdr_use_next */
43 u32 rx_dropped_frame;
44 u32 rx_frame_ptr_err;
45 u32 rx_xfr_hint_trig;
46 u32 rx_aci_events; /* later versions only */
47 u32 rx_aci_resets; /* later versions only */
48 } __attribute__ ((packed)) fw_stats_rx_t;
50 typedef struct fw_stats_dma {
51 u32 rx_dma_req;
52 u32 rx_dma_err;
53 u32 tx_dma_req;
54 u32 tx_dma_err;
55 } __attribute__ ((packed)) fw_stats_dma_t;
57 typedef struct fw_stats_irq {
58 u32 cmd_cplt;
59 u32 fiq;
60 u32 rx_hdrs;
61 u32 rx_cmplt;
62 u32 rx_mem_of;
63 u32 rx_rdys;
64 u32 irqs;
65 u32 tx_procs;
66 u32 decrypt_done;
67 u32 dma_0_done;
68 u32 dma_1_done;
69 u32 tx_exch_complet;
70 u32 commands;
71 u32 rx_procs;
72 u32 hw_pm_mode_changes;
73 u32 host_acks;
74 u32 pci_pm;
75 u32 acm_wakeups;
76 } __attribute__ ((packed)) fw_stats_irq_t;
78 typedef struct fw_stats_wep {
79 u32 wep_key_count;
80 u32 wep_default_key_count;
81 u32 dot11_def_key_mib;
82 u32 wep_key_not_found;
83 u32 wep_decrypt_fail;
84 u32 wep_pkt_decrypt;
85 u32 wep_decrypt_irqs;
86 } __attribute__ ((packed)) fw_stats_wep_t;
88 typedef struct fw_stats_pwr {
89 u32 tx_start_ctr;
90 u32 no_ps_tx_too_short;
91 u32 rx_start_ctr;
92 u32 no_ps_rx_too_short;
93 u32 lppd_started;
94 u32 no_lppd_too_noisy;
95 u32 no_lppd_too_short;
96 u32 no_lppd_matching_frame;
97 } __attribute__ ((packed)) fw_stats_pwr_t;
99 typedef struct fw_stats_mic {
100 u32 mic_rx_pkts;
101 u32 mic_calc_fail;
102 } __attribute__ ((packed)) fw_stats_mic_t;
104 typedef struct fw_stats_aes {
105 u32 aes_enc_fail;
106 u32 aes_dec_fail;
107 u32 aes_enc_pkts;
108 u32 aes_dec_pkts;
109 u32 aes_enc_irq;
110 u32 aes_dec_irq;
111 } __attribute__ ((packed)) fw_stats_aes_t;
113 typedef struct fw_stats_event {
114 u32 heartbeat;
115 u32 calibration;
116 u32 rx_mismatch;
117 u32 rx_mem_empty;
118 u32 rx_pool;
119 u32 oom_late;
120 u32 phy_tx_err;
121 u32 tx_stuck;
122 } __attribute__ ((packed)) fw_stats_event_t;
124 /* Mainly for size calculation only */
125 typedef struct fw_stats {
126 u16 type;
127 u16 len;
128 fw_stats_tx_t tx;
129 fw_stats_rx_t rx;
130 fw_stats_dma_t dma;
131 fw_stats_irq_t irq;
132 fw_stats_wep_t wep;
133 fw_stats_pwr_t pwr;
134 fw_stats_mic_t mic;
135 fw_stats_aes_t aes;
136 fw_stats_event_t evt;
137 u8 _padding[FW_STATS_FUTURE_EXTENSION];
138 } fw_stats_t;
140 /* Firmware version struct */
141 typedef struct fw_ver {
142 u16 cmd;
143 u16 size;
144 char fw_id[20];
145 u32 hw_id;
146 } __attribute__ ((packed)) fw_ver_t;
148 #define FW_ID_SIZE 20
150 #endif /* _ACX_FIRMWARE_H_ */