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