Commit | Line | Data |
---|---|---|
a9533e7e HP |
1 | /* |
2 | * Copyright (c) 2010 Broadcom Corporation | |
3 | * | |
4 | * Permission to use, copy, modify, and/or distribute this software for any | |
5 | * purpose with or without fee is hereby granted, provided that the above | |
6 | * copyright notice and this permission notice appear in all copies. | |
7 | * | |
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | |
11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | |
13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |
14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
15 | */ | |
16 | ||
17 | #ifndef _wlc_scb_h_ | |
18 | #define _wlc_scb_h_ | |
19 | ||
434c14ef RV |
20 | #include <linux/if_ether.h> /* for ETH_ALEN */ |
21 | ||
a9533e7e HP |
22 | #define AMPDU_TX_BA_MAX_WSIZE 64 /* max Tx ba window size (in pdu) */ |
23 | /* structure to store per-tid state for the ampdu initiator */ | |
24 | typedef struct scb_ampdu_tid_ini { | |
66cbd3ab | 25 | u32 magic; |
41feb5ed GKH |
26 | u8 tx_in_transit; /* number of pending mpdus in transit in driver */ |
27 | u8 tid; /* initiator tid for easy lookup */ | |
28 | u8 txretry[AMPDU_TX_BA_MAX_WSIZE]; /* tx retry count; indexed by seq modulo */ | |
a9533e7e HP |
29 | struct scb *scb; /* backptr for easy lookup */ |
30 | } scb_ampdu_tid_ini_t; | |
31 | ||
32 | #define AMPDU_MAX_SCB_TID NUMPRIO | |
33 | ||
34 | typedef struct scb_ampdu { | |
35 | struct scb *scb; /* back pointer for easy reference */ | |
41feb5ed GKH |
36 | u8 mpdu_density; /* mpdu density */ |
37 | u8 max_pdu; /* max pdus allowed in ampdu */ | |
38 | u8 release; /* # of mpdus released at a time */ | |
7d4df48e | 39 | u16 min_len; /* min mpdu len to support the density */ |
66cbd3ab | 40 | u32 max_rxlen; /* max ampdu rcv length; 8k, 16k, 32k, 64k */ |
a9533e7e HP |
41 | struct pktq txq; /* sdu transmit queue pending aggregation */ |
42 | ||
43 | /* This could easily be a ini[] pointer and we keep this info in wl itself instead | |
44 | * of having mac80211 hold it for us. Also could be made dynamic per tid instead of | |
45 | * static. | |
46 | */ | |
47 | scb_ampdu_tid_ini_t ini[AMPDU_MAX_SCB_TID]; /* initiator info - per tid (NUMPRIO) */ | |
48 | } scb_ampdu_t; | |
49 | ||
50 | #define SCB_MAGIC 0xbeefcafe | |
51 | #define INI_MAGIC 0xabcd1234 | |
52 | ||
53 | /* station control block - one per remote MAC address */ | |
54 | struct scb { | |
66cbd3ab GKH |
55 | u32 magic; |
56 | u32 flags; /* various bit flags as defined below */ | |
57 | u32 flags2; /* various bit flags2 as defined below */ | |
41feb5ed | 58 | u8 state; /* current state bitfield of auth/assoc process */ |
a44d4236 | 59 | u8 ea[ETH_ALEN]; /* station address */ |
a9533e7e HP |
60 | void *fragbuf[NUMPRIO]; /* defragmentation buffer per prio */ |
61 | uint fragresid[NUMPRIO]; /* #bytes unused in frag buffer per prio */ | |
62 | ||
7d4df48e GKH |
63 | u16 seqctl[NUMPRIO]; /* seqctl of last received frame (for dups) */ |
64 | u16 seqctl_nonqos; /* seqctl of last received frame (for dups) for | |
a9533e7e HP |
65 | * non-QoS data and management |
66 | */ | |
7d4df48e | 67 | u16 seqnum[NUMPRIO]; /* WME: driver maintained sw seqnum per priority */ |
a9533e7e HP |
68 | |
69 | scb_ampdu_t scb_ampdu; /* AMPDU state including per tid info */ | |
70 | }; | |
71 | ||
035f4c3b BR |
72 | /* scb flags */ |
73 | #define SCB_WMECAP 0x0040 /* may ONLY be set if WME_ENAB(wlc) */ | |
a9533e7e | 74 | #define SCB_HTCAP 0x10000 /* HT (MIMO) capable device */ |
a9533e7e | 75 | #define SCB_IS40 0x80000 /* 40MHz capable */ |
a9533e7e | 76 | #define SCB_STBCCAP 0x40000000 /* STBC Capable */ |
035f4c3b BR |
77 | #define SCB_WME(a) ((a)->flags & SCB_WMECAP)/* implies WME_ENAB */ |
78 | #define SCB_SEQNUM(scb, prio) ((scb)->seqnum[(prio)]) | |
a9533e7e | 79 | #define SCB_PS(a) NULL |
a9533e7e | 80 | #define SCB_STBC_CAP(a) ((a)->flags & SCB_STBCCAP) |
0f0881b0 | 81 | #define SCB_AMPDU(a) true |
a9533e7e | 82 | #endif /* _wlc_scb_h_ */ |