xref: /titanic_41/usr/src/uts/common/io/chxge/com/tp.h (revision 3441f6a1af86b9b2f883f3323bf02c9dd0f7a94d)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* tp.h */
27 
28 #ifndef CHELSIO_TP_H
29 #define CHELSIO_TP_H
30 
31 #include "common.h"
32 
33 #define TP_MAX_RX_COALESCING_SIZE 16224U
34 
35 struct tp_mib_statistics {
36 
37 	/* IP */
38 	u32 ipInReceive_hi;
39 	u32 ipInReceive_lo;
40 	u32 ipInHdrErrors_hi;
41 	u32 ipInHdrErrors_lo;
42 	u32 ipInAddrErrors_hi;
43 	u32 ipInAddrErrors_lo;
44 	u32 ipInUnknownProtos_hi;
45 	u32 ipInUnknownProtos_lo;
46 	u32 ipInDiscards_hi;
47 	u32 ipInDiscards_lo;
48 	u32 ipInDelivers_hi;
49 	u32 ipInDelivers_lo;
50 	u32 ipOutRequests_hi;
51 	u32 ipOutRequests_lo;
52 	u32 ipOutDiscards_hi;
53 	u32 ipOutDiscards_lo;
54 	u32 ipOutNoRoutes_hi;
55 	u32 ipOutNoRoutes_lo;
56 	u32 ipReasmTimeout;
57 	u32 ipReasmReqds;
58 	u32 ipReasmOKs;
59 	u32 ipReasmFails;
60 
61 	/* reserved */
62 	u32 reserved[8];
63 
64 	/* TCP */
65 	u32 tcpActiveOpens;
66 	u32 tcpPassiveOpens;
67 	u32 tcpAttemptFails;
68 	u32 tcpEstabResets;
69 	u32 tcpOutRsts;
70 	u32 tcpCurrEstab;
71 	u32 tcpInSegs_hi;
72 	u32 tcpInSegs_lo;
73 	u32 tcpOutSegs_hi;
74 	u32 tcpOutSegs_lo;
75 	u32 tcpRetransSeg_hi;
76 	u32 tcpRetransSeg_lo;
77 	u32 tcpInErrs_hi;
78 	u32 tcpInErrs_lo;
79 	u32 tcpRtoMin;
80 	u32 tcpRtoMax;
81 };
82 
83 struct petp;
84 struct tp_params;
85 
86 struct petp *t1_tp_create(adapter_t *adapter, struct tp_params *p);
87 void t1_tp_destroy(struct petp *tp);
88 
89 void t1_tp_intr_disable(struct petp *tp);
90 void t1_tp_intr_enable(struct petp *tp);
91 void t1_tp_intr_clear(struct petp *tp);
92 int t1_tp_intr_handler(struct petp *tp);
93 
94 void t1_tp_get_mib_statistics(adapter_t *adap, struct tp_mib_statistics *tps);
95 void t1_tp_set_udp_checksum_offload(struct petp *tp, int enable);
96 void t1_tp_set_tcp_checksum_offload(struct petp *tp, int enable);
97 void t1_tp_set_ip_checksum_offload(struct petp *tp, int enable);
98 int t1_tp_set_coalescing_size(struct petp *tp, unsigned int size);
99 int t1_tp_reset(struct petp *tp, struct tp_params *p, unsigned int tp_clk);
100 #endif
101