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