xref: /titanic_52/usr/src/uts/common/io/chxge/com/mc5.h (revision 27c48ed935c6a5f6015c6534b98e3090b1ddfdb6)
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"	/* mc5.h */
27 
28 #ifndef CHELSIO_MC5_H
29 #define CHELSIO_MC5_H
30 
31 #include "common.h"
32 
33 struct pemc5;
34 
35 struct pemc5_intr_counts {
36 	unsigned int hit_out_active_region_err;
37 	unsigned int hit_in_active_region_err;
38 	unsigned int hit_in_routing_region_err;
39 	unsigned int miss_err;
40 	unsigned int lip_equal_zero_err;
41 	unsigned int lip_miss_err;
42 	unsigned int parity_err;
43 	unsigned int active_region_full_err;
44 	unsigned int next_free_addr_srch_err;
45 	unsigned int syn_cookie;
46 	unsigned int syn_cookie_bad_message;
47 	unsigned int syn_cookie_off_message;
48 	unsigned int receive_unknown_cmd;
49 	unsigned int parity_in_request_q_err;
50 	unsigned int parity_in_dispatch_q_err;
51 	unsigned int del_and_act_is_empty;
52 };
53 
54 #define MC5_LIP_NUM_OF_ENTRIES  64
55 
56 /* These must be non-0 */
57 #define MC5_MODE_144_BIT     1
58 #define MC5_MODE_72_BIT      2
59 
60 struct pemc5 *t1_mc5_create(adapter_t *adapter, int mode);
61 int t1_mc5_init(struct pemc5 *mc5, unsigned int nservers,
62 		unsigned int nroutes, int parity, int syn);
63 void t1_mc5_destroy(struct pemc5 *mc5);
64 
65 int t1_read_mc5_range(struct pemc5 *mc5, unsigned int start,
66 		unsigned int n, u32 *buf);
67 const struct pemc5_intr_counts *t1_mc5_get_intr_counts(struct pemc5 *mc5);
68 
69 void t1_mc5_intr_enable(struct pemc5 *mc5);
70 void t1_mc5_intr_disable(struct pemc5 *mc5);
71 void t1_mc5_intr_clear(struct pemc5 *mc5);
72 void t1_mc5_intr_handler(struct pemc5 *mc5);
73 
74 void t1_mc5_lip_write_entries(struct pemc5 *mc5);
75 int t1_mc5_lip_add_entry(struct pemc5 *mc5, u32 lip);
76 void t1_mc5_lip_clear_entries(struct pemc5 *mc5);
77 
78 unsigned int t1_mc5_get_tcam_size(struct pemc5 *mc5);
79 unsigned int t1_mc5_get_tcam_rtbl_base(struct pemc5 *mc5);
80 unsigned int t1_mc5_get_tcam_rtbl_size(struct pemc5 *mc5);
81 unsigned int t1_mc5_get_tcam_server_base(struct pemc5 *mc5);
82 unsigned int t1_mc5_get_tcam_server_size(struct pemc5 *mc5);
83 
84 #endif
85