blob: ae482b99baaefea03aef558cca1f9be3eb617f29 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jianmin Zhu57692442020-01-03 11:43:09 +08002 * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#if !defined(__LIM_SESSION_H)
20#define __LIM_SESSION_H
21
22/**=========================================================================
23
24 \file lim_session.h
25
26 \brief prototype for lim Session related APIs
27
28 \author Sunit Bhatia
29
30 ========================================================================*/
31
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080032/* Master Structure: This will be part of PE Session Entry */
33typedef struct sPowersaveoffloadInfo {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080034 uint8_t bcnmiss;
35} tPowersaveoffloadInfo, tpPowersaveoffloadInfo;
36
37#ifdef WLAN_FEATURE_11W
Jeff Johnson4a07a9b2018-11-21 23:51:02 -080038struct comeback_timer_info {
Jeff Johnson9320c1e2018-12-02 13:09:20 -080039 struct mac_context *mac;
Jeff Johnson4a07a9b2018-11-21 23:51:02 -080040 uint8_t session_id;
41 tLimMlmStates lim_prev_mlm_state; /* Previous MLM State */
42 tLimMlmStates lim_mlm_state; /* MLM State */
43};
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080044#endif /* WLAN_FEATURE_11W */
45/*--------------------------------------------------------------------------
46 Include Files
47 ------------------------------------------------------------------------*/
48
49/*--------------------------------------------------------------------------
50 Preprocessor definitions and constants
51 ------------------------------------------------------------------------*/
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -080052/* Maximum Number of WEP KEYS */
53#define MAX_WEP_KEYS 4
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080055#define SCH_PROTECTION_RESET_TIME 4000
56
57/*--------------------------------------------------------------------------
58 Type declarations
59 ------------------------------------------------------------------------*/
60typedef struct {
61 tSirMacBeaconInterval beaconInterval;
62 uint8_t fShortPreamble;
63 uint8_t llaCoexist;
64 uint8_t llbCoexist;
65 uint8_t llgCoexist;
66 uint8_t ht20Coexist;
67 uint8_t llnNonGFCoexist;
68 uint8_t fRIFSMode;
69 uint8_t fLsigTXOPProtectionFullSupport;
70 uint8_t gHTObssMode;
71} tBeaconParams, *tpBeaconParams;
72
yeshwanth sriram guntuka7419da72017-01-19 21:17:30 +053073typedef struct join_params {
74 uint16_t prot_status_code;
75 uint16_t pe_session_id;
76 tSirResultCodes result_code;
77} join_params;
78
Jianmin Zhud2526072019-04-25 14:04:13 +080079struct reassoc_params {
80 uint16_t prot_status_code;
81 tSirResultCodes result_code;
82 struct pe_session *session;
83};
84
Peng Xu6363ec62017-05-15 11:06:33 -070085#ifdef WLAN_FEATURE_11AX_BSS_COLOR
86#define MAX_BSS_COLOR_VALUE 63
87#define TIME_BEACON_NOT_UPDATED 30000
88#define BSS_COLOR_SWITCH_COUNTDOWN 5
Kiran Kumar Lokere389c1f82019-08-10 10:47:29 -070089#define OBSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS 120000
90#define OBSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS 120000
Arif Hussain05fb4872018-01-03 16:02:55 -080091#define OBSS_COLOR_COLLISION_SCAN_PERIOD_MS 200
92#define OBSS_COLOR_COLLISION_FREE_SLOT_EXPIRY_MS 50000
Peng Xu6363ec62017-05-15 11:06:33 -070093struct bss_color_info {
94 qdf_time_t timestamp;
95 uint64_t seen_count;
96};
97#endif
98
Arif Hussainee10f902017-12-27 16:30:17 -080099/**
100 * struct obss_detection_cfg - current obss detection cfg set to firmware
101 * @obss_11b_ap_detect_mode: detection mode for 11b access point.
102 * @obss_11b_sta_detect_mode: detection mode for 11b station.
103 * @obss_11g_ap_detect_mode: detection mode for 11g access point.
104 * @obss_11a_detect_mode: detection mode for 11a access point.
105 * @obss_ht_legacy_detect_mode: detection mode for ht ap with legacy mode.
106 * @obss_ht_mixed_detect_mode: detection mode for ht ap with mixed mode.
107 * @obss_ht_20mhz_detect_mode: detection mode for ht ap with 20mhz mode.
108 */
109struct obss_detection_cfg {
110 uint8_t obss_11b_ap_detect_mode;
111 uint8_t obss_11b_sta_detect_mode;
112 uint8_t obss_11g_ap_detect_mode;
113 uint8_t obss_11a_detect_mode;
114 uint8_t obss_ht_legacy_detect_mode;
115 uint8_t obss_ht_mixed_detect_mode;
116 uint8_t obss_ht_20mhz_detect_mode;
117};
118
Pragaspathi Thilagaraj54018e02019-04-25 01:32:17 +0530119#define ADAPTIVE_11R_STA_IE_LEN 0x0B
120#define ADAPTIVE_11R_STA_OUI "\x00\x00\x0f\x22"
121#define ADAPTIVE_11R_OUI_LEN 0x04
122#define ADAPTIVE_11R_OUI_SUBTYPE 0x00
123#define ADAPTIVE_11R_OUI_VERSION 0x01
124#define ADAPTIVE_11R_DATA_LEN 0x04
125#define ADAPTIVE_11R_OUI_DATA "\x00\x00\x00\x01"
126
sheenam monga26165ab2020-02-23 05:25:01 +0530127#define BEACON_RPT_ERR_VSIE_STA_IE_LEN 0x08
128#define BEACON_RPT_ERR_VSIE_STA_OUI "\x00\x00\x0f\x22"
129#define BEACON_RPT_ERR_VSIE_OUI_LEN 0X04
130#define BEACON_RPT_ERR_VSIE_DATA_LEN 0x03
131#define BEACON_RPT_ERR_VSIE_OUI_DATA "\x05\x01\x01"
132
Jeff Johnson29737022019-02-23 11:07:43 -0800133/**
134 * struct pe_session - per-vdev PE context
135 * @available: true if the entry is available, false if it is in use
136 * @peSessionId: unique ID assigned to the entry
137 * @vdev_id: ID of the vdev for which this entry is applicable
138 * @vdev: the actual vdev for which this entry is applicable
Pragaspathi Thilagaraj0bd369d2019-04-08 00:07:53 +0530139 * @connected_akm: AKM of current connection
Pragaspathi Thilagaraj54018e02019-04-25 01:32:17 +0530140 * @is_adaptive_11R_connection: flag to check if we are connecting
gaurank kathpalia2fcec842019-08-05 17:22:27 +0530141 * @ap_ecsa_wakelock: wakelock to complete CSA operation.
142 * @ap_ecsa_runtime_lock: runtime lock to complete SAP CSA operation.
Pragaspathi Thilagaraj54018e02019-04-25 01:32:17 +0530143 * to Adaptive 11R network
Jeff Johnson29737022019-02-23 11:07:43 -0800144 */
Jeff Johnson0f99bd82018-11-18 18:42:12 -0800145struct pe_session {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800146 /* To check session table is in use or free */
147 uint8_t available;
148 uint16_t peSessionId;
Jeff Johnson29737022019-02-23 11:07:43 -0800149 union {
150 uint8_t smeSessionId;
151 uint8_t vdev_id;
152 };
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +0530153 struct wlan_objmgr_vdev *vdev;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800154
Pragaspathi Thilagaraj7fb14222019-06-17 23:26:58 +0530155 /* In AP role: BSSID and self_mac_addr will be the same. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800156 /* In STA role: they will be different */
157 tSirMacAddr bssId;
Pragaspathi Thilagaraj7fb14222019-06-17 23:26:58 +0530158 tSirMacAddr self_mac_addr;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800159 tSirMacSSid ssId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800160 uint8_t valid;
161 tLimMlmStates limMlmState; /* MLM State */
162 tLimMlmStates limPrevMlmState; /* Previous MLM State */
163 tLimSmeStates limSmeState; /* SME State */
164 tLimSmeStates limPrevSmeState; /* Previous SME State */
165 tLimSystemRole limSystemRole;
Pragaspathi Thilagarajafd0a482019-05-23 13:02:36 +0530166 enum bss_type bssType;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800167 tSirNwType nwType;
Jeff Johnson704b8912019-02-02 14:38:14 -0800168 struct start_bss_req *pLimStartBssReq; /* handle to start bss req */
Pragaspathi Thilagaraj64ae59d2019-06-22 13:00:34 +0530169 struct join_req *lim_join_req; /* handle to sme join req */
Jeff Johnson701444f2019-02-02 22:35:13 -0800170 struct join_req *pLimReAssocReq; /* handle to sme reassoc req */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800171 tpLimMlmJoinReq pLimMlmJoinReq; /* handle to MLM join Req */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800172 void *pLimMlmReassocRetryReq; /* keep reasoc req for retry */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800173 void *pLimMlmReassocReq; /* handle to MLM reassoc Req */
174 uint16_t channelChangeReasonCode;
175 uint8_t dot11mode;
176 uint8_t htCapability;
Pragaspathi Thilagaraj0bd369d2019-04-08 00:07:53 +0530177 enum ani_akm_type connected_akm;
178
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800179 /* Supported Channel Width Set: 0-20MHz 1 - 40MHz */
180 uint8_t htSupportedChannelWidthSet;
181 /* Recommended Tx Width Set
182 * 0 - use 20 MHz channel (control channel)
183 * 1 - use channel width enabled under Supported Channel Width Set
184 */
185 uint8_t htRecommendedTxWidthSet;
186 /* Identifies the 40 MHz extension channel */
187 ePhyChanBondState htSecondaryChannelOffset;
Amruta Kulkarni453c4e22019-11-20 10:59:21 -0800188 enum reg_wifi_band limRFBand;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800189 uint8_t limIbssActive; /* TO SUPPORT CONCURRENCY */
190
191 /* These global varibales moved to session Table to support BT-AMP : Oct 9th review */
192 tAniAuthType limCurrentAuthType;
193 uint16_t limCurrentBssCaps;
194 uint8_t limCurrentBssQosCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800195 uint8_t limSentCapsChangeNtf;
196 uint16_t limAID;
197
198 /* Parameters For Reassociation */
199 tSirMacAddr limReAssocbssId;
Gururaj Pandurangi9bcf6392019-10-30 12:11:49 -0700200 uint32_t lim_reassoc_chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800201 /* CB paramaters required/duplicated for Reassoc since re-assoc mantains its own params in lim */
202 uint8_t reAssocHtSupportedChannelWidthSet;
203 uint8_t reAssocHtRecommendedTxWidthSet;
204 ePhyChanBondState reAssocHtSecondaryChannelOffset;
205 tSirMacSSid limReassocSSID;
206 uint16_t limReassocBssCaps;
207 uint8_t limReassocBssQosCaps;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800208
209 /* Assoc or ReAssoc Response Data/Frame */
210 void *limAssocResponseData;
211
212 /** BSS Table parameters **/
213
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800214 uint16_t statypeForBss; /* to know session is for PEER or SELF */
215 uint8_t shortSlotTimeSupported;
216 uint8_t dtimPeriod;
217 tSirMacRateSet rateSet;
218 tSirMacRateSet extRateSet;
219 tSirMacHTOperatingMode htOperMode;
Amruta Kulkarni1d93a852020-02-11 11:05:41 -0800220 qdf_freq_t curr_op_freq;
wadesongb96f3ba2019-07-11 15:42:13 +0800221 uint32_t curr_req_chan_freq;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800222 uint8_t LimRxedBeaconCntDuringHB;
223
224 /* Time stamp of the last beacon received from the BSS to which STA is connected. */
225 uint64_t lastBeaconTimeStamp;
226 /* RX Beacon count for the current BSS to which STA is connected. */
227 uint32_t currentBssBeaconCnt;
Kiran Kumar Lokere6d3a30d2018-01-15 18:18:29 -0800228 uint8_t bcon_dtim_period;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800229
230 uint32_t bcnLen;
231 uint8_t *beacon; /* Used to store last beacon / probe response before assoc. */
232
233 uint32_t assocReqLen;
Pragaspathi Thilagarajf812ccf2019-06-22 13:07:04 +0530234 uint8_t *assoc_req; /* Used to store association request frame */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800235
236 uint32_t assocRspLen;
237 uint8_t *assocRsp; /* Used to store association response received while associating */
238 tAniSirDph dph;
239 void **parsedAssocReq; /* Used to store parsed assoc req from various requesting station */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800240 uint32_t RICDataLen; /* Used to store the Ric data received in the assoc response */
241 uint8_t *ricData;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800242#ifdef FEATURE_WLAN_ESE
243 uint32_t tspecLen; /* Used to store the TSPEC IEs received in the assoc response */
244 uint8_t *tspecIes;
245#endif
246 uint32_t encryptType;
247
248 bool bTkipCntrMeasActive; /* Used to keep record of TKIP counter measures start/stop */
249
250 uint8_t gLimProtectionControl; /* used for 11n protection */
251
252 uint8_t gHTNonGFDevicesPresent;
253
254 /* protection related config cache */
255 tCfgProtection cfgProtection;
256
257 /* Number of legacy STAs associated */
258 tLimProtStaParams gLim11bParams;
259
260 /* Number of 11A STAs associated */
261 tLimProtStaParams gLim11aParams;
262
263 /* Number of non-ht non-legacy STAs associated */
264 tLimProtStaParams gLim11gParams;
265
266 /* Number of nonGf STA associated */
267 tLimProtStaParams gLimNonGfParams;
268
269 /* Number of HT 20 STAs associated */
270 tLimProtStaParams gLimHt20Params;
271
272 /* Number of Lsig Txop not supported STAs associated */
273 tLimProtStaParams gLimLsigTxopParams;
274
275 /* Number of STAs that do not support short preamble */
276 tLimNoShortParams gLimNoShortParams;
277
278 /* Number of STAs that do not support short slot time */
279 tLimNoShortSlotParams gLimNoShortSlotParams;
280
281 /* OLBC parameters */
282 tLimProtStaParams gLimOlbcParams;
283
284 /* OLBC parameters */
285 tLimProtStaParams gLimOverlap11gParams;
286
287 tLimProtStaParams gLimOverlap11aParams;
288 tLimProtStaParams gLimOverlapHt20Params;
289 tLimProtStaParams gLimOverlapNonGfParams;
290
291 /* cache for each overlap */
292 tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
293
294 uint8_t privacy;
295 tAniAuthType authType;
Srinivas Girigowdad65dc5a2016-01-14 17:08:26 -0800296 tSirKeyMaterial WEPKeyMaterial[MAX_WEP_KEYS];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800297
298 tDot11fIERSN gStartBssRSNIe;
299 tDot11fIEWPA gStartBssWPAIe;
300 tSirAPWPSIEs APWPSIEs;
301 uint8_t apUapsdEnable;
302 tSirWPSPBCSession *pAPWPSPBCSession;
303 uint32_t DefProbeRspIeBitmap[8];
304 uint32_t proxyProbeRspEn;
305 tDot11fProbeResponse probeRespFrame;
306 uint8_t ssidHidden;
307 bool fwdWPSPBCProbeReq;
308 uint8_t wps_state;
Abhishek Singhf78bd2d2016-04-27 16:47:56 +0530309 bool wps_registration;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800310
311 uint8_t limQosEnabled:1; /* 11E */
312 uint8_t limWmeEnabled:1; /* WME */
313 uint8_t limWsmEnabled:1; /* WSM */
314 uint8_t limHcfEnabled:1;
315 uint8_t lim11dEnabled:1;
316#ifdef WLAN_FEATURE_11W
317 uint8_t limRmfEnabled:1; /* 11W */
318#endif
319 uint32_t lim11hEnable;
320
Amar Singhala297bfa2015-10-15 15:07:29 -0700321 int8_t maxTxPower; /* MIN (Regulatory and local power constraint) */
Pragaspathi Thilagaraje64714a2019-05-23 00:46:25 +0530322 enum QDF_OPMODE opmode;
Amar Singhala297bfa2015-10-15 15:07:29 -0700323 int8_t txMgmtPower;
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700324 bool is11Rconnection;
Pragaspathi Thilagaraj54018e02019-04-25 01:32:17 +0530325 bool is_adaptive_11r_connection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800326
327#ifdef FEATURE_WLAN_ESE
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700328 bool isESEconnection;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800329 tEsePEContext eseContext;
330#endif
Srinivas Girigowda74a66d62017-06-21 23:28:25 -0700331 bool isFastTransitionEnabled;
332 bool isFastRoamIniFeatureEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800333 tSirP2PNoaAttr p2pGoPsUpdate;
334 uint32_t defaultAuthFailureTimeout;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800335
336 /* EDCA QoS parameters
337 * gLimEdcaParams - These EDCA parameters are used locally on AP or STA.
338 * If STA, then these are values taken from the Assoc Rsp when associating,
339 * or Beacons/Probe Response after association. If AP, then these are
340 * values originally set locally on AP.
341 *
342 * gLimEdcaParamsBC - These EDCA parameters are use by AP to broadcast
343 * to other STATIONs in the BSS.
344 *
345 * gLimEdcaParamsActive: These EDCA parameters are what's actively being
346 * used on station. Specific AC values may be downgraded depending on
347 * admission control for that particular AC.
348 */
Srinivas Girigowda5b86fbd2019-03-21 14:54:14 -0700349 tSirMacEdcaParamRecord gLimEdcaParams[QCA_WLAN_AC_ALL]; /* used locally */
350 tSirMacEdcaParamRecord gLimEdcaParamsBC[QCA_WLAN_AC_ALL]; /* used for broadcast */
351 tSirMacEdcaParamRecord gLimEdcaParamsActive[QCA_WLAN_AC_ALL];
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800352
353 uint8_t gLimEdcaParamSetCount;
354
355 tBeaconParams beaconParams;
356 uint8_t vhtCapability;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357 tLimOperatingModeInfo gLimOperatingMode;
358 uint8_t vhtCapabilityPresentInBeacon;
359 uint8_t ch_center_freq_seg0;
Kiran Kumar Lokere13644672016-02-29 15:40:10 -0800360 enum phy_ch_width ch_width;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800361 uint8_t ch_center_freq_seg1;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800362 uint8_t enableVhtpAid;
363 uint8_t enableVhtGid;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800364 tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
365 uint8_t enableAmpduPs;
366 uint8_t enableHtSmps;
367 uint8_t htSmpsvalue;
Archana Ramachandranfec24812016-02-16 16:31:56 -0800368 bool send_smps_action;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800369 uint8_t spectrumMgtEnabled;
370 /* *********************11H related**************************** */
371 tLimSpecMgmtInfo gLimSpecMgmt;
372 /* CB Primary/Secondary Channel Switch Info */
373 tLimChannelSwitchInfo gLimChannelSwitch;
374 /* *********************End 11H related**************************** */
375
376 /*Flag to Track Status/Indicate HBFailure on this session */
377 bool LimHBFailureStatus;
378 uint32_t gLimPhyMode;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800379 uint8_t txLdpcIniFeatureEnabled;
380 /**
381 * Following is the place holder for free peer index pool.
382 * A non-zero value indicates that peer index is available
383 * for assignment.
384 */
385 uint8_t *gpLimPeerIdxpool;
386 uint8_t freePeerIdxHead;
387 uint8_t freePeerIdxTail;
388 uint16_t gLimNumOfCurrentSTAs;
389#ifdef FEATURE_WLAN_TDLS
Kabilan Kannan32eb5022016-10-04 12:24:50 -0700390 /* TDLS parameters to check whether TDLS
391 * and TDLS channel switch is allowed in the
392 * AP network
393 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800394 uint32_t peerAIDBitmap[2];
395 bool tdls_prohibited;
396 bool tdls_chan_swit_prohibited;
Bala Venkatesh33f270b2019-01-14 16:31:29 +0530397 bool tdls_send_set_state_disable;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398#endif
399 bool fWaitForProbeRsp;
400 bool fIgnoreCapsChange;
401 bool fDeauthReceived;
402#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
403 int8_t rssi;
404#endif
Deepak Dhamdhere612392c2016-08-28 02:56:51 -0700405 uint8_t max_amsdu_num;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800406 uint8_t isCoalesingInIBSSAllowed;
407
Jeff Johnsonbe119e62019-02-02 12:30:26 -0800408 struct ht_config ht_config;
Sandeep Puligilla98917432016-06-10 13:50:28 -0700409 struct sir_vht_config vht_config;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800410 /*
411 * Place holder for StartBssReq message
412 * received by SME state machine
413 */
414 uint8_t gLimCurrentBssUapsd;
415
416 /* Used on STA, this is a static UAPSD mask setting
417 * derived from SME_JOIN_REQ and SME_REASSOC_REQ. If a
418 * particular AC bit is set, it means the AC is both
419 * trigger enabled and delivery enabled.
420 */
421 uint8_t gUapsdPerAcBitmask;
422
423 /* Used on STA, this is a dynamic UPASD mask setting
424 * derived from AddTS Rsp and DelTS frame. If a
425 * particular AC bit is set, it means AC is trigger
426 * enabled.
427 */
428 uint8_t gUapsdPerAcTriggerEnableMask;
429
430 /* Used on STA, dynamic UPASD mask setting
431 * derived from AddTS Rsp and DelTs frame. If
432 * a particular AC bit is set, it means AC is
433 * delivery enabled.
434 */
435 uint8_t gUapsdPerAcDeliveryEnableMask;
436
437 /* Flag to skip CSA IE processing when CSA
438 * offload is enabled.
439 */
440 uint8_t csaOffloadEnable;
441
442 /* Used on STA for AC downgrade. This is a dynamic mask
443 * setting which keep tracks of ACs being admitted.
444 * If bit is set to 0: That partiular AC is not admitted
445 * If bit is set to 1: That particular AC is admitted
446 */
447 uint8_t gAcAdmitMask[SIR_MAC_DIRECTION_DIRECT];
448
449 /* Power Save Off load Parameters */
450 tPowersaveoffloadInfo pmmOffloadInfo;
451 /* SMPS mode */
452 uint8_t smpsMode;
453
454 uint8_t chainMask;
455
456 /* Flag to indicate Chan Sw announcement is required */
457 uint8_t dfsIncludeChanSwIe;
458
459 /* Flag to indicate Chan Wrapper Element is required */
460 uint8_t dfsIncludeChanWrapperIe;
461
462#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
463 uint8_t cc_switch_mode;
464#endif
465
466 bool isCiscoVendorAP;
467
Jeff Johnson21aac3a2019-02-02 14:26:13 -0800468 struct add_ie_params add_ie_params;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800469
470 uint8_t *pSchProbeRspTemplate;
471 /* Beginning portion of the beacon frame to be written to TFP */
472 uint8_t *pSchBeaconFrameBegin;
473 /* Trailing portion of the beacon frame to be written to TFP */
474 uint8_t *pSchBeaconFrameEnd;
475 /* Size of the beginning portion */
476 uint16_t schBeaconOffsetBegin;
477 /* Size of the trailing portion */
478 uint16_t schBeaconOffsetEnd;
479 bool isOSENConnection;
480 /* DSCP to UP mapping for HS 2.0 */
Jeff Johnson7fb55e52019-02-06 11:28:12 -0800481 struct qos_map_set QosMapSet;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800482
483#ifdef WLAN_FEATURE_ROAM_OFFLOAD
484 bool bRoamSynchInProgress;
485#endif
486
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800487 /* Fast Transition (FT) */
488 tftPEContext ftPEContext;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800489 bool isNonRoamReassoc;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800490 uint8_t is_key_installed;
Jeff Johnson47d75242018-05-12 15:58:53 -0700491 /* timer for resetting protection fileds at regular intervals */
Anurag Chouhan210db072016-02-22 18:42:15 +0530492 qdf_mc_timer_t protection_fields_reset_timer;
Pragaspathi Thilagaraj934275c2018-08-07 14:55:35 +0530493 /* timer to decrement CSA/ECSA count */
494 qdf_mc_timer_t ap_ecsa_timer;
gaurank kathpalia2fcec842019-08-05 17:22:27 +0530495 qdf_wake_lock_t ap_ecsa_wakelock;
496 qdf_runtime_lock_t ap_ecsa_runtime_lock;
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800497 struct mac_context *mac_ctx;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800498 /*
499 * variable to store state of various protection struct like
500 * gLimOlbcParams, gLimOverlap11gParams, gLimOverlapHt20Params etc
501 */
502 uint16_t old_protection_state;
503 tSirMacAddr prev_ap_bssid;
504#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
505 /* tells if Q2Q IE, from another MDM device in AP MCC mode was recvd */
506 bool sap_advertise_avoid_ch_ie;
507#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
508#ifdef FEATURE_WLAN_ESE
509 uint8_t is_ese_version_ie_present;
510#endif
511 uint8_t sap_dot11mc;
512 bool is_vendor_specific_vhtcaps;
Kiran Kumar Lokere81722632017-09-26 12:11:43 -0700513 uint8_t vendor_specific_vht_ie_sub_type;
Kapil Gupta4b2efbb2016-10-03 13:07:20 +0530514 bool vendor_vht_sap;
Nitesh Shah0ddd4f62016-05-27 10:07:32 +0530515 /* HS 2.0 Indication */
516 tDot11fIEhs20vendor_ie hs20vendor_ie;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800517 /* flag to indicate country code in beacon */
518 uint8_t country_info_present;
519 uint8_t nss;
Vignesh Viswanathand5a5f2e2018-06-01 15:35:51 +0530520 bool nss_forced_1x1;
Abhishek Singh96bda8e2015-12-03 16:45:35 +0530521 bool add_bss_failed;
Sandeep Puligillae0875662016-02-12 16:09:21 -0800522 /* To hold OBSS Scan IE Parameters */
523 struct obss_scanparam obss_ht40_scanparam;
Kiran Kumar Lokere666bf852016-05-02 12:23:02 -0700524 uint8_t vdev_nss;
Archana Ramachandran20d2e232016-02-11 16:58:40 -0800525 /* Supported NSS is intersection of self and peer NSS */
526 bool supported_nss_1x1;
Agrawal Ashish0f94b572016-02-22 13:27:06 +0530527 bool is_ext_caps_present;
Jiachao Wu712d4fd2017-08-23 16:52:34 +0800528 uint16_t beacon_tx_rate;
Kondabattini, Ganeshe4f18e02016-09-13 13:01:22 +0530529 uint8_t *access_policy_vendor_ie;
Kondabattini, Ganeshb72e25c2016-09-02 14:43:59 +0530530 uint8_t access_policy;
Selvaraj, Sridharac4fcf32016-09-28 12:57:32 +0530531 bool ignore_assoc_disallowed;
Abhishek Singh5695e2a2016-10-28 10:39:12 +0530532 bool send_p2p_conf_frame;
Deepak Dhamdhere2dae1bd2016-10-27 10:58:29 -0700533 bool process_ho_fail;
gaolez7bb1e742017-03-21 16:37:38 +0800534 /* Number of STAs that do not support ECSA capability */
535 uint8_t lim_non_ecsa_cap_num;
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800536#ifdef WLAN_FEATURE_11AX
Krishna Kumaar Natarajan4f1d7722017-03-03 21:12:51 -0800537 bool he_capable;
Naveen Rawatd8feac12017-09-08 15:08:39 -0700538 tDot11fIEhe_cap he_config;
539 tDot11fIEhe_op he_op;
Manikandan Mohan39accff2017-05-02 16:09:00 -0700540 uint32_t he_sta_obsspd;
Kiran Kumar Lokereb2ea0272019-08-27 19:16:36 -0700541 bool he_6ghz_band;
Peng Xu6363ec62017-05-15 11:06:33 -0700542#ifdef WLAN_FEATURE_11AX_BSS_COLOR
543 tDot11fIEbss_color_change he_bss_color_change;
544 struct bss_color_info bss_color_info[MAX_BSS_COLOR_VALUE];
545 uint8_t bss_color_changing;
546#endif
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800547#endif
Selvaraj, Sridhar05ea0792017-05-17 12:17:03 +0530548 bool enable_bcast_probe_rsp;
Tushnim Bhattacharyya3d17def2017-06-19 11:13:43 -0700549 uint8_t ht_client_cnt;
Abhishek Singhb59f8d42017-07-31 14:42:47 +0530550 bool force_24ghz_in_ht20;
Kiran Kumar Lokeref9dc7912017-06-28 18:10:58 -0700551 bool ch_switch_in_progress;
Kiran Kumar Lokere722dccd2018-02-23 13:23:52 -0800552 bool he_with_wep_tkip;
Sridhar Selvaraj8c6f5e82017-08-21 14:53:46 +0530553#ifdef WLAN_FEATURE_FILS_SK
554 struct pe_fils_session *fils_info;
555#endif
Naveen Rawat6fc3c502017-09-06 16:14:11 -0700556 /* previous auth frame's sequence number */
557 uint16_t prev_auth_seq_num;
Arif Hussainee10f902017-12-27 16:30:17 -0800558 struct obss_detection_cfg obss_offload_cfg;
Arif Hussain91fa3222018-01-22 19:42:54 -0800559 struct obss_detection_cfg current_obss_detection;
Arif Hussain1513cb22018-01-05 19:56:31 -0800560 bool is_session_obss_offload_enabled;
561 bool is_obss_reset_timer_initialized;
Padma, Santhosh Kumarb8f65d92017-09-14 13:05:42 +0530562 bool sae_pmk_cached;
Varun Reddy Yeturub5d858e2017-12-15 16:08:13 -0800563 bool fw_roaming_started;
564 bool recvd_deauth_while_roaming;
565 bool recvd_disassoc_while_roaming;
566 bool deauth_disassoc_rc;
Arif Hussain05fb4872018-01-03 16:02:55 -0800567 enum wmi_obss_color_collision_evt_type obss_color_collision_dec_evt;
568 bool is_session_obss_color_collision_det_enabled;
Srinivas Girigowda5b86fbd2019-03-21 14:54:14 -0700569 tSirMacEdcaParamRecord ap_mu_edca_params[QCA_WLAN_AC_ALL];
Kiran Kumar Lokereb52cfc82018-10-08 21:54:38 -0700570 bool mu_edca_present;
Abhinav Kumard528d192018-03-09 17:31:12 +0530571 int8_t def_max_tx_pwr;
Kiran Kumar Lokereeac7fe92018-07-24 16:56:01 -0700572 bool active_ba_64_session;
Sandeep Puligilla01fcd3d2019-02-08 18:17:04 -0800573 bool is_mbssid_enabled;
Varun Reddy Yeturu4f849e52018-06-15 18:08:37 -0700574#ifdef WLAN_SUPPORT_TWT
575 uint8_t peer_twt_requestor;
576 uint8_t peer_twt_responder;
577#endif
Arif Hussain6686c0b2018-08-21 18:21:05 -0700578 bool enable_session_twt_support;
Abhishek Singh20a8e442018-09-12 15:50:44 +0530579 uint32_t cac_duration_ms;
Abhishek Singh06522c52019-05-08 12:13:42 +0530580 tSirResultCodes stop_bss_reason;
Abhishek Ambure40972f12019-08-21 19:43:18 +0530581 uint16_t prot_status_code;
582 tSirResultCodes result_code;
Abhishek Singh20a8e442018-09-12 15:50:44 +0530583 uint32_t dfs_regdomain;
Jeff Johnson0f99bd82018-11-18 18:42:12 -0800584};
585
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800586/*-------------------------------------------------------------------------
587 Function declarations and documenation
588 ------------------------------------------------------------------------*/
589
Qiwei Cai50a21082018-08-07 14:30:09 +0800590#ifdef WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY
591/**
592 * pe_allocate_dph_node_array_buffer() - Allocate g_dph_node_array
593 * memory dynamically
594 *
595 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_NOMEM on failure
596 */
597QDF_STATUS pe_allocate_dph_node_array_buffer(void);
598
599/**
600 * pe_free_dph_node_array_buffer() - Free memory allocated dynamically
601 *
602 * Return: None
603 */
604void pe_free_dph_node_array_buffer(void);
605#else /* WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY */
606static inline QDF_STATUS pe_allocate_dph_node_array_buffer(void)
607{
608 return QDF_STATUS_SUCCESS;
609}
610
611static inline void pe_free_dph_node_array_buffer(void)
612{
613}
614#endif /* WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY */
615
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616/**
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +0530617 * pe_create_session() - Creates a new PE session given the BSSID
Jeff Johnson348973e2018-11-22 16:51:12 -0800618 * @mac: pointer to global adapter context
Rajeev Kumar Sirasanagandlae3b59912018-08-24 15:53:31 +0530619 * @bssid: BSSID of the new session
620 * @sessionId: PE session ID is returned here, if PE session is created.
621 * @numSta: number of stations
622 * @bssType: bss type of new session to do conditional memory allocation.
Abhishek Singh345be412019-11-19 10:59:29 +0530623 * @vdev_id: vdev_id
Abhishek Singhec2dbe22019-11-25 11:14:17 +0530624 * @opmode: operating mode
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800625 *
626 * This function returns the session context and the session ID if the session
627 * corresponding to the passed BSSID is found in the PE session table.
628 *
629 * Return: ptr to the session context or NULL if session can not be created.
630 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800631struct pe_session *pe_create_session(struct mac_context *mac,
Abhishek Singhec2dbe22019-11-25 11:14:17 +0530632 uint8_t *bssid, uint8_t *sessionId,
633 uint16_t numSta, enum bss_type bssType,
634 uint8_t vdev_id, enum QDF_OPMODE opmode);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800635
636/**
637 * pe_find_session_by_bssid() - looks up the PE session given the BSSID.
638 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800639 * @mac: pointer to global adapter context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800640 * @bssid: BSSID of the new session
641 * @sessionId: session ID is returned here, if session is created.
642 *
643 * This function returns the session context and the session ID if the session
644 * corresponding to the given BSSID is found in the PE session table.
645 *
646 * Return: pointer to the session context or NULL if session is not found.
647 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800648struct pe_session *pe_find_session_by_bssid(struct mac_context *mac, uint8_t *bssid,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800649 uint8_t *sessionId);
650
651/**
Abhishek Singhc70afa32019-09-19 15:17:21 +0530652 * pe_find_session_by_vdev_id() - looks up the PE session given the vdev_id.
653 * @mac: pointer to global adapter context
654 * @vdev_id: vdev id the session
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655 *
656 * Return: pointer to the session context or NULL if session is not found.
657 */
Abhishek Singhc70afa32019-09-19 15:17:21 +0530658struct pe_session *pe_find_session_by_vdev_id(struct mac_context *mac,
659 uint8_t vdev_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800660
661/**
Jianmin Zhu57692442020-01-03 11:43:09 +0800662 * pe_find_session_by_vdev_id_and_state() - Find PE session by vdev_id and
663 * mlm state.
664 * @mac: pointer to global adapter context
665 * @vdev_id: vdev id the session
666 * @vdev_id: vdev id the session
667 *
668 * During LFR2 roaming, new pe session is created before old pe session
669 * deleted, the 2 pe sessions have different pe session id, but same vdev id,
670 * can't get correct pe session by vdev id at this time.
671 *
672 * Return: pointer to the session context or NULL if session is not found.
673 */
674struct pe_session
675*pe_find_session_by_vdev_id_and_state(struct mac_context *mac,
676 uint8_t vdev_id,
677 enum eLimMlmStates lim_state);
678
679/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680 * pe_find_session_by_peer_sta() - looks up the PE session given the Peer
681 * Station Address.
682 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800683 * @mac: pointer to global adapter context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800684 * @sa: Peer STA Address of the session
685 * @sessionId: session ID is returned here, if session is found.
686 *
687 * This function returns the session context and the session ID if the session
688 * corresponding to the given destination address is found in the PE session
689 * table.
690 *
691 * Return: pointer to the session context or NULL if session is not found.
692 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800693struct pe_session *pe_find_session_by_peer_sta(struct mac_context *mac, uint8_t *sa,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694 uint8_t *sessionId);
695
696/**
697 * pe_find_session_by_session_id() - looks up the PE session given the session
698 * ID.
699 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800700 * @mac: pointer to global adapter context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800701 * @sessionId: session ID for which session context needs to be looked up.
702 *
703 * This function returns the session context if the session corresponding to
704 * the given session ID is found in the PE session table.
705 *
706 * Return: pointer to the session context or NULL if session is not found.
707 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800708struct pe_session *pe_find_session_by_session_id(struct mac_context *mac,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800709 uint8_t sessionId);
710
711/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800712 * pe_delete_session() - deletes the PE session given the session ID.
713 *
Jeff Johnson348973e2018-11-22 16:51:12 -0800714 * @mac: pointer to global adapter context
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800715 * @sessionId: session ID to delete.
716 *
717 * Return: void
718 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800719void pe_delete_session(struct mac_context *mac, struct pe_session *pe_session);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800720
Min Liu93073af2018-09-18 19:10:41 +0800721/**
722 * pe_find_session_by_scan_id() - looks up the PE session for given scan id
723 * @mac_ctx: pointer to global adapter context
724 * @scan_id: scan id
725 *
726 * looks up the PE session for given scan id
727 *
728 * Return: pe session entry for given scan id if found else NULL
729 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800730struct pe_session *pe_find_session_by_scan_id(struct mac_context *mac_ctx,
Min Liu93073af2018-09-18 19:10:41 +0800731 uint32_t scan_id);
732
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800733uint8_t pe_get_active_session_count(struct mac_context *mac_ctx);
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530734#ifdef WLAN_FEATURE_FILS_SK
735/**
736 * pe_delete_fils_info: API to delete fils session info
737 * @session: pe session
738 *
739 * Return: void
740 */
Jeff Johnson0bb33162018-11-18 22:20:42 -0800741void pe_delete_fils_info(struct pe_session *session);
Sridhar Selvaraj0d5d2c72017-08-17 17:30:01 +0530742#endif
Vignesh Viswanathanb3dbbc82018-04-06 00:06:27 +0530743
744/**
745 * lim_set_bcn_probe_filter - set the beacon/probe filter in mac context
746 *
747 * @mac_ctx: pointer to global mac context
748 * @session: pointer to the PE session
749 * @ibss_ssid: SSID of the session for IBSS sessions
750 * @sap_channel: Operating Channel of the session for SAP sessions
751 *
752 * Sets the beacon/probe filter in the global mac context to filter
753 * and drop beacon/probe frames before posting it to PE queue
754 *
755 * Return: None
756 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800757void lim_set_bcn_probe_filter(struct mac_context *mac_ctx,
Jeff Johnson0bb33162018-11-18 22:20:42 -0800758 struct pe_session *session,
Vignesh Viswanathanb3dbbc82018-04-06 00:06:27 +0530759 tSirMacSSid *ibss_ssid,
760 uint8_t sap_channel);
761
762/**
763 * lim_reset_bcn_probe_filter - clear the beacon/probe filter in mac context
764 *
765 * @mac_ctx: pointer to the global mac context
766 * @session: pointer to the PE session whose filter is to be cleared
767 *
768 * Return: None
769 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800770void lim_reset_bcn_probe_filter(struct mac_context *mac_ctx, struct pe_session *session);
Vignesh Viswanathanb3dbbc82018-04-06 00:06:27 +0530771
772/**
773 * lim_update_bcn_probe_filter - Update the beacon/probe filter in mac context
774 *
775 * @mac_ctx: pointer to the global mac context
776 * @session: pointer to the PE session whose filter is to be cleared
777 *
778 * This API is applicable only for SAP sessions to update the SAP channel
779 * in the filter during a channel switch
780 *
781 * Return: None
782 */
Jeff Johnson9320c1e2018-12-02 13:09:20 -0800783void lim_update_bcn_probe_filter(struct mac_context *mac_ctx, struct pe_session *session);
Vignesh Viswanathanb3dbbc82018-04-06 00:06:27 +0530784
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800785#endif /* #if !defined( __LIM_SESSION_H ) */