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