xref: /freebsd/sys/contrib/dev/broadcom/brcm80211/brcmsmac/scb.h (revision b4c3e9b5b09c829b4135aff738bd2893ed052377)
1*b4c3e9b5SBjoern A. Zeeb /*
2*b4c3e9b5SBjoern A. Zeeb  * Copyright (c) 2010 Broadcom Corporation
3*b4c3e9b5SBjoern A. Zeeb  *
4*b4c3e9b5SBjoern A. Zeeb  * Permission to use, copy, modify, and/or distribute this software for any
5*b4c3e9b5SBjoern A. Zeeb  * purpose with or without fee is hereby granted, provided that the above
6*b4c3e9b5SBjoern A. Zeeb  * copyright notice and this permission notice appear in all copies.
7*b4c3e9b5SBjoern A. Zeeb  *
8*b4c3e9b5SBjoern A. Zeeb  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*b4c3e9b5SBjoern A. Zeeb  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*b4c3e9b5SBjoern A. Zeeb  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11*b4c3e9b5SBjoern A. Zeeb  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*b4c3e9b5SBjoern A. Zeeb  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13*b4c3e9b5SBjoern A. Zeeb  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14*b4c3e9b5SBjoern A. Zeeb  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*b4c3e9b5SBjoern A. Zeeb  */
16*b4c3e9b5SBjoern A. Zeeb 
17*b4c3e9b5SBjoern A. Zeeb #ifndef _BRCM_SCB_H_
18*b4c3e9b5SBjoern A. Zeeb #define _BRCM_SCB_H_
19*b4c3e9b5SBjoern A. Zeeb 
20*b4c3e9b5SBjoern A. Zeeb #include <linux/if_ether.h>
21*b4c3e9b5SBjoern A. Zeeb #include <brcmu_utils.h>
22*b4c3e9b5SBjoern A. Zeeb #include <defs.h>
23*b4c3e9b5SBjoern A. Zeeb #include "types.h"
24*b4c3e9b5SBjoern A. Zeeb 
25*b4c3e9b5SBjoern A. Zeeb #define AMPDU_TX_BA_MAX_WSIZE	64	/* max Tx ba window size (in pdu) */
26*b4c3e9b5SBjoern A. Zeeb 
27*b4c3e9b5SBjoern A. Zeeb #define AMPDU_MAX_SCB_TID	NUMPRIO
28*b4c3e9b5SBjoern A. Zeeb 
29*b4c3e9b5SBjoern A. Zeeb /* scb flags */
30*b4c3e9b5SBjoern A. Zeeb #define SCB_WMECAP		0x0040
31*b4c3e9b5SBjoern A. Zeeb #define SCB_HTCAP		0x10000	/* HT (MIMO) capable device */
32*b4c3e9b5SBjoern A. Zeeb #define SCB_IS40		0x80000	/* 40MHz capable */
33*b4c3e9b5SBjoern A. Zeeb #define SCB_STBCCAP		0x40000000	/* STBC Capable */
34*b4c3e9b5SBjoern A. Zeeb 
35*b4c3e9b5SBjoern A. Zeeb #define SCB_MAGIC	0xbeefcafe
36*b4c3e9b5SBjoern A. Zeeb 
37*b4c3e9b5SBjoern A. Zeeb /* structure to store per-tid state for the ampdu initiator */
38*b4c3e9b5SBjoern A. Zeeb struct scb_ampdu_tid_ini {
39*b4c3e9b5SBjoern A. Zeeb 	/* tx retry count; indexed by seq modulo */
40*b4c3e9b5SBjoern A. Zeeb 	u8 txretry[AMPDU_TX_BA_MAX_WSIZE];
41*b4c3e9b5SBjoern A. Zeeb };
42*b4c3e9b5SBjoern A. Zeeb 
43*b4c3e9b5SBjoern A. Zeeb struct scb_ampdu {
44*b4c3e9b5SBjoern A. Zeeb 	u8 max_pdu;		/* max pdus allowed in ampdu */
45*b4c3e9b5SBjoern A. Zeeb 	u8 release;		/* # of mpdus released at a time */
46*b4c3e9b5SBjoern A. Zeeb 	u32 max_rx_ampdu_bytes;	/* max ampdu rcv length; 8k, 16k, 32k, 64k */
47*b4c3e9b5SBjoern A. Zeeb 
48*b4c3e9b5SBjoern A. Zeeb 	/*
49*b4c3e9b5SBjoern A. Zeeb 	 * This could easily be a ini[] pointer and we keep this info in wl
50*b4c3e9b5SBjoern A. Zeeb 	 * itself instead of having mac80211 hold it for us. Also could be made
51*b4c3e9b5SBjoern A. Zeeb 	 * dynamic per tid instead of static.
52*b4c3e9b5SBjoern A. Zeeb 	 */
53*b4c3e9b5SBjoern A. Zeeb 	/* initiator info - per tid (NUMPRIO): */
54*b4c3e9b5SBjoern A. Zeeb 	struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID];
55*b4c3e9b5SBjoern A. Zeeb };
56*b4c3e9b5SBjoern A. Zeeb 
57*b4c3e9b5SBjoern A. Zeeb /* station control block - one per remote MAC address */
58*b4c3e9b5SBjoern A. Zeeb struct scb {
59*b4c3e9b5SBjoern A. Zeeb 	u32 magic;
60*b4c3e9b5SBjoern A. Zeeb 	u32 flags;	/* various bit flags as defined below */
61*b4c3e9b5SBjoern A. Zeeb 	u16 seqctl[NUMPRIO];	/* seqctl of last received frame (for dups) */
62*b4c3e9b5SBjoern A. Zeeb 	u16 seqnum[NUMPRIO];/* WME: driver maintained sw seqnum per priority */
63*b4c3e9b5SBjoern A. Zeeb 
64*b4c3e9b5SBjoern A. Zeeb 	struct scb_ampdu scb_ampdu;	/* AMPDU state including per tid info */
65*b4c3e9b5SBjoern A. Zeeb };
66*b4c3e9b5SBjoern A. Zeeb 
67*b4c3e9b5SBjoern A. Zeeb #endif				/* _BRCM_SCB_H_ */
68