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