xref: /wlan-driver/qca-wifi-host-cmn/os_if/linux/mlme/src/osif_vdev_mgr_util.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name /**
18*5113495bSYour Name  * DOC: osif_vdev_mgr_util.c
19*5113495bSYour Name  *
20*5113495bSYour Name  * This header file maintains definitaions of osif APIs corresponding to vdev
21*5113495bSYour Name  * manager.
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #include <include/wlan_mlme_cmn.h>
25*5113495bSYour Name #include "osif_vdev_mgr_util.h"
26*5113495bSYour Name 
27*5113495bSYour Name static struct osif_vdev_mgr_ops *osif_vdev_mgr_legacy_ops;
28*5113495bSYour Name 
29*5113495bSYour Name #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
osif_vdev_mgr_set_mac_addr_response(uint8_t vdev_id,uint8_t resp_status)30*5113495bSYour Name static QDF_STATUS osif_vdev_mgr_set_mac_addr_response(uint8_t vdev_id,
31*5113495bSYour Name 						      uint8_t resp_status)
32*5113495bSYour Name {
33*5113495bSYour Name 	if (osif_vdev_mgr_legacy_ops &&
34*5113495bSYour Name 	    osif_vdev_mgr_legacy_ops->osif_vdev_mgr_set_mac_addr_response)
35*5113495bSYour Name 		osif_vdev_mgr_legacy_ops->osif_vdev_mgr_set_mac_addr_response(
36*5113495bSYour Name 						vdev_id, resp_status);
37*5113495bSYour Name 
38*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
39*5113495bSYour Name }
40*5113495bSYour Name #endif
osif_vdev_mgr_send_scan_done_complete_cb(uint8_t vdev_id)41*5113495bSYour Name static void osif_vdev_mgr_send_scan_done_complete_cb(uint8_t vdev_id)
42*5113495bSYour Name {
43*5113495bSYour Name 	if (osif_vdev_mgr_legacy_ops &&
44*5113495bSYour Name 	    osif_vdev_mgr_legacy_ops->osif_vdev_mgr_send_scan_done_complete_cb)
45*5113495bSYour Name 	     osif_vdev_mgr_legacy_ops->osif_vdev_mgr_send_scan_done_complete_cb(
46*5113495bSYour Name 								vdev_id);
47*5113495bSYour Name }
48*5113495bSYour Name 
49*5113495bSYour Name static struct mlme_vdev_mgr_ops vdev_mgr_ops = {
50*5113495bSYour Name #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
51*5113495bSYour Name 	.mlme_vdev_mgr_set_mac_addr_response =
52*5113495bSYour Name 					osif_vdev_mgr_set_mac_addr_response,
53*5113495bSYour Name #endif
54*5113495bSYour Name 	.mlme_vdev_mgr_send_scan_done_complete_cb =
55*5113495bSYour Name 				osif_vdev_mgr_send_scan_done_complete_cb,
56*5113495bSYour Name };
57*5113495bSYour Name 
58*5113495bSYour Name /**
59*5113495bSYour Name  * osif_vdev_mgr_get_global_ops() - Get vdev manager global ops
60*5113495bSYour Name  *
61*5113495bSYour Name  * Return: Connection manager global ops
62*5113495bSYour Name  */
osif_vdev_mgr_get_global_ops(void)63*5113495bSYour Name static struct mlme_vdev_mgr_ops *osif_vdev_mgr_get_global_ops(void)
64*5113495bSYour Name {
65*5113495bSYour Name 	return &vdev_mgr_ops;
66*5113495bSYour Name }
67*5113495bSYour Name 
osif_vdev_mgr_register_cb(void)68*5113495bSYour Name QDF_STATUS osif_vdev_mgr_register_cb(void)
69*5113495bSYour Name {
70*5113495bSYour Name 	mlme_set_osif_vdev_mgr_cb(osif_vdev_mgr_get_global_ops);
71*5113495bSYour Name 
72*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
73*5113495bSYour Name }
74*5113495bSYour Name 
osif_vdev_mgr_set_legacy_cb(struct osif_vdev_mgr_ops * osif_legacy_ops)75*5113495bSYour Name void osif_vdev_mgr_set_legacy_cb(struct osif_vdev_mgr_ops *osif_legacy_ops)
76*5113495bSYour Name {
77*5113495bSYour Name 	osif_vdev_mgr_legacy_ops = osif_legacy_ops;
78*5113495bSYour Name }
79*5113495bSYour Name 
osif_vdev_mgr_reset_legacy_cb(void)80*5113495bSYour Name void osif_vdev_mgr_reset_legacy_cb(void)
81*5113495bSYour Name {
82*5113495bSYour Name 	osif_vdev_mgr_legacy_ops = NULL;
83*5113495bSYour Name }
84