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 CFR_CAPTURE_HOST_MEM_REQ_ID 9 35 #define HOST_CONTIGUOUS_MEM_CHUNK_REQUIRED 0x8 36 37 /** 38 * init_deinit_handle_host_mem_req() - handle host memory request 39 * @psoc: PSOC object 40 * @tgt_info: PSOC_INFO object 41 * @event: Event buffer from FW 42 * 43 * API to handle memory request from FW and allocate memory chunks 44 * 45 * Return: SUCCESS on successful memory allocation 46 * On FAILURE (appropriate failure codes are returned) 47 */ 48 QDF_STATUS init_deinit_handle_host_mem_req( 49 struct wlan_objmgr_psoc *psoc, 50 struct target_psoc_info *tgt_info, uint8_t *event); 51 52 /** 53 * init_deinit_free_num_units() - Free allocated mem chunks 54 * @psoc: PSOC object 55 * @tgt_info: PSOC_INFO object 56 * 57 * API to free memory 58 * 59 * Return: SUCCESS on successful memory free 60 * On FAILURE (appropriate failure codes are returned) 61 */ 62 QDF_STATUS init_deinit_free_num_units(struct wlan_objmgr_psoc *psoc, 63 struct target_psoc_info *tgt_hdl); 64 65 /** 66 * init_deinit_derive_band_to_mac_param() - Derive band to mac param 67 * @psoc: PSOC object 68 * @tgt_info: PSOC_INFO object 69 * @init_param: Pointer to init param 70 * 71 * API to derive band to mac param 72 * 73 * Return: void 74 */ 75 void init_deinit_derive_band_to_mac_param( 76 struct wlan_objmgr_psoc *psoc, 77 struct target_psoc_info *tgt_info, 78 struct wmi_init_cmd_param *init_param); 79 80 /** 81 * init_deinit_prepare_send_init_cmd() - prepare send init cmd 82 * @psoc: PSOC object 83 * @tgt_info: PSOC_INFO object 84 * 85 * API to prepare send init command 86 * 87 * Return: void 88 */ 89 void init_deinit_prepare_send_init_cmd( 90 struct wlan_objmgr_psoc *psoc, 91 struct target_psoc_info *tgt_info); 92 93 #endif /* _INIT_DEINIT_INIT_CMD_H_*/ 94