Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 1 | /* |
Rakshith Suresh Patkar | 8a0b6e9 | 2019-07-26 16:23:37 +0530 | [diff] [blame] | 2 | * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 3 | * |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [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 | |
Yun Park | 81e7dd6 | 2017-04-03 08:39:18 -0700 | [diff] [blame] | 19 | /** |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 20 | * @file cdp_txrx_flow_ctrl_legacy.h |
| 21 | * @brief Define the host data path legacy flow control API |
| 22 | * functions |
| 23 | */ |
| 24 | #ifndef _CDP_TXRX_FC_LEG_H_ |
| 25 | #define _CDP_TXRX_FC_LEG_H_ |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 26 | #include <cdp_txrx_mob_def.h> |
Venkata Sharath Chandra Manchala | f2a125a | 2016-11-28 18:10:11 -0800 | [diff] [blame] | 27 | #include "cdp_txrx_handle.h" |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 28 | |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 29 | #ifdef QCA_HL_NETDEV_FLOW_CONTROL |
| 30 | |
| 31 | /** |
| 32 | * cdp_hl_fc_register() - Register HL flow control callback. |
Rakesh Pillai | d295d1e | 2019-09-11 08:00:36 +0530 | [diff] [blame] | 33 | * @soc: data path soc handle |
| 34 | * @pdev_id: datapath pdev identifier |
| 35 | * @flowcontrol: callback function pointer to stop/start OS netdev queues |
| 36 | * |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 37 | * Register flow control callback. |
Rakesh Pillai | d295d1e | 2019-09-11 08:00:36 +0530 | [diff] [blame] | 38 | * |
| 39 | * Returns: 0 for success |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 40 | */ |
| 41 | static inline int |
Rakesh Pillai | d295d1e | 2019-09-11 08:00:36 +0530 | [diff] [blame] | 42 | cdp_hl_fc_register(ol_txrx_soc_handle soc, uint8_t pdev_id, |
| 43 | tx_pause_callback flowcontrol) |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 44 | { |
| 45 | if (!soc || !soc->ops) { |
| 46 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
| 47 | "%s invalid instance", __func__); |
| 48 | QDF_BUG(0); |
| 49 | return -EINVAL; |
| 50 | } |
| 51 | |
| 52 | if (!soc->ops->l_flowctl_ops || |
| 53 | !soc->ops->l_flowctl_ops->register_tx_flow_control) |
| 54 | return -EINVAL; |
| 55 | |
Rakesh Pillai | d295d1e | 2019-09-11 08:00:36 +0530 | [diff] [blame] | 56 | return soc->ops->l_flowctl_ops->register_tx_flow_control(soc, pdev_id, |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 57 | flowcontrol); |
| 58 | } |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 59 | |
| 60 | static inline int cdp_hl_fc_set_td_limit(ol_txrx_soc_handle soc, |
Yue Ma | 9c43a47 | 2019-11-12 12:51:02 -0800 | [diff] [blame] | 61 | uint8_t vdev_id, uint32_t chan_freq) |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 62 | { |
| 63 | if (!soc->ops->l_flowctl_ops->set_vdev_tx_desc_limit) |
| 64 | return 0; |
| 65 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 66 | return soc->ops->l_flowctl_ops->set_vdev_tx_desc_limit(soc, vdev_id, |
Yue Ma | 9c43a47 | 2019-11-12 12:51:02 -0800 | [diff] [blame] | 67 | chan_freq); |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | static inline int cdp_hl_fc_set_os_queue_status(ol_txrx_soc_handle soc, |
Krunal Soni | be43d55 | 2018-10-03 11:20:20 -0700 | [diff] [blame] | 71 | uint8_t vdev_id, |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 72 | enum netif_action_type action) |
| 73 | { |
| 74 | if (!soc->ops->l_flowctl_ops->set_vdev_os_queue_status) |
| 75 | return -EINVAL; |
| 76 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 77 | return soc->ops->l_flowctl_ops->set_vdev_os_queue_status(soc, |
| 78 | vdev_id, |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 79 | action); |
| 80 | } |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 81 | #else |
| 82 | static inline int |
Rakesh Pillai | d295d1e | 2019-09-11 08:00:36 +0530 | [diff] [blame] | 83 | cdp_hl_fc_register(ol_txrx_soc_handle soc, uint8_t pdev_id, |
| 84 | tx_pause_callback flowcontrol) |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 85 | { |
| 86 | return 0; |
| 87 | } |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 88 | |
| 89 | static inline int cdp_hl_fc_set_td_limit(ol_txrx_soc_handle soc, |
Yue Ma | 9c43a47 | 2019-11-12 12:51:02 -0800 | [diff] [blame] | 90 | uint8_t vdev_id, uint32_t chan_freq) |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 91 | { |
| 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | static inline int cdp_hl_fc_set_os_queue_status(ol_txrx_soc_handle soc, |
Krunal Soni | be43d55 | 2018-10-03 11:20:20 -0700 | [diff] [blame] | 96 | uint8_t vdev_id, |
Ajit Pal Singh | 506c4d6 | 2018-04-25 16:59:19 +0530 | [diff] [blame] | 97 | enum netif_action_type action) |
| 98 | { |
| 99 | return 0; |
| 100 | } |
| 101 | |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 102 | #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ |
| 103 | |
| 104 | #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 105 | /** |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 106 | * cdp_fc_register() - Register flow control callback function pointer |
| 107 | * @soc - data path soc handle |
| 108 | * @vdev_id - virtual interface id to register flow control |
| 109 | * @flowControl - callback function pointer |
| 110 | * @osif_fc_ctx - client context pointer |
bings | 4dcaf8b | 2017-08-11 10:37:46 +0800 | [diff] [blame] | 111 | * @flow_control_is_pause: is vdev paused by flow control |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 112 | * |
| 113 | * Register flow control callback function pointer and client context pointer |
| 114 | * |
| 115 | * return 0 success |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 116 | */ |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 117 | static inline int |
| 118 | cdp_fc_register(ol_txrx_soc_handle soc, uint8_t vdev_id, |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 119 | ol_txrx_tx_flow_control_fp flowcontrol, void *osif_fc_ctx, |
bings | 4dcaf8b | 2017-08-11 10:37:46 +0800 | [diff] [blame] | 120 | ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause) |
Yuanyuan Liu | 4e3feeb | 2016-04-20 10:41:15 -0700 | [diff] [blame] | 121 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 122 | if (!soc || !soc->ops) { |
| 123 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 124 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 125 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 126 | return 0; |
| 127 | } |
| 128 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 129 | if (!soc->ops->l_flowctl_ops || |
| 130 | !soc->ops->l_flowctl_ops->register_tx_flow_control) |
| 131 | return 0; |
| 132 | |
| 133 | return soc->ops->l_flowctl_ops->register_tx_flow_control( |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 134 | soc, vdev_id, flowcontrol, osif_fc_ctx, |
bings | 4dcaf8b | 2017-08-11 10:37:46 +0800 | [diff] [blame] | 135 | flow_control_is_pause); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 136 | } |
Ajit Pal Singh | d1543e0 | 2018-04-19 15:02:22 +0530 | [diff] [blame] | 137 | #else |
| 138 | static inline int |
| 139 | cdp_fc_register(ol_txrx_soc_handle soc, uint8_t vdev_id, |
| 140 | ol_txrx_tx_flow_control_fp flowcontrol, void *osif_fc_ctx, |
| 141 | ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause) |
| 142 | { |
| 143 | return 0; |
| 144 | } |
| 145 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 146 | /** |
| 147 | * cdp_fc_deregister() - remove flow control instance |
| 148 | * @soc - data path soc handle |
| 149 | * @vdev_id - virtual interface id to register flow control |
| 150 | * |
| 151 | * remove flow control instance |
| 152 | * |
| 153 | * return 0 success |
| 154 | */ |
| 155 | static inline int |
| 156 | cdp_fc_deregister(ol_txrx_soc_handle soc, uint8_t vdev_id) |
| 157 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 158 | if (!soc || !soc->ops) { |
| 159 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 160 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 161 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 162 | return 0; |
| 163 | } |
| 164 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 165 | if (!soc->ops->l_flowctl_ops || |
| 166 | !soc->ops->l_flowctl_ops->deregister_tx_flow_control_cb) |
| 167 | return 0; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 168 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 169 | return soc->ops->l_flowctl_ops->deregister_tx_flow_control_cb( |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 170 | soc, vdev_id); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | /** |
| 174 | * cdp_fc_get_tx_resource() - get data path resource count |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 175 | * @soc: data path soc handle |
| 176 | * @pdev_id: datapath pdev ID |
| 177 | * @peer_addr: peer mac address |
| 178 | * @low_watermark: low resource threshold |
| 179 | * @high_watermark_offset: high resource threshold |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 180 | * |
| 181 | * get data path resource count |
| 182 | * |
| 183 | * return true enough data path resource available |
| 184 | * false resource is not avaialbe |
| 185 | */ |
| 186 | static inline bool |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 187 | cdp_fc_get_tx_resource(ol_txrx_soc_handle soc, uint8_t pdev_id, |
Rakshith Suresh Patkar | 8a0b6e9 | 2019-07-26 16:23:37 +0530 | [diff] [blame] | 188 | struct qdf_mac_addr peer_addr, |
| 189 | unsigned int low_watermark, |
| 190 | unsigned int high_watermark_offset) |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 191 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 192 | if (!soc || !soc->ops) { |
| 193 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 194 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 195 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 196 | return false; |
| 197 | } |
| 198 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 199 | if (!soc->ops->l_flowctl_ops || |
| 200 | !soc->ops->l_flowctl_ops->get_tx_resource) |
| 201 | return false; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 202 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 203 | return soc->ops->l_flowctl_ops->get_tx_resource(soc, pdev_id, peer_addr, |
| 204 | low_watermark, |
| 205 | high_watermark_offset); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | /** |
| 209 | * cdp_fc_ll_set_tx_pause_q_depth() - set pause queue depth |
| 210 | * @soc - data path soc handle |
| 211 | * @vdev_id - virtual interface id to register flow control |
| 212 | * @pause_q_depth - pending tx queue delth |
| 213 | * |
| 214 | * set pause queue depth |
| 215 | * |
| 216 | * return 0 success |
| 217 | */ |
| 218 | static inline int |
| 219 | cdp_fc_ll_set_tx_pause_q_depth(ol_txrx_soc_handle soc, |
| 220 | uint8_t vdev_id, int pause_q_depth) |
| 221 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 222 | if (!soc || !soc->ops) { |
| 223 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 224 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 225 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 226 | return 0; |
| 227 | } |
| 228 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 229 | if (!soc->ops->l_flowctl_ops || |
| 230 | !soc->ops->l_flowctl_ops->ll_set_tx_pause_q_depth) |
| 231 | return 0; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 232 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 233 | return soc->ops->l_flowctl_ops->ll_set_tx_pause_q_depth( |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 234 | soc, vdev_id, pause_q_depth); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 235 | |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | /** |
| 239 | * cdp_fc_vdev_flush() - flush tx queue |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 240 | * @soc: data path soc handle |
| 241 | * @vdev_id: id of vdev |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 242 | * |
| 243 | * flush tx queue |
| 244 | * |
| 245 | * return None |
| 246 | */ |
| 247 | static inline void |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 248 | cdp_fc_vdev_flush(ol_txrx_soc_handle soc, uint8_t vdev_id) |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 249 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 250 | if (!soc || !soc->ops) { |
| 251 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 252 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 253 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 254 | return; |
| 255 | } |
| 256 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 257 | if (!soc->ops->l_flowctl_ops || |
| 258 | !soc->ops->l_flowctl_ops->vdev_flush) |
| 259 | return; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 260 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 261 | soc->ops->l_flowctl_ops->vdev_flush(soc, vdev_id); |
Yuanyuan Liu | 4e3feeb | 2016-04-20 10:41:15 -0700 | [diff] [blame] | 262 | } |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 263 | |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 264 | /** |
| 265 | * cdp_fc_vdev_pause() - pause tx scheduler on vdev |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 266 | * @soc: data path soc handle |
| 267 | * @vdev_id: id of vdev |
| 268 | * @reason: pause reason |
| 269 | * @pause_type: type of pause |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 270 | * |
| 271 | * pause tx scheduler on vdev |
| 272 | * |
| 273 | * return None |
| 274 | */ |
| 275 | static inline void |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 276 | cdp_fc_vdev_pause(ol_txrx_soc_handle soc, uint8_t vdev_id, |
| 277 | uint32_t reason, uint32_t pause_type) |
Yuanyuan Liu | 4e3feeb | 2016-04-20 10:41:15 -0700 | [diff] [blame] | 278 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 279 | if (!soc || !soc->ops) { |
| 280 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 281 | "%s invalid instance", __func__); |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 282 | QDF_BUG(0); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 283 | return; |
| 284 | } |
| 285 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 286 | if (!soc->ops->l_flowctl_ops || |
| 287 | !soc->ops->l_flowctl_ops->vdev_pause) |
| 288 | return; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 289 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 290 | soc->ops->l_flowctl_ops->vdev_pause(soc, vdev_id, reason, pause_type); |
Yuanyuan Liu | 4e3feeb | 2016-04-20 10:41:15 -0700 | [diff] [blame] | 291 | } |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 292 | |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 293 | /** |
| 294 | * cdp_fc_vdev_unpause() - resume tx scheduler on vdev |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 295 | * @soc: data path soc handle |
| 296 | * @vdev_id: id of vdev |
| 297 | * @reason: pause reason |
| 298 | * @pause_type: type of pause |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 299 | * |
| 300 | * resume tx scheduler on vdev |
| 301 | * |
| 302 | * return None |
| 303 | */ |
| 304 | static inline void |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 305 | cdp_fc_vdev_unpause(ol_txrx_soc_handle soc, uint8_t vdev_id, |
| 306 | uint32_t reason, uint32_t pause_type) |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 307 | { |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 308 | if (!soc || !soc->ops) { |
| 309 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 310 | "%s invalid instance", __func__); |
| 311 | return; |
| 312 | } |
| 313 | |
Venkata Sharath Chandra Manchala | aa62ae7 | 2017-10-20 00:00:54 -0700 | [diff] [blame] | 314 | if (!soc->ops->l_flowctl_ops || |
| 315 | !soc->ops->l_flowctl_ops->vdev_unpause) |
| 316 | return; |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 317 | |
Rakesh Pillai | 2032554 | 2019-11-07 19:26:36 +0530 | [diff] [blame] | 318 | soc->ops->l_flowctl_ops->vdev_unpause(soc, vdev_id, reason, |
| 319 | pause_type); |
Leo Chang | db6358c | 2016-09-27 17:00:52 -0700 | [diff] [blame] | 320 | } |
Dhanashri Atre | 9c222b1 | 2016-03-22 13:26:13 -0700 | [diff] [blame] | 321 | #endif /* _CDP_TXRX_FC_LEG_H_ */ |