xref: /illumos-gate/usr/src/uts/common/io/chxge/com/tp.h (revision 2d6eb4a5e0a47d30189497241345dc5466bb68ab)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright (C) 2003-2005 Chelsio Communications.  All rights reserved.
24  */
25 
26 #ifndef CHELSIO_TP_H
27 #define CHELSIO_TP_H
28 
29 #include "common.h"
30 
31 #define TP_MAX_RX_COALESCING_SIZE 16224U
32 
33 struct tp_mib_statistics {
34 
35 	/* IP */
36 	u32 ipInReceive_hi;
37 	u32 ipInReceive_lo;
38 	u32 ipInHdrErrors_hi;
39 	u32 ipInHdrErrors_lo;
40 	u32 ipInAddrErrors_hi;
41 	u32 ipInAddrErrors_lo;
42 	u32 ipInUnknownProtos_hi;
43 	u32 ipInUnknownProtos_lo;
44 	u32 ipInDiscards_hi;
45 	u32 ipInDiscards_lo;
46 	u32 ipInDelivers_hi;
47 	u32 ipInDelivers_lo;
48 	u32 ipOutRequests_hi;
49 	u32 ipOutRequests_lo;
50 	u32 ipOutDiscards_hi;
51 	u32 ipOutDiscards_lo;
52 	u32 ipOutNoRoutes_hi;
53 	u32 ipOutNoRoutes_lo;
54 	u32 ipReasmTimeout;
55 	u32 ipReasmReqds;
56 	u32 ipReasmOKs;
57 	u32 ipReasmFails;
58 
59 	/* reserved */
60 	u32 reserved[8];
61 
62 	/* TCP */
63 	u32 tcpActiveOpens;
64 	u32 tcpPassiveOpens;
65 	u32 tcpAttemptFails;
66 	u32 tcpEstabResets;
67 	u32 tcpOutRsts;
68 	u32 tcpCurrEstab;
69 	u32 tcpInSegs_hi;
70 	u32 tcpInSegs_lo;
71 	u32 tcpOutSegs_hi;
72 	u32 tcpOutSegs_lo;
73 	u32 tcpRetransSeg_hi;
74 	u32 tcpRetransSeg_lo;
75 	u32 tcpInErrs_hi;
76 	u32 tcpInErrs_lo;
77 	u32 tcpRtoMin;
78 	u32 tcpRtoMax;
79 };
80 
81 struct petp;
82 struct tp_params;
83 
84 struct petp *t1_tp_create(adapter_t *adapter, struct tp_params *p);
85 void t1_tp_destroy(struct petp *tp);
86 
87 void t1_tp_intr_disable(struct petp *tp);
88 void t1_tp_intr_enable(struct petp *tp);
89 void t1_tp_intr_clear(struct petp *tp);
90 int t1_tp_intr_handler(struct petp *tp);
91 
92 void t1_tp_get_mib_statistics(adapter_t *adap, struct tp_mib_statistics *tps);
93 void t1_tp_set_udp_checksum_offload(struct petp *tp, int enable);
94 void t1_tp_set_tcp_checksum_offload(struct petp *tp, int enable);
95 void t1_tp_set_ip_checksum_offload(struct petp *tp, int enable);
96 int t1_tp_set_coalescing_size(struct petp *tp, unsigned int size);
97 int t1_tp_reset(struct petp *tp, struct tp_params *p, unsigned int tp_clk);
98 #endif
99