1 /*
2  * Copyright (c) 2017-2019 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  * DOC: Declare various struct, macros which shall be used in
21  * pmo gtk related feature.
22  *
23  * Note: This file shall not contain public API's prototype/declarations.
24  *
25  */
26 
27 #ifndef _WLAN_PMO_GTK_PUBLIC_STRUCT_H
28 #define _WLAN_PMO_GTK_PUBLIC_STRUCT_H
29 
30 #include "wlan_pmo_common_public_struct.h"
31 
32 #define PMO_GTK_OFFLOAD_ENABLE  0
33 #define PMO_GTK_OFFLOAD_DISABLE 1
34 #define PMO_KEK_LEN 64
35 #define PMO_KCK_LEN 32
36 #define PMO_REPLAY_COUNTER_LEN 8
37 #define PMO_MAC_MAX_KEY_LENGTH 32
38 #define PMO_IGTK_PN_SIZE 6
39 
40 /**
41  * struct pmo_gtk_req - pmo gtk request
42  * @flags: optional flags
43  * @kck: Key confirmation key
44  * @kck_len: Key confirmation key length
45  * @kek: key encryption key
46  * @kek_len: KEK Length
47  * @replay_counter: replay_counter
48  * @bssid: bssid
49  * @is_fils_connection: is current connection with peer FILS or not.
50  */
51 struct pmo_gtk_req {
52 	uint32_t flags;
53 	uint8_t kck[PMO_KCK_LEN];
54 	uint8_t kck_len;
55 	uint8_t kek[PMO_KEK_LEN];
56 	uint32_t kek_len;
57 	uint64_t replay_counter;
58 	struct qdf_mac_addr bssid;
59 	bool is_fils_connection;
60 };
61 
62 /**
63  * struct pmo_gtk_rsp_params - pmo gtk response
64  * @vdev_id: vdev id on which arp offload needed
65  * @status_flag: status flags
66  * @refresh_cnt: number of successful GTK refresh exchanges since SET operation
67  * @replay_counter:GTK replay counter
68  * @igtk_key_index: igtk key index
69  * @igtk_key_length: igtk key length
70  * @igtk_key_rsc: igtk key index
71  * @igtk_key: igtk key length
72  * @bssid: BSSID
73  */
74 struct pmo_gtk_rsp_params {
75 	uint8_t  vdev_id;
76 	uint32_t status_flag;
77 	uint32_t refresh_cnt;
78 	uint64_t replay_counter;
79 	uint8_t igtk_key_index;
80 	uint8_t igtk_key_length;
81 	uint8_t igtk_key_rsc[PMO_IGTK_PN_SIZE];
82 	uint8_t igtk_key[PMO_MAC_MAX_KEY_LENGTH];
83 	struct qdf_mac_addr bssid;
84 };
85 
86 /**
87  * typedef pmo_gtk_rsp_callback() - gtk response callback
88  * @callback_context: client context
89  * @gtk_rsp: GTK response
90  */
91 typedef void (*pmo_gtk_rsp_callback)(void *callback_context,
92 		struct pmo_gtk_rsp_params *gtk_rsp);
93 
94 /**
95  * struct pmo_gtk_rsp_req - gtk respsonse request
96  * @callback: client callback for providing gtk response when fwr send event
97  * @callback_context: client callback response
98  */
99 struct pmo_gtk_rsp_req {
100 	pmo_gtk_rsp_callback callback;
101 	void *callback_context;
102 };
103 
104 #endif /* end  of _WLAN_PMO_GTK_PUBLIC_STRUCT_H */
105 
106