Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Srinivas Girigowda | d462f3b | 2019-03-25 14:05:33 -0700 | [diff] [blame] | 2 | * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #ifndef _OL_CFG__H_ |
| 20 | #define _OL_CFG__H_ |
| 21 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 22 | #include <qdf_types.h> /* uint32_t */ |
Dhanashri Atre | 12a0839 | 2016-02-17 13:10:34 -0800 | [diff] [blame] | 23 | #include <cdp_txrx_cmn.h> /* ol_pdev_handle */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 24 | #include <cds_ieee80211_common.h> /* ieee80211_qosframe_htc_addr4 */ |
| 25 | #include <enet.h> /* LLC_SNAP_HDR_LEN */ |
Siddarth Poddar | 1df1cd8 | 2016-04-27 17:32:21 +0530 | [diff] [blame] | 26 | #if defined(CONFIG_HL_SUPPORT) |
| 27 | #include "wlan_tgt_def_config_hl.h" |
| 28 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 29 | #include "wlan_tgt_def_config.h" |
Siddarth Poddar | 1df1cd8 | 2016-04-27 17:32:21 +0530 | [diff] [blame] | 30 | #endif |
Dhanashri Atre | 12a0839 | 2016-02-17 13:10:34 -0800 | [diff] [blame] | 31 | #include "ol_txrx_ctrl_api.h" /* txrx_pdev_cfg_param_t */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 32 | #include <cdp_txrx_handle.h> |
Srinivas Girigowda | d462f3b | 2019-03-25 14:05:33 -0700 | [diff] [blame] | 33 | #include "qca_vendor.h" |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 34 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | /** |
| 36 | * @brief format of data frames delivered to/from the WLAN driver by/to the OS |
| 37 | */ |
| 38 | enum wlan_frm_fmt { |
| 39 | wlan_frm_fmt_unknown, |
| 40 | wlan_frm_fmt_raw, |
| 41 | wlan_frm_fmt_native_wifi, |
| 42 | wlan_frm_fmt_802_3, |
| 43 | }; |
| 44 | |
hangtian | 1c37fb9 | 2019-04-10 11:15:20 +0800 | [diff] [blame] | 45 | /* Max throughput */ |
Hangtian Zhu | 39e2e21 | 2019-09-02 13:34:57 +0800 | [diff] [blame] | 46 | #ifdef SLUB_MEM_OPTIMIZE |
hangtian | 1c37fb9 | 2019-04-10 11:15:20 +0800 | [diff] [blame] | 47 | #define MAX_THROUGHPUT 400 |
| 48 | #else |
| 49 | #define MAX_THROUGHPUT 800 |
| 50 | #endif |
| 51 | |
Poddar, Siddarth | 8390502 | 2016-04-16 17:56:08 -0700 | [diff] [blame] | 52 | /* Throttle period Different level Duty Cycle values*/ |
| 53 | #define THROTTLE_DUTY_CYCLE_LEVEL0 (0) |
| 54 | #define THROTTLE_DUTY_CYCLE_LEVEL1 (50) |
| 55 | #define THROTTLE_DUTY_CYCLE_LEVEL2 (75) |
| 56 | #define THROTTLE_DUTY_CYCLE_LEVEL3 (94) |
| 57 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | struct wlan_ipa_uc_rsc_t { |
| 59 | u8 uc_offload_enabled; |
| 60 | u32 tx_max_buf_cnt; |
| 61 | u32 tx_buf_size; |
| 62 | u32 rx_ind_ring_size; |
| 63 | u32 tx_partition_base; |
| 64 | }; |
| 65 | |
| 66 | /* Config parameters for txrx_pdev */ |
| 67 | struct txrx_pdev_cfg_t { |
| 68 | u8 is_high_latency; |
| 69 | u8 defrag_timeout_check; |
| 70 | u8 rx_pn_check; |
| 71 | u8 pn_rx_fwd_check; |
| 72 | u8 host_addba; |
| 73 | u8 tx_free_at_download; |
| 74 | u8 rx_fwd_inter_bss; |
| 75 | u32 max_thruput_mbps; |
| 76 | u32 target_tx_credit; |
| 77 | u32 vow_config; |
| 78 | u32 tx_download_size; |
| 79 | u32 max_peer_id; |
| 80 | u32 max_vdev; |
| 81 | u32 max_nbuf_frags; |
| 82 | u32 throttle_period_ms; |
Poddar, Siddarth | 8390502 | 2016-04-16 17:56:08 -0700 | [diff] [blame] | 83 | u8 dutycycle_level[4]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | enum wlan_frm_fmt frame_type; |
| 85 | u8 rx_fwd_disabled; |
| 86 | u8 is_packet_log_enabled; |
| 87 | u8 is_full_reorder_offload; |
Yu Wang | 66a250b | 2017-07-19 11:46:40 +0800 | [diff] [blame] | 88 | #ifdef WLAN_FEATURE_TSF_PLUS |
| 89 | u8 is_ptp_rx_opt_enabled; |
| 90 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | struct wlan_ipa_uc_rsc_t ipa_uc_rsc; |
| 92 | bool ip_tcp_udp_checksum_offload; |
| 93 | bool enable_rxthread; |
| 94 | bool ce_classify_enabled; |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 95 | #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 96 | uint32_t tx_flow_stop_queue_th; |
| 97 | uint32_t tx_flow_start_queue_offset; |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 98 | #endif |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 99 | bool flow_steering_enabled; |
Ajit Pal Singh | c31d101 | 2018-06-07 19:47:22 +0530 | [diff] [blame] | 100 | /* |
| 101 | * To track if credit reporting through |
| 102 | * HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND is enabled/disabled. |
| 103 | * In Genoa(QCN7605) credits are reported through |
| 104 | * HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND only. |
| 105 | */ |
| 106 | u8 credit_update_enabled; |
Srinivas Girigowda | d462f3b | 2019-03-25 14:05:33 -0700 | [diff] [blame] | 107 | struct ol_tx_sched_wrr_ac_specs_t ac_specs[QCA_WLAN_AC_ALL]; |
jitiphil | 377bcc1 | 2018-10-05 19:46:08 +0530 | [diff] [blame] | 108 | bool gro_enable; |
| 109 | bool tso_enable; |
| 110 | bool lro_enable; |
| 111 | bool enable_data_stall_detection; |
| 112 | bool enable_flow_steering; |
| 113 | bool disable_intra_bss_fwd; |
| 114 | /* IPA Micro controller data path offload TX buffer size */ |
| 115 | uint32_t uc_tx_buffer_size; |
| 116 | /* IPA Micro controller data path offload RX indication ring count */ |
| 117 | uint32_t uc_rx_indication_ring_count; |
| 118 | /* IPA Micro controller data path offload TX partition base */ |
| 119 | uint32_t uc_tx_partition_base; |
Rakshith Suresh Patkar | 0f6375c | 2018-12-04 20:59:07 +0530 | [diff] [blame] | 120 | /* Flag to indicate whether new htt format is supported */ |
| 121 | bool new_htt_format_enabled; |
Tiger Yu | e40e783 | 2019-04-25 10:46:53 +0800 | [diff] [blame] | 122 | |
| 123 | #ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK |
| 124 | /* enable the tcp delay ack feature in the driver */ |
| 125 | bool del_ack_enable; |
| 126 | /* timeout if no more tcp ack frames, unit is ms */ |
| 127 | uint16_t del_ack_timer_value; |
| 128 | /* the maximum number of replaced tcp ack frames */ |
| 129 | uint16_t del_ack_pkt_count; |
| 130 | #endif |
Nirav Shah | fb9b1df | 2019-11-15 11:40:52 +0530 | [diff] [blame^] | 131 | |
| 132 | #ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE |
| 133 | uint16_t bundle_timer_value; |
| 134 | uint16_t bundle_size; |
| 135 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 136 | }; |
| 137 | |
| 138 | /** |
Jeff Johnson | ffa9afc | 2016-12-19 15:34:41 -0800 | [diff] [blame] | 139 | * ol_tx_set_flow_control_parameters() - set flow control parameters |
| 140 | * @cfg_ctx: cfg context |
| 141 | * @cfg_param: cfg parameters |
| 142 | * |
| 143 | * Return: none |
| 144 | */ |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 145 | #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL) |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 146 | void ol_tx_set_flow_control_parameters(struct cdp_cfg *cfg_ctx, |
Jeff Johnson | ffa9afc | 2016-12-19 15:34:41 -0800 | [diff] [blame] | 147 | struct txrx_pdev_cfg_param_t *cfg_param); |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 148 | #else |
| 149 | static inline |
| 150 | void ol_tx_set_flow_control_parameters(struct cdp_cfg *cfg_ctx, |
| 151 | struct txrx_pdev_cfg_param_t *cfg_param) |
| 152 | { |
| 153 | } |
| 154 | #endif |
Jeff Johnson | ffa9afc | 2016-12-19 15:34:41 -0800 | [diff] [blame] | 155 | |
| 156 | /** |
Jeff Johnson | bacec09 | 2016-12-20 14:08:47 -0800 | [diff] [blame] | 157 | * ol_pdev_cfg_attach - setup configuration parameters |
| 158 | * @osdev: OS handle needed as an argument for some OS primitives |
| 159 | * @cfg_param: configuration parameters |
| 160 | * |
| 161 | * Allocation configuration context that will be used across data path |
| 162 | * |
| 163 | * Return: the control device object |
| 164 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 165 | struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param); |
Jeff Johnson | bacec09 | 2016-12-20 14:08:47 -0800 | [diff] [blame] | 166 | |
| 167 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 168 | * @brief Specify whether the system is high-latency or low-latency. |
| 169 | * @details |
| 170 | * Indicate whether the system is operating in high-latency (message |
| 171 | * based, e.g. USB) mode or low-latency (memory-mapped, e.g. PCIe) mode. |
| 172 | * Some chips support just one type of host / target interface. |
| 173 | * Other chips support both LL and HL interfaces (e.g. PCIe and USB), |
| 174 | * so the selection will be made based on which bus HW is present, or |
| 175 | * which is preferred if both are present. |
| 176 | * |
| 177 | * @param pdev - handle to the physical device |
| 178 | * @return 1 -> high-latency -OR- 0 -> low-latency |
| 179 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 180 | int ol_cfg_is_high_latency(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 181 | |
| 182 | /** |
Ajit Pal Singh | c31d101 | 2018-06-07 19:47:22 +0530 | [diff] [blame] | 183 | * @brief Specify whether credit reporting through |
| 184 | * HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND is enabled by default. |
| 185 | * In Genoa credits are reported only through |
| 186 | * HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND |
| 187 | * @details |
| 188 | * @param pdev - handle to the physical device |
| 189 | * @return 1 -> enabled -OR- 0 -> disabled |
| 190 | */ |
| 191 | int ol_cfg_is_credit_update_enabled(struct cdp_cfg *cfg_pdev); |
| 192 | |
| 193 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 194 | * @brief Specify the range of peer IDs. |
| 195 | * @details |
| 196 | * Specify the maximum peer ID. This is the maximum number of peers, |
| 197 | * minus one. |
| 198 | * This is used by the host to determine the size of arrays indexed by |
| 199 | * peer ID. |
| 200 | * |
| 201 | * @param pdev - handle to the physical device |
| 202 | * @return maximum peer ID |
| 203 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 204 | int ol_cfg_max_peer_id(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 205 | |
| 206 | /** |
| 207 | * @brief Specify the max number of virtual devices within a physical device. |
| 208 | * @details |
| 209 | * Specify how many virtual devices may exist within a physical device. |
| 210 | * |
| 211 | * @param pdev - handle to the physical device |
| 212 | * @return maximum number of virtual devices |
| 213 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 214 | int ol_cfg_max_vdevs(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 215 | |
| 216 | /** |
| 217 | * @brief Check whether host-side rx PN check is enabled or disabled. |
| 218 | * @details |
| 219 | * Choose whether to allocate rx PN state information and perform |
| 220 | * rx PN checks (if applicable, based on security type) on the host. |
| 221 | * If the rx PN check is specified to be done on the host, the host SW |
| 222 | * will determine which peers are using a security type (e.g. CCMP) that |
| 223 | * requires a PN check. |
| 224 | * |
| 225 | * @param pdev - handle to the physical device |
| 226 | * @return 1 -> host performs rx PN check -OR- 0 -> no host-side rx PN check |
| 227 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 228 | int ol_cfg_rx_pn_check(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 229 | |
| 230 | /** |
| 231 | * @brief Check whether host-side rx forwarding is enabled or disabled. |
| 232 | * @details |
| 233 | * Choose whether to check whether to forward rx frames to tx on the host. |
| 234 | * For LL systems, this rx -> tx host-side forwarding check is typically |
| 235 | * enabled. |
| 236 | * For HL systems, the rx -> tx forwarding check is typically done on the |
| 237 | * target. However, even in HL systems, the host-side rx -> tx forwarding |
| 238 | * will typically be enabled, as a second-tier safety net in case the |
| 239 | * target doesn't have enough memory to store all rx -> tx forwarded frames. |
| 240 | * |
| 241 | * @param pdev - handle to the physical device |
| 242 | * @return 1 -> host does rx->tx forward -OR- 0 -> no host-side rx->tx forward |
| 243 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 244 | int ol_cfg_rx_fwd_check(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | |
| 246 | /** |
Jeff Johnson | bacec09 | 2016-12-20 14:08:47 -0800 | [diff] [blame] | 247 | * ol_set_cfg_rx_fwd_disabled - set rx fwd disable/enable |
| 248 | * |
| 249 | * @pdev - handle to the physical device |
| 250 | * @disable_rx_fwd 1 -> no rx->tx forward -> rx->tx forward |
| 251 | * |
| 252 | * Choose whether to forward rx frames to tx (where applicable) within the |
| 253 | * WLAN driver, or to leave all forwarding up to the operating system. |
| 254 | * Currently only intra-bss fwd is supported. |
| 255 | * |
| 256 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 257 | void ol_set_cfg_rx_fwd_disabled(struct cdp_cfg *ppdev, uint8_t disable_rx_fwd); |
Jeff Johnson | bacec09 | 2016-12-20 14:08:47 -0800 | [diff] [blame] | 258 | |
| 259 | /** |
| 260 | * ol_set_cfg_packet_log_enabled - Set packet log config in HTT |
| 261 | * config based on CFG ini configuration |
| 262 | * |
| 263 | * @pdev - handle to the physical device |
| 264 | * @val - 0 - disable, 1 - enable |
| 265 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 266 | void ol_set_cfg_packet_log_enabled(struct cdp_cfg *ppdev, uint8_t val); |
Jeff Johnson | bacec09 | 2016-12-20 14:08:47 -0800 | [diff] [blame] | 267 | |
| 268 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 269 | * @brief Check whether rx forwarding is enabled or disabled. |
| 270 | * @details |
| 271 | * Choose whether to forward rx frames to tx (where applicable) within the |
| 272 | * WLAN driver, or to leave all forwarding up to the operating system. |
| 273 | * |
| 274 | * @param pdev - handle to the physical device |
| 275 | * @return 1 -> no rx->tx forward -OR- 0 -> rx->tx forward (in host or target) |
| 276 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 277 | int ol_cfg_rx_fwd_disabled(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 278 | |
| 279 | /** |
| 280 | * @brief Check whether to perform inter-BSS or intra-BSS rx->tx forwarding. |
| 281 | * @details |
| 282 | * Check whether data received by an AP on one virtual device destined |
| 283 | * to a STA associated with a different virtual device within the same |
| 284 | * physical device should be forwarded within the driver, or whether |
| 285 | * forwarding should only be done within a virtual device. |
| 286 | * |
| 287 | * @param pdev - handle to the physical device |
| 288 | * @return |
| 289 | * 1 -> forward both within and between vdevs |
| 290 | * -OR- |
| 291 | * 0 -> forward only within a vdev |
| 292 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 293 | int ol_cfg_rx_fwd_inter_bss(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 294 | |
| 295 | /** |
| 296 | * @brief Specify data frame format used by the OS. |
| 297 | * @details |
| 298 | * Specify what type of frame (802.3 or native WiFi) the host data SW |
| 299 | * should expect from and provide to the OS shim. |
| 300 | * |
| 301 | * @param pdev - handle to the physical device |
| 302 | * @return enumerated data frame format |
| 303 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 304 | enum wlan_frm_fmt ol_cfg_frame_type(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 305 | |
| 306 | /** |
| 307 | * @brief Specify the peak throughput. |
| 308 | * @details |
| 309 | * Specify the peak throughput that a system is expected to support. |
| 310 | * The data SW uses this configuration to help choose the size for its |
| 311 | * tx descriptor pool and rx buffer ring. |
| 312 | * The data SW assumes that the peak throughput applies to either rx or tx, |
| 313 | * rather than having separate specs of the rx max throughput vs. the tx |
| 314 | * max throughput. |
| 315 | * |
| 316 | * @param pdev - handle to the physical device |
| 317 | * @return maximum supported throughput in Mbps (not MBps) |
| 318 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 319 | int ol_cfg_max_thruput_mbps(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 320 | |
| 321 | /** |
| 322 | * @brief Specify the maximum number of fragments per tx network buffer. |
| 323 | * @details |
| 324 | * Specify the maximum number of fragments that a tx frame provided to |
| 325 | * the WLAN driver by the OS may contain. |
| 326 | * In LL systems, the host data SW uses this maximum fragment count to |
| 327 | * determine how many elements to allocate in the fragmentation descriptor |
| 328 | * it creates to specify to the tx MAC DMA where to locate the tx frame's |
| 329 | * data. |
| 330 | * This maximum fragments count is only for regular frames, not TSO frames, |
| 331 | * since TSO frames are sent in segments with a limited number of fragments |
| 332 | * per segment. |
| 333 | * |
| 334 | * @param pdev - handle to the physical device |
| 335 | * @return maximum number of fragments that can occur in a regular tx frame |
| 336 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 337 | int ol_cfg_netbuf_frags_max(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 338 | |
| 339 | /** |
| 340 | * @brief For HL systems, specify when to free tx frames. |
| 341 | * @details |
| 342 | * In LL systems, the host's tx frame is referenced by the MAC DMA, and |
| 343 | * thus cannot be freed until the target indicates that it is finished |
| 344 | * transmitting the frame. |
| 345 | * In HL systems, the entire tx frame is downloaded to the target. |
| 346 | * Consequently, the target has its own copy of the tx frame, and the |
| 347 | * host can free the tx frame as soon as the download completes. |
| 348 | * Alternatively, the HL host can keep the frame allocated until the |
| 349 | * target explicitly tells the HL host it is done transmitting the frame. |
| 350 | * This gives the target the option of discarding its copy of the tx |
| 351 | * frame, and then later getting a new copy from the host. |
| 352 | * This function tells the host whether it should retain its copy of the |
| 353 | * transmit frames until the target explicitly indicates it is finished |
| 354 | * transmitting them, or if it should free its copy as soon as the |
| 355 | * tx frame is downloaded to the target. |
| 356 | * |
| 357 | * @param pdev - handle to the physical device |
| 358 | * @return |
| 359 | * 0 -> retain the tx frame until the target indicates it is done |
| 360 | * transmitting the frame |
| 361 | * -OR- |
| 362 | * 1 -> free the tx frame as soon as the download completes |
| 363 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 364 | int ol_cfg_tx_free_at_download(struct cdp_cfg *cfg_pdev); |
| 365 | void ol_cfg_set_tx_free_at_download(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 366 | |
| 367 | /** |
| 368 | * @brief Low water mark for target tx credit. |
| 369 | * Tx completion handler is invoked to reap the buffers when the target tx |
| 370 | * credit goes below Low Water Mark. |
| 371 | */ |
| 372 | #define OL_CFG_NUM_MSDU_REAP 512 |
| 373 | #define ol_cfg_tx_credit_lwm(pdev) \ |
| 374 | ((CFG_TGT_NUM_MSDU_DESC > OL_CFG_NUM_MSDU_REAP) ? \ |
| 375 | (CFG_TGT_NUM_MSDU_DESC - OL_CFG_NUM_MSDU_REAP) : 0) |
| 376 | |
| 377 | /** |
| 378 | * @brief In a HL system, specify the target initial credit count. |
| 379 | * @details |
| 380 | * The HL host tx data SW includes a module for determining which tx frames |
| 381 | * to download to the target at a given time. |
| 382 | * To make this judgement, the HL tx download scheduler has to know |
| 383 | * how many buffers the HL target has available to hold tx frames. |
| 384 | * Due to the possibility that a single target buffer pool can be shared |
| 385 | * between rx and tx frames, the host may not be able to obtain a precise |
| 386 | * specification of the tx buffer space available in the target, but it |
| 387 | * uses the best estimate, as provided by this configuration function, |
| 388 | * to determine how best to schedule the tx frame downloads. |
| 389 | * |
| 390 | * @param pdev - handle to the physical device |
| 391 | * @return the number of tx buffers available in a HL target |
| 392 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 393 | uint16_t ol_cfg_target_tx_credit(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 394 | |
| 395 | /** |
| 396 | * @brief Specify the LL tx MSDU header download size. |
| 397 | * @details |
| 398 | * In LL systems, determine how many bytes from a tx frame to download, |
| 399 | * in order to provide the target FW's Descriptor Engine with enough of |
| 400 | * the packet's payload to interpret what kind of traffic this is, |
| 401 | * and who it is for. |
| 402 | * This download size specification does not include the 802.3 / 802.11 |
| 403 | * frame encapsulation headers; it starts with the encapsulated IP packet |
| 404 | * (or whatever ethertype is carried within the ethernet-ish frame). |
| 405 | * The LL host data SW will determine how many bytes of the MSDU header to |
| 406 | * download by adding this download size specification to the size of the |
| 407 | * frame header format specified by the ol_cfg_frame_type configuration |
| 408 | * function. |
| 409 | * |
| 410 | * @param pdev - handle to the physical device |
| 411 | * @return the number of bytes beyond the 802.3 or native WiFi header to |
| 412 | * download to the target for tx classification |
| 413 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 414 | int ol_cfg_tx_download_size(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 415 | |
| 416 | /** |
| 417 | * brief Specify where defrag timeout and duplicate detection is handled |
| 418 | * @details |
| 419 | * non-aggregate duplicate detection and timing out stale fragments |
| 420 | * requires additional target memory. To reach max client |
| 421 | * configurations (128+), non-aggregate duplicate detection and the |
| 422 | * logic to time out stale fragments is moved to the host. |
| 423 | * |
| 424 | * @param pdev - handle to the physical device |
| 425 | * @return |
| 426 | * 0 -> target is responsible non-aggregate duplicate detection and |
| 427 | * timing out stale fragments. |
| 428 | * |
| 429 | * 1 -> host is responsible non-aggregate duplicate detection and |
| 430 | * timing out stale fragments. |
| 431 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 432 | int ol_cfg_rx_host_defrag_timeout_duplicate_check(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 433 | |
| 434 | /** |
| 435 | * brief Query for the period in ms used for throttling for |
| 436 | * thermal mitigation |
| 437 | * @details |
| 438 | * In LL systems, transmit data throttling is used for thermal |
| 439 | * mitigation where data is paused and resumed during the |
| 440 | * throttle period i.e. the throttle period consists of an |
| 441 | * "on" phase when transmit is allowed and an "off" phase when |
| 442 | * transmit is suspended. This function returns the total |
| 443 | * period used for throttling. |
| 444 | * |
| 445 | * @param pdev - handle to the physical device |
| 446 | * @return the total throttle period in ms |
| 447 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 448 | int ol_cfg_throttle_period_ms(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 449 | |
| 450 | /** |
Poddar, Siddarth | 8390502 | 2016-04-16 17:56:08 -0700 | [diff] [blame] | 451 | * brief Query for the duty cycle in percentage used for throttling for |
| 452 | * thermal mitigation |
| 453 | * |
| 454 | * @param pdev - handle to the physical device |
| 455 | * @param level - duty cycle level |
| 456 | * @return the duty cycle level in percentage |
| 457 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 458 | int ol_cfg_throttle_duty_cycle_level(struct cdp_cfg *cfg_pdev, int level); |
Poddar, Siddarth | 8390502 | 2016-04-16 17:56:08 -0700 | [diff] [blame] | 459 | |
| 460 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 461 | * brief Check whether full reorder offload is |
| 462 | * enabled/disable by the host |
| 463 | * @details |
| 464 | * If the host does not support receive reorder (i.e. the |
| 465 | * target performs full receive re-ordering) this will return |
| 466 | * "enabled" |
| 467 | * |
| 468 | * @param pdev - handle to the physical device |
| 469 | * @return 1 - enable, 0 - disable |
| 470 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 471 | int ol_cfg_is_full_reorder_offload(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 472 | |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 473 | int ol_cfg_is_rx_thread_enabled(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 474 | |
Yu Wang | 66a250b | 2017-07-19 11:46:40 +0800 | [diff] [blame] | 475 | #ifdef WLAN_FEATURE_TSF_PLUS |
| 476 | void ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val); |
| 477 | u_int8_t ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev); |
| 478 | #else |
| 479 | static inline void |
| 480 | ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val) |
| 481 | { |
| 482 | } |
| 483 | |
| 484 | static inline u_int8_t |
| 485 | ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev) |
| 486 | { |
| 487 | return 0; |
| 488 | } |
| 489 | #endif |
| 490 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 491 | /** |
| 492 | * ol_cfg_is_ip_tcp_udp_checksum_offload_enabled() - return |
| 493 | * ip_tcp_udp_checksum_offload is enable/disable |
| 494 | * @pdev : handle to the physical device |
| 495 | * |
| 496 | * Return: 1 - enable, 0 - disable |
| 497 | */ |
| 498 | static inline |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 499 | int ol_cfg_is_ip_tcp_udp_checksum_offload_enabled(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 500 | { |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 501 | struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; |
Yun Park | 73fbcf5 | 2017-04-05 11:49:16 -0700 | [diff] [blame] | 502 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 503 | return cfg->ip_tcp_udp_checksum_offload; |
| 504 | } |
| 505 | |
| 506 | |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 507 | #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL) |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 508 | int ol_cfg_get_tx_flow_stop_queue_th(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 509 | |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 510 | int ol_cfg_get_tx_flow_start_queue_offset(struct cdp_cfg *cfg_pdev); |
hangtian | b9c9136 | 2019-06-07 10:39:38 +0800 | [diff] [blame] | 511 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 512 | |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 513 | bool ol_cfg_is_ce_classify_enabled(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 514 | |
| 515 | enum wlan_target_fmt_translation_caps { |
| 516 | wlan_frm_tran_cap_raw = 0x01, |
| 517 | wlan_frm_tran_cap_native_wifi = 0x02, |
| 518 | wlan_frm_tran_cap_8023 = 0x04, |
| 519 | }; |
| 520 | |
| 521 | /** |
| 522 | * @brief Specify the maximum header size added by SW tx encapsulation |
| 523 | * @details |
| 524 | * This function returns the maximum size of the new L2 header, not the |
| 525 | * difference between the new and old L2 headers. |
| 526 | * Thus, this function returns the maximum 802.11 header size that the |
| 527 | * tx SW may need to add to tx data frames. |
| 528 | * |
| 529 | * @param pdev - handle to the physical device |
| 530 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 531 | static inline int ol_cfg_sw_encap_hdr_max_size(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 532 | { |
| 533 | /* |
| 534 | * 24 byte basic 802.11 header |
| 535 | * + 6 byte 4th addr |
| 536 | * + 2 byte QoS control |
| 537 | * + 4 byte HT control |
| 538 | * + 8 byte LLC/SNAP |
| 539 | */ |
| 540 | return sizeof(struct ieee80211_qosframe_htc_addr4) + LLC_SNAP_HDR_LEN; |
| 541 | } |
| 542 | |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 543 | static inline uint8_t ol_cfg_tx_encap(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 544 | { |
| 545 | /* tx encap done in HW */ |
| 546 | return 0; |
| 547 | } |
| 548 | |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 549 | static inline int ol_cfg_host_addba(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 550 | { |
| 551 | /* |
| 552 | * ADDBA negotiation is handled by the target FW for Peregrine + Rome. |
| 553 | */ |
| 554 | return 0; |
| 555 | } |
| 556 | |
| 557 | /** |
| 558 | * @brief If the host SW's ADDBA negotiation fails, should it be retried? |
| 559 | * |
| 560 | * @param pdev - handle to the physical device |
| 561 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 562 | static inline int ol_cfg_addba_retry(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 563 | { |
| 564 | return 0; /* disabled for now */ |
| 565 | } |
| 566 | |
| 567 | /** |
| 568 | * @brief How many frames to hold in a paused vdev's tx queue in LL systems |
| 569 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 570 | static inline int ol_tx_cfg_max_tx_queue_depth_ll(struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 571 | { |
| 572 | /* |
| 573 | * Store up to 1500 frames for a paused vdev. |
| 574 | * For example, if the vdev is sending 300 Mbps of traffic, and the |
| 575 | * PHY is capable of 600 Mbps, then it will take 56 ms for the PHY to |
| 576 | * drain both the 700 frames that are queued initially, plus the next |
| 577 | * 700 frames that come in while the PHY is catching up. |
| 578 | * So in this example scenario, the PHY will remain fully utilized |
| 579 | * in a MCC system that has a channel-switching period of 56 ms or less. |
| 580 | * 700 frames calculation was correct when FW drain packet without |
| 581 | * any overhead. Actual situation drain overhead will slowdown drain |
| 582 | * speed. And channel period is less than 56 msec |
| 583 | * Worst scenario, 1500 frames should be stored in host. |
| 584 | */ |
| 585 | return 1500; |
| 586 | } |
| 587 | |
| 588 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 589 | * @brief Get packet log config from HTT config |
| 590 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 591 | uint8_t ol_cfg_is_packet_log_enabled(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 592 | |
| 593 | #ifdef IPA_OFFLOAD |
| 594 | /** |
| 595 | * @brief IPA micro controller data path offload enable or not |
| 596 | * @detail |
| 597 | * This function returns IPA micro controller data path offload |
| 598 | * feature enabled or not |
| 599 | * |
| 600 | * @param pdev - handle to the physical device |
| 601 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 602 | unsigned int ol_cfg_ipa_uc_offload_enabled(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 603 | /** |
| 604 | * @brief IPA micro controller data path TX buffer size |
| 605 | * @detail |
| 606 | * This function returns IPA micro controller data path offload |
| 607 | * TX buffer size which should be pre-allocated by driver. |
| 608 | * Default buffer size is 2K |
| 609 | * |
| 610 | * @param pdev - handle to the physical device |
| 611 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 612 | unsigned int ol_cfg_ipa_uc_tx_buf_size(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 613 | /** |
| 614 | * @brief IPA micro controller data path TX buffer size |
| 615 | * @detail |
| 616 | * This function returns IPA micro controller data path offload |
| 617 | * TX buffer count which should be pre-allocated by driver. |
| 618 | * |
| 619 | * @param pdev - handle to the physical device |
| 620 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 621 | unsigned int ol_cfg_ipa_uc_tx_max_buf_cnt(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 622 | /** |
| 623 | * @brief IPA micro controller data path TX buffer size |
| 624 | * @detail |
| 625 | * This function returns IPA micro controller data path offload |
| 626 | * RX indication ring size which will notified by WLAN FW to IPA |
| 627 | * micro controller |
| 628 | * |
| 629 | * @param pdev - handle to the physical device |
| 630 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 631 | unsigned int ol_cfg_ipa_uc_rx_ind_ring_size(struct cdp_cfg *cfg_pdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 632 | /** |
| 633 | * @brief IPA micro controller data path TX buffer size |
| 634 | * @param pdev - handle to the physical device |
| 635 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 636 | unsigned int ol_cfg_ipa_uc_tx_partition_base(struct cdp_cfg *cfg_pdev); |
| 637 | void ol_cfg_set_ipa_uc_tx_partition_base(struct cdp_cfg *cfg_pdev, |
Yun Park | b4f591d | 2017-03-29 15:51:01 -0700 | [diff] [blame] | 638 | uint32_t value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 639 | #else |
| 640 | static inline unsigned int ol_cfg_ipa_uc_offload_enabled( |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 641 | struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 642 | { |
| 643 | return 0; |
| 644 | } |
| 645 | |
| 646 | static inline unsigned int ol_cfg_ipa_uc_tx_buf_size( |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 647 | struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 648 | { |
| 649 | return 0; |
| 650 | } |
| 651 | |
| 652 | static inline unsigned int ol_cfg_ipa_uc_tx_max_buf_cnt( |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 653 | struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 654 | { |
| 655 | return 0; |
| 656 | } |
| 657 | |
| 658 | static inline unsigned int ol_cfg_ipa_uc_rx_ind_ring_size( |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 659 | struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 660 | { |
| 661 | return 0; |
| 662 | } |
| 663 | |
| 664 | static inline unsigned int ol_cfg_ipa_uc_tx_partition_base( |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 665 | struct cdp_cfg *cfg_pdev) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 666 | { |
| 667 | return 0; |
| 668 | } |
Yun Park | 4d968df | 2016-10-11 11:44:15 -0700 | [diff] [blame] | 669 | |
| 670 | static inline void ol_cfg_set_ipa_uc_tx_partition_base( |
Yun Park | b4f591d | 2017-03-29 15:51:01 -0700 | [diff] [blame] | 671 | void *cfg_pdev, uint32_t value) |
Yun Park | 4d968df | 2016-10-11 11:44:15 -0700 | [diff] [blame] | 672 | { |
Yun Park | 4d968df | 2016-10-11 11:44:15 -0700 | [diff] [blame] | 673 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 674 | #endif /* IPA_OFFLOAD */ |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 675 | |
| 676 | /** |
| 677 | * ol_set_cfg_flow_steering - Set Rx flow steering config based on CFG ini |
| 678 | * config. |
| 679 | * |
| 680 | * @pdev - handle to the physical device |
| 681 | * @val - 0 - disable, 1 - enable |
| 682 | * |
| 683 | * Return: None |
| 684 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 685 | static inline void ol_set_cfg_flow_steering(struct cdp_cfg *cfg_pdev, |
| 686 | uint8_t val) |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 687 | { |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 688 | struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 689 | |
| 690 | cfg->flow_steering_enabled = val; |
| 691 | } |
| 692 | |
| 693 | /** |
| 694 | * ol_cfg_is_flow_steering_enabled - Return Rx flow steering config. |
| 695 | * |
| 696 | * @pdev - handle to the physical device |
| 697 | * |
| 698 | * Return: value of configured flow steering value. |
| 699 | */ |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 700 | static inline uint8_t ol_cfg_is_flow_steering_enabled(struct cdp_cfg *cfg_pdev) |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 701 | { |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 702 | struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; |
Manjunathappa Prakash | fff753c | 2016-09-01 19:34:56 -0700 | [diff] [blame] | 703 | |
| 704 | return cfg->flow_steering_enabled; |
| 705 | } |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 706 | |
| 707 | /** |
Rakshith Suresh Patkar | 0f6375c | 2018-12-04 20:59:07 +0530 | [diff] [blame] | 708 | * ol_set_cfg_new_htt_format - Set whether FW supports new htt format |
| 709 | * |
| 710 | * @pdev - handle to the physical device |
| 711 | * @val - true - supported, false - not supported |
| 712 | * |
| 713 | * Return: None |
| 714 | */ |
| 715 | static inline void |
| 716 | ol_set_cfg_new_htt_format(struct cdp_cfg *cfg_pdev, bool val) |
| 717 | { |
| 718 | struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; |
| 719 | |
| 720 | cfg->new_htt_format_enabled = val; |
| 721 | } |
| 722 | |
| 723 | /** |
| 724 | * ol_cfg_is_htt_new_format_enabled - Return whether FW supports new htt format |
| 725 | * |
| 726 | * @pdev - handle to the physical device |
| 727 | * |
| 728 | * Return: value of configured htt_new_format |
| 729 | */ |
| 730 | static inline bool |
| 731 | ol_cfg_is_htt_new_format_enabled(struct cdp_cfg *cfg_pdev) |
| 732 | { |
| 733 | struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; |
| 734 | |
| 735 | return cfg->new_htt_format_enabled; |
| 736 | } |
| 737 | |
Tiger Yu | e40e783 | 2019-04-25 10:46:53 +0800 | [diff] [blame] | 738 | #ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK |
| 739 | /** |
| 740 | * ol_cfg_get_del_ack_timer_value() - get delayed ack timer value |
| 741 | * @cfg_pdev: pdev handle |
| 742 | * |
| 743 | * Return: timer value |
| 744 | */ |
| 745 | int ol_cfg_get_del_ack_timer_value(struct cdp_cfg *cfg_pdev); |
| 746 | |
| 747 | /** |
| 748 | * ol_cfg_get_del_ack_enable_value() - get delayed ack enable value |
| 749 | * @cfg_pdev: pdev handle |
| 750 | * |
| 751 | * Return: enable/disable |
| 752 | */ |
| 753 | bool ol_cfg_get_del_ack_enable_value(struct cdp_cfg *cfg_pdev); |
| 754 | |
| 755 | /** |
| 756 | * ol_cfg_get_del_ack_count_value() - get delayed ack count value |
| 757 | * @cfg_pdev: pdev handle |
| 758 | * |
| 759 | * Return: count value |
| 760 | */ |
| 761 | int ol_cfg_get_del_ack_count_value(struct cdp_cfg *cfg_pdev); |
| 762 | |
| 763 | /** |
| 764 | * ol_cfg_update_del_ack_params() - update delayed ack params |
| 765 | * @cfg_ctx: cfg context |
| 766 | * @cfg_param: parameters |
| 767 | * |
| 768 | * Return: none |
| 769 | */ |
| 770 | void ol_cfg_update_del_ack_params(struct txrx_pdev_cfg_t *cfg_ctx, |
| 771 | struct txrx_pdev_cfg_param_t *cfg_param); |
| 772 | #else |
| 773 | /** |
| 774 | * ol_cfg_update_del_ack_params() - update delayed ack params |
| 775 | * @cfg_ctx: cfg context |
| 776 | * @cfg_param: parameters |
| 777 | * |
| 778 | * Return: none |
| 779 | */ |
| 780 | static inline |
| 781 | void ol_cfg_update_del_ack_params(struct txrx_pdev_cfg_t *cfg_ctx, |
| 782 | struct txrx_pdev_cfg_param_t *cfg_param) |
| 783 | { |
| 784 | } |
| 785 | #endif |
| 786 | |
Nirav Shah | fb9b1df | 2019-11-15 11:40:52 +0530 | [diff] [blame^] | 787 | #ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE |
| 788 | int ol_cfg_get_bundle_timer_value(struct cdp_cfg *cfg_pdev); |
| 789 | int ol_cfg_get_bundle_size(struct cdp_cfg *cfg_pdev); |
| 790 | #else |
| 791 | #endif |
Rakshith Suresh Patkar | 0f6375c | 2018-12-04 20:59:07 +0530 | [diff] [blame] | 792 | /** |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 793 | * ol_cfg_get_wrr_skip_weight() - brief Query for the param of wrr_skip_weight |
| 794 | * @pdev: handle to the physical device. |
| 795 | * @ac: access control, it will be BE, BK, VI, VO |
| 796 | * |
| 797 | * Return: wrr_skip_weight for specified ac. |
| 798 | */ |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 799 | int ol_cfg_get_wrr_skip_weight(struct cdp_cfg *pdev, int ac); |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 800 | |
| 801 | /** |
| 802 | * ol_cfg_get_credit_threshold() - Query for the param of credit_threshold |
| 803 | * @pdev: handle to the physical device. |
| 804 | * @ac: access control, it will be BE, BK, VI, VO |
| 805 | * |
| 806 | * Return: credit_threshold for specified ac. |
| 807 | */ |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 808 | uint32_t ol_cfg_get_credit_threshold(struct cdp_cfg *pdev, int ac); |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 809 | |
| 810 | /** |
| 811 | * ol_cfg_get_send_limit() - Query for the param of send_limit |
| 812 | * @pdev: handle to the physical device. |
| 813 | * @ac: access control, it will be BE, BK, VI, VO |
| 814 | * |
| 815 | * Return: send_limit for specified ac. |
| 816 | */ |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 817 | uint16_t ol_cfg_get_send_limit(struct cdp_cfg *pdev, int ac); |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 818 | |
| 819 | /** |
| 820 | * ol_cfg_get_credit_reserve() - Query for the param of credit_reserve |
| 821 | * @pdev: handle to the physical device. |
| 822 | * @ac: access control, it will be BE, BK, VI, VO |
| 823 | * |
| 824 | * Return: credit_reserve for specified ac. |
| 825 | */ |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 826 | int ol_cfg_get_credit_reserve(struct cdp_cfg *pdev, int ac); |
gbian | 62edd7e | 2017-03-07 13:12:13 +0800 | [diff] [blame] | 827 | |
| 828 | /** |
| 829 | * ol_cfg_get_discard_weight() - Query for the param of discard_weight |
| 830 | * @pdev: handle to the physical device. |
| 831 | * @ac: access control, it will be BE, BK, VI, VO |
| 832 | * |
| 833 | * Return: discard_weight for specified ac. |
| 834 | */ |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 835 | int ol_cfg_get_discard_weight(struct cdp_cfg *pdev, int ac); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 836 | #endif /* _OL_CFG__H_ */ |