blob: a5f41b0a2e84950fd78b6634b40ec22f0dc18655 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Poddar, Siddartha78cac32016-12-29 20:08:34 +05302 * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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 Shahcbc6d722016-03-01 16:24:53 +053035#include <qdf_nbuf.h> /* qdf_nbuf_t */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080036#include "cds_sched.h"
Dhanashri Atre12a08392016-02-17 13:10:34 -080037#include "ol_txrx_ctrl_api.h"
Manjunathappa Prakash3454fd62016-04-01 08:52:06 -070038#include <cdp_txrx_peer_ops.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080039
40/**
41 * struct ol_rx_cached_buf - rx cached buffer
42 * @list: linked list
43 * @buf: skb buffer
44 */
45struct ol_rx_cached_buf {
46 struct list_head list;
Nirav Shahcbc6d722016-03-01 16:24:53 +053047 qdf_nbuf_t buf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080048};
49
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050struct txrx_rx_metainfo;
51
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053052typedef QDF_STATUS (*ol_rx_callback_fp)(void *p_cds_gctx,
Nirav Shahcbc6d722016-03-01 16:24:53 +053053 qdf_nbuf_t pDataBuff,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080054 uint8_t ucSTAId);
55
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080056/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080057 * @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 Shahcbc6d722016-03-01 16:24:53 +053081qdf_nbuf_t ol_txrx_osif_tso_segment(ol_txrx_vdev_handle txrx_vdev,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080082 int max_seg_payload_bytes,
Nirav Shahcbc6d722016-03-01 16:24:53 +053083 qdf_nbuf_t jumbo_tcp_frame);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084
Leo Chang98726762016-10-28 11:07:18 -070085qdf_nbuf_t ol_tx_data(void *data_vdev, qdf_nbuf_t skb);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080086
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080087void ol_rx_data_process(struct ol_txrx_peer_t *peer,
Nirav Shahcbc6d722016-03-01 16:24:53 +053088 qdf_nbuf_t rx_buf_list);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089
90void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer,
91 bool drop);
Poddar, Siddartha78cac32016-12-29 20:08:34 +053092/**
93 * ol_txrx_flush_cache_rx_queue() - flush cache rx queue frame
94 *
95 * Return: None
96 */
97void ol_txrx_flush_cache_rx_queue(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080098
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080099#endif /* _OL_TXRX_OSIF_API__H_ */