1  /*
2   * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
3   * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4   *
5   * Permission to use, copy, modify, and/or distribute this software for
6   * any purpose with or without fee is hereby granted, provided that the
7   * above copyright notice and this permission notice appear in all
8   * copies.
9   *
10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17   * PERFORMANCE OF THIS SOFTWARE.
18   */
19  
20  #if !defined(__LIM_SESSION_H)
21  #define __LIM_SESSION_H
22  
23  #include "wlan_cm_public_struct.h"
24  /**=========================================================================
25  
26     \file  lim_session.h
27  
28     \brief prototype for lim Session related APIs
29  
30     \author Sunit Bhatia
31  
32     ========================================================================*/
33  
34  /* Master Structure: This will be part of PE Session Entry */
35  typedef struct sPowersaveoffloadInfo {
36  	uint8_t bcnmiss;
37  } tPowersaveoffloadInfo, tpPowersaveoffloadInfo;
38  
39  struct comeback_timer_info {
40  	struct mac_context *mac;
41  	uint8_t vdev_id;
42  	uint8_t retried;
43  	tLimMlmStates lim_prev_mlm_state;  /* Previous MLM State */
44  	tLimMlmStates lim_mlm_state;       /* MLM State */
45  };
46  /*--------------------------------------------------------------------------
47     Include Files
48     ------------------------------------------------------------------------*/
49  
50  /*--------------------------------------------------------------------------
51     Preprocessor definitions and constants
52     ------------------------------------------------------------------------*/
53  #define SCH_PROTECTION_RESET_TIME 4000
54  
55  /*--------------------------------------------------------------------------
56     Type declarations
57     ------------------------------------------------------------------------*/
58  typedef struct {
59  	tSirMacBeaconInterval beaconInterval;
60  	uint8_t fShortPreamble;
61  	uint8_t llaCoexist;
62  	uint8_t llbCoexist;
63  	uint8_t llgCoexist;
64  	uint8_t ht20Coexist;
65  	uint8_t llnNonGFCoexist;
66  	uint8_t fRIFSMode;
67  	uint8_t fLsigTXOPProtectionFullSupport;
68  	uint8_t gHTObssMode;
69  } tBeaconParams, *tpBeaconParams;
70  
71  typedef struct join_params {
72  	uint16_t prot_status_code;
73  	uint16_t pe_session_id;
74  	tSirResultCodes result_code;
75  } join_params;
76  
77  struct reassoc_params {
78  	uint16_t prot_status_code;
79  	tSirResultCodes result_code;
80  	struct pe_session *session;
81  };
82  
83  #ifdef WLAN_FEATURE_11AX_BSS_COLOR
84  #define MAX_BSS_COLOR_VALUE 63
85  #define TIME_BEACON_NOT_UPDATED 30000
86  #define BSS_COLOR_SWITCH_COUNTDOWN 5
87  #define OBSS_COLOR_COLLISION_DETECTION_STA_PERIOD_MS 120000
88  #define OBSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS 120000
89  /*
90   * Have OBSS scan duration as 1200 seconds(20 minutes) when there is an active
91   * NDP to avoid glitches during NDP traffic due the scan.
92   */
93  #define OBSS_COLOR_COLLISION_DETECTION_NDP_PERIOD_MS 1200000
94  #define OBSS_COLOR_COLLISION_SCAN_PERIOD_MS 200
95  #define OBSS_COLOR_COLLISION_FREE_SLOT_EXPIRY_MS 50000
96  struct bss_color_info {
97  	qdf_time_t timestamp;
98  	uint64_t seen_count;
99  };
100  #endif
101  
102  /**
103   * struct obss_detection_cfg - current obss detection cfg set to firmware
104   * @obss_11b_ap_detect_mode: detection mode for 11b access point.
105   * @obss_11b_sta_detect_mode: detection mode for 11b station.
106   * @obss_11g_ap_detect_mode: detection mode for 11g access point.
107   * @obss_11a_detect_mode: detection mode for 11a access point.
108   * @obss_ht_legacy_detect_mode: detection mode for ht ap with legacy mode.
109   * @obss_ht_mixed_detect_mode: detection mode for ht ap with mixed mode.
110   * @obss_ht_20mhz_detect_mode: detection mode for ht ap with 20mhz mode.
111   */
112  struct obss_detection_cfg {
113  	uint8_t obss_11b_ap_detect_mode;
114  	uint8_t obss_11b_sta_detect_mode;
115  	uint8_t obss_11g_ap_detect_mode;
116  	uint8_t obss_11a_detect_mode;
117  	uint8_t obss_ht_legacy_detect_mode;
118  	uint8_t obss_ht_mixed_detect_mode;
119  	uint8_t obss_ht_20mhz_detect_mode;
120  };
121  
122  #define ADAPTIVE_11R_STA_IE_LEN   0x0B
123  #define ADAPTIVE_11R_STA_OUI      "\x00\x00\x0f\x22"
124  #define ADAPTIVE_11R_OUI_LEN      0x04
125  #define ADAPTIVE_11R_OUI_SUBTYPE  0x00
126  #define ADAPTIVE_11R_OUI_VERSION  0x01
127  #define ADAPTIVE_11R_DATA_LEN      0x04
128  #define ADAPTIVE_11R_OUI_DATA     "\x00\x00\x00\x01"
129  
130  #ifdef WLAN_FEATURE_11BE_MLO
131  #define WLAN_STA_PROFILE_MAX_LEN 514
132  #define WLAN_MLO_IE_COM_MAX_LEN 257
133  
134  /**
135   * struct wlan_mlo_sta_profile - Per STA profile structure
136   * @num_data: the length of data
137   * @data: the Per STA profile subelement data. Subelement ID + LEN + others,
138   * if num_data more than 257, it includes the frag IE for tx; it does not
139   * include the frag IE since it has been skipped when store the IE.
140   */
141  struct wlan_mlo_sta_profile {
142  	uint16_t num_data;
143  	uint8_t data[WLAN_STA_PROFILE_MAX_LEN];
144  };
145  
146  /**
147   * struct medium_sync_delay - medium sync delay info
148   * @medium_sync_duration: medium sync duration
149   * @medium_sync_ofdm_ed_thresh: medium sync OFDM ED threshold
150   * @medium_sync_max_txop_num: medium sync max txop num
151   */
152  struct medium_sync_delay {
153  	uint16_t medium_sync_duration:8;
154  	uint16_t medium_sync_ofdm_ed_thresh:4;
155  	uint16_t medium_sync_max_txop_num:4;
156  };
157  
158  /**
159   * struct eml_capabilities - EML capability info
160   * @emlsr_support: EMLSR support
161   * @emlsr_padding_delay: EMLSR padding delay
162   * @emlsr_transition_delay: EMLSR transition delay
163   * @emlmr_support: EMLSR support
164   * @emlmr_delay: EMLSR delay
165   * @transition_timeout: transition timeout
166   * @reserved: reserve
167   */
168  struct eml_capabilities {
169  	uint16_t emlsr_support:1;
170  	uint16_t emlsr_padding_delay:3;
171  	uint16_t emlsr_transition_delay:3;
172  	uint16_t emlmr_support:1;
173  	uint16_t emlmr_delay:3;
174  	uint16_t transition_timeout:4;
175  	uint16_t reserved:1;
176  };
177  
178  /**
179   * struct mld_capab_and_op - MLD capability and operations info
180   * @max_simultaneous_link_num: MAX simultaneous link num
181   * @srs_support: SRS support
182   * @tid_link_map_supported: TID link map support
183   * @str_freq_separation: STR freq separation
184   * @aar_support: AAR support
185   * @reserved: reserve
186   */
187  struct mld_capab_and_op {
188  	uint16_t max_simultaneous_link_num:4;
189  	uint16_t srs_support:1;
190  	uint16_t tid_link_map_supported:2;
191  	uint16_t str_freq_separation:5;
192  	uint16_t aar_support:1;
193  	uint16_t reserved:3;
194  };
195  
196  /**
197   * struct ext_mld_capab_and_op - EXT MLD capability and operations info
198   * @op_parameter_update_support: operation parameter update support
199   * @rec_max_simultaneous_links: recommended max simultaneous links
200   * @reserved: reserved
201   */
202  struct ext_mld_capab_and_op {
203  	uint16_t op_parameter_update_support:1;
204  	uint16_t rec_max_simultaneous_links:3;
205  	uint16_t reserved:11;
206  };
207  
208  /**
209   * struct wlan_mlo_ie - wlan ML IE info
210   * @type: the variant of the ML IE
211   * @reserved: reserved
212   * @link_id_info_present: the present flag of link id info
213   * @bss_param_change_cnt_present: the present flag of bss prarm change cnt
214   * @medium_sync_delay_info_present: the present flag of medium sync delay info
215   * @eml_capab_present: the present flag of EML capability
216   * @mld_capab_and_op_present: the present flag of MLD capability and operation
217   * @mld_id_present: the present flag of MLD ID
218   * @ext_mld_capab_and_op_present: Extended MLD Capabilities And
219   *                                Operations Present
220   * @reserved_1: reserved
221   * @common_info_length: common info length
222   * @mld_mac_addr: MLD mac address
223   * @link_id: link id
224   * @bss_param_change_count: bss param change count
225   * @medium_sync_delay_info: structure of medium_sync_delay
226   * @eml_capabilities_info: structure of eml_capabilities
227   * @mld_capab_and_op_info: structure of mld_capabilities and operations
228   * @mld_id_info: MLD ID
229   * @ext_mld_capab_and_op_info: structure of ext_mld_capab_and operations
230   * @num_sta_profile: the number of sta profile
231   * @sta_profile: structure of wlan_mlo_sta_profile
232   * @num_data: the length of data
233   * @data: the ML IE data, includes element ID + length + extension element ID +
234   * multi-link control and common info.
235   */
236  struct wlan_mlo_ie {
237  	uint16_t type:3;
238  	uint16_t reserved:1;
239  	uint16_t link_id_info_present:1;
240  	uint16_t bss_param_change_cnt_present:1;
241  	uint16_t medium_sync_delay_info_present:1;
242  	uint16_t eml_capab_present:1;
243  	uint16_t mld_capab_and_op_present: 1;
244  	uint16_t mld_id_present: 1;
245  	uint16_t ext_mld_capab_and_op_present: 1;
246  	uint16_t reserved_1:5;
247  	uint8_t common_info_length;
248  	uint8_t mld_mac_addr[6];
249  	uint8_t link_id;
250  	uint8_t bss_param_change_count;
251  	struct medium_sync_delay medium_sync_delay_info;
252  	struct eml_capabilities eml_capabilities_info;
253  	struct mld_capab_and_op mld_capab_and_op_info;
254  	uint8_t mld_id_info;
255  	struct ext_mld_capab_and_op ext_mld_capab_and_op_info;
256  	uint16_t num_sta_profile;
257  	struct wlan_mlo_sta_profile sta_profile[WLAN_MLO_MAX_VDEVS];
258  	uint16_t num_data;
259  	uint8_t data[WLAN_MLO_IE_COM_MAX_LEN];
260  };
261  
262  /**
263   * struct mlo_link_ie - IE per link to populate mlo ie
264   * @link_ds: DS IE
265   * @link_edca: ecsa IE
266   * @link_wmm_params: wmm params IE
267   * @link_wmm_caps: wmm caps IE
268   * @link_csa: csa IE
269   * @link_ecsa:ecsa IE
270   * @link_swt_time: switch time IE
271   * @link_quiet: quiet IE
272   * @link_ht_cap: ht cap IE
273   * @link_ht_info: ht info IE
274   * @link_cap: link caps IE
275   * @link_ext_cap: link extend cap IE
276   * @link_vht_cap: vht cap IE
277   * @link_vht_op: vht op IE
278   * @link_qcn_ie: qcn IE
279   * @link_he_cap: he cap IE
280   * @link_he_op: he op IE
281   * @link_he_6ghz_band_cap: 6G band cap IE
282   * @link_eht_cap: eht cap IE
283   * @link_eht_op: eht op IE
284   * @max_chan_swt_time: MLOTD
285   * @bss_param_change_cnt: bss param change count
286   */
287  struct mlo_link_ie {
288  	tDot11fIEDSParams                    link_ds;
289  	tDot11fIEEDCAParamSet                link_edca;
290  	tDot11fIEWMMParams                   link_wmm_params;
291  	tDot11fIEWMMCaps                     link_wmm_caps;
292  	tDot11fIEChanSwitchAnn               link_csa;
293  	tDot11fIEext_chan_switch_ann         link_ecsa;
294  	tDot11fIEmax_chan_switch_time        link_swt_time;
295  	tDot11fIEQuiet                       link_quiet;
296  	tDot11fIEHTCaps                      link_ht_cap;
297  	tDot11fIEHTInfo                      link_ht_info;
298  	tDot11fFfCapabilities                link_cap;
299  	tDot11fIEExtCap                      link_ext_cap;
300  	tDot11fIEVHTCaps                     link_vht_cap;
301  	tDot11fIEVHTOperation                link_vht_op;
302  	tDot11fIEqcn_ie                      link_qcn_ie;
303  	tDot11fIEhe_cap                      link_he_cap;
304  	tDot11fIEhe_op                       link_he_op;
305  	tDot11fIEhe_6ghz_band_cap            link_he_6ghz_band_cap;
306  	tDot11fIEeht_cap                     link_eht_cap;
307  	tDot11fIEeht_op                      link_eht_op;
308  	uint32_t                             max_chan_swt_time;
309  	uint8_t                              bss_param_change_cnt;
310  };
311  
312  /**
313   * struct mlo_link_ie_info - information per link to populate mlo ie
314   * @upt_bcn_mlo_ie: notify partner links to update their mlo ie of bcn temp
315   * @bss_param_change: bss param changed
316   * @bcn_tmpl_exist: bcn template is generated or not
317   * @link_ie: IEs which will be used for generating partner mlo IE
318   */
319  struct mlo_link_ie_info {
320  	bool upt_bcn_mlo_ie;
321  	bool bss_param_change;
322  	bool bcn_tmpl_exist;
323  	struct mlo_link_ie link_ie;
324  };
325  
326  /**
327   * struct wlan_mlo_ie_info - struct for mlo IE information
328   * @mld_mac_addr: MLD MAC address
329   * @common_info_length: Common Info Length
330   * @reserved_1: reserved bits
331   * @mld_id_present: MLD ID present
332   * @mld_capab_and_op_present: MLD capability and operations present
333   * @eml_capab_present: EML capability present
334   * @medium_sync_delay_info_present: Medium sync delay information present
335   * @bss_param_change_cnt_present: BSS parameter change count present
336   * @link_id_info_present: Link ID information present
337   * @ext_mld_capab_and_op_present: Extended MLD Capabilities And
338   *                                Operations Present
339   * @reserved: reserved bit
340   * @type: Type bits
341   */
342  struct wlan_mlo_ie_info {
343  #ifndef ANI_LITTLE_BIT_ENDIAN
344  	uint8_t mld_mac_addr[6];
345  	uint8_t common_info_length;
346  	uint16_t reserved_1:5;
347  	uint16_t ext_mld_capab_and_op_present:1;
348  	uint16_t mld_id_present:1;
349  	uint16_t mld_capab_and_op_present:1;
350  	uint16_t eml_capab_present:1;
351  	uint16_t medium_sync_delay_info_present:1;
352  	uint16_t bss_param_change_cnt_present:1;
353  	uint16_t link_id_info_present:1;
354  	uint16_t reserved:1;
355  	uint16_t type:3;
356  #else
357  	uint16_t type:3;
358  	uint16_t reserved:1;
359  	uint16_t link_id_info_present:1;
360  	uint16_t bss_param_change_cnt_present:1;
361  	uint16_t medium_sync_delay_info_present:1;
362  	uint16_t eml_capab_present:1;
363  	uint16_t mld_capab_and_op_present:1;
364  	uint16_t mld_id_present:1;
365  	uint16_t ext_mld_capab_and_op_present:1;
366  	uint16_t reserved_1:5;
367  	uint8_t common_info_length;
368  	uint8_t mld_mac_addr[6];
369  #endif
370  } qdf_packed;
371  
372  #endif
373  
374  /**
375   * struct pe_session - per-vdev PE context
376   * @available: true if the entry is available, false if it is in use
377   * @cm_id:
378   * @peSessionId: unique ID assigned to the entry
379   * @smeSessionId: ID of the session (legacy nomenclature)
380   * @vdev_id: ID of the vdev for which this entry is applicable
381   * @vdev: the actual vdev for which this entry is applicable
382   * @bssId: BSSID of the session
383   * @self_mac_addr: self MAC address
384   * * In AP role: BSSID and self_mac_addr will be the same.
385   * * In STA role: they will be different
386   * @ssId:
387   * @valid:
388   * @limMlmState: MLM State
389   * @limPrevMlmState: Previous MLM State
390   * @limSmeState: SME State
391   * @limPrevSmeState: Previous SME State
392   * @limSystemRole:
393   * @bssType:
394   * @nwType:
395   * @pLimStartBssReq:
396   * @lim_join_req: handle to sme join req
397   * @pLimReAssocReq: handle to sme reassoc req
398   * @pLimMlmJoinReq: handle to MLM join Req
399   * @pLimMlmReassocRetryReq: keep reasoc req for retry
400   * @pLimMlmReassocReq: handle to MLM reassoc Req
401   * @channelChangeReasonCode:
402   * @dot11mode:
403   * @htCapability:
404   * @connected_akm: AKM of current connection
405   * @htSupportedChannelWidthSet: HT Supported Channel Width Set:
406   * * 0 - 20MHz
407   * * 1 - 40MHz
408   * @htRecommendedTxWidthSet: Recommended Tx Width Set:
409   * * 0 - use 20 MHz channel (control channel)
410   * * 1 - use channel width enabled under Supported Channel Width Set
411   * @htSecondaryChannelOffset: Identifies the 40 MHz extension channel
412   * @limRFBand:
413   * @limCurrentAuthType:
414   * @limCurrentBssCaps:
415   * @limCurrentBssQosCaps:
416   * @limSentCapsChangeNtf:
417   * @limAID:
418   * @limReAssocbssId:
419   * @lim_reassoc_chan_freq:
420   * @reAssocHtSupportedChannelWidthSet:
421   * @reAssocHtRecommendedTxWidthSet:
422   * @reAssocHtSecondaryChannelOffset:
423   * @limReassocSSID:
424   * @limReassocBssCaps:
425   * @limReassocBssQosCaps:
426   * @limAssocResponseData: Assoc or ReAssoc Response Data/Frame
427   * @statypeForBss: to know session is for PEER or SELF
428   * @shortSlotTimeSupported:
429   * @dtimPeriod:
430   * @rateSet:
431   * @extRateSet:
432   * @htOperMode:
433   * @curr_op_freq:
434   * @curr_req_chan_freq:
435   * @LimRxedBeaconCntDuringHB:
436   * @lastBeaconTimeStamp: Time stamp of the last beacon received from the BSS
437   *                       to which STA is connected.
438   * @currentBssBeaconCnt: RX Beacon count for the current BSS to which STA
439   *                       is connected.
440   * @bcon_dtim_period: Beacon DTIM period
441   * @bcnLen: Length of @beacon
442   * @beacon: Used to store last beacon / probe response before assoc.
443   * @assocReqLen: Length of @assoc_req
444   * @assoc_req: Used to store association request frame
445   * @assocRspLen: Length of @assocRsp
446   * @assocRsp: Used to store association response received while associating
447   * @dph:
448   * @parsedAssocReq: Used to store parsed assoc req from various requesting
449   *                  station
450   * @RICDataLen: Length of @ricData
451   * @ricData: Used to store the Ric data received in the assoc response
452   * @tspecLen: Length of @tspecIes
453   * @tspecIes: Used to store the TSPEC IEs received in the assoc response
454   * @encryptType:
455   * @gLimProtectionControl: used for 11n protection
456   * @gHTNonGFDevicesPresent:
457   * @cfgProtection: protection related config cache
458   * @gLim11bParams: Number of legacy STAs associated
459   * @gLim11aParams: Number of 11A STAs associated
460   * @gLim11gParams: Number of non-ht non-legacy STAs associated
461   * @gLimNonGfParams: Number of nonGf STA associated
462   * @gLimHt20Params: Number of HT 20 STAs associated
463   * @gLimLsigTxopParams: Number of Lsig Txop not supported STAs associated
464   * @gLimNoShortParams: Number of STAs that do not support short preamble
465   * @gLimNoShortSlotParams: Number of STAs that do not support short slot time
466   * @gLimOlbcParams: OLBC parameters
467   * @gLimOverlap11gParams: OLBC parameters
468   * @gLimOverlap11aParams:
469   * @gLimOverlapHt20Params:
470   * @gLimOverlapNonGfParams:
471   * @protStaCache: cache for each overlap
472   * @privacy:
473   * @authType:
474   * @WEPKeyMaterial:
475   * @wmm_params:
476   * @gStartBssRSNIe:
477   * @gStartBssWPAIe:
478   * @APWPSIEs:
479   * @apUapsdEnable:
480   * @pAPWPSPBCSession:
481   * @DefProbeRspIeBitmap:
482   * @proxyProbeRspEn:
483   * @probeRespFrame:
484   * @ssidHidden:
485   * @fwdWPSPBCProbeReq:
486   * @wps_state:
487   * @wps_registration:
488   * @limQosEnabled: Is 802.11e QoS enabled
489   * @limWmeEnabled: Is WME enabled
490   * @limWsmEnabled: Is WSM enabled
491   * @limHcfEnabled: Is HCF enabled
492   * @limRmfEnabled: Is 802.11w RMF enabled
493   * @lim11hEnable: Is 802.11h enabled
494   * @maxTxPower: Max transmit power, the minimum of Regulatory and local
495   *              power constraint)
496   * @min_11h_pwr:
497   * @max_11h_pwr:
498   * @opmode:
499   * @txMgmtPower:
500   * @is11Rconnection:
501   * @is_adaptive_11r_connection: flag to check if we are connecting
502   * @isESEconnection:
503   * @eseContext:
504   * @isFastTransitionEnabled:
505   * @isFastRoamIniFeatureEnabled:
506   * @p2pGoPsUpdate:
507   * @defaultAuthFailureTimeout:
508   * @gLimEdcaParams: These EDCA parameters are used locally on AP or STA.
509   * If STA, then these are values taken from the Assoc Rsp when associating,
510   * or Beacons/Probe Response after association.  If AP, then these are
511   * values originally set locally on AP.
512   * @gLimEdcaParamsBC: These EDCA parameters are use by AP to broadcast
513   * to other STATIONs in the BSS.
514   * @gLimEdcaParamsActive: These EDCA parameters are what's actively being
515   * used on station. Specific AC values may be downgraded depending on
516   * admission control for that particular AC.
517   * @gLimEdcaParamSetCount:
518   * @beaconParams:
519   * @vhtCapability:
520   * @gLimOperatingMode:
521   * @vhtCapabilityPresentInBeacon:
522   * @ch_center_freq_seg0: center freq number as advertised OTA
523   * @ch_width:    Session max channel width
524   * @ap_ch_width: AP advertised channel width
525   * @puncture_bitmap:
526   * @ch_center_freq_seg1:
527   * @enableVhtpAid:
528   * @enableVhtGid:
529   * @gLimWiderBWChannelSwitch:
530   * @enableAmpduPs:
531   * @send_smps_action:
532   * @spectrumMgtEnabled:
533   * @gLimSpecMgmt:
534   * @gLimChannelSwitch: CB Primary/Secondary Channel Switch Info
535   * @gLimPhyMode:
536   * @txLdpcIniFeatureEnabled:
537   * @gpLimPeerIdxpool: free peer index pool. A non-zero value indicates that
538   *                    peer index is available for assignment.
539   * @freePeerIdxHead:
540   * @freePeerIdxTail:
541   * @gLimNumOfCurrentSTAs:
542   * @peerAIDBitmap:
543   * @tdls_send_set_state_disable:
544   * @fWaitForProbeRsp:
545   * @fIgnoreCapsChange:
546   * @fDeauthReceived:
547   * @rssi:
548   * @max_amsdu_num:
549   * @ht_config:
550   * @vht_config:
551   * @gLimCurrentBssUapsd:
552   * @gUapsdPerAcBitmask: Used on STA, this is a static UAPSD mask setting
553   *                      derived from SME_JOIN_REQ and SME_REASSOC_REQ. If a
554   *                      particular AC bit is set, it means the AC is both
555   *                      trigger enabled and delivery enabled.
556   * @gUapsdPerAcTriggerEnableMask: Used on STA, this is a dynamic UPASD mask
557   *                                setting derived from AddTS Rsp and DelTS
558   *                                frame. If a particular AC bit is set, it
559   *                                means AC is trigger enabled.
560   * @gUapsdPerAcDeliveryEnableMask: Used on STA, dynamic UPASD mask setting
561   *                                 derived from AddTS Rsp and DelTs frame. If
562   *                                 a particular AC bit is set, it means AC is
563   *                                 delivery enabled.
564   * @csaOffloadEnable: Flag to skip CSA IE processing when CSA offload is
565   *                    enabled.
566   * @gAcAdmitMask: Used on STA for AC downgrade. This is a dynamic mask
567   *                setting which keep tracks of ACs being admitted.
568   *                If bit is set to 0: That particular AC is not admitted
569   *                If bit is set to 1: That particular AC is admitted
570   * @pmmOffloadInfo: Power Save Off load Parameters
571   * @smpsMode: SMPS mode
572   * @chainMask:
573   * @dfsIncludeChanSwIe: Flag to indicate Chan Sw announcement is required
574   * @dfsIncludeChanWrapperIe: Flag to indicate Chan Wrapper Element is required
575   * @bw_update_include_ch_sw_ie: Flag to indicate chan switch Element is required
576   *                              due to bandwidth update
577   * @cc_switch_mode:
578   * @isCiscoVendorAP:
579   * @add_ie_params:
580   * @pSchProbeRspTemplate:
581   * @pSchBeaconFrameBegin: Beginning portion of the beacon frame to be written
582   *                        to TFP
583   * @pSchBeaconFrameEnd: Trailing portion of the beacon frame to be written
584   *                      to TFP
585   * @schBeaconOffsetBegin: Size of the beginning portion
586   * @schBeaconOffsetEnd: Size of the trailing portion
587   * @isOSENConnection:
588   * @QosMapSet: DSCP to UP mapping for HS 2.0
589   * @bRoamSynchInProgress:
590   * @ftPEContext: Fast Transition (FT) Context
591   * @isNonRoamReassoc:
592   * @pmf_retry_timer:
593   * @pmf_retry_timer_info:
594   * @protection_fields_reset_timer: timer for resetting protection fields
595   *                                 at regular intervals
596   * @ap_ecsa_timer: timer to decrement CSA/ECSA count
597   * @ap_ecsa_wakelock: wakelock to complete CSA operation.
598   * @ap_ecsa_runtime_lock: runtime lock to complete SAP CSA operation.
599   *                        to Adaptive 11R network
600   * @mac_ctx: MAC context
601   * @old_protection_state: variable to store state of various protection
602   *                        struct like gLimOlbcParams, gLimOverlap11gParams,
603   *                         gLimOverlapHt20Params etc
604   * @prev_ap_bssid:
605   * @sap_advertise_avoid_ch_ie: tells if Q2Q IE, from another MDM device in
606   *                             AP MCC mode was received
607   * @is_ese_version_ie_present:
608   * @sap_dot11mc:
609   * @is_vendor_specific_vhtcaps:
610   * @vendor_specific_vht_ie_sub_type:
611   * @vendor_vht_sap:
612   * @hs20vendor_ie: HS 2.0 Indication
613   * @country_info_present: flag to indicate country code in beacon
614   * @nss:
615   * @nss_forced_1x1:
616   * @add_bss_failed:
617   * @obss_ht40_scanparam: OBSS Scan IE Parameters
618   * @vdev_nss:
619   * @supported_nss_1x1: Supported NSS is intersection of self and peer NSS
620   * @is_ext_caps_present:
621   * @beacon_tx_rate:
622   * @access_policy_vendor_ie:
623   * @access_policy:
624   * @send_p2p_conf_frame:
625   * @process_ho_fail:
626   * @lim_non_ecsa_cap_num: Number of STAs that do not support ECSA capability
627   * @he_capable:
628   * @he_config:
629   * @he_op:
630   * @he_sta_obsspd:
631   * @he_6ghz_band:
632   * @he_bss_color_change:
633   * @bss_color_info:
634   * @bss_color_changing:
635   * @deauth_retry:
636   * @enable_bcast_probe_rsp:
637   * @ht_client_cnt:
638   * @ch_switch_in_progress:
639   * @he_with_wep_tkip:
640   * @fils_info:
641   * @prev_auth_seq_num: Sequence number of previously received auth frame to
642   *                     detect duplicate frames.
643   * @prev_auth_mac_addr: mac_addr of the sta correspond to @prev_auth_seq_num
644   * @obss_offload_cfg:
645   * @current_obss_detection:
646   * @is_session_obss_offload_enabled:
647   * @is_obss_reset_timer_initialized:
648   * @sae_pmk_cached:
649   * @recvd_deauth_while_roaming:
650   * @recvd_disassoc_while_roaming:
651   * @deauth_disassoc_rc:
652   * @obss_color_collision_dec_evt:
653   * @is_session_obss_color_collision_det_enabled:
654   * @ap_mu_edca_params:
655   * @mu_edca_present:
656   * @def_max_tx_pwr:
657   * @active_ba_64_session:
658   * @is_mbssid_enabled:
659   * @peer_twt_requestor:
660   * @peer_twt_responder:
661   * @enable_session_twt_support:
662   * @cac_duration_ms:
663   * @stop_bss_reason:
664   * @prot_status_code:
665   * @result_code:
666   * @dfs_regdomain:
667   * @ap_defined_power_type_6g: 6 GHz power type advertised by AP
668   * @best_6g_power_type: best 6 GHz power type
669   * @sta_follows_sap_power:
670   * @eht_capable:
671   * @eht_config:
672   * @eht_op:
673   * @mlo_link_info:
674   * @ml_partner_info:
675   * @mlo_ie_total_len:
676   * @mlo_ie:
677   * @user_edca_set:
678   * @is_oui_auth_assoc_6mbps_2ghz_enable: send auth/assoc req with 6 Mbps rate
679   * @is_unexpected_peer_error: true if unexpected peer error
680   * on 2.4 GHz
681   * @join_probe_cnt: join probe request count
682   */
683  struct pe_session {
684  	uint8_t available;
685  	wlan_cm_id cm_id;
686  	uint16_t peSessionId;
687  	union {
688  		uint8_t smeSessionId;
689  		uint8_t vdev_id;
690  	};
691  	struct wlan_objmgr_vdev *vdev;
692  
693  	tSirMacAddr bssId;
694  	tSirMacAddr self_mac_addr;
695  	tSirMacSSid ssId;
696  	uint8_t valid;
697  	tLimMlmStates limMlmState;
698  	tLimMlmStates limPrevMlmState;
699  	tLimSmeStates limSmeState;
700  	tLimSmeStates limPrevSmeState;
701  	tLimSystemRole limSystemRole;
702  	enum bss_type bssType;
703  	tSirNwType nwType;
704  	struct start_bss_config *pLimStartBssReq;
705  	struct join_req *lim_join_req;
706  	struct join_req *pLimReAssocReq;
707  	tpLimMlmJoinReq pLimMlmJoinReq;
708  	void *pLimMlmReassocRetryReq;
709  	void *pLimMlmReassocReq;
710  	uint16_t channelChangeReasonCode;
711  	uint8_t dot11mode;
712  	uint8_t htCapability;
713  	enum ani_akm_type connected_akm;
714  
715  	uint8_t htSupportedChannelWidthSet;
716  	uint8_t htRecommendedTxWidthSet;
717  	ePhyChanBondState htSecondaryChannelOffset;
718  	enum reg_wifi_band limRFBand;
719  
720  	tAniAuthType limCurrentAuthType;
721  	uint16_t limCurrentBssCaps;
722  	uint8_t limCurrentBssQosCaps;
723  	uint8_t limSentCapsChangeNtf;
724  	uint16_t limAID;
725  
726  	tSirMacAddr limReAssocbssId;
727  	uint32_t lim_reassoc_chan_freq;
728  	uint8_t reAssocHtSupportedChannelWidthSet;
729  	uint8_t reAssocHtRecommendedTxWidthSet;
730  	ePhyChanBondState reAssocHtSecondaryChannelOffset;
731  	tSirMacSSid limReassocSSID;
732  	uint16_t limReassocBssCaps;
733  	uint8_t limReassocBssQosCaps;
734  
735  	void *limAssocResponseData;
736  
737  	uint16_t statypeForBss;
738  	uint8_t shortSlotTimeSupported;
739  	uint8_t dtimPeriod;
740  	tSirMacRateSet rateSet;
741  	tSirMacRateSet extRateSet;
742  	tSirMacHTOperatingMode htOperMode;
743  	qdf_freq_t curr_op_freq;
744  	uint32_t curr_req_chan_freq;
745  	uint8_t LimRxedBeaconCntDuringHB;
746  	uint64_t lastBeaconTimeStamp;
747  	uint32_t currentBssBeaconCnt;
748  	uint8_t bcon_dtim_period;
749  
750  	uint32_t bcnLen;
751  	uint8_t *beacon;
752  
753  	uint32_t assocReqLen;
754  	uint8_t *assoc_req;
755  
756  	uint32_t assocRspLen;
757  	uint8_t *assocRsp;
758  	tAniSirDph dph;
759  	void **parsedAssocReq;
760  	uint32_t RICDataLen;
761  	uint8_t *ricData;
762  #ifdef FEATURE_WLAN_ESE
763  	uint32_t tspecLen;
764  	uint8_t *tspecIes;
765  #endif
766  	uint32_t encryptType;
767  
768  	uint8_t gLimProtectionControl;
769  
770  	uint8_t gHTNonGFDevicesPresent;
771  
772  	tCfgProtection cfgProtection;
773  	tLimProtStaParams gLim11bParams;
774  	tLimProtStaParams gLim11aParams;
775  	tLimProtStaParams gLim11gParams;
776  	tLimProtStaParams gLimNonGfParams;
777  	tLimProtStaParams gLimHt20Params;
778  	tLimProtStaParams gLimLsigTxopParams;
779  	tLimNoShortParams gLimNoShortParams;
780  	tLimNoShortSlotParams gLimNoShortSlotParams;
781  	tLimProtStaParams gLimOlbcParams;
782  	tLimProtStaParams gLimOverlap11gParams;
783  	tLimProtStaParams gLimOverlap11aParams;
784  	tLimProtStaParams gLimOverlapHt20Params;
785  	tLimProtStaParams gLimOverlapNonGfParams;
786  
787  	tCacheParams protStaCache[LIM_PROT_STA_CACHE_SIZE];
788  
789  	uint8_t privacy;
790  	tAniAuthType authType;
791  	tDot11fIEWMMParams wmm_params;
792  	tDot11fIERSN gStartBssRSNIe;
793  	tDot11fIEWPA gStartBssWPAIe;
794  	tSirAPWPSIEs APWPSIEs;
795  	uint8_t apUapsdEnable;
796  	tSirWPSPBCSession *pAPWPSPBCSession;
797  	uint32_t DefProbeRspIeBitmap[8];
798  	uint32_t proxyProbeRspEn;
799  	tDot11fProbeResponse probeRespFrame;
800  	uint8_t ssidHidden;
801  	bool fwdWPSPBCProbeReq;
802  	uint8_t wps_state;
803  	bool wps_registration;
804  
805  	uint8_t limQosEnabled:1;
806  	uint8_t limWmeEnabled:1;
807  	uint8_t limWsmEnabled:1;
808  	uint8_t limHcfEnabled:1;
809  	uint8_t limRmfEnabled:1;
810  	uint32_t lim11hEnable;
811  
812  	int8_t maxTxPower;
813  	int8_t min_11h_pwr;
814  	int8_t max_11h_pwr;
815  	enum QDF_OPMODE opmode;
816  	int8_t txMgmtPower;
817  	bool is11Rconnection;
818  	bool is_adaptive_11r_connection;
819  
820  #ifdef FEATURE_WLAN_ESE
821  	tEsePEContext eseContext;
822  #endif
823  	tSirP2PNoaAttr p2pGoPsUpdate;
824  	uint32_t defaultAuthFailureTimeout;
825  
826  	tSirMacEdcaParamRecord gLimEdcaParams[QCA_WLAN_AC_ALL];
827  	tSirMacEdcaParamRecord gLimEdcaParamsBC[QCA_WLAN_AC_ALL];
828  	tSirMacEdcaParamRecord gLimEdcaParamsActive[QCA_WLAN_AC_ALL];
829  
830  	uint8_t gLimEdcaParamSetCount;
831  
832  	tBeaconParams beaconParams;
833  	uint8_t vhtCapability;
834  	tLimOperatingModeInfo gLimOperatingMode;
835  	uint8_t vhtCapabilityPresentInBeacon;
836  	uint8_t ch_center_freq_seg0;
837  	enum phy_ch_width ch_width;
838  	enum phy_ch_width ap_ch_width;
839  #ifdef WLAN_FEATURE_11BE
840  	uint16_t puncture_bitmap;
841  #endif
842  	uint8_t ch_center_freq_seg1;
843  	uint8_t enableVhtpAid;
844  	uint8_t enableVhtGid;
845  	tLimWiderBWChannelSwitchInfo gLimWiderBWChannelSwitch;
846  	uint8_t enableAmpduPs;
847  	bool send_smps_action;
848  	uint8_t spectrumMgtEnabled;
849  
850  	tLimSpecMgmtInfo gLimSpecMgmt;
851  	tLimChannelSwitchInfo gLimChannelSwitch;
852  
853  	uint32_t gLimPhyMode;
854  	uint8_t txLdpcIniFeatureEnabled;
855  	uint8_t *gpLimPeerIdxpool;
856  	uint8_t freePeerIdxHead;
857  	uint8_t freePeerIdxTail;
858  	uint16_t gLimNumOfCurrentSTAs;
859  #ifdef FEATURE_WLAN_TDLS
860  	uint32_t peerAIDBitmap[2];
861  	bool tdls_send_set_state_disable;
862  #endif
863  	bool fWaitForProbeRsp;
864  	bool fIgnoreCapsChange;
865  	bool fDeauthReceived;
866  #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
867  	int8_t rssi;
868  #endif
869  	uint8_t max_amsdu_num;
870  	struct mlme_ht_capabilities_info ht_config;
871  	struct wlan_vht_config vht_config;
872  	uint8_t gLimCurrentBssUapsd;
873  	uint8_t gUapsdPerAcBitmask;
874  	uint8_t gUapsdPerAcTriggerEnableMask;
875  	uint8_t gUapsdPerAcDeliveryEnableMask;
876  	uint8_t csaOffloadEnable;
877  	uint8_t gAcAdmitMask[SIR_MAC_DIRECTION_DIRECT];
878  
879  	tPowersaveoffloadInfo pmmOffloadInfo;
880  	uint8_t smpsMode;
881  
882  	uint8_t chainMask;
883  
884  	uint8_t dfsIncludeChanSwIe;
885  
886  	uint8_t dfsIncludeChanWrapperIe;
887  	uint8_t bw_update_include_ch_sw_ie;
888  
889  #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
890  	uint8_t cc_switch_mode;
891  #endif
892  
893  	bool isCiscoVendorAP;
894  
895  	struct add_ie_params add_ie_params;
896  
897  	uint8_t *pSchProbeRspTemplate;
898  	uint8_t *pSchBeaconFrameBegin;
899  	uint8_t *pSchBeaconFrameEnd;
900  	uint16_t schBeaconOffsetBegin;
901  	uint16_t schBeaconOffsetEnd;
902  	bool isOSENConnection;
903  	struct qos_map_set QosMapSet;
904  
905  #ifdef WLAN_FEATURE_ROAM_OFFLOAD
906  	bool bRoamSynchInProgress;
907  #endif
908  
909  	tftPEContext ftPEContext;
910  	bool isNonRoamReassoc;
911  	qdf_mc_timer_t pmf_retry_timer;
912  	struct comeback_timer_info pmf_retry_timer_info;
913  	qdf_mc_timer_t protection_fields_reset_timer;
914  	qdf_mc_timer_t ap_ecsa_timer;
915  	qdf_wake_lock_t ap_ecsa_wakelock;
916  	qdf_runtime_lock_t ap_ecsa_runtime_lock;
917  	struct mac_context *mac_ctx;
918  	uint16_t old_protection_state;
919  	tSirMacAddr prev_ap_bssid;
920  #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
921  	bool sap_advertise_avoid_ch_ie;
922  #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
923  #ifdef FEATURE_WLAN_ESE
924  	uint8_t is_ese_version_ie_present;
925  #endif
926  	bool sap_dot11mc;
927  	bool is_vendor_specific_vhtcaps;
928  	uint8_t vendor_specific_vht_ie_sub_type;
929  	bool vendor_vht_sap;
930  	tDot11fIEhs20vendor_ie hs20vendor_ie;
931  	uint8_t country_info_present;
932  	uint8_t nss;
933  	bool nss_forced_1x1;
934  	bool add_bss_failed;
935  	struct obss_scanparam obss_ht40_scanparam;
936  	uint8_t vdev_nss;
937  	bool supported_nss_1x1;
938  	bool is_ext_caps_present;
939  	uint16_t beacon_tx_rate;
940  	uint8_t *access_policy_vendor_ie;
941  	uint8_t access_policy;
942  	bool send_p2p_conf_frame;
943  	bool process_ho_fail;
944  	uint8_t lim_non_ecsa_cap_num;
945  #ifdef WLAN_FEATURE_11AX
946  	bool he_capable;
947  	tDot11fIEhe_cap he_config;
948  	tDot11fIEhe_op he_op;
949  	uint32_t he_sta_obsspd;
950  	bool he_6ghz_band;
951  #ifdef WLAN_FEATURE_11AX_BSS_COLOR
952  	tDot11fIEbss_color_change he_bss_color_change;
953  	struct bss_color_info bss_color_info[MAX_BSS_COLOR_VALUE];
954  	uint8_t bss_color_changing;
955  #endif
956  #endif
957  	struct deauth_retry_params deauth_retry;
958  	bool enable_bcast_probe_rsp;
959  	uint8_t ht_client_cnt;
960  	bool ch_switch_in_progress;
961  	bool he_with_wep_tkip;
962  #ifdef WLAN_FEATURE_FILS_SK
963  	struct pe_fils_session *fils_info;
964  #endif
965  
966  	uint16_t prev_auth_seq_num;
967  	tSirMacAddr prev_auth_mac_addr;
968  	struct obss_detection_cfg obss_offload_cfg;
969  	struct obss_detection_cfg current_obss_detection;
970  	bool is_session_obss_offload_enabled;
971  	bool is_obss_reset_timer_initialized;
972  	bool sae_pmk_cached;
973  	bool recvd_deauth_while_roaming;
974  	bool recvd_disassoc_while_roaming;
975  	uint16_t deauth_disassoc_rc;
976  	enum wmi_obss_color_collision_evt_type obss_color_collision_dec_evt;
977  	bool is_session_obss_color_collision_det_enabled;
978  	tSirMacEdcaParamRecord ap_mu_edca_params[QCA_WLAN_AC_ALL];
979  	bool mu_edca_present;
980  	int8_t def_max_tx_pwr;
981  	bool active_ba_64_session;
982  	bool is_mbssid_enabled;
983  #ifdef WLAN_SUPPORT_TWT
984  	uint8_t peer_twt_requestor;
985  	uint8_t peer_twt_responder;
986  #endif
987  	bool enable_session_twt_support;
988  	uint32_t cac_duration_ms;
989  	tSirResultCodes stop_bss_reason;
990  	uint16_t prot_status_code;
991  	tSirResultCodes result_code;
992  	uint32_t dfs_regdomain;
993  	uint8_t ap_defined_power_type_6g;
994  	uint8_t best_6g_power_type;
995  	bool sta_follows_sap_power;
996  #ifdef WLAN_FEATURE_11BE
997  	bool eht_capable;
998  	tDot11fIEeht_cap eht_config;
999  	tDot11fIEeht_op eht_op;
1000  #ifdef WLAN_FEATURE_11BE_MLO
1001  	struct mlo_link_ie_info mlo_link_info;
1002  	struct mlo_partner_info ml_partner_info;
1003  	uint16_t mlo_ie_total_len;
1004  	struct wlan_mlo_ie mlo_ie;
1005  #endif
1006  #endif /* WLAN_FEATURE_11BE */
1007  	uint8_t user_edca_set;
1008  	bool is_oui_auth_assoc_6mbps_2ghz_enable;
1009  	bool is_unexpected_peer_error;
1010  	uint8_t join_probe_cnt;
1011  };
1012  
1013  /*-------------------------------------------------------------------------
1014     Function declarations and documentation
1015     ------------------------------------------------------------------------*/
1016  
1017  #ifdef WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY
1018  /**
1019   * pe_allocate_dph_node_array_buffer() - Allocate g_dph_node_array
1020   * memory dynamically
1021   *
1022   * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_NOMEM on failure
1023   */
1024  QDF_STATUS pe_allocate_dph_node_array_buffer(void);
1025  
1026  /**
1027   * pe_free_dph_node_array_buffer() - Free memory allocated dynamically
1028   *
1029   * Return: None
1030   */
1031  void pe_free_dph_node_array_buffer(void);
1032  #else /* WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY */
pe_allocate_dph_node_array_buffer(void)1033  static inline QDF_STATUS pe_allocate_dph_node_array_buffer(void)
1034  {
1035  	return QDF_STATUS_SUCCESS;
1036  }
1037  
pe_free_dph_node_array_buffer(void)1038  static inline void pe_free_dph_node_array_buffer(void)
1039  {
1040  }
1041  #endif /* WLAN_ALLOCATE_GLOBAL_BUFFERS_DYNAMICALLY */
1042  
1043  /**
1044   * pe_create_session() - Creates a new PE session given the BSSID
1045   * @mac: pointer to global adapter context
1046   * @bssid: BSSID of the new session
1047   * @sessionId: PE session ID is returned here, if PE session is created.
1048   * @numSta: number of stations
1049   * @bssType: bss type of new session to do conditional memory allocation.
1050   * @vdev_id: vdev_id
1051   *
1052   * This function returns the session context and the session ID if the session
1053   * corresponding to the passed BSSID is found in the PE session table.
1054   *
1055   * Return: ptr to the session context or NULL if session can not be created.
1056   */
1057  struct pe_session *pe_create_session(struct mac_context *mac,
1058  				     uint8_t *bssid, uint8_t *sessionId,
1059  				     uint16_t numSta, enum bss_type bssType,
1060  				     uint8_t vdev_id);
1061  
1062  /**
1063   * pe_find_session_by_bssid() - looks up the PE session given the BSSID.
1064   *
1065   * @mac:          pointer to global adapter context
1066   * @bssid:         BSSID of the new session
1067   * @sessionId:     session ID is returned here, if session is created.
1068   *
1069   * This function returns the session context and the session ID if the session
1070   * corresponding to the given BSSID is found in the PE session table.
1071   *
1072   * Return: pointer to the session context or NULL if session is not found.
1073   */
1074  struct pe_session *pe_find_session_by_bssid(struct mac_context *mac, uint8_t *bssid,
1075  				     uint8_t *sessionId);
1076  
1077  /**
1078   * pe_find_session_by_vdev_id() - looks up the PE session given the vdev_id.
1079   * @mac:             pointer to global adapter context
1080   * @vdev_id:         vdev id the session
1081   *
1082   * Return: pointer to the session context or NULL if session is not found.
1083   */
1084  struct pe_session *pe_find_session_by_vdev_id(struct mac_context *mac,
1085  					      uint8_t vdev_id);
1086  
1087  /**
1088   * pe_find_session_by_vdev_id_and_state() - Find PE session by vdev_id and
1089   * mlm state.
1090   * @mac:             pointer to global adapter context
1091   * @vdev_id:         vdev id the session
1092   * @lim_state:       LIM state of the session
1093   *
1094   * During LFR2 roaming, new pe session is created before old pe session
1095   * deleted, the 2 pe sessions have different pe session id, but same vdev id,
1096   * can't get correct pe session by vdev id at this time.
1097   *
1098   * Return: pointer to the session context or NULL if session is not found.
1099   */
1100  struct pe_session
1101  *pe_find_session_by_vdev_id_and_state(struct mac_context *mac,
1102  				      uint8_t vdev_id,
1103  				      enum eLimMlmStates lim_state);
1104  
1105  /**
1106   * pe_find_session_by_bssid_and_vdev_id() - looks up the PE session given
1107   * the BSSID and vdev id.
1108   * @mac:          pointer to global adapter context
1109   * @bssid:         BSSID of the new session
1110   * @vdev_id:         vdev id the session
1111   * @sessionId:     session ID is returned here, if session is created.
1112   *
1113   * This function returns the session context and the session ID if the session
1114   * corresponding to the given BSSID and vdev id is found in the PE
1115   * session table.
1116   *
1117   * Return: pointer to the session context or NULL if session is not found.
1118   */
1119  struct pe_session *pe_find_session_by_bssid_and_vdev_id(struct mac_context *mac,
1120  							uint8_t *bssid,
1121  							uint8_t vdev_id,
1122  							uint8_t *sessionId);
1123  
1124  /**
1125   * pe_find_session_by_peer_sta() - looks up the PE session given the Peer
1126   * Station Address.
1127   *
1128   * @mac:          pointer to global adapter context
1129   * @sa:            Peer STA Address of the session
1130   * @sessionId:     session ID is returned here, if session is found.
1131   *
1132   * This function returns the session context and the session ID if the session
1133   * corresponding to the given destination address is found in the PE session
1134   * table.
1135   *
1136   * Return: pointer to the session context or NULL if session is not found.
1137   */
1138  struct pe_session *pe_find_session_by_peer_sta(struct mac_context *mac, uint8_t *sa,
1139  					uint8_t *sessionId);
1140  
1141  /**
1142   * pe_find_session_by_session_id() - looks up the PE session given the session
1143   * ID.
1144   *
1145   * @mac:          pointer to global adapter context
1146   * @sessionId:     session ID for which session context needs to be looked up.
1147   *
1148   * This function returns the session context  if the session corresponding to
1149   * the given session ID is found in the PE session table.
1150   *
1151   * Return: pointer to the session context or NULL if session is not found.
1152   */
1153  struct pe_session *pe_find_session_by_session_id(struct mac_context *mac,
1154  					  uint8_t sessionId);
1155  
1156  /**
1157   * pe_delete_session() - deletes the PE session given the session ID.
1158   *
1159   * @mac:        pointer to global adapter context
1160   * @pe_session: session to delete
1161   *
1162   * Return: void
1163   */
1164  void pe_delete_session(struct mac_context *mac, struct pe_session *pe_session);
1165  
1166  /**
1167   * pe_find_session_by_scan_id() - looks up the PE session for given scan id
1168   * @mac_ctx:   pointer to global adapter context
1169   * @scan_id:   scan id
1170   *
1171   * looks up the PE session for given scan id
1172   *
1173   * Return: pe session entry for given scan id if found else NULL
1174   */
1175  struct pe_session *pe_find_session_by_scan_id(struct mac_context *mac_ctx,
1176  				       uint32_t scan_id);
1177  
1178  uint8_t pe_get_active_session_count(struct mac_context *mac_ctx);
1179  
1180  /**
1181   * lim_dump_session_info() - Dump the key parameters of PE session
1182   * @mac_ctx: Global MAC context
1183   * @pe_session: PE session
1184   *
1185   * Dumps the fields from the @pe_session for debugging.
1186   *
1187   * Return: void
1188   */
1189  void lim_dump_session_info(struct mac_context *mac_ctx,
1190  			   struct pe_session *pe_session);
1191  
1192  #ifdef WLAN_FEATURE_11AX
1193  /**
1194   * lim_dump_he_info() - Dump HE fields in PE session
1195   * @mac: Global MAC context
1196   * @session: PE session
1197   *
1198   * Dumps the fields related to HE from the @session for debugging
1199   *
1200   * Return: void
1201   */
1202  void lim_dump_he_info(struct mac_context *mac, struct pe_session *session);
1203  #else
lim_dump_he_info(struct mac_context * mac,struct pe_session * session)1204  static inline void lim_dump_he_info(struct mac_context *mac,
1205  				    struct pe_session *session)
1206  {
1207  }
1208  #endif
1209  
1210  #ifdef WLAN_FEATURE_11BE_MLO
1211  /**
1212   * lim_dump_eht_info() - Dump EHT fields in PE session
1213   * @session: PE session
1214   *
1215   * Dumps the fields related to EHT from @session for debugging
1216   *
1217   * Return: void
1218   */
1219  void lim_dump_eht_info(struct pe_session *session);
1220  #else
lim_dump_eht_info(struct pe_session * session)1221  static inline void lim_dump_eht_info(struct pe_session *session)
1222  {
1223  }
1224  #endif
1225  
1226  #ifdef WLAN_FEATURE_FILS_SK
1227  /**
1228   * pe_delete_fils_info: API to delete fils session info
1229   * @session: pe session
1230   *
1231   * Return: void
1232   */
1233  void pe_delete_fils_info(struct pe_session *session);
1234  #endif
1235  
1236  /**
1237   * lim_set_bcn_probe_filter - set the beacon/probe filter in mac context
1238   *
1239   * @mac_ctx: pointer to global mac context
1240   * @session: pointer to the PE session
1241   * @sap_channel: Operating Channel of the session for SAP sessions
1242   *
1243   * Sets the beacon/probe filter in the global mac context to filter
1244   * and drop beacon/probe frames before posting it to PE queue
1245   *
1246   * Return: None
1247   */
1248  void lim_set_bcn_probe_filter(struct mac_context *mac_ctx,
1249  				struct pe_session *session,
1250  				uint8_t sap_channel);
1251  
1252  /**
1253   * lim_reset_bcn_probe_filter - clear the beacon/probe filter in mac context
1254   *
1255   * @mac_ctx: pointer to the global mac context
1256   * @session: pointer to the PE session whose filter is to be cleared
1257   *
1258   * Return: None
1259   */
1260  void lim_reset_bcn_probe_filter(struct mac_context *mac_ctx, struct pe_session *session);
1261  
1262  /**
1263   * lim_update_bcn_probe_filter - Update the beacon/probe filter in mac context
1264   *
1265   * @mac_ctx: pointer to the global mac context
1266   * @session: pointer to the PE session whose filter is to be cleared
1267   *
1268   * This API is applicable only for SAP sessions to update the SAP channel
1269   * in the filter during a channel switch
1270   *
1271   * Return: None
1272   */
1273  void lim_update_bcn_probe_filter(struct mac_context *mac_ctx, struct pe_session *session);
1274  
1275  #endif /* #if !defined( __LIM_SESSION_H ) */
1276