1  /*
2   * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3   *
4   * Permission to use, copy, modify, and/or distribute this software for any
5   * purpose with or without fee is hereby granted, provided that the above
6   * copyright notice and this permission notice appear in all copies.
7   *
8   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10   * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11   * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12   * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15   */
16  /**
17   * DOC: declare WIFI POS ucfg APIs exposed by the mlme component
18   */
19  
20  #include "wifi_pos_ucfg_api.h"
21  #include "wifi_pos_utils_i.h"
22  #include "os_if_wifi_pos_utils.h"
23  
24  #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
25  QDF_STATUS
ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc * psoc)26  ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc *psoc)
27  {
28  	QDF_STATUS status;
29  
30  	status = osif_wifi_pos_register_ops(psoc);
31  	if (QDF_IS_STATUS_ERROR(status))
32  		wifi_pos_err("Register OSIF ops failed");
33  
34  	status = wifi_pos_register_legacy_ops(psoc);
35  	if (QDF_IS_STATUS_ERROR(status))
36  		wifi_pos_err("Set legacy ops failed");
37  
38  	return status;
39  }
40  
41  QDF_STATUS
ucfg_wifi_pos_psoc_close(struct wlan_objmgr_psoc * psoc)42  ucfg_wifi_pos_psoc_close(struct wlan_objmgr_psoc *psoc)
43  {
44  	QDF_STATUS status;
45  
46  	status = wifi_pos_deregister_legacy_ops(psoc);
47  	if (QDF_IS_STATUS_ERROR(status))
48  		wifi_pos_err("Set legacy ops failed");
49  
50  	status = osif_wifi_pos_deregister_ops(psoc);
51  	if (QDF_IS_STATUS_ERROR(status))
52  		wifi_pos_err("Register OSIF ops failed");
53  
54  	return status;
55  }
56  #endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
57