Broadcom SDK and wireless driver: another attempt to update to ver. 5.10.147.0
[tomato.git] / release / src-rt / include / wllmacctl.h
blob53a95998f6bf67118137e22531e7fd0bf792789f
1 /*
2 * LMAC API definitions for
3 * Broadcom 802.11abg Networking Device Driver
5 * Definitions subject to change without notice.
7 * Copyright (C) 2009, Broadcom Corporation
8 * All Rights Reserved.
9 *
10 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
15 * $Id: wllmacctl.h,v 13.17 2008/02/13 04:00:11 Exp $:
18 #ifndef _wllmacctl_h_
19 #define _wllmacctl_h_
21 #include <typedefs.h>
22 #include <proto/ethernet.h>
23 #include <proto/bcmeth.h>
24 #include <proto/bcmevent.h>
25 #include <proto/802.11.h>
27 /* Init/Configure response */
29 typedef struct {
30 uint8 vec[32]; /* bitvec of channels */
31 } lmacchanvec_t;
33 #define LMAC_CAP_MAGIC 0xdeadbeef
34 #define LMAC_VERSION_BUF_SIZE 64
36 typedef struct wl_lmac_cap {
37 uint32 magic;
38 uint32 hwrates;
39 uint8 scan_ssid;
40 uint8 bands; /* bands */
41 uint8 nmulticast;
42 uint8 nratefallbackclasses;
43 uint16 ssid_buffer_len;
44 uint16 rxpacketflags;
45 struct {
46 int32 max_dBm;
47 int32 min_dBm;
48 uint32 step_dB;
49 } txpower[3];
50 uint32 capabilities;
51 uint16 max_txbuffers;
52 uint16 max_rxbuffers;
54 wlc_rev_info_t lmac_rev_info;
55 uint32 radioid[2];
56 lmacchanvec_t sup_chan[2];
57 char lmac_version[LMAC_VERSION_BUF_SIZE];
58 } wl_lmac_cap_t;
60 /* rateset defines */
61 #define LMAC_RATE_1M 0x00000001
62 #define LMAC_RATE_2M 0x00000002
63 #define LMAC_RATE_5M5 0x00000004
64 #define LMAC_RATE_6M 0x00000008
65 #define LMAC_RATE_9M 0x00000010
66 #define LMAC_RATE_11M 0x00000020
67 #define LMAC_RATE_12M 0x00000040
68 #define LMAC_RATE_18M 0x00000080
69 #define LMAC_RATE_22M 0x00000100
70 #define LMAC_RATE_24M 0x00000200
71 #define LMAC_RATE_33M 0x00000400
72 #define LMAC_RATE_36M 0x00000800
73 #define LMAC_RATE_48M 0x00001000
74 #define LMAC_RATE_54M 0x00002000
76 /* LMAC capabilities */
77 #define LMAC_CAP_MAXRXLIFETIME_AC 0x00000001
78 #define LMAC_CAP_IBSS_PS 0x00000002
79 #define LMAC_CAP_TRUNCATE_TXPOLICY 0x00000004
80 #define LMAC_CAP_PREAMBLE_OVERRIDE 0x00000008
81 #define LMAC_CAP_TXPWR_SENDPKT 0x00000010
82 #define LMAC_CAP_EXPIRY_TXPACKET 0x00000020
83 #define LMAC_CAP_PROBEFOR_JOIN 0x00000040
84 #define LMAC_CAP_MAXLIFETIME_Q 0x00000080
85 #define LMAC_CAP_TXNOACK_Q 0x00000100
86 #define LMAC_CAP_BLOCKACK_Q 0x00000200
87 #define LMAC_CAP_DOT11SLOTTIME 0x00000400
88 #define LMAC_CAP_WMM_SA 0x00000800
89 #define LMAC_CAP_SAPSD 0x00001000
90 #define LMAC_CAP_RM 0x00002000
91 #define LMAC_CAP_LEGACY_PSPOLL_Q 0x00004000
92 #define LMAC_CAP_WEP128 0x00008000
93 #define LMAC_CAP_MOREDATA_ACK 0x00010000
94 #define LMAC_CAP_SCAN_MINMAX_TIME 0x00020000
95 #define LMAC_CAP_TXAUTORATE 0x00040000
96 #define LMAC_CAP_HT 0x00080000
97 #define LMAC_CAP_STA 0x80000000 /* (BRCM) STA functions included */
99 /* LMAC Join params */
100 #define WLC_LMAC_JOIN_MODE_IBSS 0
101 #define WLC_LMAC_JOIN_MODE_BSS 1
103 /* Note: order of fields is chosen carefully for proper alignment */
104 typedef struct wl_lmac_join_params {
105 uint32 mode;
106 uint32 basic_rates;
107 uint32 beacon_interval; /* TUs */
108 uint16 atim_window;
109 struct ether_addr bssid;
110 uint8 band;
111 uint8 channel;
112 uint8 preamble;
113 uint8 SSID_len;
114 uint8 SSID[32];
115 uint8 probe_for_join;
116 } wl_lmac_join_params_t;
118 typedef struct wl_lmac_bss_params {
119 uint16 aid;
120 uint8 dtim_interval;
121 } wl_lmac_bss_params_t;
123 typedef enum queue_id {
124 Q_BE = 0,
125 Q_BK,
126 Q_VI,
127 Q_VO,
128 Q_HCCA
129 } queue_id_t;
131 typedef enum ps_scheme {
132 PS_REGULAR = 0,
133 PS_UAPSD,
134 PS_LEGACY_PSPOLL,
135 PS_SAPSD
136 } ps_scheme_t;
138 typedef enum ack_policy {
139 ACKP_NORMAL = 0,
140 ACKP_NOACK,
141 ACKP_BLOCKACK
142 } ack_policy_t;
144 typedef struct wl_lmac_conf_q {
145 queue_id_t qid;
146 ack_policy_t ack;
147 ps_scheme_t ps;
148 uint8 pad;
150 uint32 maxtxlifetime; /* usec */
151 struct {
152 uint32 start_time;
153 uint32 interval;
154 } sapsd_conf;
155 uint16 mediumtime;
156 } wl_lmac_conf_q_t;
158 typedef struct wl_lmac_conf_ac {
159 uint16 cwmin[AC_COUNT];
160 uint16 cwmax[AC_COUNT];
161 uint8 aifs[AC_COUNT];
162 uint16 txop[AC_COUNT];
163 uint16 max_rxlifetime[AC_COUNT];
164 } wl_lmac_conf_ac_t;
166 #define TEMPLATE_BUFFER_LEN (256 + 32)
167 #define TEMPLATE_BEACON_FRAME 0
168 #define TEMPLATE_PRBREQ_FRAME 1
169 #define TEMPLATE_NULLDATA_FRAME 2
170 #define TEMPLATE_PRBRESP_FRAME 3
171 #define TEMPLATE_QOSNULLDATA_FRAME 4
172 #define TEMPLATE_PSPOLL_FRAME 5
173 #define TEMPLATE_COUNT 6 /* Must be last */
175 struct wl_lmac_frmtemplate {
176 uint32 frm_type;
177 uint32 rate;
178 uint32 length; /* Actual size of frm_data[] content only */
181 #define LMAC_FRMTEMPLATE_FIXED_SIZE (sizeof(struct wl_lmac_frmtemplate))
183 #define BCNIE_FILTER_BIT0_MASK 0x01
184 #define BCNIE_FILTER_BIT1_MASK 0x02
186 typedef struct wl_lmac_bcnfilter {
187 uint32 bcn_filter_enable;
188 uint32 hostwake_bcn_count;
189 } wl_lmac_bcnfilter_t;
191 typedef struct wl_lmac_bcn_reg_ie {
192 uint8 id;
193 uint8 mask;
194 } wl_lmac_bcn_regie_t;
196 typedef struct wl_lmac_bcn_prop_ie {
197 uint8 id;
198 uint8 mask;
199 uint8 OUI[3];
200 uint8 type;
201 uint16 ver;
202 } wl_lmac_bcn_propie_t;
204 typedef struct wl_lmac_bcniefilter {
205 uint32 nies;
206 } wl_lmac_bcniefilter_t;
208 struct wl_lmac_txrate_class {
209 uint8 retry_54Mbps;
210 uint8 retry_48Mbps;
211 uint8 retry_36Mbps;
212 uint8 retry_33Mbps;
213 uint8 retry_24Mbps;
214 uint8 retry_22Mbps;
215 uint8 retry_18Mbps;
216 uint8 retry_12Mbps;
217 uint8 retry_11Mbps;
218 uint8 retry_9Mbps;
219 uint8 retry_6Mbps;
220 uint8 retry_5p5Mbps;
221 uint8 retry_2Mbps;
222 uint8 retry_1Mbps;
223 uint8 SRL;
224 uint8 LRL;
225 uint32 iflags;
228 typedef struct wl_lmac_txrate_policy {
229 uint32 nclasses;
230 struct wl_lmac_txrate_class txrate_classes[1];
231 } wl_lmac_txrate_policy_t;
233 typedef struct wl_lmac_txautorate_policy {
234 uint32 nclasses;
235 uint8 data[1];
236 } wl_lmac_txautorate_policy_t;
238 typedef struct wl_lmac_setchannel {
239 uint8 channel;
240 uint8 txp_user_target[45];
241 uint8 txp_limit[45];
242 uint8 override;
243 uint8 txpwr_percent;
244 } wl_lmac_set_channel_t;
246 #define LMAC_WEP_DEFAULT_KEY 0
247 #define LMAC_WEP_PAIRWISE_KEY 1
248 #define LMAC_TKIP_GROUP_KEY 2
249 #define LMAC_TKIP_PAIRWISE_KEY 3
250 #define LMAC_AES_GROUP_KEY 4
251 #define LMAC_AES_PAIRWISE_KEY 5
253 typedef struct wl_lmac_addkey {
254 uint8 keytype;
255 uint8 keydata[64];
256 uint8 keyindex;
257 } wl_lmac_addkey_t;
259 typedef struct wl_lmac_delkey {
260 uint8 keyindex;
261 } wl_lmac_delkey_t;
263 typedef struct wl_bcmlmac_txdone {
264 /* Length is D11_TXH_LEN(104),TXSTATUS_LEN(16),D11_PHY_HDR_LEN(6) */
265 uint8 data[128];
266 } wl_bcmlmac_txdone_t;
268 #define LMAC_MODE_NORMAL 0
269 #define LMAC_MODE_EXTENDED 1 /* Expands format of txheader/rxheader/rxstatus/etc */
271 /* LMAC RX filter mode bits */
272 #define LMAC_PROMISC 0x00000001
273 #define LMAC_BSSIDFILTER 0x00000002
274 #define LMAC_MONITOR 0x80000000
276 /* Error codes that can be returned by LMAC */
277 #define LMAC_SUCCESS 0
278 #define LMAC_FAILURE 1
279 #define LMAC_RX_DECRYPT_FAILED 2
280 #define LMAC_RX_MICFAILURE 3
281 #define LMAC_SUCCESSXFER 4
282 #define LMAC_PENDING 5
283 #define LMAC_TXQ_FULL 6
284 #define LMAC_EXCEED_RETRY 7
285 #define LMAC_LIFETIME_EXPIRED 8
286 #define LMAC_NOLINK 9
287 #define LMAC_MAC_ERROR 10
289 /* LMAC events */
290 #define LMAC_EVENT_INITDONE 0
291 #define LMAC_EVENT_FATAL 1
292 #define LMAC_EVENT_BSSLOST 2
293 #define LMAC_EVENT_BSSREGAINED 3
294 #define LMAC_EVENT_RADARDETECT 4
295 #define LMAC_EVENT_LOWRSSI 5
296 #define LMAC_EVENT_SCANCOMPLETE 6
297 #define LMAC_EVENT_RMCOMPLETE 7
298 #define LMAC_EVENT_JOINCOMPLETE 8
299 #define LMAC_EVENT_PSCOMPLETE 9
300 #define LMAC_EVENT_LAST 10 /* Must be last */
302 typedef struct wllmac_join_data {
303 int32 max_powerlevel;
304 int32 min_powerlevel;
305 } wllmac_join_data_t;
307 typedef struct wllmac_pscomplete_data {
308 uint32 pmstate;
309 } wllmac_pscomplete_data_t;
311 typedef struct wllmac_scancomplete_data {
312 uint32 pmstate;
313 } wllmac_scancomplete_data_t;
315 #define LMAC_BAND2G 0x01
316 #define LMAC_BAND4G 0x02
317 #define LMAC_BAND5G 0x04
318 #define LMAC_BANDS_ALL (LMAC_BAND2G | LMAC_BAND4G | LMAC_BAND5G)
320 /* LMAC Band and Channel defines, freq in MHz */
321 #define LMAC_BAND2G_BASE 2407
322 #define LMAC_BAND4G_BASE 4900
323 #define LMAC_BAND5G_BASE 5000
324 #define LMAC_CHAN_FREQ_OFFSET 5
326 #define LMAC_CHAN_MAX 200
328 typedef struct wl_lmac_rmreq_params {
329 int32 tx_power;
330 uint32 channel;
331 uint8 band;
332 uint8 activation_delay;
333 uint8 measurement_offset;
334 uint8 nmeasures;
335 } wl_lmac_rmreq_params_t;
337 typedef struct wlc_lmac_rm_req {
338 uint32 type;
339 uint32 dur;
340 uint32 resrved;
341 } wl_lmac_rm_req_t;
343 struct wlc_lmac_rm_bcn_measure {
344 uint32 scan_mode;
347 #define LMAC_WAKEUP_BEACON 0
348 #define LMAC_WAKEUP_DTIMBEACON 1
349 #define LMAC_WAKEUP_NBEACONS 2
350 #define LMAC_WAKEUP_NDTIMBEACONS 3
352 #define LMAC_SLEEPMODE_WAKEUP 0
353 #define LMAC_SLEEPMODE_PDOWN 1
354 #define LMAC_SLEEPMODE_LPDOWN 2
356 #endif /* _wllmacctl_h_ */