xref: /wlan-driver/qcacld-3.0/components/wifi_pos/dispatcher/src/wifi_pos_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2022 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  * DOC: declare WIFI POS ucfg APIs exposed by the mlme component
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name #include "wifi_pos_ucfg_api.h"
21*5113495bSYour Name #include "wifi_pos_utils_i.h"
22*5113495bSYour Name #include "os_if_wifi_pos_utils.h"
23*5113495bSYour Name 
24*5113495bSYour Name #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
25*5113495bSYour Name QDF_STATUS
ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc * psoc)26*5113495bSYour Name ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc *psoc)
27*5113495bSYour Name {
28*5113495bSYour Name 	QDF_STATUS status;
29*5113495bSYour Name 
30*5113495bSYour Name 	status = osif_wifi_pos_register_ops(psoc);
31*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
32*5113495bSYour Name 		wifi_pos_err("Register OSIF ops failed");
33*5113495bSYour Name 
34*5113495bSYour Name 	status = wifi_pos_register_legacy_ops(psoc);
35*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
36*5113495bSYour Name 		wifi_pos_err("Set legacy ops failed");
37*5113495bSYour Name 
38*5113495bSYour Name 	return status;
39*5113495bSYour Name }
40*5113495bSYour Name 
41*5113495bSYour Name QDF_STATUS
ucfg_wifi_pos_psoc_close(struct wlan_objmgr_psoc * psoc)42*5113495bSYour Name ucfg_wifi_pos_psoc_close(struct wlan_objmgr_psoc *psoc)
43*5113495bSYour Name {
44*5113495bSYour Name 	QDF_STATUS status;
45*5113495bSYour Name 
46*5113495bSYour Name 	status = wifi_pos_deregister_legacy_ops(psoc);
47*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
48*5113495bSYour Name 		wifi_pos_err("Set legacy ops failed");
49*5113495bSYour Name 
50*5113495bSYour Name 	status = osif_wifi_pos_deregister_ops(psoc);
51*5113495bSYour Name 	if (QDF_IS_STATUS_ERROR(status))
52*5113495bSYour Name 		wifi_pos_err("Register OSIF ops failed");
53*5113495bSYour Name 
54*5113495bSYour Name 	return status;
55*5113495bSYour Name }
56*5113495bSYour Name #endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
57