1 /* 2 * Copyright (c) 2020, The Linux Foundation. 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: This file has the dcs dispatcher API which is exposed to outside of dcs 19 * component. 20 */ 21 #ifndef _WLAN_DCS_UCFG_API_H_ 22 #define _WLAN_DCS_UCFG_API_H_ 23 24 #include <qdf_status.h> 25 #include <wlan_objmgr_pdev_obj.h> 26 27 /** 28 * @brief List of DCS capabilities that can be set or unset 29 * dynamically 30 * @see UMAC auto channel selection document for details on each feature 31 * 32 */ 33 #define CAP_DCS_CWIM 0x1 34 #define CAP_DCS_WLANIM 0x2 35 #define CAP_DCS_MASK (CAP_DCS_CWIM | CAP_DCS_WLANIM) 36 37 /** 38 * typedef dcs_callback() - DCS callback 39 * @psoc: Pointer to psoc 40 * @pdev_id: pdev id 41 * @interference_type: interference type 42 * @arg: list of arguments 43 */ 44 typedef void (*dcs_callback)( 45 struct wlan_objmgr_psoc *psoc, 46 uint8_t pdev_id, 47 uint8_t interference_type, 48 void *arg); 49 50 /** 51 * ucfg_dcs_register_cb() - API to register dcs callback 52 * @psoc: pointer to psoc object 53 * @cbk: dcs callback to be registered 54 * @arg: argument 55 * 56 * This function gets called to register dcs callback function 57 * 58 * Return: None 59 */ 60 void ucfg_dcs_register_cb( 61 struct wlan_objmgr_psoc *psoc, 62 dcs_callback cbk, 63 void *arg); 64 65 /** 66 * ucfg_wlan_dcs_cmd(): API to send dcs command 67 * @psoc: pointer to psoc object 68 * @pdev_id: pdev_id 69 * @is_host_pdev_id: pdev_id is host id or not 70 * 71 * This function gets called to send dcs command 72 * 73 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error 74 */ 75 QDF_STATUS 76 ucfg_wlan_dcs_cmd(struct wlan_objmgr_psoc *psoc, 77 uint32_t pdev_id, 78 bool is_host_pdev_id); 79 80 /** 81 * ucfg_config_dcs_enable() - API to config dcs enable 82 * @psoc: pointer to psoc object 83 * @pdev_id: pdev id 84 * @interference_type: CAP_DCS_CWIM, CAP_DCS_WLANIM, CAP_DCS_MASK 85 * 86 * This function gets called to config dcs enable 87 * 88 * Return: None 89 */ 90 void ucfg_config_dcs_enable(struct wlan_objmgr_psoc *psoc, 91 uint32_t pdev_id, 92 uint8_t interference_type); 93 94 /** 95 * ucfg_config_dcs_disable() - API to config dcs disable 96 * @psoc: pointer to psoc object 97 * @pdev_id: pdev id 98 * @interference_type: CAP_DCS_CWIM, CAP_DCS_WLANIM, CAP_DCS_MASK 99 * 100 * This function gets called to config dcs disable 101 * 102 * Return: None 103 */ 104 void ucfg_config_dcs_disable(struct wlan_objmgr_psoc *psoc, 105 uint32_t pdev_id, 106 uint8_t interference_type); 107 108 /** 109 * ucfg_get_dcs_enable() - API to get dcs enable 110 * @psoc: pointer to psoc object 111 * @pdev_id: pdev id 112 * 113 * This function gets called to get current host 114 * config dcs enable/disable status 115 * 116 * Return: WLANIM/CWIM enable status 117 */ 118 uint8_t ucfg_get_dcs_enable(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id); 119 120 /** 121 * ucfg_dcs_clear() - API to clear dcs related information 122 * @psoc: pointer to psoc object 123 * @pdev_id: pdev id 124 * 125 * This function gets called to clear dcs related information 126 * 127 * Return: None 128 */ 129 void ucfg_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id); 130 #endif /* _WLAN_DCS_UCFG_API_H_ */ 131