Move struct firmware_image from acx_struct.h to acx_firmware.h
[acx-mac80211.git] / acx_firmware.h
blob16fca14747531ef1422ce51d3fa890b82d166538
1 #ifndef _ACX_FIRMWARE_H_
2 #define _ACX_FIRMWARE_H_
4 /*
5 * acx_firmware.h: firmware-related structures and constants.
7 * Copyright (c) 2008 Francis Galiegue <fgaliegue@gmail.com> for the ACX100
8 * driver project.
10 * This file is licensed under the GPL version 2. See the README file for
11 * details.
15 * The original comments talk about "firmware statistics". I take it this means
16 * that you can read from these structures and gather values.
19 /*
20 * The original comment defined this constant as "a random 100 bytes more to
21 * catch firmware versions which provide a bigger struct".
23 * Err, FIXME! Does that mean that this area could actually be written to beyond
24 * our knowledge???
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 */
142 typedef struct fw_ver {
143 u16 cmd;
144 u16 size;
145 char fw_id[20];
146 u32 hw_id;
147 } __attribute__ ((packed)) fw_ver_t;
149 #define FW_ID_SIZE 20
151 #endif /* _ACX_FIRMWARE_H_ */