Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Nirav Shah | c4aa1ab | 2018-04-21 12:38:44 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 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 | /** |
| 20 | * @file ol_tx_queue.h |
| 21 | * @brief API definitions for the tx frame queue module within the data SW. |
| 22 | */ |
| 23 | #ifndef _OL_TX_QUEUE__H_ |
| 24 | #define _OL_TX_QUEUE__H_ |
| 25 | |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 26 | #include <qdf_nbuf.h> /* qdf_nbuf_t */ |
Dhanashri Atre | 12a0839 | 2016-02-17 13:10:34 -0800 | [diff] [blame] | 27 | #include <cdp_txrx_cmn.h> /* ol_txrx_vdev_t, etc. */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 28 | #include <qdf_types.h> /* bool */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 29 | |
| 30 | /*--- function prototypes for optional queue log feature --------------------*/ |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 31 | #if defined(ENABLE_TX_QUEUE_LOG) || \ |
| 32 | (defined(DEBUG_HL_LOGGING) && defined(CONFIG_HL_SUPPORT)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 33 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 34 | /** |
| 35 | * ol_tx_queue_log_enqueue() - enqueue tx queue logs |
| 36 | * @pdev: physical device object |
| 37 | * @msdu_info: tx msdu meta data |
| 38 | * @frms: number of frames for which logs need to be enqueued |
| 39 | * @bytes: number of bytes |
| 40 | * |
| 41 | * |
| 42 | * Return: None |
| 43 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 44 | void |
| 45 | ol_tx_queue_log_enqueue(struct ol_txrx_pdev_t *pdev, |
| 46 | struct ol_txrx_msdu_info_t *msdu_info, |
| 47 | int frms, int bytes); |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * ol_tx_queue_log_dequeue() - dequeue tx queue logs |
| 51 | * @pdev: physical device object |
| 52 | * @txq: tx queue |
| 53 | * @frms: number of frames for which logs need to be dequeued |
| 54 | * @bytes: number of bytes |
| 55 | * |
| 56 | * |
| 57 | * Return: None |
| 58 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 59 | void |
| 60 | ol_tx_queue_log_dequeue(struct ol_txrx_pdev_t *pdev, |
| 61 | struct ol_tx_frms_queue_t *txq, int frms, int bytes); |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 62 | |
| 63 | /** |
| 64 | * ol_tx_queue_log_free() - free tx queue logs |
| 65 | * @pdev: physical device object |
| 66 | * @txq: tx queue |
| 67 | * @tid: tid value |
| 68 | * @frms: number of frames for which logs need to be freed |
| 69 | * @bytes: number of bytes |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 70 | * @is_peer_txq - peer queue or not |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 71 | * |
| 72 | * |
| 73 | * Return: None |
| 74 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 75 | void |
| 76 | ol_tx_queue_log_free(struct ol_txrx_pdev_t *pdev, |
| 77 | struct ol_tx_frms_queue_t *txq, |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 78 | int tid, int frms, int bytes, bool is_peer_txq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | |
| 80 | #else |
| 81 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 82 | static inline void |
| 83 | ol_tx_queue_log_enqueue(struct ol_txrx_pdev_t *pdev, |
| 84 | struct ol_txrx_msdu_info_t *msdu_info, |
| 85 | int frms, int bytes) |
| 86 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 87 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 88 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 89 | static inline void |
| 90 | ol_tx_queue_log_dequeue(struct ol_txrx_pdev_t *pdev, |
| 91 | struct ol_tx_frms_queue_t *txq, int frms, int bytes) |
| 92 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 93 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 94 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 95 | static inline void |
| 96 | ol_tx_queue_log_free(struct ol_txrx_pdev_t *pdev, |
| 97 | struct ol_tx_frms_queue_t *txq, |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 98 | int tid, int frms, int bytes, bool is_peer_txq) |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 99 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 100 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 101 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 102 | #endif |
| 103 | |
| 104 | #if defined(CONFIG_HL_SUPPORT) |
| 105 | |
| 106 | /** |
| 107 | * @brief Queue a tx frame to the tid queue. |
| 108 | * |
| 109 | * @param pdev - the data virtual device sending the data |
| 110 | * (for storing the tx desc in the virtual dev's tx_target_list, |
| 111 | * and for accessing the phy dev) |
| 112 | * @param txq - which queue the tx frame gets stored in |
| 113 | * @param tx_desc - tx meta-data, including prev and next ptrs |
| 114 | * @param tx_msdu_info - characteristics of the tx frame |
| 115 | */ |
| 116 | void |
| 117 | ol_tx_enqueue( |
| 118 | struct ol_txrx_pdev_t *pdev, |
| 119 | struct ol_tx_frms_queue_t *txq, |
| 120 | struct ol_tx_desc_t *tx_desc, |
| 121 | struct ol_txrx_msdu_info_t *tx_msdu_info); |
| 122 | |
| 123 | /** |
| 124 | * @brief - remove the specified number of frames from the head of a tx queue |
| 125 | * @details |
| 126 | * This function removes frames from the head of a tx queue, |
| 127 | * and returns them as a NULL-terminated linked list. |
| 128 | * The function will remove frames until one of the following happens: |
| 129 | * 1. The tx queue is empty |
| 130 | * 2. The specified number of frames have been removed |
| 131 | * 3. Removal of more frames would exceed the specified credit limit |
| 132 | * |
| 133 | * @param pdev - the physical device object |
| 134 | * @param txq - which tx queue to remove frames from |
| 135 | * @param head - which contains return linked-list of tx frames (descriptors) |
| 136 | * @param num_frames - maximum number of frames to remove |
| 137 | * @param[in/out] credit - |
| 138 | * input: max credit the dequeued frames can consume |
| 139 | * output: how much credit the dequeued frames consume |
| 140 | * @param[out] bytes - the sum of the sizes of the dequeued frames |
| 141 | * @return number of frames dequeued |
Yun Park | d79331a | 2017-04-06 22:18:36 -0700 | [diff] [blame] | 142 | */ |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 143 | u_int16_t |
| 144 | ol_tx_dequeue( |
| 145 | struct ol_txrx_pdev_t *pdev, |
| 146 | struct ol_tx_frms_queue_t *txq, |
| 147 | ol_tx_desc_list *head, |
| 148 | u_int16_t num_frames, |
| 149 | u_int32_t *credit, |
| 150 | int *bytes); |
| 151 | |
| 152 | /** |
| 153 | * @brief - free all of frames from the tx queue while deletion |
| 154 | * @details |
| 155 | * This function frees all of frames from the tx queue. |
| 156 | * This function is called during peer or vdev deletion. |
| 157 | * This function notifies the scheduler, so the scheduler can update |
| 158 | * its state to account for the absence of the queue. |
| 159 | * |
| 160 | * @param pdev - the physical device object, which stores the txqs |
| 161 | * @param txq - which tx queue to free frames from |
| 162 | * @param tid - the extended TID that the queue belongs to |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 163 | * @param is_peer_txq - peer queue or not |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 164 | */ |
| 165 | void |
| 166 | ol_tx_queue_free( |
| 167 | struct ol_txrx_pdev_t *pdev, |
| 168 | struct ol_tx_frms_queue_t *txq, |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 169 | int tid, bool is_peer_txq); |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 170 | |
| 171 | /** |
| 172 | * @brief - discard pending tx frames from the tx queue |
| 173 | * @details |
| 174 | * This function is called if there are too many queues in tx scheduler. |
| 175 | * This function is called if we wants to flush all pending tx |
| 176 | * queues in tx scheduler. |
| 177 | * |
| 178 | * @param pdev - the physical device object, which stores the txqs |
| 179 | * @param flush_all - flush all pending tx queues if set to true |
Yun Park | d79331a | 2017-04-06 22:18:36 -0700 | [diff] [blame] | 180 | * @param tx_descs - List Of tx_descs to be discarded will be returned by this |
| 181 | * function |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 182 | */ |
| 183 | |
| 184 | void |
| 185 | ol_tx_queue_discard( |
| 186 | struct ol_txrx_pdev_t *pdev, |
| 187 | bool flush_all, |
| 188 | ol_tx_desc_list *tx_descs); |
| 189 | |
| 190 | #else |
| 191 | |
| 192 | static inline void |
| 193 | ol_tx_enqueue( |
| 194 | struct ol_txrx_pdev_t *pdev, |
| 195 | struct ol_tx_frms_queue_t *txq, |
| 196 | struct ol_tx_desc_t *tx_desc, |
| 197 | struct ol_txrx_msdu_info_t *tx_msdu_info) |
| 198 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | static inline u_int16_t |
| 202 | ol_tx_dequeue( |
| 203 | struct ol_txrx_pdev_t *pdev, |
| 204 | struct ol_tx_frms_queue_t *txq, |
| 205 | ol_tx_desc_list *head, |
| 206 | u_int16_t num_frames, |
| 207 | u_int32_t *credit, |
| 208 | int *bytes) |
| 209 | { |
| 210 | return 0; |
| 211 | } |
| 212 | |
| 213 | static inline void |
| 214 | ol_tx_queue_free( |
| 215 | struct ol_txrx_pdev_t *pdev, |
| 216 | struct ol_tx_frms_queue_t *txq, |
Poddar, Siddarth | 74178df | 2016-08-09 17:32:50 +0530 | [diff] [blame] | 217 | int tid, bool is_peer_txq) |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 218 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | static inline void |
| 222 | ol_tx_queue_discard( |
| 223 | struct ol_txrx_pdev_t *pdev, |
| 224 | bool flush_all, |
| 225 | ol_tx_desc_list *tx_descs) |
| 226 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 227 | } |
| 228 | #endif /* defined(CONFIG_HL_SUPPORT) */ |
| 229 | |
Nirav Shah | c4aa1ab | 2018-04-21 12:38:44 +0530 | [diff] [blame] | 230 | #if (!defined(QCA_LL_LEGACY_TX_FLOW_CONTROL)) && (!defined(CONFIG_HL_SUPPORT)) |
| 231 | static inline |
| 232 | void ol_txrx_vdev_flush(struct cdp_vdev *data_vdev) |
| 233 | { |
| 234 | } |
| 235 | #else |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 236 | void ol_txrx_vdev_flush(struct cdp_vdev *pvdev); |
Nirav Shah | c4aa1ab | 2018-04-21 12:38:44 +0530 | [diff] [blame] | 237 | #endif |
Jeff Johnson | b13a501 | 2016-12-21 08:41:16 -0800 | [diff] [blame] | 238 | |
| 239 | #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ |
Nirav Shah | c4aa1ab | 2018-04-21 12:38:44 +0530 | [diff] [blame] | 240 | (defined(QCA_LL_TX_FLOW_CONTROL_V2)) || \ |
Jeff Johnson | b13a501 | 2016-12-21 08:41:16 -0800 | [diff] [blame] | 241 | defined(CONFIG_HL_SUPPORT) |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 242 | void ol_txrx_vdev_pause(struct cdp_vdev *pvdev, uint32_t reason); |
| 243 | void ol_txrx_vdev_unpause(struct cdp_vdev *pvdev, uint32_t reason); |
Jeff Johnson | b13a501 | 2016-12-21 08:41:16 -0800 | [diff] [blame] | 244 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
| 245 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 246 | #if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) |
| 247 | |
| 248 | void |
| 249 | ol_txrx_peer_bal_add_limit_peer( |
| 250 | struct ol_txrx_pdev_t *pdev, |
| 251 | u_int16_t peer_id, |
| 252 | u_int16_t peer_limit); |
| 253 | |
| 254 | void |
| 255 | ol_txrx_peer_bal_remove_limit_peer( |
| 256 | struct ol_txrx_pdev_t *pdev, |
| 257 | u_int16_t peer_id); |
| 258 | |
| 259 | /** |
| 260 | * ol_txrx_peer_pause_but_no_mgmt_q() - suspend/pause all txqs except |
| 261 | * management queue for a given peer |
| 262 | * @peer: peer device object |
| 263 | * |
| 264 | * Return: None |
| 265 | */ |
| 266 | void |
| 267 | ol_txrx_peer_pause_but_no_mgmt_q(ol_txrx_peer_handle peer); |
| 268 | |
| 269 | /** |
| 270 | * ol_txrx_peer_unpause_but_no_mgmt_q() - unpause all txqs except management |
| 271 | * queue for a given peer |
| 272 | * @peer: peer device object |
| 273 | * |
| 274 | * Return: None |
| 275 | */ |
| 276 | void |
| 277 | ol_txrx_peer_unpause_but_no_mgmt_q(ol_txrx_peer_handle peer); |
| 278 | |
| 279 | /** |
| 280 | * ol_tx_bad_peer_dequeue_check() - retrieve the send limit |
| 281 | * of the tx queue category |
| 282 | * @txq: tx queue of the head of the category list |
| 283 | * @max_frames: send limit of the txq category |
| 284 | * @tx_limit_flag: set true is tx limit is reached |
| 285 | * |
| 286 | * Return: send limit |
| 287 | */ |
| 288 | u_int16_t |
| 289 | ol_tx_bad_peer_dequeue_check(struct ol_tx_frms_queue_t *txq, |
| 290 | u_int16_t max_frames, |
| 291 | u_int16_t *tx_limit_flag); |
| 292 | |
| 293 | /** |
| 294 | * ol_tx_bad_peer_update_tx_limit() - update the send limit of the |
| 295 | * tx queue category |
| 296 | * @pdev: the physical device object |
| 297 | * @txq: tx queue of the head of the category list |
| 298 | * @frames: frames that has been dequeued |
| 299 | * @tx_limit_flag: tx limit reached flag |
| 300 | * |
| 301 | * Return: None |
| 302 | */ |
| 303 | void |
| 304 | ol_tx_bad_peer_update_tx_limit(struct ol_txrx_pdev_t *pdev, |
| 305 | struct ol_tx_frms_queue_t *txq, |
| 306 | u_int16_t frames, |
| 307 | u_int16_t tx_limit_flag); |
| 308 | |
| 309 | /** |
| 310 | * ol_txrx_set_txq_peer() - set peer to the tx queue's peer |
| 311 | * @txq: tx queue for a given tid |
| 312 | * @peer: the peer device object |
| 313 | * |
| 314 | * Return: None |
| 315 | */ |
| 316 | void |
| 317 | ol_txrx_set_txq_peer( |
| 318 | struct ol_tx_frms_queue_t *txq, |
| 319 | struct ol_txrx_peer_t *peer); |
| 320 | |
| 321 | /** |
| 322 | * @brief - initialize the peer balance context |
| 323 | * @param pdev - the physical device object, which stores the txqs |
| 324 | */ |
| 325 | void ol_tx_badpeer_flow_cl_init(struct ol_txrx_pdev_t *pdev); |
| 326 | |
| 327 | /** |
| 328 | * @brief - deinitialize the peer balance context |
| 329 | * @param pdev - the physical device object, which stores the txqs |
| 330 | */ |
| 331 | void ol_tx_badpeer_flow_cl_deinit(struct ol_txrx_pdev_t *pdev); |
| 332 | |
| 333 | #else |
| 334 | |
| 335 | static inline void ol_txrx_peer_bal_add_limit_peer( |
| 336 | struct ol_txrx_pdev_t *pdev, |
| 337 | u_int16_t peer_id, |
| 338 | u_int16_t peer_limit) |
| 339 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | static inline void ol_txrx_peer_bal_remove_limit_peer( |
| 343 | struct ol_txrx_pdev_t *pdev, |
| 344 | u_int16_t peer_id) |
| 345 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | static inline void ol_txrx_peer_pause_but_no_mgmt_q(ol_txrx_peer_handle peer) |
| 349 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | static inline void ol_txrx_peer_unpause_but_no_mgmt_q(ol_txrx_peer_handle peer) |
| 353 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | static inline u_int16_t |
| 357 | ol_tx_bad_peer_dequeue_check(struct ol_tx_frms_queue_t *txq, |
| 358 | u_int16_t max_frames, |
| 359 | u_int16_t *tx_limit_flag) |
| 360 | { |
| 361 | /* just return max_frames */ |
| 362 | return max_frames; |
| 363 | } |
| 364 | |
| 365 | static inline void |
| 366 | ol_tx_bad_peer_update_tx_limit(struct ol_txrx_pdev_t *pdev, |
| 367 | struct ol_tx_frms_queue_t *txq, |
| 368 | u_int16_t frames, |
| 369 | u_int16_t tx_limit_flag) |
| 370 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | static inline void |
| 374 | ol_txrx_set_txq_peer( |
| 375 | struct ol_tx_frms_queue_t *txq, |
| 376 | struct ol_txrx_peer_t *peer) |
| 377 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 378 | } |
| 379 | |
| 380 | static inline void ol_tx_badpeer_flow_cl_init(struct ol_txrx_pdev_t *pdev) |
| 381 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | static inline void ol_tx_badpeer_flow_cl_deinit(struct ol_txrx_pdev_t *pdev) |
| 385 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | #endif /* defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) */ |
| 389 | |
| 390 | #if defined(CONFIG_HL_SUPPORT) && defined(DEBUG_HL_LOGGING) |
| 391 | |
| 392 | /** |
| 393 | * ol_tx_queue_log_sched() - start logging of tx queues for HL |
| 394 | * @pdev: physical device object |
| 395 | * @credit: number of credits |
| 396 | * @num_active_tids: number of active tids for which logging needs to be done |
| 397 | * @active_bitmap:bitmap |
| 398 | * @data: buffer |
| 399 | * |
| 400 | * Return: None |
| 401 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 402 | void |
| 403 | ol_tx_queue_log_sched(struct ol_txrx_pdev_t *pdev, |
| 404 | int credit, |
| 405 | int *num_active_tids, |
| 406 | uint32_t **active_bitmap, uint8_t **data); |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 407 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 409 | static inline void |
| 410 | ol_tx_queue_log_sched(struct ol_txrx_pdev_t *pdev, |
| 411 | int credit, |
| 412 | int *num_active_tids, |
| 413 | uint32_t **active_bitmap, uint8_t **data) |
| 414 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 415 | } |
| 416 | #endif /* defined(CONFIG_HL_SUPPORT) && defined(DEBUG_HL_LOGGING) */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 418 | #if defined(CONFIG_HL_SUPPORT) && TXRX_DEBUG_LEVEL > 5 |
| 419 | /** |
| 420 | * @brief - show current state of all tx queues |
| 421 | * @param pdev - the physical device object, which stores the txqs |
| 422 | */ |
| 423 | void |
| 424 | ol_tx_queues_display(struct ol_txrx_pdev_t *pdev); |
| 425 | |
| 426 | #else |
| 427 | |
| 428 | static inline void |
| 429 | ol_tx_queues_display(struct ol_txrx_pdev_t *pdev) |
| 430 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 431 | } |
| 432 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 433 | |
| 434 | #define ol_tx_queue_decs_reinit(peer, peer_id) /* no-op */ |
| 435 | |
| 436 | #ifdef QCA_SUPPORT_TX_THROTTLE |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 437 | void ol_tx_throttle_set_level(struct cdp_pdev *ppdev, int level); |
| 438 | void ol_tx_throttle_init_period(struct cdp_pdev *ppdev, int period, |
Jeff Johnson | b13a501 | 2016-12-21 08:41:16 -0800 | [diff] [blame] | 439 | uint8_t *dutycycle_level); |
| 440 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 441 | /** |
| 442 | * @brief - initialize the throttle context |
| 443 | * @param pdev - the physical device object, which stores the txqs |
| 444 | */ |
| 445 | void ol_tx_throttle_init(struct ol_txrx_pdev_t *pdev); |
| 446 | #else |
Jeff Johnson | b13a501 | 2016-12-21 08:41:16 -0800 | [diff] [blame] | 447 | static inline void ol_tx_throttle_init(struct ol_txrx_pdev_t *pdev) {} |
Nirav Shah | 46fc630 | 2018-04-21 12:49:28 +0530 | [diff] [blame^] | 448 | |
| 449 | static inline void ol_tx_throttle_set_level(struct cdp_pdev *ppdev, int level) |
| 450 | {} |
| 451 | |
| 452 | static inline void ol_tx_throttle_init_period(struct cdp_pdev *ppdev, |
| 453 | int period, |
| 454 | uint8_t *dutycycle_level) |
| 455 | {} |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 456 | #endif |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 457 | |
| 458 | #ifdef FEATURE_HL_GROUP_CREDIT_FLOW_CONTROL |
| 459 | |
| 460 | static inline bool |
| 461 | ol_tx_is_txq_last_serviced_queue(struct ol_txrx_pdev_t *pdev, |
| 462 | struct ol_tx_frms_queue_t *txq) |
| 463 | { |
| 464 | return txq == pdev->tx_sched.last_used_txq; |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * ol_tx_txq_group_credit_limit() - check for credit limit of a given tx queue |
| 469 | * @pdev: physical device object |
| 470 | * @txq: tx queue for which credit limit needs be to checked |
| 471 | * @credit: number of credits of the selected category |
| 472 | * |
| 473 | * Return: updated credits |
| 474 | */ |
| 475 | u_int32_t ol_tx_txq_group_credit_limit( |
| 476 | struct ol_txrx_pdev_t *pdev, |
| 477 | struct ol_tx_frms_queue_t *txq, |
| 478 | u_int32_t credit); |
| 479 | |
| 480 | /** |
| 481 | * ol_tx_txq_group_credit_update() - update group credits of the |
| 482 | * selected catoegory |
| 483 | * @pdev: physical device object |
| 484 | * @txq: tx queue for which credit needs to be updated |
| 485 | * @credit: number of credits by which selected category needs to be updated |
| 486 | * @absolute: TXQ group absolute value |
| 487 | * |
| 488 | * Return: None |
| 489 | */ |
| 490 | void ol_tx_txq_group_credit_update( |
| 491 | struct ol_txrx_pdev_t *pdev, |
| 492 | struct ol_tx_frms_queue_t *txq, |
| 493 | int32_t credit, |
| 494 | u_int8_t absolute); |
| 495 | |
| 496 | /** |
| 497 | * ol_tx_set_vdev_group_ptr() - update vdev queues group pointer |
| 498 | * @pdev: physical device object |
| 499 | * @vdev_id: vdev id for which group pointer needs to update |
| 500 | * @grp_ptr: pointer to ol tx queue group which needs to be set for vdev queues |
| 501 | * |
| 502 | * Return: None |
| 503 | */ |
| 504 | void |
| 505 | ol_tx_set_vdev_group_ptr( |
| 506 | ol_txrx_pdev_handle pdev, |
| 507 | u_int8_t vdev_id, |
| 508 | struct ol_tx_queue_group_t *grp_ptr); |
| 509 | |
| 510 | /** |
| 511 | * ol_tx_txq_set_group_ptr() - update tx queue group pointer |
| 512 | * @txq: tx queue of which group pointer needs to update |
| 513 | * @grp_ptr: pointer to ol tx queue group which needs to be |
| 514 | * set for given tx queue |
| 515 | * |
| 516 | * |
| 517 | * Return: None |
| 518 | */ |
| 519 | void |
| 520 | ol_tx_txq_set_group_ptr( |
| 521 | struct ol_tx_frms_queue_t *txq, |
| 522 | struct ol_tx_queue_group_t *grp_ptr); |
| 523 | |
| 524 | /** |
| 525 | * ol_tx_set_peer_group_ptr() - update peer tx queues group pointer |
| 526 | * for a given tid |
| 527 | * @pdev: physical device object |
| 528 | * @peer: peer device object |
| 529 | * @vdev_id: vdev id |
| 530 | * @tid: tid for which group pointer needs to update |
| 531 | * |
| 532 | * |
| 533 | * Return: None |
| 534 | */ |
| 535 | void |
| 536 | ol_tx_set_peer_group_ptr( |
| 537 | ol_txrx_pdev_handle pdev, |
| 538 | struct ol_txrx_peer_t *peer, |
| 539 | u_int8_t vdev_id, |
| 540 | u_int8_t tid); |
| 541 | #else |
| 542 | |
| 543 | static inline bool |
| 544 | ol_tx_is_txq_last_serviced_queue(struct ol_txrx_pdev_t *pdev, |
| 545 | struct ol_tx_frms_queue_t *txq) |
| 546 | { |
| 547 | return 0; |
| 548 | } |
| 549 | |
| 550 | static inline |
| 551 | u_int32_t ol_tx_txq_group_credit_limit( |
| 552 | struct ol_txrx_pdev_t *pdev, |
| 553 | struct ol_tx_frms_queue_t *txq, |
| 554 | u_int32_t credit) |
| 555 | { |
| 556 | return credit; |
| 557 | } |
| 558 | |
| 559 | static inline void ol_tx_txq_group_credit_update( |
| 560 | struct ol_txrx_pdev_t *pdev, |
| 561 | struct ol_tx_frms_queue_t *txq, |
| 562 | int32_t credit, |
| 563 | u_int8_t absolute) |
| 564 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | static inline void |
| 568 | ol_tx_txq_set_group_ptr( |
| 569 | struct ol_tx_frms_queue_t *txq, |
| 570 | struct ol_tx_queue_group_t *grp_ptr) |
| 571 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 572 | } |
| 573 | |
| 574 | static inline void |
| 575 | ol_tx_set_peer_group_ptr( |
| 576 | ol_txrx_pdev_handle pdev, |
| 577 | struct ol_txrx_peer_t *peer, |
| 578 | u_int8_t vdev_id, |
| 579 | u_int8_t tid) |
| 580 | { |
Siddarth Poddar | b2011f6 | 2016-04-27 20:45:42 +0530 | [diff] [blame] | 581 | } |
| 582 | #endif |
| 583 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 584 | #endif /* _OL_TX_QUEUE__H_ */ |