xref: /wlan-driver/qca-wifi-host-cmn/umac/afc/dispatcher/inc/wlan_afc_ucfg_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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: wlan_afc_ucfg_api.h
19  *
20  * This file has the prototypes of AFC dispatcher API which is exposed
21  * to outside of AFC component.
22  */
23 
24 #ifndef __WLAN_AFC_UCFG_API_H__
25 #define __WLAN_AFC_UCFG_API_H__
26 
27 #include <wlan_afc_main.h>
28 
29 #ifdef CONFIG_AFC_SUPPORT
30 /**
31  * ucfg_afc_register_data_send_cb() - UCFG API to register AFC data send
32  * callback function to pass AFC response data to target.
33  * @psoc: Pointer to PSOC object
34  * @func: Pointer to PLD AFC function to pass AFC response data to target
35  *
36  * Return: QDF STATUS
37  */
38 QDF_STATUS ucfg_afc_register_data_send_cb(struct wlan_objmgr_psoc *psoc,
39 					  send_response_to_afcmem func);
40 /**
41  * ucfg_afc_data_send() - UCFG API to send AFC response data to target
42  * @psoc: Pointer to PSOC object
43  * @pdev: Pointer to PDEV object
44  * @data: Pointer to AFC response data which pass to target
45  * @len: Length of AFC response data
46  *
47  * Return: 0 if success, otherwise error code
48  */
49 int ucfg_afc_data_send(struct wlan_objmgr_psoc *psoc,
50 		       struct wlan_objmgr_pdev *pdev,
51 		       struct wlan_afc_host_resp *data,
52 		       uint32_t len);
53 /**
54  * ucfg_afc_init() - UCFG API to initialize AFC component
55  *
56  * Return: QDF STATUS
57  */
58 QDF_STATUS ucfg_afc_init(void);
59 
60 /**
61  * ucfg_afc_deinit() - UCFG API to deinitialize AFC component
62  *
63  * Return: QDF STATUS
64  */
65 QDF_STATUS ucfg_afc_deinit(void);
66 #else
ucfg_afc_init(void)67 static inline QDF_STATUS ucfg_afc_init(void)
68 {
69 	return QDF_STATUS_SUCCESS;
70 }
71 
ucfg_afc_deinit(void)72 static inline QDF_STATUS ucfg_afc_deinit(void)
73 {
74 	return QDF_STATUS_SUCCESS;
75 }
76 #endif
77 #endif
78