xref: /wlan-driver/qcacld-3.0/core/wma/src/wma_nan_datapath.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: wma_nan_datapath.h
22*5113495bSYour Name  *
23*5113495bSYour Name  * WMA NAN Data path API specification
24*5113495bSYour Name  */
25*5113495bSYour Name 
26*5113495bSYour Name #ifndef __WMA_NAN_DATAPATH_H
27*5113495bSYour Name #define __WMA_NAN_DATAPATH_H
28*5113495bSYour Name 
29*5113495bSYour Name #include <sir_common.h>
30*5113495bSYour Name #include <ani_global.h>
31*5113495bSYour Name #include "wma.h"
32*5113495bSYour Name #include "sir_api.h"
33*5113495bSYour Name #include "sme_nan_datapath.h"
34*5113495bSYour Name 
wma_ndp_wow_event_callback(void * handle,void * event,uint32_t len,uint32_t event_id)35*5113495bSYour Name static inline int wma_ndp_wow_event_callback(void *handle, void *event,
36*5113495bSYour Name 					     uint32_t len, uint32_t event_id)
37*5113495bSYour Name {
38*5113495bSYour Name 	return 0;
39*5113495bSYour Name }
40*5113495bSYour Name 
wma_ndp_get_eventid_from_tlvtag(uint32_t tag)41*5113495bSYour Name static inline uint32_t wma_ndp_get_eventid_from_tlvtag(uint32_t tag)
42*5113495bSYour Name {
43*5113495bSYour Name 	return 0;
44*5113495bSYour Name }
45*5113495bSYour Name 
46*5113495bSYour Name #ifdef WLAN_FEATURE_NAN
47*5113495bSYour Name #define WMA_IS_VDEV_IN_NDI_MODE(intf, vdev_id) \
48*5113495bSYour Name 				(WMI_VDEV_TYPE_NDI == intf[vdev_id].type)
49*5113495bSYour Name 
50*5113495bSYour Name /**
51*5113495bSYour Name  * wma_add_sta_ndi_mode() - Process ADD_STA for NaN Data path
52*5113495bSYour Name  * @wma: wma handle
53*5113495bSYour Name  * @add_sta: Parameters of ADD_STA command
54*5113495bSYour Name  *
55*5113495bSYour Name  * Sends CREATE_PEER command to firmware
56*5113495bSYour Name  * Return: QDF status
57*5113495bSYour Name  */
58*5113495bSYour Name QDF_STATUS  wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta);
59*5113495bSYour Name 
60*5113495bSYour Name /**
61*5113495bSYour Name  * wma_update_hdd_cfg_ndp() - Update target device NAN datapath capability
62*5113495bSYour Name  * @wma_handle: pointer to WMA context
63*5113495bSYour Name  * @tgt_cfg: Pointer to target configuration data structure
64*5113495bSYour Name  *
65*5113495bSYour Name  * Return: none
66*5113495bSYour Name  */
wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,struct wma_tgt_cfg * tgt_cfg)67*5113495bSYour Name static inline void wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,
68*5113495bSYour Name 					struct wma_tgt_cfg *tgt_cfg)
69*5113495bSYour Name {
70*5113495bSYour Name 	tgt_cfg->nan_datapath_enabled = wma_handle->nan_datapath_enabled;
71*5113495bSYour Name }
72*5113495bSYour Name 
73*5113495bSYour Name /**
74*5113495bSYour Name  * wma_delete_sta_req_ndi_mode() - Process DEL_STA request for NDI data peer
75*5113495bSYour Name  * @wma: WMA context
76*5113495bSYour Name  * @del_sta: DEL_STA parameters from LIM
77*5113495bSYour Name  *
78*5113495bSYour Name  * Removes wma/txrx peer entry for the NDI STA
79*5113495bSYour Name  *
80*5113495bSYour Name  * Returns: QDF_STATUS_SUCCESS if peer deletion is successful
81*5113495bSYour Name  */
82*5113495bSYour Name QDF_STATUS wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
83*5113495bSYour Name 				       tpDeleteStaParams del_sta);
84*5113495bSYour Name 
85*5113495bSYour Name /**
86*5113495bSYour Name  * wma_is_ndi_active() - Determines of the nan data iface is active
87*5113495bSYour Name  * @wma_handle: handle to wma context
88*5113495bSYour Name  *
89*5113495bSYour Name  * Returns: true if ndi active, flase otherwise
90*5113495bSYour Name  */
wma_is_ndi_active(tp_wma_handle wma_handle)91*5113495bSYour Name static inline bool wma_is_ndi_active(tp_wma_handle wma_handle)
92*5113495bSYour Name {
93*5113495bSYour Name 	int i;
94*5113495bSYour Name 
95*5113495bSYour Name 	for (i = 0; i < wma_handle->max_bssid; i++) {
96*5113495bSYour Name 		if (wma_handle->interfaces[i].type == WMI_VDEV_TYPE_NDI &&
97*5113495bSYour Name 				wma_handle->interfaces[i].peer_count > 0)
98*5113495bSYour Name 			return true;
99*5113495bSYour Name 	}
100*5113495bSYour Name 	return false;
101*5113495bSYour Name }
102*5113495bSYour Name #else /* WLAN_FEATURE_NAN */
103*5113495bSYour Name #define WMA_IS_VDEV_IN_NDI_MODE(intf, vdev_id) (false)
wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,struct wma_tgt_cfg * tgt_cfg)104*5113495bSYour Name static inline void wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,
105*5113495bSYour Name 					struct wma_tgt_cfg *tgt_cfg)
106*5113495bSYour Name {
107*5113495bSYour Name 	return;
108*5113495bSYour Name }
109*5113495bSYour Name 
110*5113495bSYour Name static inline
wma_delete_sta_req_ndi_mode(tp_wma_handle wma,tpDeleteStaParams del_sta)111*5113495bSYour Name QDF_STATUS wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
112*5113495bSYour Name 				       tpDeleteStaParams del_sta)
113*5113495bSYour Name {
114*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
115*5113495bSYour Name }
116*5113495bSYour Name 
117*5113495bSYour Name static inline
wma_add_sta_ndi_mode(tp_wma_handle wma,tpAddStaParams add_sta)118*5113495bSYour Name QDF_STATUS wma_add_sta_ndi_mode(tp_wma_handle wma,
119*5113495bSYour Name 				tpAddStaParams add_sta)
120*5113495bSYour Name {
121*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
122*5113495bSYour Name }
123*5113495bSYour Name 
wma_is_ndi_active(tp_wma_handle wma_handle)124*5113495bSYour Name static inline bool wma_is_ndi_active(tp_wma_handle wma_handle) { return false; }
125*5113495bSYour Name #endif /* WLAN_FEATURE_NAN */
126*5113495bSYour Name 
127*5113495bSYour Name #endif /* __WMA_NAN_DATAPATH_H */
128