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