Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 1 | /* |
Houston Hoffman | 47e387b | 2015-10-20 17:04:42 -0700 | [diff] [blame] | 2 | * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -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 _HTC_INTERNAL_H_ |
| 29 | #define _HTC_INTERNAL_H_ |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif /* __cplusplus */ |
| 34 | |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 35 | #include "htc_api.h" |
| 36 | #include "htc_packet.h" |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 37 | #include <hif.h> |
| 38 | #include <htc.h> |
| 39 | #include <qdf_atomic.h> |
| 40 | #include <qdf_event.h> |
| 41 | #include <qdf_lock.h> |
| 42 | #include <qdf_nbuf.h> |
| 43 | #include <qdf_timer.h> |
| 44 | #include <qdf_types.h> |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 45 | |
| 46 | /* HTC operational parameters */ |
| 47 | #define HTC_TARGET_RESPONSE_TIMEOUT 2000 /* in ms */ |
| 48 | #define HTC_TARGET_DEBUG_INTR_MASK 0x01 |
| 49 | #define HTC_TARGET_CREDIT_INTR_MASK 0xF0 |
| 50 | #define HTC_MIN_MSG_PER_BUNDLE 2 |
| 51 | #if defined(HIF_USB) |
| 52 | #define HTC_MAX_MSG_PER_BUNDLE 9 |
| 53 | #else |
| 54 | #define HTC_MAX_MSG_PER_BUNDLE 16 |
| 55 | #endif |
| 56 | /* |
| 57 | * HTC_MAX_TX_BUNDLE_SEND_LIMIT - |
| 58 | * This value is in units of tx frame fragments. |
| 59 | * It needs to be at least as large as the maximum number of tx frames in a |
| 60 | * HTC download bundle times the average number of fragments in each such frame |
| 61 | * (In certain operating systems, such as Linux, we expect to only have |
| 62 | * a single fragment per frame anyway.) |
| 63 | */ |
| 64 | #define HTC_MAX_TX_BUNDLE_SEND_LIMIT 255 |
| 65 | |
| 66 | #define HTC_PACKET_CONTAINER_ALLOCATION 32 |
| 67 | #define NUM_CONTROL_TX_BUFFERS 2 |
| 68 | #define HTC_CONTROL_BUFFER_SIZE (HTC_MAX_CONTROL_MESSAGE_LENGTH + HTC_HDR_LENGTH) |
| 69 | #define HTC_CONTROL_BUFFER_ALIGN 32 |
| 70 | #define HTC_TARGET_RESPONSE_POLL_MS 10 |
| 71 | #if !defined(A_SIMOS_DEVHOST) |
| 72 | #define HTC_TARGET_MAX_RESPONSE_POLL 200 /* actual HW */ |
| 73 | #else |
| 74 | #define HTC_TARGET_MAX_RESPONSE_POLL 600 /* host + target simulation */ |
| 75 | #endif |
| 76 | |
| 77 | #define HTC_SERVICE_TX_PACKET_TAG HTC_TX_PACKET_TAG_INTERNAL |
| 78 | |
| 79 | #define HTC_CREDIT_HISTORY_MAX 1024 |
| 80 | |
Yue Ma | ec9e71c | 2016-02-26 18:52:20 -0800 | [diff] [blame] | 81 | #define HTC_IS_EPPING_ENABLED(_x) ((_x) == QDF_GLOBAL_EPPING_MODE) |
| 82 | |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 83 | typedef enum { |
| 84 | HTC_REQUEST_CREDIT, |
| 85 | HTC_PROCESS_CREDIT_REPORT, |
| 86 | HTC_SUSPEND_ACK, |
| 87 | HTC_SUSPEND_NACK, |
| 88 | } htc_credit_exchange_type; |
| 89 | |
| 90 | typedef struct { |
| 91 | htc_credit_exchange_type type; |
| 92 | uint64_t time; |
| 93 | uint32_t tx_credit; |
| 94 | uint32_t htc_tx_queue_depth; |
| 95 | } HTC_CREDIT_HISTORY; |
| 96 | |
| 97 | typedef struct _HTC_ENDPOINT { |
| 98 | HTC_ENDPOINT_ID Id; |
Houston Hoffman | 4f2f459 | 2015-10-20 18:00:29 -0700 | [diff] [blame] | 99 | |
| 100 | /* service ID this endpoint is bound to |
| 101 | * non-zero value means this endpoint is in use |
| 102 | */ |
| 103 | HTC_SERVICE_ID service_id; |
| 104 | |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 105 | HTC_EP_CALLBACKS EpCallBacks; /* callbacks associated with this endpoint */ |
| 106 | HTC_PACKET_QUEUE TxQueue; /* HTC frame buffer TX queue */ |
| 107 | int MaxTxQueueDepth; /* max depth of the TX queue before we need to |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 108 | call driver's full handler */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 109 | int MaxMsgLength; /* max length of endpoint message */ |
| 110 | uint8_t UL_PipeID; |
| 111 | uint8_t DL_PipeID; |
| 112 | int ul_is_polled; /* Need to call HIF to get tx completion callbacks? */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 113 | qdf_timer_t ul_poll_timer; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 114 | int ul_poll_timer_active; |
| 115 | int ul_outstanding_cnt; |
| 116 | int dl_is_polled; /* Need to call HIF to fetch rx? (Not currently supported.) */ |
| 117 | #if 0 /* not currently supported */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 118 | qdf_timer_t dl_poll_timer; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 119 | #endif |
| 120 | |
| 121 | HTC_PACKET_QUEUE TxLookupQueue; /* lookup queue to match netbufs to htc packets */ |
| 122 | HTC_PACKET_QUEUE RxBufferHoldQueue; /* temporary hold queue for back compatibility */ |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 123 | uint8_t SeqNo; /* TX seq no (helpful) for debugging */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 124 | qdf_atomic_t TxProcessCount; /* serialization */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 125 | struct _HTC_TARGET *target; |
| 126 | int TxCredits; /* TX credits available on this endpoint */ |
| 127 | int TxCreditSize; /* size in bytes of each credit (set by HTC) */ |
| 128 | int TxCreditsPerMaxMsg; /* credits required per max message (precalculated) */ |
| 129 | #ifdef HTC_EP_STAT_PROFILING |
Houston Hoffman | 29573d9 | 2015-10-20 17:49:44 -0700 | [diff] [blame] | 130 | HTC_ENDPOINT_STATS endpoint_stats; /* endpoint statistics */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 131 | #endif |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 132 | bool TxCreditFlowEnabled; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 133 | } HTC_ENDPOINT; |
| 134 | |
| 135 | #ifdef HTC_EP_STAT_PROFILING |
Houston Hoffman | 29573d9 | 2015-10-20 17:49:44 -0700 | [diff] [blame] | 136 | #define INC_HTC_EP_STAT(p, stat, count) ((p)->endpoint_stats.stat += (count)) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 137 | #else |
Houston Hoffman | 29573d9 | 2015-10-20 17:49:44 -0700 | [diff] [blame] | 138 | #define INC_HTC_EP_STAT(p, stat, count) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 139 | #endif |
| 140 | |
| 141 | typedef struct { |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 142 | uint16_t service_id; |
| 143 | uint8_t CreditAllocation; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 144 | } HTC_SERVICE_TX_CREDIT_ALLOCATION; |
| 145 | |
| 146 | #define HTC_MAX_SERVICE_ALLOC_ENTRIES 8 |
| 147 | |
| 148 | /* Error codes for HTC layer packet stats*/ |
| 149 | enum ol_ath_htc_pkt_ecodes { |
| 150 | GET_HTC_PKT_Q_FAIL = 0, /* error- get packet at head of HTC_PACKET_Q */ |
| 151 | HTC_PKT_Q_EMPTY, |
| 152 | HTC_SEND_Q_EMPTY |
| 153 | }; |
| 154 | /* our HTC target state */ |
| 155 | typedef struct _HTC_TARGET { |
Komal Seelam | 5584a7c | 2016-02-24 19:22:48 +0530 | [diff] [blame] | 156 | struct hif_opaque_softc *hif_dev; |
Houston Hoffman | 29573d9 | 2015-10-20 17:49:44 -0700 | [diff] [blame] | 157 | HTC_ENDPOINT endpoint[ENDPOINT_MAX]; |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 158 | qdf_spinlock_t HTCLock; |
| 159 | qdf_spinlock_t HTCRxLock; |
| 160 | qdf_spinlock_t HTCTxLock; |
| 161 | qdf_spinlock_t HTCCreditLock; |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 162 | uint32_t HTCStateFlags; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 163 | void *host_handle; |
| 164 | HTC_INIT_INFO HTCInitInfo; |
| 165 | HTC_PACKET *pHTCPacketStructPool; /* pool of HTC packets */ |
| 166 | HTC_PACKET_QUEUE ControlBufferTXFreeList; |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 167 | uint8_t CtrlResponseBuffer[HTC_MAX_CONTROL_MESSAGE_LENGTH]; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 168 | int CtrlResponseLength; |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 169 | qdf_event_t ctrl_response_valid; |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 170 | bool CtrlResponseProcessing; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 171 | int TotalTransmitCredits; |
| 172 | HTC_SERVICE_TX_CREDIT_ALLOCATION |
| 173 | ServiceTxAllocTable[HTC_MAX_SERVICE_ALLOC_ENTRIES]; |
| 174 | int TargetCreditSize; |
| 175 | #ifdef RX_SG_SUPPORT |
Vishwajith Upendra | 70f8b6e | 2016-03-01 16:28:23 +0530 | [diff] [blame] | 176 | qdf_nbuf_queue_t RxSgQueue; |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 177 | bool IsRxSgInprogress; |
| 178 | uint32_t CurRxSgTotalLen; /* current total length */ |
| 179 | uint32_t ExpRxSgTotalLen; /* expected total length */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 180 | #endif |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 181 | qdf_device_t osdev; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 182 | struct ol_ath_htc_stats htc_pkt_stats; |
| 183 | HTC_PACKET *pBundleFreeList; |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 184 | uint32_t ce_send_cnt; |
| 185 | uint32_t TX_comp_cnt; |
| 186 | uint8_t MaxMsgsPerHTCBundle; |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 187 | qdf_work_t queue_kicker; |
Yue Ma | ec9e71c | 2016-02-26 18:52:20 -0800 | [diff] [blame] | 188 | uint32_t con_mode; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 189 | } HTC_TARGET; |
| 190 | |
| 191 | #define HTC_ENABLE_BUNDLE(target) (target->MaxMsgsPerHTCBundle > 1) |
| 192 | #ifdef RX_SG_SUPPORT |
| 193 | #define RESET_RX_SG_CONFIG(_target) \ |
| 194 | _target->ExpRxSgTotalLen = 0; \ |
| 195 | _target->CurRxSgTotalLen = 0; \ |
| 196 | _target->IsRxSgInprogress = false; |
| 197 | #endif |
| 198 | |
| 199 | #define HTC_STATE_STOPPING (1 << 0) |
| 200 | #define HTC_STOPPING(t) ((t)->HTCStateFlags & HTC_STATE_STOPPING) |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 201 | #define LOCK_HTC(t) qdf_spin_lock_bh(&(t)->HTCLock); |
| 202 | #define UNLOCK_HTC(t) qdf_spin_unlock_bh(&(t)->HTCLock); |
| 203 | #define LOCK_HTC_RX(t) qdf_spin_lock_bh(&(t)->HTCRxLock); |
| 204 | #define UNLOCK_HTC_RX(t) qdf_spin_unlock_bh(&(t)->HTCRxLock); |
| 205 | #define LOCK_HTC_TX(t) qdf_spin_lock_bh(&(t)->HTCTxLock); |
| 206 | #define UNLOCK_HTC_TX(t) qdf_spin_unlock_bh(&(t)->HTCTxLock); |
| 207 | #define LOCK_HTC_CREDIT(t) qdf_spin_lock_bh(&(t)->HTCCreditLock); |
| 208 | #define UNLOCK_HTC_CREDIT(t) qdf_spin_unlock_bh(&(t)->HTCCreditLock); |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 209 | |
| 210 | #define GET_HTC_TARGET_FROM_HANDLE(hnd) ((HTC_TARGET *)(hnd)) |
| 211 | |
| 212 | #define IS_TX_CREDIT_FLOW_ENABLED(ep) ((ep)->TxCreditFlowEnabled) |
| 213 | |
| 214 | #define HTC_POLL_CLEANUP_PERIOD_MS 10 /* milliseconds */ |
| 215 | |
| 216 | /* Macro to Increment the HTC_PACKET_ERRORS for Tx.*/ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 217 | #define OL_ATH_HTC_PKT_ERROR_COUNT_INCR(_target, _ecode) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 218 | do { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 219 | if (_ecode == GET_HTC_PKT_Q_FAIL) \ |
| 220 | (_target->htc_pkt_stats.htc_get_pkt_q_fail_count) += 1 \ |
| 221 | ; \ |
| 222 | if (_ecode == HTC_PKT_Q_EMPTY) \ |
| 223 | (_target->htc_pkt_stats.htc_pkt_q_empty_count) += 1 \ |
| 224 | ; \ |
| 225 | if (_ecode == HTC_SEND_Q_EMPTY) \ |
| 226 | (_target->htc_pkt_stats.htc_send_q_empty_count) += 1 \ |
| 227 | ; \ |
| 228 | } while (0); |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 229 | /* internal HTC functions */ |
| 230 | |
Vishwajith Upendra | 70f8b6e | 2016-03-01 16:28:23 +0530 | [diff] [blame] | 231 | QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf, |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 232 | uint8_t pipeID); |
Vishwajith Upendra | 70f8b6e | 2016-03-01 16:28:23 +0530 | [diff] [blame] | 233 | QDF_STATUS htc_tx_completion_handler(void *Context, qdf_nbuf_t netbuf, |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 234 | unsigned int transferID, uint32_t toeplitz_hash_result); |
| 235 | |
| 236 | HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target); |
| 237 | void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket); |
| 238 | |
| 239 | HTC_PACKET *allocate_htc_packet_container(HTC_TARGET *target); |
| 240 | void free_htc_packet_container(HTC_TARGET *target, HTC_PACKET *pPacket); |
| 241 | void htc_flush_rx_hold_queue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint); |
| 242 | void htc_flush_endpoint_tx(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, |
| 243 | HTC_TX_TAG Tag); |
| 244 | void htc_recv_init(HTC_TARGET *target); |
| 245 | A_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target); |
| 246 | void htc_free_control_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket); |
| 247 | HTC_PACKET *htc_alloc_control_tx_packet(HTC_TARGET *target); |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 248 | uint8_t htc_get_credit_allocation(HTC_TARGET *target, uint16_t service_id); |
| 249 | void htc_tx_resource_avail_handler(void *context, uint8_t pipeID); |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 250 | void htc_control_rx_complete(void *Context, HTC_PACKET *pPacket); |
| 251 | void htc_process_credit_rpt(HTC_TARGET *target, |
| 252 | HTC_CREDIT_REPORT *pRpt, |
| 253 | int NumEntries, HTC_ENDPOINT_ID FromEndpoint); |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 254 | void htc_fw_event_handler(void *context, QDF_STATUS status); |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 255 | void htc_send_complete_check_cleanup(void *context); |
Yue Ma | ec9e71c | 2016-02-26 18:52:20 -0800 | [diff] [blame] | 256 | #ifdef FEATURE_RUNTIME_PM |
Houston Hoffman | 47e387b | 2015-10-20 17:04:42 -0700 | [diff] [blame] | 257 | void htc_kick_queues(void *context); |
Yue Ma | ec9e71c | 2016-02-26 18:52:20 -0800 | [diff] [blame] | 258 | #endif |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 259 | |
| 260 | void htc_credit_record(htc_credit_exchange_type type, uint32_t tx_credit, |
| 261 | uint32_t htc_tx_queue_depth); |
| 262 | |
| 263 | static inline void htc_send_complete_poll_timer_stop(HTC_ENDPOINT * |
| 264 | pEndpoint) { |
| 265 | LOCK_HTC_TX(pEndpoint->target); |
| 266 | if (pEndpoint->ul_poll_timer_active) { |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 267 | /* qdf_timer_stop(&pEndpoint->ul_poll_timer); */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 268 | pEndpoint->ul_poll_timer_active = 0; |
| 269 | } |
| 270 | UNLOCK_HTC_TX(pEndpoint->target); |
| 271 | } |
| 272 | |
| 273 | static inline void htc_send_complete_poll_timer_start(HTC_ENDPOINT * |
| 274 | pEndpoint) { |
| 275 | LOCK_HTC_TX(pEndpoint->target); |
| 276 | if (pEndpoint->ul_outstanding_cnt |
| 277 | && !pEndpoint->ul_poll_timer_active) { |
| 278 | /* |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 279 | qdf_timer_start( |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 280 | &pEndpoint->ul_poll_timer, HTC_POLL_CLEANUP_PERIOD_MS); |
| 281 | */ |
| 282 | pEndpoint->ul_poll_timer_active = 1; |
| 283 | } |
| 284 | UNLOCK_HTC_TX(pEndpoint->target); |
| 285 | } |
| 286 | |
| 287 | static inline void |
| 288 | htc_send_complete_check(HTC_ENDPOINT *pEndpoint, int force) { |
| 289 | /* |
| 290 | * Stop the polling-cleanup timer that will result in a later call to |
| 291 | * this function. It may get started again below, if there are still |
| 292 | * outsending sends. |
| 293 | */ |
| 294 | htc_send_complete_poll_timer_stop(pEndpoint); |
| 295 | /* |
| 296 | * Check whether HIF has any prior sends that have finished, |
| 297 | * have not had the post-processing done. |
| 298 | */ |
| 299 | hif_send_complete_check(pEndpoint->target->hif_dev, |
| 300 | pEndpoint->UL_PipeID, force); |
| 301 | /* |
| 302 | * If there are still outstanding sends after polling, start a timer |
| 303 | * to check again a little later. |
| 304 | */ |
| 305 | htc_send_complete_poll_timer_start(pEndpoint); |
| 306 | } |
| 307 | |
| 308 | #ifdef __cplusplus |
| 309 | } |
| 310 | #endif |
| 311 | |
| 312 | #ifndef DEBUG_BUNDLE |
| 313 | #define DEBUG_BUNDLE 0 |
| 314 | #endif |
| 315 | |
| 316 | #ifdef HIF_SDIO |
| 317 | #ifndef ENABLE_BUNDLE_TX |
| 318 | #define ENABLE_BUNDLE_TX 1 |
| 319 | #endif |
| 320 | |
| 321 | #ifndef ENABLE_BUNDLE_RX |
| 322 | #define ENABLE_BUNDLE_RX 1 |
| 323 | #endif |
| 324 | #endif /* HIF_SDIO */ |
| 325 | #endif /* !_HTC_HOST_INTERNAL_H_ */ |