xref: /wlan-driver/qcacld-3.0/core/mac/src/pe/include/lim_ft_defs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-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 /**=========================================================================
21 
22    Macros and Function prototypes FT and 802.11R purposes
23 
24    ========================================================================*/
25 
26 #ifndef __LIMFTDEFS_H__
27 #define __LIMFTDEFS_H__
28 
29 #include <cds_api.h>
30 #include "wma_if.h"
31 
32 /*--------------------------------------------------------------------------
33    Preprocessor definitions and constants
34    ------------------------------------------------------------------------*/
35 /* Time to dwell on preauth channel during roaming, in milliseconds */
36 #define LIM_FT_PREAUTH_ACTIVE_SCAN_TIME 50
37 #define LIM_FT_PREAUTH_PASSIVE_SCAN_TIME 150
38 
39 /*--------------------------------------------------------------------------
40    Type declarations
41    ------------------------------------------------------------------------*/
42 /*--------------------------------------------------------------------------
43    FT Pre Auth Req SME<->PE
44    ------------------------------------------------------------------------*/
45 typedef struct sSirFTPreAuthReq {
46 	uint16_t messageType;   /* eWNI_SME_FT_PRE_AUTH_REQ */
47 	uint16_t length;
48 	uint32_t dot11mode;
49 	/*
50 	 * Track if response is processed for this request
51 	 * We expect only one response per request.
52 	 */
53 	bool bPreAuthRspProcessed;
54 	uint16_t pre_auth_channel_freq;
55 	/* BSSID currently associated to suspend the link */
56 	tSirMacAddr currbssId;
57 	tSirMacAddr preAuthbssId;       /* BSSID to preauth to */
58 	tSirMacAddr self_mac_addr;
59 	uint32_t scan_id;
60 	uint16_t ft_ies_length;
61 	uint8_t ft_ies[MAX_FTIE_SIZE];
62 	struct bss_description *pbssDescription;
63 } tSirFTPreAuthReq, *tpSirFTPreAuthReq;
64 
65 /*-------------------------------------------------------------------------
66    FT Pre Auth Rsp PE<->SME
67    ------------------------------------------------------------------------*/
68 typedef struct sSirFTPreAuthRsp {
69 	uint16_t messageType;   /* eWNI_SME_FT_PRE_AUTH_RSP */
70 	uint16_t length;
71 	uint8_t vdev_id;
72 	tSirMacAddr preAuthbssId;       /* BSSID to preauth to */
73 	QDF_STATUS status;
74 	uint16_t ft_ies_length;
75 	uint8_t ft_ies[MAX_FTIE_SIZE];
76 } tSirFTPreAuthRsp, *tpSirFTPreAuthRsp;
77 
78 /*--------------------------------------------------------------------------
79    FT Pre Auth Rsp Key SME<->PE
80    ------------------------------------------------------------------------*/
81 typedef struct sSirFTUpdateKeyInfo {
82 	uint16_t messageType;
83 	uint16_t length;
84 	uint32_t vdev_id;
85 	struct qdf_mac_addr bssid;
86 } tSirFTUpdateKeyInfo, *tpSirFTUpdateKeyInfo;
87 
88 /*-------------------------------------------------------------------------
89    Global FT Information
90    ------------------------------------------------------------------------*/
91 typedef struct sFTPEContext {
92 	tpSirFTPreAuthReq pFTPreAuthReq;        /* Saved FT Pre Auth Req */
93 	QDF_STATUS ftPreAuthStatus;
94 	uint16_t saved_auth_rsp_length;
95 	uint8_t saved_auth_rsp[MAX_FTIE_SIZE];
96 	/* Items created for the new FT, session */
97 	void *pAddBssReq;       /* Save add bss req */
98 	void *pAddStaReq;       /*Save add sta req  */
99 	uint32_t peSessionId;
100 	uint32_t smeSessionId;
101 
102 	/* This flag is required to indicate on which session the preauth
103 	 * has taken place, since the auth response for preauth will come
104 	 * for a new BSSID for which there is no session yet. This flag
105 	 * will be used to extract the session from the session preauth
106 	 * has been initiated
107 	 */
108 	bool ftPreAuthSession;
109 } tftPEContext, *tpftPEContext;
110 
111 #endif /* __LIMFTDEFS_H__ */
112