xref: /wlan-dirver/qca-wifi-host-cmn/target_if/init_deinit/inc/init_cmd_api.h (revision f28396d060cff5c6519f883cb28ae0116ce479f1)
1 /*
2  * Copyright (c) 2018, 2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: init_cmd_api.h
21  *
22  * Public APIs to prepare and send init command
23  */
24 
25 #ifndef _INIT_DEINIT_INIT_CMD_H_
26 #define _INIT_DEINIT_INIT_CMD_H_
27 
28 /* max size if 256k */
29 #define HOST_MEM_CHUNK_MAX_SIZE (256 * 1024)
30 #define HOST_MEM_CHUNK_MAX_SIZE_POWER2 (8 + 10)
31 #define TXBF_CV_POOL0 2
32 #define TXBF_CV_POOL1 3
33 #define TXBF_CV_POOL2 4
34 #define HOST_CONTIGUOUS_MEM_CHUNK_REQUIRED 0x8
35 
36 /**
37  * init_deinit_handle_host_mem_req() - handle host memory request
38  * @psoc: PSOC object
39  * @tgt_info: PSOC_INFO object
40  * @event: Event buffer from FW
41  *
42  * API to handle memory request from FW and allocate memory chunks
43  *
44  * Return: SUCCESS on successful memory allocation
45  *         On FAILURE (appropriate failure codes are returned)
46  */
47 QDF_STATUS init_deinit_handle_host_mem_req(
48 		 struct wlan_objmgr_psoc *psoc,
49 		 struct target_psoc_info *tgt_info, uint8_t *event);
50 
51 /**
52  * init_deinit_free_num_units() - Free allocated mem chunks
53  * @psoc: PSOC object
54  * @tgt_info: PSOC_INFO object
55  *
56  * API to free memory
57  *
58  * Return: SUCCESS on successful memory free
59  *         On FAILURE (appropriate failure codes are returned)
60  */
61 QDF_STATUS init_deinit_free_num_units(struct wlan_objmgr_psoc *psoc,
62 			struct target_psoc_info *tgt_hdl);
63 
64 /**
65  * init_deinit_derive_band_to_mac_param() - Derive band to mac param
66  * @psoc: PSOC object
67  * @tgt_info: PSOC_INFO object
68  * @band_to_mac: BAND_TO_MAC object
69  *
70  * API to derive band to mac param
71  *
72  * Return: void
73  */
74 void init_deinit_derive_band_to_mac_param(
75 		struct wlan_objmgr_psoc *psoc,
76 		struct target_psoc_info *tgt_info,
77 		struct wmi_host_pdev_band_to_mac *band_to_mac);
78 
79 /**
80  * init_deinit_prepare_send_init_cmd() - prepare send init cmd
81  * @psoc: PSOC object
82  * @tgt_info: PSOC_INFO object
83  *
84  * API to prepare send init command
85  *
86  * Return: void
87  */
88 void init_deinit_prepare_send_init_cmd(
89 		 struct wlan_objmgr_psoc *psoc,
90 		 struct target_psoc_info *tgt_info);
91 
92 #endif /* _INIT_DEINIT_INIT_CMD_H_*/
93