xref: /wlan-driver/qcacld-3.0/components/nan/dispatcher/inc/wlan_nan_api_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 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: contains prototypes for NAN component
19*5113495bSYour Name  */
20*5113495bSYour Name 
21*5113495bSYour Name #ifndef _WLAN_NAN_API_I_H_
22*5113495bSYour Name #define _WLAN_NAN_API_I_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include "wlan_objmgr_cmn.h"
25*5113495bSYour Name #include "nan_public_structs.h"
26*5113495bSYour Name 
27*5113495bSYour Name #ifdef WLAN_FEATURE_NAN
28*5113495bSYour Name /**
29*5113495bSYour Name  * wlan_nan_get_ndi_state: get ndi state from vdev obj
30*5113495bSYour Name  * @vdev: pointer to vdev object
31*5113495bSYour Name  *
32*5113495bSYour Name  * Return: ndi state
33*5113495bSYour Name  */
34*5113495bSYour Name enum nan_datapath_state wlan_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev);
35*5113495bSYour Name 
36*5113495bSYour Name /**
37*5113495bSYour Name  * wlan_nan_get_vdev_id_from_bssid() - get NAN vdev_id for BSSID
38*5113495bSYour Name  * @pdev: PDEV object
39*5113495bSYour Name  * @bssid: BSSID present in mgmt frame
40*5113495bSYour Name  * @dbg_id:   Object Manager ref debug id
41*5113495bSYour Name  *
42*5113495bSYour Name  * This is wrapper API for nan_get_vdev_id_from_bssid()
43*5113495bSYour Name  *
44*5113495bSYour Name  * Return: NAN vdev_id
45*5113495bSYour Name  */
46*5113495bSYour Name uint8_t wlan_nan_get_vdev_id_from_bssid(struct wlan_objmgr_pdev *pdev,
47*5113495bSYour Name 					tSirMacAddr bssid,
48*5113495bSYour Name 					wlan_objmgr_ref_dbgid dbg_id);
49*5113495bSYour Name 
50*5113495bSYour Name /**
51*5113495bSYour Name  * wlan_nan_is_disc_active() - Check if NAN discovery is active
52*5113495bSYour Name  * @psoc: Pointer to PSOC object
53*5113495bSYour Name  *
54*5113495bSYour Name  * Return: True if Discovery is active
55*5113495bSYour Name  */
56*5113495bSYour Name bool wlan_nan_is_disc_active(struct wlan_objmgr_psoc *psoc);
57*5113495bSYour Name 
58*5113495bSYour Name /**
59*5113495bSYour Name  * wlan_nan_is_eht_capable() - Get NAN EHT capability
60*5113495bSYour Name  * @psoc: pointer to psoc object
61*5113495bSYour Name  *
62*5113495bSYour Name  * Return: Boolean flag indicating whether the NAN EHT capability is
63*5113495bSYour Name  * disabled or not
64*5113495bSYour Name  */
65*5113495bSYour Name bool wlan_nan_is_eht_capable(struct wlan_objmgr_psoc *psoc);
66*5113495bSYour Name 
67*5113495bSYour Name #else
68*5113495bSYour Name static inline
wlan_nan_get_ndi_state(struct wlan_objmgr_vdev * vdev)69*5113495bSYour Name enum nan_datapath_state wlan_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev)
70*5113495bSYour Name {
71*5113495bSYour Name 	return NAN_DATA_INVALID_STATE;
72*5113495bSYour Name }
73*5113495bSYour Name 
74*5113495bSYour Name static inline
wlan_nan_get_vdev_id_from_bssid(struct wlan_objmgr_pdev * pdev,tSirMacAddr bssid,wlan_objmgr_ref_dbgid dbg_id)75*5113495bSYour Name uint8_t wlan_nan_get_vdev_id_from_bssid(struct wlan_objmgr_pdev *pdev,
76*5113495bSYour Name 					tSirMacAddr bssid,
77*5113495bSYour Name 					wlan_objmgr_ref_dbgid dbg_id)
78*5113495bSYour Name {
79*5113495bSYour Name 	return INVALID_VDEV_ID;
80*5113495bSYour Name }
81*5113495bSYour Name 
82*5113495bSYour Name static inline
wlan_nan_is_disc_active(struct wlan_objmgr_psoc * psoc)83*5113495bSYour Name bool wlan_nan_is_disc_active(struct wlan_objmgr_psoc *psoc)
84*5113495bSYour Name {
85*5113495bSYour Name 	return false;
86*5113495bSYour Name }
87*5113495bSYour Name 
88*5113495bSYour Name static inline bool
wlan_nan_is_eht_capable(struct wlan_objmgr_psoc * psoc)89*5113495bSYour Name wlan_nan_is_eht_capable(struct wlan_objmgr_psoc *psoc)
90*5113495bSYour Name {
91*5113495bSYour Name 	return false;
92*5113495bSYour Name }
93*5113495bSYour Name #endif /*WLAN_FEATURE_NAN */
94*5113495bSYour Name #endif /*_WLAN_NAN_API_I_H_ */
95