1 /* 2 * Copyright (c) 2017-2018 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 #ifndef _TARGET_IF_DIRECT_BUF_RX_API_H_ 20 #define _TARGET_IF_DIRECT_BUF_RX_API_H_ 21 22 #include "qdf_nbuf.h" 23 #include "qdf_atomic.h" 24 25 #define direct_buf_rx_log(level, args...) \ 26 QDF_TRACE(QDF_MODULE_ID_DIRECT_BUF_RX, level, ## args) 27 #define direct_buf_rx_logfl(level, format, args...) \ 28 direct_buf_rx_log(level, FL(format), ## args) 29 #define direct_buf_alert(format, args...) \ 30 direct_buf_rx_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) 31 #define direct_buf_rx_err(format, args...) \ 32 direct_buf_rx_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) 33 #define direct_buf_rx_warn(format, args...) \ 34 direct_buf_rx_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) 35 #define direct_buf_rx_notice(format, args...) \ 36 direct_buf_rx_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) 37 #define direct_buf_rx_info(format, args...) \ 38 direct_buf_rx_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args) 39 #define direct_buf_rx_debug(format, args...) \ 40 direct_buf_rx_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) 41 #define direct_buf_rx_enter() \ 42 direct_buf_rx_logfl(QDF_TRACE_LEVEL_DEBUG, "enter") 43 #define direct_buf_rx_exit() \ 44 direct_buf_rx_logfl(QDF_TRACE_LEVEL_DEBUG, "exit") 45 46 #define DBR_MAX_CHAINS (8) 47 48 struct wlan_objmgr_psoc; 49 struct wlan_lmac_if_tx_ops; 50 51 /** 52 * struct direct_buf_rx_data - direct buffer rx data 53 * @dbr_len: Length of the buffer DMAed 54 * @vaddr: Virtual address of the buffer that has DMAed data 55 * @meta_data_valid: Indicates that metadata is valid 56 * @meta_data: Meta data 57 */ 58 struct direct_buf_rx_data { 59 size_t dbr_len; 60 void *vaddr; 61 bool meta_data_valid; 62 struct direct_buf_rx_metadata meta_data; 63 }; 64 65 /** 66 * direct_buf_rx_init() - Function to initialize direct buf rx module 67 * 68 * Return: QDF status of operation 69 */ 70 QDF_STATUS direct_buf_rx_init(void); 71 72 /** 73 * direct_buf_rx_deinit() - Function to deinitialize direct buf rx module 74 * 75 * Return: QDF status of operation 76 */ 77 QDF_STATUS direct_buf_rx_deinit(void); 78 79 /** 80 * direct_buf_rx_target_attach() - Attach hal_soc,osdev in direct buf rx psoc obj 81 * @psoc: pointer to psoc object 82 * @hal_soc: Opaque HAL SOC handle 83 * @osdev: QDF os device handle 84 * 85 * Return: QDF status of operation 86 */ 87 QDF_STATUS direct_buf_rx_target_attach(struct wlan_objmgr_psoc *psoc, 88 void *hal_soc, qdf_device_t osdev); 89 90 /** 91 * target_if_direct_buf_rx_register_tx_ops() - Register tx ops for direct buffer 92 * rx module 93 * @tx_ops: pointer to lmac interface tx ops 94 * 95 * Return: None 96 */ 97 void target_if_direct_buf_rx_register_tx_ops( 98 struct wlan_lmac_if_tx_ops *tx_ops); 99 100 #endif /* _TARGET_IF_DIRECT_BUF_RX_API_H_ */ 101