Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Poddar, Siddarth | a78cac3 | 2016-12-29 20:08:34 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -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 | /** |
| 29 | * @file ol_txrx_osif_api.h |
| 30 | * @brief Define the host data API functions called by the host OS shim SW. |
| 31 | */ |
| 32 | #ifndef _OL_TXRX_OSIF_API__H_ |
| 33 | #define _OL_TXRX_OSIF_API__H_ |
| 34 | |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 35 | #include <qdf_nbuf.h> /* qdf_nbuf_t */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 36 | #include "cds_sched.h" |
Dhanashri Atre | 12a0839 | 2016-02-17 13:10:34 -0800 | [diff] [blame] | 37 | #include "ol_txrx_ctrl_api.h" |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 38 | #include <cdp_txrx_peer_ops.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * struct ol_rx_cached_buf - rx cached buffer |
| 42 | * @list: linked list |
| 43 | * @buf: skb buffer |
| 44 | */ |
| 45 | struct ol_rx_cached_buf { |
| 46 | struct list_head list; |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 47 | qdf_nbuf_t buf; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 48 | }; |
| 49 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 50 | struct txrx_rx_metainfo; |
| 51 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 52 | typedef QDF_STATUS (*ol_rx_callback_fp)(void *p_cds_gctx, |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 53 | qdf_nbuf_t pDataBuff, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 54 | uint8_t ucSTAId); |
| 55 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 56 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 57 | * @brief Divide a jumbo TCP frame into smaller segments. |
| 58 | * @details |
| 59 | * For efficiency, the protocol stack above the WLAN driver may operate |
| 60 | * on jumbo tx frames, which are larger than the 802.11 MTU. |
| 61 | * The OSIF SW uses this txrx API function to divide the jumbo tx TCP frame |
| 62 | * into a series of segment frames. |
| 63 | * The segments are created as clones of the input jumbo frame. |
| 64 | * The txrx SW generates a new encapsulation header (ethernet + IP + TCP) |
| 65 | * for each of the output segment frames. The exact format of this header, |
| 66 | * e.g. 802.3 vs. Ethernet II, and IPv4 vs. IPv6, is chosen to match the |
| 67 | * header format of the input jumbo frame. |
| 68 | * The input jumbo frame is not modified. |
| 69 | * After the ol_txrx_osif_tso_segment returns, the OSIF SW needs to perform |
| 70 | * DMA mapping on each of the segment network buffers, and also needs to |
| 71 | * |
| 72 | * @param txrx_vdev - which virtual device will transmit the TSO segments |
| 73 | * @param max_seg_payload_bytes - the maximum size for the TCP payload of |
| 74 | * each segment frame. |
| 75 | * This does not include the ethernet + IP + TCP header sizes. |
| 76 | * @param jumbo_tcp_frame - jumbo frame which needs to be cloned+segmented |
| 77 | * @return |
| 78 | * NULL if the segmentation fails, - OR - |
| 79 | * a NULL-terminated list of segment network buffers |
| 80 | */ |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 81 | qdf_nbuf_t ol_txrx_osif_tso_segment(ol_txrx_vdev_handle txrx_vdev, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 82 | int max_seg_payload_bytes, |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 83 | qdf_nbuf_t jumbo_tcp_frame); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | |
Leo Chang | 9872676 | 2016-10-28 11:07:18 -0700 | [diff] [blame] | 85 | qdf_nbuf_t ol_tx_data(void *data_vdev, qdf_nbuf_t skb); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 86 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | void ol_rx_data_process(struct ol_txrx_peer_t *peer, |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 88 | qdf_nbuf_t rx_buf_list); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | |
| 90 | void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer, |
| 91 | bool drop); |
Poddar, Siddarth | a78cac3 | 2016-12-29 20:08:34 +0530 | [diff] [blame] | 92 | /** |
| 93 | * ol_txrx_flush_cache_rx_queue() - flush cache rx queue frame |
| 94 | * |
| 95 | * Return: None |
| 96 | */ |
| 97 | void ol_txrx_flush_cache_rx_queue(void); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 98 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 99 | #endif /* _OL_TXRX_OSIF_API__H_ */ |