xref: /wlan-driver/qca-wifi-host-cmn/umac/cmn_services/crypto/src/wlan_crypto_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2024 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  * DOC: contains crypto north bound interface definitions
22  */
23 
24 #include <qdf_types.h>
25 #include <wlan_crypto_global_def.h>
26 #include <wlan_objmgr_vdev_obj.h>
27 #include <wlan_crypto_global_api.h>
28 #include "wlan_crypto_def_i.h"
29 
ucfg_crypto_set_key_req(struct wlan_objmgr_vdev * vdev,struct wlan_crypto_key * req,enum wlan_crypto_key_type key_type)30 QDF_STATUS ucfg_crypto_set_key_req(struct wlan_objmgr_vdev *vdev,
31 				   struct wlan_crypto_key *req,
32 				   enum wlan_crypto_key_type key_type)
33 {
34 	/*
35 	 * It is the job of dispatcher to decide whether the
36 	 * request has to be sent to scheduler or should be
37 	 * sent as a offload request or process directly.
38 	 *
39 	 * Current requirement is to process set key request
40 	 * as run to completion without posting any messages.
41 	 * Hence the request handler is directly called from
42 	 * here.
43 	 */
44 	return wlan_crypto_set_key_req(vdev, req, key_type);
45 }
46 
ucfg_crypto_flush_entries(struct wlan_objmgr_psoc * psoc)47 void ucfg_crypto_flush_entries(struct wlan_objmgr_psoc *psoc)
48 {
49 	crypto_flush_entries(psoc);
50 }
51 
ucfg_crypto_free_key_by_link_id(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * link_addr,uint8_t link_id)52 void ucfg_crypto_free_key_by_link_id(struct wlan_objmgr_psoc *psoc,
53 				     struct qdf_mac_addr *link_addr,
54 				     uint8_t link_id)
55 {
56 	wlan_crypto_free_key_by_link_id(psoc, link_addr, link_id);
57 }
58