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
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 $:
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 */
30 uint8 vec
[32]; /* bitvec of channels */
33 #define LMAC_CAP_MAGIC 0xdeadbeef
34 #define LMAC_VERSION_BUF_SIZE 64
36 typedef struct wl_lmac_cap
{
40 uint8 bands
; /* bands */
42 uint8 nratefallbackclasses
;
43 uint16 ssid_buffer_len
;
54 wlc_rev_info_t lmac_rev_info
;
56 lmacchanvec_t sup_chan
[2];
57 char lmac_version
[LMAC_VERSION_BUF_SIZE
];
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
{
107 uint32 beacon_interval
; /* TUs */
109 struct ether_addr bssid
;
115 uint8 probe_for_join
;
116 } wl_lmac_join_params_t
;
118 typedef struct wl_lmac_bss_params
{
121 } wl_lmac_bss_params_t
;
123 typedef enum queue_id
{
131 typedef enum ps_scheme
{
138 typedef enum ack_policy
{
144 typedef struct wl_lmac_conf_q
{
150 uint32 maxtxlifetime
; /* usec */
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
];
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
{
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
{
194 } wl_lmac_bcn_regie_t
;
196 typedef struct wl_lmac_bcn_prop_ie
{
202 } wl_lmac_bcn_propie_t
;
204 typedef struct wl_lmac_bcniefilter
{
206 } wl_lmac_bcniefilter_t
;
208 struct wl_lmac_txrate_class
{
228 typedef struct wl_lmac_txrate_policy
{
230 struct wl_lmac_txrate_class txrate_classes
[1];
231 } wl_lmac_txrate_policy_t
;
233 typedef struct wl_lmac_txautorate_policy
{
236 } wl_lmac_txautorate_policy_t
;
238 typedef struct wl_lmac_setchannel
{
240 uint8 txp_user_target
[45];
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
{
259 typedef struct wl_lmac_delkey
{
263 typedef struct wl_bcmlmac_txdone
{
264 /* Length is D11_TXH_LEN(104),TXSTATUS_LEN(16),D11_PHY_HDR_LEN(6) */
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
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
{
309 } wllmac_pscomplete_data_t
;
311 typedef struct wllmac_scancomplete_data
{
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
{
332 uint8 activation_delay
;
333 uint8 measurement_offset
;
335 } wl_lmac_rmreq_params_t
;
337 typedef struct wlc_lmac_rm_req
{
343 struct wlc_lmac_rm_bcn_measure
{
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_ */