Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 1 | /* |
Himanshu Agarwal | 974d0a5 | 2017-03-08 21:13:51 +0530 | [diff] [blame] | 2 | * Copyright (c) 2013-2014, 2016-2017 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_PACKET_H_ |
| 29 | #define HTC_PACKET_H_ |
| 30 | |
| 31 | #include <osdep.h> |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 32 | #include "dl_list.h" |
| 33 | |
| 34 | /* ------ Endpoint IDS ------ */ |
| 35 | typedef enum { |
| 36 | ENDPOINT_UNUSED = -1, |
| 37 | ENDPOINT_0 = 0, |
| 38 | ENDPOINT_1 = 1, |
| 39 | ENDPOINT_2 = 2, |
| 40 | ENDPOINT_3, |
| 41 | ENDPOINT_4, |
| 42 | ENDPOINT_5, |
| 43 | ENDPOINT_6, |
| 44 | ENDPOINT_7, |
| 45 | ENDPOINT_8, |
| 46 | ENDPOINT_MAX, |
| 47 | } HTC_ENDPOINT_ID; |
| 48 | |
| 49 | struct _HTC_PACKET; |
| 50 | |
| 51 | typedef void (*HTC_PACKET_COMPLETION)(void *, struct _HTC_PACKET *); |
| 52 | |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 53 | typedef uint16_t HTC_TX_TAG; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 54 | |
| 55 | typedef struct _HTC_TX_PACKET_INFO { |
| 56 | HTC_TX_TAG Tag; /* tag used to selective flush packets */ |
| 57 | int CreditsUsed; /* number of credits used for this TX packet (HTC internal) */ |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 58 | uint8_t SendFlags; /* send flags (HTC internal) */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 59 | int SeqNo; /* internal seq no for debugging (HTC internal) */ |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 60 | uint32_t Flags; /* internal use */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 61 | } HTC_TX_PACKET_INFO; |
| 62 | |
Houston Hoffman | c5141b0 | 2015-11-18 02:36:30 -0800 | [diff] [blame] | 63 | /** |
| 64 | * HTC_TX_PACKET_TAG_XXX - #defines for tagging packets for special handling |
| 65 | * HTC_TX_PACKET_TAG_ALL: zero is reserved and used to flush ALL packets |
| 66 | * HTC_TX_PACKET_TAG_INTERNAL: internal tags start here |
| 67 | * HTC_TX_PACKET_TAG_USER_DEFINED: user-defined tags start here |
| 68 | * HTC_TX_PACKET_TAG_BUNDLED: indicate this is a bundled tx packet |
| 69 | * HTC_TX_PACKET_TAG_AUTO_PM: indicate a power management wmi command |
| 70 | */ |
| 71 | #define HTC_TX_PACKET_TAG_ALL 0 |
| 72 | #define HTC_TX_PACKET_TAG_INTERNAL 1 |
| 73 | #define HTC_TX_PACKET_TAG_USER_DEFINED (HTC_TX_PACKET_TAG_INTERNAL + 9) |
| 74 | #define HTC_TX_PACKET_TAG_BUNDLED (HTC_TX_PACKET_TAG_USER_DEFINED + 1) |
| 75 | #define HTC_TX_PACKET_TAG_AUTO_PM (HTC_TX_PACKET_TAG_USER_DEFINED + 2) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 76 | |
Houston Hoffman | 1dd2276 | 2015-11-10 11:35:49 -0800 | [diff] [blame] | 77 | /* Tag packet for runtime put after sending */ |
| 78 | #define HTC_TX_PACKET_TAG_RUNTIME_PUT (HTC_TX_PACKET_TAG_USER_DEFINED + 3) |
| 79 | |
| 80 | |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 81 | #define HTC_TX_PACKET_FLAG_FIXUP_NETBUF (1 << 0) |
| 82 | |
| 83 | typedef struct _HTC_RX_PACKET_INFO { |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 84 | uint32_t ExpectedHdr; /* HTC internal use */ |
| 85 | uint32_t HTCRxFlags; /* HTC internal use */ |
| 86 | uint32_t IndicationFlags; /* indication flags set on each RX packet indication */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 87 | } HTC_RX_PACKET_INFO; |
| 88 | |
| 89 | #define HTC_RX_FLAGS_INDICATE_MORE_PKTS (1 << 0) /* more packets on this endpoint are being fetched */ |
Himanshu Agarwal | 974d0a5 | 2017-03-08 21:13:51 +0530 | [diff] [blame] | 90 | #define HTC_PACKET_MAGIC_COOKIE 0xdeadbeef |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 91 | |
| 92 | /* wrapper around endpoint-specific packets */ |
| 93 | typedef struct _HTC_PACKET { |
| 94 | DL_LIST ListLink; /* double link */ |
| 95 | void *pPktContext; /* caller's per packet specific context */ |
| 96 | |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 97 | uint8_t *pBufferStart; /* the true buffer start , the caller can |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 98 | store the real buffer start here. In |
| 99 | receive callbacks, the HTC layer sets pBuffer |
| 100 | to the start of the payload past the header. This |
| 101 | field allows the caller to reset pBuffer when it |
| 102 | recycles receive packets back to HTC */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 103 | /* |
| 104 | * Pointer to the start of the buffer. In the transmit |
| 105 | * direction this points to the start of the payload. In the |
| 106 | * receive direction, however, the buffer when queued up |
| 107 | * points to the start of the HTC header but when returned |
| 108 | * to the caller points to the start of the payload |
| 109 | */ |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 110 | uint8_t *pBuffer; /* payload start (RX/TX) */ |
| 111 | uint32_t BufferLength; /* length of buffer */ |
| 112 | uint32_t ActualLength; /* actual length of payload */ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 113 | HTC_ENDPOINT_ID Endpoint; /* endpoint that this packet was sent/recv'd from */ |
| 114 | A_STATUS Status; /* completion status */ |
| 115 | union { |
| 116 | HTC_TX_PACKET_INFO AsTx; /* Tx Packet specific info */ |
| 117 | HTC_RX_PACKET_INFO AsRx; /* Rx Packet specific info */ |
| 118 | } PktInfo; |
| 119 | |
| 120 | /* the following fields are for internal HTC use */ |
Yue Ma | b16cf30 | 2016-03-08 18:30:25 -0800 | [diff] [blame] | 121 | uint32_t netbufOrigHeadRoom; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 122 | HTC_PACKET_COMPLETION Completion; /* completion */ |
| 123 | void *pContext; /* HTC private completion context */ |
| 124 | void *pNetBufContext; /* optimization for network-oriented data, the HTC packet |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 125 | can pass the network buffer corresponding to the HTC packet |
| 126 | lower layers may optimized the transfer knowing this is |
| 127 | a network buffer */ |
Himanshu Agarwal | 974d0a5 | 2017-03-08 21:13:51 +0530 | [diff] [blame] | 128 | uint32_t magic_cookie; |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 129 | } HTC_PACKET; |
| 130 | |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 131 | #define COMPLETE_HTC_PACKET(p, status) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 132 | { \ |
| 133 | (p)->Status = (status); \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 134 | (p)->Completion((p)->pContext, (p)); \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 135 | } |
| 136 | |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 137 | #define INIT_HTC_PACKET_INFO(p, b, len) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 138 | { \ |
| 139 | (p)->pBufferStart = (b); \ |
| 140 | (p)->BufferLength = (len); \ |
| 141 | } |
| 142 | |
| 143 | /* macro to set an initial RX packet for refilling HTC */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 144 | #define SET_HTC_PACKET_INFO_RX_REFILL(p, c, b, len, ep) \ |
| 145 | do { \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 146 | (p)->pPktContext = (c); \ |
| 147 | (p)->pBuffer = (b); \ |
| 148 | (p)->pBufferStart = (b); \ |
| 149 | (p)->BufferLength = (len); \ |
| 150 | (p)->Endpoint = (ep); \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 151 | } while (0) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 152 | |
| 153 | /* fast macro to recycle an RX packet that will be re-queued to HTC */ |
| 154 | #define HTC_PACKET_RESET_RX(p) \ |
| 155 | { (p)->pBuffer = (p)->pBufferStart; (p)->ActualLength = 0; } |
| 156 | |
| 157 | /* macro to set packet parameters for TX */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 158 | #define SET_HTC_PACKET_INFO_TX(p, c, b, len, ep, tag) \ |
| 159 | do { \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 160 | (p)->pPktContext = (c); \ |
| 161 | (p)->pBuffer = (b); \ |
| 162 | (p)->ActualLength = (len); \ |
| 163 | (p)->Endpoint = (ep); \ |
| 164 | (p)->PktInfo.AsTx.Tag = (tag); \ |
| 165 | (p)->PktInfo.AsTx.Flags = 0; \ |
DARAM SUDHA | e428c4c | 2015-03-13 19:15:00 +0530 | [diff] [blame] | 166 | (p)->PktInfo.AsTx.SendFlags = 0; \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 167 | } while (0) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 168 | |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 169 | #define SET_HTC_PACKET_NET_BUF_CONTEXT(p, nb) \ |
| 170 | do { \ |
| 171 | (p)->pNetBufContext = (nb); \ |
| 172 | } while (0) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 173 | |
| 174 | #define GET_HTC_PACKET_NET_BUF_CONTEXT(p) (p)->pNetBufContext |
| 175 | |
| 176 | /* HTC Packet Queueing Macros */ |
| 177 | typedef struct _HTC_PACKET_QUEUE { |
| 178 | DL_LIST QueueHead; |
| 179 | int Depth; |
| 180 | } HTC_PACKET_QUEUE; |
| 181 | |
| 182 | /* initialize queue */ |
| 183 | #define INIT_HTC_PACKET_QUEUE(pQ) \ |
| 184 | { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 185 | DL_LIST_INIT(&(pQ)->QueueHead); \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 186 | (pQ)->Depth = 0; \ |
| 187 | } |
| 188 | |
| 189 | /* enqueue HTC packet to the tail of the queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 190 | #define HTC_PACKET_ENQUEUE(pQ, p) \ |
| 191 | { dl_list_insert_tail(&(pQ)->QueueHead, &(p)->ListLink); \ |
| 192 | (pQ)->Depth++; \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | /* enqueue HTC packet to the tail of the queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 196 | #define HTC_PACKET_ENQUEUE_TO_HEAD(pQ, p) \ |
| 197 | { dl_list_insert_head(&(pQ)->QueueHead, &(p)->ListLink); \ |
| 198 | (pQ)->Depth++; \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 199 | } |
| 200 | /* test if a queue is empty */ |
| 201 | #define HTC_QUEUE_EMPTY(pQ) ((pQ)->Depth == 0) |
| 202 | /* get packet at head without removing it */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 203 | static inline HTC_PACKET *htc_get_pkt_at_head(HTC_PACKET_QUEUE *queue) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 204 | { |
| 205 | if (queue->Depth == 0) { |
| 206 | return NULL; |
| 207 | } |
| 208 | return |
| 209 | A_CONTAINING_STRUCT((DL_LIST_GET_ITEM_AT_HEAD(&queue->QueueHead)), |
| 210 | HTC_PACKET, ListLink); |
| 211 | } |
| 212 | |
| 213 | /* remove a packet from a queue, where-ever it is in the queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 214 | #define HTC_PACKET_REMOVE(pQ, p) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 215 | { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 216 | dl_list_remove(&(p)->ListLink); \ |
| 217 | (pQ)->Depth--; \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | /* dequeue an HTC packet from the head of the queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 221 | static inline HTC_PACKET *htc_packet_dequeue(HTC_PACKET_QUEUE *queue) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 222 | { |
| 223 | DL_LIST *pItem = dl_list_remove_item_from_head(&queue->QueueHead); |
| 224 | if (pItem != NULL) { |
| 225 | queue->Depth--; |
| 226 | return A_CONTAINING_STRUCT(pItem, HTC_PACKET, ListLink); |
| 227 | } |
| 228 | return NULL; |
| 229 | } |
| 230 | |
| 231 | /* dequeue an HTC packet from the tail of the queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 232 | static inline HTC_PACKET *htc_packet_dequeue_tail(HTC_PACKET_QUEUE *queue) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 233 | { |
| 234 | DL_LIST *pItem = dl_list_remove_item_from_tail(&queue->QueueHead); |
| 235 | if (pItem != NULL) { |
| 236 | queue->Depth--; |
| 237 | return A_CONTAINING_STRUCT(pItem, HTC_PACKET, ListLink); |
| 238 | } |
| 239 | return NULL; |
| 240 | } |
| 241 | |
| 242 | #define HTC_PACKET_QUEUE_DEPTH(pQ) (pQ)->Depth |
| 243 | |
| 244 | #define HTC_GET_ENDPOINT_FROM_PKT(p) (p)->Endpoint |
| 245 | #define HTC_GET_TAG_FROM_PKT(p) (p)->PktInfo.AsTx.Tag |
| 246 | |
| 247 | /* transfer the packets from one queue to the tail of another queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 248 | #define HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(pQDest, pQSrc) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 249 | { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 250 | dl_list_transfer_items_to_tail(&(pQDest)->QueueHead, &(pQSrc)->QueueHead); \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 251 | (pQDest)->Depth += (pQSrc)->Depth; \ |
| 252 | (pQSrc)->Depth = 0; \ |
| 253 | } |
| 254 | |
| 255 | /* |
| 256 | * Transfer the packets from one queue to the head of another queue. |
| 257 | * This xfer_to_head(q1,q2) is basically equivalent to xfer_to_tail(q2,q1), |
| 258 | * but it updates the queue descriptor object for the initial queue to refer |
| 259 | * to the concatenated queue. |
| 260 | */ |
| 261 | #define HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(pQDest, pQSrc) \ |
| 262 | { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 263 | dl_list_transfer_items_to_head(&(pQDest)->QueueHead, &(pQSrc)->QueueHead); \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 264 | (pQDest)->Depth += (pQSrc)->Depth; \ |
| 265 | (pQSrc)->Depth = 0; \ |
| 266 | } |
| 267 | |
| 268 | /* fast version to init and add a single packet to a queue */ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 269 | #define INIT_HTC_PACKET_QUEUE_AND_ADD(pQ, pP) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 270 | { \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 271 | DL_LIST_INIT_AND_ADD(&(pQ)->QueueHead, &(pP)->ListLink) \ |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 272 | (pQ)->Depth = 1; \ |
| 273 | } |
| 274 | |
| 275 | #define HTC_PACKET_QUEUE_ITERATE_ALLOW_REMOVE(pQ, pPTemp) \ |
Chouhan, Anurag | fc06aa9 | 2016-03-03 19:05:05 +0530 | [diff] [blame] | 276 | ITERATE_OVER_LIST_ALLOW_REMOVE(&(pQ)->QueueHead, (pPTemp), HTC_PACKET, ListLink) |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 277 | |
| 278 | #define HTC_PACKET_QUEUE_ITERATE_IS_VALID(pQ) ITERATE_IS_VALID(&(pQ)->QueueHead) |
| 279 | #define HTC_PACKET_QUEUE_ITERATE_RESET(pQ) ITERATE_RESET(&(pQ)->QueueHead) |
| 280 | |
| 281 | #define HTC_PACKET_QUEUE_ITERATE_END ITERATE_END |
| 282 | |
Himanshu Agarwal | 974d0a5 | 2017-03-08 21:13:51 +0530 | [diff] [blame] | 283 | /** |
| 284 | * htc_packet_set_magic_cookie() - set magic cookie in htc packet |
| 285 | * htc_pkt - pointer to htc packet |
| 286 | * value - value to set in magic cookie |
| 287 | * |
| 288 | * This API sets the magic cookie passed in htc packet. |
| 289 | * |
| 290 | * Return : None |
| 291 | */ |
| 292 | static inline void htc_packet_set_magic_cookie(HTC_PACKET *htc_pkt, |
| 293 | uint32_t value) |
| 294 | { |
| 295 | htc_pkt->magic_cookie = value; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * htc_packet_set_magic_cookie() - get magic cookie in htc packet |
| 300 | * htc_pkt - pointer to htc packet |
| 301 | * |
| 302 | * This API returns the magic cookie in htc packet. |
| 303 | * |
| 304 | * Return : magic cookie |
| 305 | */ |
| 306 | static inline uint32_t htc_packet_get_magic_cookie(HTC_PACKET *htc_pkt) |
| 307 | { |
| 308 | return htc_pkt->magic_cookie; |
| 309 | } |
| 310 | |
Prakash Dhavali | d5c9f1c | 2015-11-08 19:04:44 -0800 | [diff] [blame] | 311 | #endif /*HTC_PACKET_H_ */ |