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 #ifndef __WMA_PASN_PEER_API_H__
18 #define __WMA_PASN_PEER_API_H__
19
20 #include "qdf_types.h"
21 #include "osapi_linux.h"
22 #include "wmi_services.h"
23 #include "wmi_unified.h"
24 #include "wmi_unified_api.h"
25 #include "wlan_objmgr_psoc_obj.h"
26 #include "wma.h"
27
28 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
29 /**
30 * wma_pasn_peer_remove - Remove RTT pasn peer and send peer delete command to
31 * firmware
32 * @wma: WMA handle
33 * @peer_addr: Peer mac address
34 * @vdev_id: vdev id
35 * @no_fw_peer_delete: Don't send peer delete to firmware
36 *
37 * Return: QDF_STATUS
38 */
39 QDF_STATUS
40 wma_pasn_peer_remove(struct wlan_objmgr_psoc *psoc,
41 struct qdf_mac_addr *peer_addr,
42 uint8_t vdev_id, bool no_fw_peer_delete);
43
44 /**
45 * wma_pasn_peer_create() - Create RTT PASN peer
46 * @psoc: PSOC pointer
47 * @peer_addr: Peer address
48 * @vdev_id: vdev id
49 *
50 * Return: QDF_STATUS
51 */
52 QDF_STATUS
53 wma_pasn_peer_create(struct wlan_objmgr_psoc *psoc,
54 struct qdf_mac_addr *peer_addr,
55 uint8_t vdev_id);
56
57 /**
58 * wma_pasn_handle_peer_create_conf() - Handle PASN peer create confirm event
59 * @wma: WMA handle
60 * @peer_mac: peer mac address
61 * @status: status
62 * @vdev_id: vdev id
63 *
64 * Return: QDF_STATUS
65 */
66 QDF_STATUS
67 wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
68 struct qdf_mac_addr *peer_mac,
69 QDF_STATUS status, uint8_t vdev_id);
70
71 /**
72 * wma_delete_all_pasn_peers() - Delete all PASN peers
73 * @wma: WMA handle
74 * @vdev: Vdev object pointer
75 *
76 * Return: QDF_STATUS
77 */
78 QDF_STATUS
79 wma_delete_all_pasn_peers(tp_wma_handle wma, struct wlan_objmgr_vdev *vdev);
80
81 QDF_STATUS
82 wma_resume_vdev_delete(tp_wma_handle wma, uint8_t vdev_id);
83
84 QDF_STATUS
85 wma_pasn_peer_delete_all_complete(struct wlan_objmgr_vdev *vdev);
86 #else
87 static inline QDF_STATUS
wma_pasn_peer_create(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * peer_addr,uint8_t vdev_id)88 wma_pasn_peer_create(struct wlan_objmgr_psoc *psoc,
89 struct qdf_mac_addr *peer_addr,
90 uint8_t vdev_id)
91 {
92 return QDF_STATUS_SUCCESS;
93 }
94
95 static inline QDF_STATUS
wma_pasn_peer_remove(struct wlan_objmgr_psoc * psoc,struct qdf_mac_addr * peer_addr,uint8_t vdev_id,bool no_fw_peer_delete)96 wma_pasn_peer_remove(struct wlan_objmgr_psoc *psoc,
97 struct qdf_mac_addr *peer_addr,
98 uint8_t vdev_id, bool no_fw_peer_delete)
99 {
100 return QDF_STATUS_SUCCESS;
101 }
102
103 static inline QDF_STATUS
wma_pasn_handle_peer_create_conf(tp_wma_handle wma,struct qdf_mac_addr * peer_mac,QDF_STATUS status,uint8_t vdev_id)104 wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
105 struct qdf_mac_addr *peer_mac,
106 QDF_STATUS status, uint8_t vdev_id)
107 {
108 return QDF_STATUS_SUCCESS;
109 }
110
111 static inline QDF_STATUS
wma_delete_all_pasn_peers(tp_wma_handle wma,struct wlan_objmgr_vdev * vdev)112 wma_delete_all_pasn_peers(tp_wma_handle wma, struct wlan_objmgr_vdev *vdev)
113 {
114 return QDF_STATUS_SUCCESS;
115 }
116
117 static inline QDF_STATUS
wma_resume_vdev_delete(tp_wma_handle wma,uint8_t vdev_id)118 wma_resume_vdev_delete(tp_wma_handle wma, uint8_t vdev_id)
119 {
120 return QDF_STATUS_SUCCESS;
121 }
122 #endif
123 #endif
124