1 /*
2  * Copyright (c) 2012, 2014-2019 The Linux Foundation. All rights reserved.
3  *
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 
19 /**
20  * @file ol_txrx_osif_api.h
21  * @brief Define the host data API functions called by the host OS shim SW.
22  */
23 #ifndef _OL_TXRX_OSIF_API__H_
24 #define _OL_TXRX_OSIF_API__H_
25 
26 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
27 #include "cds_sched.h"
28 #include "ol_txrx_ctrl_api.h"
29 #include <cdp_txrx_peer_ops.h>
30 
31 /**
32  * struct ol_rx_cached_buf - rx cached buffer
33  * @list: linked list
34  * @buf: skb buffer
35  */
36 struct ol_rx_cached_buf {
37 	struct list_head list;
38 	qdf_nbuf_t buf;
39 };
40 
41 struct txrx_rx_metainfo;
42 
43 /**
44  * @brief Divide a jumbo TCP frame into smaller segments.
45  * @details
46  *  For efficiency, the protocol stack above the WLAN driver may operate
47  *  on jumbo tx frames, which are larger than the 802.11 MTU.
48  *  The OSIF SW uses this txrx API function to divide the jumbo tx TCP frame
49  *  into a series of segment frames.
50  *  The segments are created as clones of the input jumbo frame.
51  *  The txrx SW generates a new encapsulation header (ethernet + IP + TCP)
52  *  for each of the output segment frames.  The exact format of this header,
53  *  e.g. 802.3 vs. Ethernet II, and IPv4 vs. IPv6, is chosen to match the
54  *  header format of the input jumbo frame.
55  *  The input jumbo frame is not modified.
56  *  After the ol_txrx_osif_tso_segment returns, the OSIF SW needs to perform
57  *  DMA mapping on each of the segment network buffers, and also needs to
58  *
59  * @param txrx_vdev - which virtual device will transmit the TSO segments
60  * @param max_seg_payload_bytes - the maximum size for the TCP payload of
61  *      each segment frame.
62  *      This does not include the ethernet + IP + TCP header sizes.
63  * @param jumbo_tcp_frame - jumbo frame which needs to be cloned+segmented
64  * @return
65  *      NULL if the segmentation fails, - OR -
66  *      a NULL-terminated list of segment network buffers
67  */
68 qdf_nbuf_t ol_txrx_osif_tso_segment(ol_txrx_vdev_handle txrx_vdev,
69 				    int max_seg_payload_bytes,
70 				    qdf_nbuf_t jumbo_tcp_frame);
71 
72 qdf_nbuf_t ol_tx_data(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb);
73 
74 void ol_rx_data_process(struct ol_txrx_peer_t *peer,
75 			qdf_nbuf_t rx_buf_list);
76 
77 void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer,
78 			     bool drop);
79 #endif /* _OL_TXRX_OSIF_API__H_ */
80