Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved. |
| 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 | /** |
| 29 | * @file ol_txrx_htt_api.h |
| 30 | * @brief Define the host data API functions called by the host HTT SW. |
| 31 | */ |
| 32 | #ifndef _OL_TXRX_HTT_API__H_ |
| 33 | #define _OL_TXRX_HTT_API__H_ |
| 34 | |
| 35 | #include <htt.h> /* HTT_TX_COMPL_IND_STAT */ |
| 36 | #include <athdefs.h> /* A_STATUS */ |
| 37 | #include <cdf_nbuf.h> /* cdf_nbuf_t */ |
| 38 | |
| 39 | #include <ol_txrx_api.h> /* ol_txrx_pdev_handle */ |
| 40 | |
| 41 | static inline uint16_t *ol_tx_msdu_id_storage(cdf_nbuf_t msdu) |
| 42 | { |
| 43 | cdf_assert(cdf_nbuf_headroom(msdu) >= (sizeof(uint16_t) * 2 - 1)); |
| 44 | return (uint16_t *) (((cdf_size_t) (cdf_nbuf_head(msdu) + 1)) & ~0x1); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @brief Tx MSDU download completion for a LL system |
| 49 | * @details |
| 50 | * Release the reference to the downloaded tx descriptor. |
| 51 | * In the unlikely event that the reference count is zero, free |
| 52 | * the tx descriptor and tx frame. |
| 53 | * |
| 54 | * @param pdev - (abstract) pointer to the txrx physical device |
| 55 | * @param status - indication of whether the download succeeded |
| 56 | * @param msdu - the downloaded tx frame |
| 57 | * @param msdu_id - the txrx ID of the tx frame - this is used for |
| 58 | * locating the frame's tx descriptor |
| 59 | */ |
| 60 | void |
| 61 | ol_tx_download_done_ll(void *pdev, |
| 62 | A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id); |
| 63 | |
| 64 | /** |
| 65 | * @brief Tx MSDU download completion for HL system without tx completion msgs |
| 66 | * @details |
| 67 | * Free the tx descriptor and tx frame. |
| 68 | * Invoke the HL tx download scheduler. |
| 69 | * |
| 70 | * @param pdev - (abstract) pointer to the txrx physical device |
| 71 | * @param status - indication of whether the download succeeded |
| 72 | * @param msdu - the downloaded tx frame |
| 73 | * @param msdu_id - the txrx ID of the tx frame - this is used for |
| 74 | * locating the frame's tx descriptor |
| 75 | */ |
| 76 | void |
| 77 | ol_tx_download_done_hl_free(void *pdev, |
| 78 | A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id); |
| 79 | |
| 80 | /** |
| 81 | * @brief Tx MSDU download completion for HL system with tx completion msgs |
| 82 | * @details |
| 83 | * Release the reference to the downloaded tx descriptor. |
| 84 | * In the unlikely event that the reference count is zero, free |
| 85 | * the tx descriptor and tx frame. |
| 86 | * Optionally, invoke the HL tx download scheduler. (It is probable that |
| 87 | * the HL tx download scheduler would operate in response to tx completion |
| 88 | * messages rather than download completion events.) |
| 89 | * |
| 90 | * @param pdev - (abstract) pointer to the txrx physical device |
| 91 | * @param status - indication of whether the download succeeded |
| 92 | * @param msdu - the downloaded tx frame |
| 93 | * @param msdu_id - the txrx ID of the tx frame - this is used for |
| 94 | * locating the frame's tx descriptor |
| 95 | */ |
| 96 | void |
| 97 | ol_tx_download_done_hl_retain(void *pdev, |
| 98 | A_STATUS status, |
| 99 | cdf_nbuf_t msdu, uint16_t msdu_id); |
| 100 | |
| 101 | /* |
| 102 | * For now, make the host HTT -> host txrx tx completion status |
| 103 | * match the target HTT -> host HTT tx completion status, so no |
| 104 | * translation is needed. |
| 105 | */ |
| 106 | /* |
| 107 | * host-only statuses use a different part of the number space |
| 108 | * than host-target statuses |
| 109 | */ |
| 110 | #define HTT_HOST_ONLY_STATUS_CODE_START 128 |
| 111 | enum htt_tx_status { |
| 112 | /* ok - successfully sent + acked */ |
| 113 | htt_tx_status_ok = HTT_TX_COMPL_IND_STAT_OK, |
| 114 | |
| 115 | /* discard - not sent (congestion control) */ |
| 116 | htt_tx_status_discard = HTT_TX_COMPL_IND_STAT_DISCARD, |
| 117 | |
| 118 | /* no_ack - sent, but no ack */ |
| 119 | htt_tx_status_no_ack = HTT_TX_COMPL_IND_STAT_NO_ACK, |
| 120 | |
| 121 | /* download_fail - host could not deliver the tx frame to target */ |
| 122 | htt_tx_status_download_fail = HTT_HOST_ONLY_STATUS_CODE_START, |
| 123 | }; |
| 124 | |
| 125 | /** |
| 126 | * @brief Process a tx completion message sent by the target. |
| 127 | * @details |
| 128 | * When the target is done transmitting a tx frame (either because |
| 129 | * the frame was sent + acknowledged, or because the target gave up) |
| 130 | * it sends a tx completion message to the host. |
| 131 | * This notification function is used regardless of whether the |
| 132 | * transmission succeeded or not; the status argument indicates whether |
| 133 | * the transmission succeeded. |
| 134 | * This tx completion message indicates via the descriptor ID which |
| 135 | * tx frames were completed, and indicates via the status whether the |
| 136 | * frames were transmitted successfully. |
| 137 | * The host frees the completed descriptors / frames (updating stats |
| 138 | * in the process). |
| 139 | * |
| 140 | * @param pdev - the data physical device that sent the tx frames |
| 141 | * (registered with HTT as a context pointer during attach time) |
| 142 | * @param num_msdus - how many MSDUs are referenced by the tx completion |
| 143 | * message |
| 144 | * @param status - whether transmission was successful |
| 145 | * @param tx_msdu_id_iterator - abstract method of finding the IDs for the |
| 146 | * individual MSDUs referenced by the tx completion message, via the |
| 147 | * htt_tx_compl_desc_id API function |
| 148 | */ |
| 149 | void |
| 150 | ol_tx_completion_handler(ol_txrx_pdev_handle pdev, |
| 151 | int num_msdus, |
| 152 | enum htt_tx_status status, void *tx_msdu_id_iterator); |
| 153 | |
| 154 | void ol_tx_credit_completion_handler(ol_txrx_pdev_handle pdev, int credits); |
| 155 | |
| 156 | /** |
| 157 | * @brief Init the total amount of target credit. |
| 158 | * @details |
| 159 | * |
| 160 | * @param pdev - the data physical device that sent the tx frames |
| 161 | * @param credit_delta - how much to increment the target's tx credit by |
| 162 | */ |
| 163 | void ol_tx_target_credit_init(struct ol_txrx_pdev_t *pdev, int credit_delta); |
| 164 | |
| 165 | /** |
| 166 | * @brief Process a tx completion message for a single MSDU. |
| 167 | * @details |
| 168 | * The ol_tx_single_completion_handler function performs the same tx |
| 169 | * completion processing as the ol_tx_completion_handler, but for a |
| 170 | * single frame. |
| 171 | * ol_tx_completion_handler is optimized to handle batch completions |
| 172 | * as efficiently as possible; in contrast ol_tx_single_completion_handler |
| 173 | * handles single frames as simply and generally as possible. |
| 174 | * Thus, this ol_tx_single_completion_handler function is suitable for |
| 175 | * intermittent usage, such as for tx mgmt frames. |
| 176 | * |
| 177 | * @param pdev - the data physical device that sent the tx frames |
| 178 | * @param status - whether transmission was successful |
| 179 | * @param tx_msdu_id - ID of the frame which completed transmission |
| 180 | */ |
| 181 | void |
| 182 | ol_tx_single_completion_handler(ol_txrx_pdev_handle pdev, |
| 183 | enum htt_tx_status status, uint16_t tx_desc_id); |
| 184 | |
| 185 | /** |
| 186 | * @brief Update the amount of target credit. |
| 187 | * @details |
| 188 | * When the target finishes with an old transmit frame, it can use the |
| 189 | * space that was occupied by the old tx frame to store a new tx frame. |
| 190 | * This function is used to inform the txrx layer, where the HL tx download |
| 191 | * scheduler resides, about such updates to the target's tx credit. |
| 192 | * This credit update is done explicitly, rather than having the txrx layer |
| 193 | * update the credit count itself inside the ol_tx_completion handler |
| 194 | * function. This provides HTT with the flexibility to limit the rate of |
| 195 | * downloads from the TXRX layer's download scheduler, by controlling how |
| 196 | * much credit the download scheduler gets, and also provides the flexibility |
| 197 | * to account for a change in the tx memory pool size within the target. |
| 198 | * This function is only used for HL systems; in LL systems, each tx frame |
| 199 | * is assumed to use exactly one credit (for its target-side tx descriptor), |
| 200 | * and any rate limiting is managed within the target. |
| 201 | * |
| 202 | * @param pdev - the data physical device that sent the tx frames |
| 203 | * @param credit_delta - how much to increment the target's tx credit by |
| 204 | */ |
| 205 | void ol_tx_target_credit_update(struct ol_txrx_pdev_t *pdev, int credit_delta); |
| 206 | |
| 207 | /** |
| 208 | * @brief Process an rx indication message sent by the target. |
| 209 | * @details |
| 210 | * The target sends a rx indication message to the host as a |
| 211 | * notification that there are new rx frames available for the |
| 212 | * host to process. |
| 213 | * The HTT host layer locates the rx descriptors and rx frames |
| 214 | * associated with the indication, and calls this function to |
| 215 | * invoke the rx data processing on the new frames. |
| 216 | * (For LL, the rx descriptors and frames are delivered directly |
| 217 | * to the host via MAC DMA, while for HL the rx descriptor and |
| 218 | * frame for individual frames are combined with the rx indication |
| 219 | * message.) |
| 220 | * All MPDUs referenced by a rx indication message belong to the |
| 221 | * same peer-TID. |
| 222 | * |
| 223 | * @param pdev - the data physical device that received the frames |
| 224 | * (registered with HTT as a context pointer during attach time) |
| 225 | * @param rx_ind_msg - the network buffer holding the rx indication message |
| 226 | * (For HL, this netbuf also holds the rx desc and rx payload, but |
| 227 | * the data SW is agnostic to whether the desc and payload are |
| 228 | * piggybacked with the rx indication message.) |
| 229 | * @param peer_id - which peer sent this rx data |
| 230 | * @param tid - what (extended) traffic type the rx data is |
| 231 | * @param num_mpdu_ranges - how many ranges of MPDUs does the message describe. |
| 232 | * Each MPDU within the range has the same rx status. |
| 233 | */ |
| 234 | void |
| 235 | ol_rx_indication_handler(ol_txrx_pdev_handle pdev, |
| 236 | cdf_nbuf_t rx_ind_msg, |
| 237 | uint16_t peer_id, uint8_t tid, int num_mpdu_ranges); |
| 238 | |
| 239 | /** |
| 240 | * @brief Process an rx fragment indication message sent by the target. |
| 241 | * @details |
| 242 | * The target sends a rx fragment indication message to the host as a |
| 243 | * notification that there are new rx fragment available for the |
| 244 | * host to process. |
| 245 | * The HTT host layer locates the rx descriptors and rx fragment |
| 246 | * associated with the indication, and calls this function to |
| 247 | * invoke the rx fragment data processing on the new fragment. |
| 248 | * |
| 249 | * @param pdev - the data physical device that received the frames |
| 250 | * (registered with HTT as a context pointer during attach time) |
| 251 | * @param rx_frag_ind_msg - the network buffer holding the rx fragment indication message |
| 252 | * @param peer_id - which peer sent this rx data |
| 253 | * @param tid - what (extended) traffic type the rx data is |
| 254 | */ |
| 255 | void ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev, |
| 256 | cdf_nbuf_t rx_frag_ind_msg, |
| 257 | uint16_t peer_id, uint8_t tid); |
| 258 | |
| 259 | /** |
| 260 | * @brief Process rx offload deliver indication message sent by the target. |
| 261 | * @details |
| 262 | * When the target exits offload mode, target delivers packets that it has |
| 263 | * held in its memory to the host using this message. |
| 264 | * Low latency case: |
| 265 | * The message contains the number of MSDUs that are being delivered by the |
| 266 | * target to the host. The packet itself resides in host ring along with some |
| 267 | * metadata describing the peer id, vdev id, tid, FW desc and length of |
| 268 | * the packet being delivered. |
| 269 | * Hight letency case: |
| 270 | * The message itself contains the payload of the MSDU being delivered by |
| 271 | * the target to the host. The message also contains meta data describing |
| 272 | * the packet such as peer id, vdev id, tid, FW desc and length of the packet |
| 273 | * being delivered. Refer to htt.h for the exact structure of the message. |
| 274 | * @param pdev - the data physical device that received the frame. |
| 275 | * @param msg - offload deliver indication message |
| 276 | * @param msdu_cnt - number of MSDUs being delivred. |
| 277 | */ |
| 278 | void |
| 279 | ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev, |
| 280 | cdf_nbuf_t msg, int msdu_cnt); |
| 281 | |
| 282 | /** |
| 283 | * @brief Process a peer map message sent by the target. |
| 284 | * @details |
| 285 | * Each time the target allocates a new peer ID, it will inform the |
| 286 | * host via the "peer map" message. This function processes that |
| 287 | * message. The host data SW looks for a peer object whose MAC address |
| 288 | * matches the MAC address specified in the peer map message, and then |
| 289 | * sets up a mapping between the peer ID specified in the message and |
| 290 | * the peer object that was found. |
| 291 | * |
| 292 | * @param pdev - data physical device handle |
| 293 | * (registered with HTT as a context pointer during attach time) |
| 294 | * @param peer_id - ID generated by the target to refer to the peer in question |
| 295 | * The target may create multiple IDs for a single peer. |
| 296 | * @param vdev_id - Reference to the virtual device the peer is associated with |
| 297 | * @param peer_mac_addr - MAC address of the peer in question |
| 298 | * @param tx_ready - whether transmits to this peer can be done already, or |
| 299 | * need to wait for a call to peer_tx_ready (only applies to HL systems) |
| 300 | */ |
| 301 | void |
| 302 | ol_rx_peer_map_handler(ol_txrx_pdev_handle pdev, |
| 303 | uint16_t peer_id, |
| 304 | uint8_t vdev_id, uint8_t *peer_mac_addr, int tx_ready); |
| 305 | |
| 306 | /** |
| 307 | * @brief notify the host that the target is ready to transmit to a new peer. |
| 308 | * @details |
| 309 | * Some targets can immediately accept tx frames for a new peer, as soon as |
| 310 | * the peer's association completes. Other target need a short setup time |
| 311 | * before they are ready to accept tx frames for the new peer. |
| 312 | * If the target needs time for setup, it will provide a peer_tx_ready |
| 313 | * message when it is done with the setup. This function forwards this |
| 314 | * notification from the target to the host's tx queue manager. |
| 315 | * This function only applies for HL systems, in which the host determines |
| 316 | * which peer a given tx frame is for, and stores the tx frames in queues. |
| 317 | * |
| 318 | * @param pdev - data physical device handle |
| 319 | * (registered with HTT as a context pointer during attach time) |
| 320 | * @param peer_id - ID for the new peer which can now accept tx frames |
| 321 | */ |
| 322 | void ol_txrx_peer_tx_ready_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id); |
| 323 | |
| 324 | /** |
| 325 | * @brief Process a peer unmap message sent by the target. |
| 326 | * @details |
| 327 | * Each time the target frees a peer ID, it will inform the host via the |
| 328 | * "peer unmap" message. This function processes that message. |
| 329 | * The host data SW uses the peer ID from the message to find the peer |
| 330 | * object from peer_map[peer_id], then invalidates peer_map[peer_id] |
| 331 | * (by setting it to NULL), and checks whether there are any remaining |
| 332 | * references to the peer object. If not, the function deletes the |
| 333 | * peer object. |
| 334 | * |
| 335 | * @param pdev - data physical device handle |
| 336 | * (registered with HTT as a context pointer during attach time) |
| 337 | * @param peer_id - ID that is being freed. |
| 338 | * The target may create multiple IDs for a single peer. |
| 339 | */ |
| 340 | void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id); |
| 341 | |
| 342 | /** |
| 343 | * @brief Process a security indication message sent by the target. |
| 344 | * @details |
| 345 | * When a key is assigned to a peer, the target will inform the host |
| 346 | * with a security indication message. |
| 347 | * The host remembers the security type, and infers whether a rx PN |
| 348 | * check is needed. |
| 349 | * |
| 350 | * @param pdev - data physical device handle |
| 351 | * @param peer_id - which peer the security info is for |
| 352 | * @param sec_type - which type of security / key the peer is using |
| 353 | * @param is_unicast - whether security spec is for a unicast or multicast key |
| 354 | * @param michael_key - key used for TKIP MIC (if sec_type == TKIP) |
| 355 | * @param rx_pn - RSC used for WAPI PN replay check (if sec_type == WAPI) |
| 356 | */ |
| 357 | void |
| 358 | ol_rx_sec_ind_handler(ol_txrx_pdev_handle pdev, |
| 359 | uint16_t peer_id, |
| 360 | enum htt_sec_type sec_type, |
| 361 | int is_unicast, uint32_t *michael_key, uint32_t *rx_pn); |
| 362 | |
| 363 | /** |
| 364 | * @brief Process an ADDBA message sent by the target. |
| 365 | * @details |
| 366 | * When the target notifies the host of an ADDBA event for a specified |
| 367 | * peer-TID, the host will set up the rx reordering state for the peer-TID. |
| 368 | * Specifically, the host will create a rx reordering array whose length |
| 369 | * is based on the window size specified in the ADDBA. |
| 370 | * |
| 371 | * @param pdev - data physical device handle |
| 372 | * (registered with HTT as a context pointer during attach time) |
| 373 | * @param peer_id - which peer the ADDBA event is for |
| 374 | * @param tid - which traffic ID within the peer the ADDBA event is for |
| 375 | * @param win_sz - how many sequence numbers are in the ARQ block ack window |
| 376 | * set up by the ADDBA event |
| 377 | * @param start_seq_num - the initial value of the sequence number during the |
| 378 | * block ack agreement, as specified by the ADDBA request. |
| 379 | * @param failed - indicate whether the target's ADDBA setup succeeded: |
| 380 | * 0 -> success, 1 -> fail |
| 381 | */ |
| 382 | void |
| 383 | ol_rx_addba_handler(ol_txrx_pdev_handle pdev, |
| 384 | uint16_t peer_id, |
| 385 | uint8_t tid, |
| 386 | uint8_t win_sz, uint16_t start_seq_num, uint8_t failed); |
| 387 | |
| 388 | /** |
| 389 | * @brief Process a DELBA message sent by the target. |
| 390 | * @details |
| 391 | * When the target notifies the host of a DELBA event for a specified |
| 392 | * peer-TID, the host will clean up the rx reordering state for the peer-TID. |
| 393 | * Specifically, the host will remove the rx reordering array, and will |
| 394 | * set the reorder window size to be 1 (stop and go ARQ). |
| 395 | * |
| 396 | * @param pdev - data physical device handle |
| 397 | * (registered with HTT as a context pointer during attach time) |
| 398 | * @param peer_id - which peer the ADDBA event is for |
| 399 | * @param tid - which traffic ID within the peer the ADDBA event is for |
| 400 | */ |
| 401 | void |
| 402 | ol_rx_delba_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id, uint8_t tid); |
| 403 | |
| 404 | enum htt_rx_flush_action { |
| 405 | htt_rx_flush_release, |
| 406 | htt_rx_flush_discard, |
| 407 | }; |
| 408 | |
| 409 | /** |
| 410 | * @brief Process a rx reorder flush message sent by the target. |
| 411 | * @details |
| 412 | * The target's rx reorder logic can send a flush indication to the |
| 413 | * host's rx reorder buffering either as a flush IE within a rx |
| 414 | * indication message, or as a standalone rx reorder flush message. |
| 415 | * This ol_rx_flush_handler function processes the standalone rx |
| 416 | * reorder flush message from the target. |
| 417 | * The flush message specifies a range of sequence numbers whose |
| 418 | * rx frames are flushed. |
| 419 | * Some sequence numbers within the specified range may not have |
| 420 | * rx frames; the host needs to check for each sequence number in |
| 421 | * the specified range whether there are rx frames held for that |
| 422 | * sequence number. |
| 423 | * |
| 424 | * @param pdev - data physical device handle |
| 425 | * (registered with HTT as a context pointer during attach time) |
| 426 | * @param peer_id - which peer's rx data is being flushed |
| 427 | * @param tid - which traffic ID within the peer has the rx data being flushed |
| 428 | * @param seq_num_start - Which sequence number within the rx reordering |
| 429 | * buffer the flushing should start with. |
| 430 | * This is the LSBs of the 802.11 sequence number. |
| 431 | * This sequence number is masked with the rounded-to-power-of-two |
| 432 | * window size to generate a reorder buffer index. |
| 433 | * The flush includes this initial sequence number. |
| 434 | * @param seq_num_end - Which sequence number within the rx reordering |
| 435 | * buffer the flushing should stop at. |
| 436 | * This is the LSBs of the 802.11 sequence number. |
| 437 | * This sequence number is masked with the rounded-to-power-of-two |
| 438 | * window size to generate a reorder buffer index. |
| 439 | * The flush excludes this final sequence number. |
| 440 | * @param action - whether to release or discard the rx frames |
| 441 | */ |
| 442 | void |
| 443 | ol_rx_flush_handler(ol_txrx_pdev_handle pdev, |
| 444 | uint16_t peer_id, |
| 445 | uint8_t tid, |
| 446 | uint16_t seq_num_start, |
| 447 | uint16_t seq_num_end, enum htt_rx_flush_action action); |
| 448 | |
| 449 | /** |
| 450 | * @brief Process a rx pn indication message |
| 451 | * @details |
| 452 | * When the peer is configured to get PN checking done in target, |
| 453 | * the target instead of sending reorder flush/release messages |
| 454 | * sends PN indication messages which contain the start and end |
| 455 | * sequence numbers to be flushed/released along with the sequence |
| 456 | * numbers of MPDUs that failed the PN check in target. |
| 457 | * |
| 458 | * @param pdev - data physical device handle |
| 459 | * (registered with HTT as a context pointer during attach time) |
| 460 | * @param peer_id - which peer's rx data is being flushed |
| 461 | * @param tid - which traffic ID within the peer |
| 462 | * @param seq_num_start - Which sequence number within the rx reordering |
| 463 | * buffer to start with. |
| 464 | * This is the LSBs of the 802.11 sequence number. |
| 465 | * This sequence number is masked with the rounded-to-power-of-two |
| 466 | * window size to generate a reorder buffer index. |
| 467 | * This is the initial sequence number. |
| 468 | * @param seq_num_end - Which sequence number within the rx reordering |
| 469 | * buffer to stop at. |
| 470 | * This is the LSBs of the 802.11 sequence number. |
| 471 | * This sequence number is masked with the rounded-to-power-of-two |
| 472 | * window size to generate a reorder buffer index. |
| 473 | * The processing stops right before this sequence number |
| 474 | * @param pn_ie_cnt - Indicates the number of PN information elements. |
| 475 | * @param pn_ie - Pointer to the array of PN information elements. Each |
| 476 | * PN information element contains the LSBs of the 802.11 sequence number |
| 477 | * of the MPDU that failed the PN checking in target. |
| 478 | */ |
| 479 | void |
| 480 | ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev, |
| 481 | uint16_t peer_id, |
| 482 | uint8_t tid, |
| 483 | int seq_num_start, |
| 484 | int seq_num_end, uint8_t pn_ie_cnt, uint8_t *pn_ie); |
| 485 | |
| 486 | /** |
| 487 | * @brief Process a stats message sent by the target. |
| 488 | * @details |
| 489 | * The host can request target for stats. |
| 490 | * The target sends the stats to the host via a confirmation message. |
| 491 | * This ol_txrx_fw_stats_handler function processes the confirmation message. |
| 492 | * Currently, this processing consists of copying the stats from the message |
| 493 | * buffer into the txrx pdev object, and waking the sleeping host context |
| 494 | * that requested the stats. |
| 495 | * |
| 496 | * @param pdev - data physical device handle |
| 497 | * (registered with HTT as a context pointer during attach time) |
| 498 | * @param cookie - Value echoed from the cookie in the stats request |
| 499 | * message. This allows the host SW to find the stats request object. |
| 500 | * (Currently, this cookie is unused.) |
| 501 | * @param stats_info_list - stats confirmation message contents, containing |
| 502 | * a list of the stats requested from the target |
| 503 | */ |
| 504 | void |
| 505 | ol_txrx_fw_stats_handler(ol_txrx_pdev_handle pdev, |
| 506 | uint64_t cookie, uint8_t *stats_info_list); |
| 507 | |
| 508 | /** |
| 509 | * @brief Process a tx inspect message sent by the target. |
| 510 | * @details: |
| 511 | * TODO: update |
| 512 | * This tx inspect message indicates via the descriptor ID |
| 513 | * which tx frames are to be inspected by host. The host |
| 514 | * re-injects the packet back to the host for a number of |
| 515 | * cases. |
| 516 | * |
| 517 | * @param pdev - the data physical device that sent the tx frames |
| 518 | * (registered with HTT as a context pointer during attach time) |
| 519 | * @param num_msdus - how many MSDUs are referenced by the tx completion |
| 520 | * message |
| 521 | * @param tx_msdu_id_iterator - abstract method of finding the IDs for the |
| 522 | * individual MSDUs referenced by the tx completion message, via the |
| 523 | * htt_tx_compl_desc_id API function |
| 524 | */ |
| 525 | void |
| 526 | ol_tx_inspect_handler(ol_txrx_pdev_handle pdev, |
| 527 | int num_msdus, void *tx_desc_id_iterator); |
| 528 | |
| 529 | /** |
| 530 | * @brief Get the UAPSD mask. |
| 531 | * @details |
| 532 | * This function will return the UAPSD TID mask. |
| 533 | * |
| 534 | * @param txrx_pdev - pointer to the txrx pdev object |
| 535 | * @param peer_id - PeerID. |
| 536 | * @return uapsd mask value |
| 537 | */ |
| 538 | uint8_t |
| 539 | ol_txrx_peer_uapsdmask_get(struct ol_txrx_pdev_t *txrx_pdev, uint16_t peer_id); |
| 540 | |
| 541 | /** |
| 542 | * @brief Get the Qos Capable. |
| 543 | * @details |
| 544 | * This function will return the txrx_peer qos_capable. |
| 545 | * |
| 546 | * @param txrx_pdev - pointer to the txrx pdev object |
| 547 | * @param peer_id - PeerID. |
| 548 | * @return qos_capable value |
| 549 | */ |
| 550 | uint8_t |
| 551 | ol_txrx_peer_qoscapable_get(struct ol_txrx_pdev_t *txrx_pdev, uint16_t peer_id); |
| 552 | |
| 553 | /** |
| 554 | * @brief Process an rx indication message sent by the target. |
| 555 | * @details |
| 556 | * The target sends a rx indication message to the host as a |
| 557 | * notification that there are new rx frames available for the |
| 558 | * host to process. |
| 559 | * The HTT host layer locates the rx descriptors and rx frames |
| 560 | * associated with the indication, and calls this function to |
| 561 | * invoke the rx data processing on the new frames. |
| 562 | * All MPDUs referenced by a rx indication message belong to the |
| 563 | * same peer-TID. The frames indicated have been re-ordered by |
| 564 | * the target. |
| 565 | * |
| 566 | * @param pdev - the data physical device that received the frames |
| 567 | * (registered with HTT as a context pointer during attach time) |
| 568 | * @param rx_ind_msg - the network buffer holding the rx indication message |
| 569 | * @param peer_id - which peer sent this rx data |
| 570 | * @param tid - what (extended) traffic type the rx data is |
| 571 | * @param is_offload - is this an offload indication? |
| 572 | */ |
| 573 | void |
| 574 | ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev, |
| 575 | cdf_nbuf_t rx_ind_msg, |
| 576 | uint16_t peer_id, |
| 577 | uint8_t tid, uint8_t is_offload); |
| 578 | |
| 579 | #endif /* _OL_TXRX_HTT_API__H_ */ |