blob: ae590db66603f1d2a0d11416995309a982ae9934 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/*
29
30 *
31
32 * Author: Sandesh Goel
33
34 * Date: 02/25/02
35
36 * History:-
37
38 * Date Modified by Modification Information
39
40 * --------------------------------------------------------------------
41
42 *
43
44 */
45
46#ifndef __DPH_GLOBAL_H__
47#define __DPH_GLOBAL_H__
48
49#include "lim_global.h"
50#include "sir_mac_prot_def.h"
51#include "sir_mac_prop_exts.h"
52#include "sir_api.h"
53
54/* Following determines whether statistics are maintained or not */
55#define DPH_STATS
56
57/* STAID for Management frames */
58#define DPH_USE_MGMT_STAID -1
59
60/* Keep Alive frames */
61#define DPH_NON_KEEPALIVE_FRAME 0
62#define DPH_KEEPALIVE_FRAME 1
63
64/* DPH Hash Index for BSS(STA's Peer) on station. */
65#define DPH_STA_HASH_INDEX_PEER 1
66
67#ifdef WLAN_FEATURE_11W
68/* DPH PMF SA Query state for station */
69#define DPH_SA_QUERY_NOT_IN_PROGRESS 1
70#define DPH_SA_QUERY_IN_PROGRESS 2
71#define DPH_SA_QUERY_TIMED_OUT 3
72#endif
73
74typedef struct sDphRateBasedCtr {
75 uint32_t hi;
76 uint32_t lo;
77} tDphRateBasedCtr;
78
79typedef struct sDphPhyRates {
80 uint8_t dataRateX2;
81 uint8_t ackRateX2;
82 uint8_t rtsRateX2;
83} tDphPhyRates;
84
85typedef struct sDphIFSValues {
86 uint8_t sifs;
87 uint8_t pifs;
88 uint8_t difs;
89 uint8_t preamble;
90} tDphIFSValues;
91
92typedef struct sDphQosParams {
93 uint8_t addtsPresent;
94 tSirAddtsReqInfo addts;
95 tSirMacQosCapabilityStaIE capability;
96} tDphQosParams;
97
98/* Queue attribute structure */
99typedef struct sDphQueueAttr {
100 uint16_t valid:1;
101 uint16_t seqNum:12;
102 uint16_t ackPolicy:2;
103 uint16_t rsvd:1;
104} tDphQueueAttr, *tpDphQueueAttr;
105
106/* STA state node */
107typedef struct sDphHashNode {
108 /*
109 * BYTE 0
110 * HASH ENTRY FIELDS NOT NEEDED IN HAL.
111 * This STA valid or not
112 */
113 uint8_t valid:1;
114 uint8_t encPolicy:3;
115 uint8_t defaultKey:1;
116 uint8_t defaultKeyId:2;
117 uint8_t qosMode:1;
118 /* BYTE 1 */
119 uint8_t erpEnabled:1;
120 /* This has been added to the dph hash table */
121 uint8_t added:1;
122 uint8_t linkTestOn:1;
123 uint8_t shortPreambleEnabled:1;
124 uint8_t shortSlotTimeEnabled:1;
125 uint8_t stopTx:1;
126 /* set if both ap and sta are wme capable */
127 uint8_t wmeEnabled:1;
128 /* set if both ap and sta are 11e capable */
129 uint8_t lleEnabled:1;
130 /* BYTE 2 */
131 /* set if both ap and sta are wsm capable */
132 uint8_t wsmEnabled:1;
133 /* station gave version info */
134 uint8_t versionPresent:1;
135 /* allow bursting regardless of qosMode */
136 uint8_t burstEnableForce:1;
137 uint8_t staAuthenticated:1;
138 uint8_t fAniCount:1;
139 uint8_t rmfEnabled:1;
140 /* Fragmentation size */
141 uint16_t fragSize;
142 /* LIM state */
143 tLimMlmStaContext mlmStaContext;
144 /* Number of Tim to wait if the STA doesn't respond / fetch data */
145 uint8_t timWaitCount;
146 /* Number of Successful MPDU's being sent */
147 uint32_t curTxMpduCnt;
148 /* number of consecutive TIMs sent without response */
149 uint8_t numTimSent;
150 /* qos parameter info */
151 tDphQosParams qos;
152 /* station version info - valid only if versionPresent is set */
153 tSirMacPropVersion version;
154#ifdef PLM_WDS
155 uint8_t wdsIndex;
156 uint8_t wdsPeerBeaconSeen;
157#endif
158 /* Taurus capabilities */
159 uint16_t baPolicyFlag; /* BA Policy for each TID. */
160 /*
161 * All the legacy and airgo supported rates.
162 */
163 tSirSupportedRates supportedRates;
164 uint8_t htGreenfield:1;
165 uint8_t htShortGI40Mhz:1;
166 uint8_t htShortGI20Mhz:1;
167 /* DSSS/CCK at 40 MHz: Enabled 1 or Disabled */
168 uint8_t htDsssCckRate40MHzSupport:1;
169 /* L-SIG TXOP Protection used only if peer support available */
170 uint8_t htLsigTXOPProtection:1;
171 /*
172 * A-MPDU Density
173 * 000 - No restriction
174 * 001 - 1/8 usec
175 * 010 - 1/4 usec
176 * 011 - 1/2 usec
177 * 100 - 1 usec
178 * 101 - 2 usec
179 * 110 - 4 usec
180 * 111 - 8 usec
181 */
182 uint8_t htAMpduDensity:3;
183 /* Set to 0 for 3839 octets */
184 /* Set to 1 for 7935 octets */
185 uint8_t htMaxAmsduLength;
186 /* MIMO Power Save */
187 tSirMacHTMIMOPowerSaveState htMIMOPSState;
188 /* */
189 /* Maximum Rx A-MPDU factor */
190 uint8_t htMaxRxAMpduFactor:3;
191 /*
192 * Recommended Tx Width Set
193 * 0 - use 20 MHz channel (control channel)
194 * 1 - use 40 Mhz channel
195 */
196 uint8_t htSupportedChannelWidthSet:1;
197 uint8_t htSecondaryChannelOffset:2;
198 uint8_t rsvd1:2;
199 /* DPH HASH ENTRY FIELDS NEEDED IN HAL ONLY */
200 uint8_t dpuSig:4; /* DPU signiture */
201 uint8_t staSig:4; /* STA signature */
202 uint8_t staType;
203 uint16_t bssId; /* BSSID */
204 uint16_t assocId; /* Association ID */
205 /* This is the real sta index generated by HAL */
206 uint16_t staIndex;
207 uint8_t staAddr[6];
208 /*
209 * The DPU signatures will be sent eventually to TL to help
210 * it determine the association to which a packet belongs to
211 */
212 /*Unicast DPU signature */
213 uint8_t ucUcastSig;
214 /*Broadcast DPU signature */
215 uint8_t ucBcastSig;
216
217 uint8_t vhtSupportedChannelWidthSet;
218 uint8_t vhtSupportedRxNss;
219 uint8_t vhtBeamFormerCapable;
220 uint8_t vht_su_bfee_capable;
221#ifdef WLAN_FEATURE_11W
222 uint8_t pmfSaQueryState;
223 uint8_t pmfSaQueryRetryCount;
224 uint16_t pmfSaQueryCurrentTransId;
225 uint16_t pmfSaQueryStartTransId;
226 TX_TIMER pmfSaQueryTimer;
227 v_TIME_t last_unprot_deauth_disassoc;
228 uint8_t proct_deauh_disassoc_cnt;
229 v_TIME_t last_assoc_received_time;
230#endif
231 uint8_t htLdpcCapable;
232 uint8_t vhtLdpcCapable;
233#ifdef FEATURE_WLAN_TDLS
234 uint16_t ht_caps;
235 uint32_t vht_caps;
236#endif
237 uint8_t timingMeasCap;
238 /* key installed for this STA or not in the firmware */
239 uint8_t is_key_installed;
240 uint8_t is_disassoc_deauth_in_progress;
241 /*
242 * When a station with already an existing dph entry tries to
243 * associate again, the old dph entry will be zeroed out except
244 * for the next pointer. The next pointer must be defined at the
245 * end of the structure.
246 */
247 struct sDphHashNode *next;
248} tDphHashNode, *tpDphHashNode;
249
250#include "dph_hash_table.h"
251
252/* ------------------------------------------------------------------- */
253typedef struct sAniSirDph {
254 /* The hash table object */
255 dphHashTableClass dphHashTable;
256} tAniSirDph, *tpAniSirDph;
257
258#endif