net: wifi: rockchip: update broadcom drivers for kernel4.4
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rkwifi / bcmdhd / dhd_ip.h
1 /*
2  * Header file describing the common ip parser function.
3  *
4  * Provides type definitions and function prototypes used to parse ip packet.
5  *
6  * Copyright (C) 1999-2016, Broadcom Corporation
7  * 
8  *      Unless you and Broadcom execute a separate written software license
9  * agreement governing use of this software, this software is licensed to you
10  * under the terms of the GNU General Public License version 2 (the "GPL"),
11  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
12  * following added to such license:
13  * 
14  *      As a special exception, the copyright holders of this software give you
15  * permission to link this software with independent modules, and to copy and
16  * distribute the resulting executable under terms of your choice, provided that
17  * you also meet, for each linked independent module, the terms and conditions of
18  * the license of that module.  An independent module is a module which is not
19  * derived from this software.  The special exception does not apply to any
20  * modifications of the software.
21  * 
22  *      Notwithstanding the above, under no circumstances may you combine this
23  * software in any way with any other Broadcom software provided under a license
24  * other than the GPL, without Broadcom's express prior written consent.
25  *
26  *
27  * <<Broadcom-WL-IPTag/Open:>>
28  *
29  * $Id: dhd_ip.h 537119 2015-02-25 04:24:14Z $
30  */
31
32 #ifndef _dhd_ip_h_
33 #define _dhd_ip_h_
34
35 #ifdef DHDTCPACK_SUPPRESS
36 #include <dngl_stats.h>
37 #include <bcmutils.h>
38 #include <dhd.h>
39 #endif /* DHDTCPACK_SUPPRESS */
40
41 typedef enum pkt_frag
42 {
43         DHD_PKT_FRAG_NONE = 0,
44         DHD_PKT_FRAG_FIRST,
45         DHD_PKT_FRAG_CONT,
46         DHD_PKT_FRAG_LAST
47 } pkt_frag_t;
48
49 extern pkt_frag_t pkt_frag_info(osl_t *osh, void *p);
50
51 #ifdef DHDTCPACK_SUPPRESS
52 #define TCPACKSZMIN     (ETHER_HDR_LEN + IPV4_MIN_HEADER_LEN + TCP_MIN_HEADER_LEN)
53 /* Size of MAX possible TCP ACK packet. Extra bytes for IP/TCP option fields */
54 #define TCPACKSZMAX     (TCPACKSZMIN + 100)
55
56 /* Max number of TCP streams that have own src/dst IP addrs and TCP ports */
57 #define TCPACK_INFO_MAXNUM 4
58 #define TCPDATA_INFO_MAXNUM 4
59 #define TCPDATA_PSH_INFO_MAXNUM (8 * TCPDATA_INFO_MAXNUM)
60
61 #define TCPDATA_INFO_TIMEOUT 5000       /* Remove tcpdata_info if inactive for this time (in ms) */
62
63 #define DEFAULT_TCPACK_SUPP_RATIO 3
64 #ifndef CUSTOM_TCPACK_SUPP_RATIO
65 #define CUSTOM_TCPACK_SUPP_RATIO DEFAULT_TCPACK_SUPP_RATIO
66 #endif /* CUSTOM_TCPACK_SUPP_RATIO */
67
68 #define DEFAULT_TCPACK_DELAY_TIME 10 /* ms */
69 #ifndef CUSTOM_TCPACK_DELAY_TIME
70 #define CUSTOM_TCPACK_DELAY_TIME DEFAULT_TCPACK_DELAY_TIME
71 #endif /* CUSTOM_TCPACK_DELAY_TIME */
72
73 extern int dhd_tcpack_suppress_set(dhd_pub_t *dhdp, uint8 on);
74 extern void dhd_tcpack_info_tbl_clean(dhd_pub_t *dhdp);
75 extern int dhd_tcpack_check_xmit(dhd_pub_t *dhdp, void *pkt);
76 extern bool dhd_tcpack_suppress(dhd_pub_t *dhdp, void *pkt);
77 extern bool dhd_tcpdata_info_get(dhd_pub_t *dhdp, void *pkt);
78 extern bool dhd_tcpack_hold(dhd_pub_t *dhdp, void *pkt, int ifidx);
79 /* #define DHDTCPACK_SUP_DBG */
80 #if defined(DEBUG_COUNTER) && defined(DHDTCPACK_SUP_DBG)
81 extern counter_tbl_t tack_tbl;
82 #endif /* DEBUG_COUNTER && DHDTCPACK_SUP_DBG */
83 #endif /* DHDTCPACK_SUPPRESS */
84
85 #endif /* _dhd_ip_h_ */