1 /* 2 * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. 3 * 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: These APIs are used by DFS core functions to call lmac/offload 22 * functions. 23 */ 24 25 #ifndef _WLAN_DFS_LMAC_API_H_ 26 #define _WLAN_DFS_LMAC_API_H_ 27 28 #include <wlan_objmgr_psoc_obj.h> 29 #include <wlan_objmgr_pdev_obj.h> 30 31 /** 32 * lmac_get_caps() - Get DFS capabilities. 33 * @pdev: Pointer to PDEV structure. 34 * @dfs_caps: Pointer to dfs_caps structure 35 */ 36 void lmac_get_caps(struct wlan_objmgr_pdev *pdev, 37 struct wlan_dfs_caps *dfs_caps); 38 39 /** 40 * lmac_get_tsf64() - Get tsf64 value. 41 * @pdev: Pointer to PDEV structure. 42 * 43 * Return: tsf64 timer value. 44 */ 45 uint64_t lmac_get_tsf64(struct wlan_objmgr_pdev *pdev); 46 47 /** 48 * lmac_dfs_disable() - Disable DFS. 49 * @pdev: Pointer to PDEV structure. 50 * @no_cac: no_cac flag. 51 */ 52 void lmac_dfs_disable(struct wlan_objmgr_pdev *pdev, int no_cac); 53 54 /** 55 * lmac_dfs_enable() - Enable DFS. 56 * @pdev: Pointer to PDEV structure. 57 * @is_fastclk: fastclk value. 58 * @param: Pointer to wlan_dfs_phyerr_param structure. 59 * @dfsdomain: DFS domain. 60 */ 61 void lmac_dfs_enable(struct wlan_objmgr_pdev *pdev, 62 int *is_fastclk, 63 struct wlan_dfs_phyerr_param *param, 64 int dfsdomain); 65 66 /** 67 * lmac_dfs_get_thresholds() - Get thresholds. 68 * @pdev: Pointer to PDEV structure. 69 * @param: Pointer to wlan_dfs_phyerr_param structure. 70 */ 71 void lmac_dfs_get_thresholds(struct wlan_objmgr_pdev *pdev, 72 struct wlan_dfs_phyerr_param *param); 73 74 /** 75 * lmac_is_mode_offload() - Check the radio for offload. 76 * @pdev: Pointer to PDEV structure. 77 */ 78 bool lmac_is_mode_offload(struct wlan_objmgr_pdev *pdev); 79 80 /** 81 * lmac_get_ah_devid() - Get ah devid. 82 * @pdev: Pointer to PDEV structure. 83 */ 84 uint16_t lmac_get_ah_devid(struct wlan_objmgr_pdev *pdev); 85 86 /** 87 * lmac_is_mode_dfs_offload() - Check the DFS offload is enabled. 88 * @psoc: Pointer to PSOC structure. 89 * 90 * returns true if DFS offload is enabled, otherwise returns false 91 */ 92 bool lmac_is_mode_dfs_offload(struct wlan_objmgr_psoc *psoc); 93 94 /** 95 * lmac_get_ext_busy() - Get ext_busy. 96 * @pdev: Pointer to PDEV structure. 97 */ 98 uint32_t lmac_get_ext_busy(struct wlan_objmgr_pdev *pdev); 99 100 /** 101 * lmac_set_use_cac_prssi() - Set use_cac_prssi value. 102 * @pdev: Pointer to PDEV structure. 103 */ 104 void lmac_set_use_cac_prssi(struct wlan_objmgr_pdev *pdev); 105 106 /** 107 * lmac_get_target_type() - Get target type. 108 * @pdev: Pointer to PDEV structure. 109 */ 110 uint32_t lmac_get_target_type(struct wlan_objmgr_pdev *pdev); 111 112 /** 113 * lmac_get_phymode_info() - Get phymode info. 114 * @pdev: Pointer to PDEV structure. 115 */ 116 uint32_t lmac_get_phymode_info(struct wlan_objmgr_pdev *pdev, 117 uint32_t chan_mode); 118 119 /** 120 * lmac_is_host_dfs_check_support_enabled() - Check if Host DFS confirmation 121 * feature is supported. 122 * @pdev: Pointer to PDEV structure. 123 * 124 * Return: true, host dfs check supported, else false. 125 */ 126 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) 127 bool lmac_is_host_dfs_check_support_enabled(struct wlan_objmgr_pdev *pdev); 128 #else 129 static inline bool lmac_is_host_dfs_check_support_enabled( 130 struct wlan_objmgr_pdev *pdev) 131 { 132 return false; 133 } 134 #endif 135 #endif /* _WLAN_DFS_LMAC_API_H_ */ 136