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