1*3dec9fcdSqs /*
2*3dec9fcdSqs  * CDDL HEADER START
3*3dec9fcdSqs  *
4*3dec9fcdSqs  * The contents of this file are subject to the terms of the
5*3dec9fcdSqs  * Common Development and Distribution License (the "License").
6*3dec9fcdSqs  * You may not use this file except in compliance with the License.
7*3dec9fcdSqs  *
8*3dec9fcdSqs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3dec9fcdSqs  * or http://www.opensolaris.org/os/licensing.
10*3dec9fcdSqs  * See the License for the specific language governing permissions
11*3dec9fcdSqs  * and limitations under the License.
12*3dec9fcdSqs  *
13*3dec9fcdSqs  * When distributing Covered Code, include this CDDL HEADER in each
14*3dec9fcdSqs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3dec9fcdSqs  * If applicable, add the following below this CDDL HEADER, with the
16*3dec9fcdSqs  * fields enclosed by brackets "[]" replaced with your own identifying
17*3dec9fcdSqs  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3dec9fcdSqs  *
19*3dec9fcdSqs  * CDDL HEADER END
20*3dec9fcdSqs  */
21*3dec9fcdSqs 
22*3dec9fcdSqs /*
23*3dec9fcdSqs  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*3dec9fcdSqs  * Use is subject to license terms.
25*3dec9fcdSqs  */
26*3dec9fcdSqs 
27*3dec9fcdSqs #ifndef _HXGE_CLASSIFY_H
28*3dec9fcdSqs #define	_HXGE_CLASSIFY_H
29*3dec9fcdSqs 
30*3dec9fcdSqs #ifdef __cplusplus
31*3dec9fcdSqs extern "C" {
32*3dec9fcdSqs #endif
33*3dec9fcdSqs 
34*3dec9fcdSqs #include <hxge_pfc.h>
35*3dec9fcdSqs #include <hxge_pfc_hw.h>
36*3dec9fcdSqs #include <hpi_pfc.h>
37*3dec9fcdSqs 
38*3dec9fcdSqs 
39*3dec9fcdSqs /*
40*3dec9fcdSqs  * The following are the user configurable ether types. Refer to
41*3dec9fcdSqs  * /usr/include/sys/ethernet.h
42*3dec9fcdSqs  *
43*3dec9fcdSqs  * ETHERTYPE_PUP	(0x0200)
44*3dec9fcdSqs  * ETHERTYPE_802_MIN	(0x0600)
45*3dec9fcdSqs  * ETHERTYPE_IP		(0x0800)
46*3dec9fcdSqs  * ETHERTYPE_ARP	(0x0806)
47*3dec9fcdSqs  * ETHERTYPE_REVARP	(0x8035)
48*3dec9fcdSqs  * ETHERTYPE_AT		(0x809b)
49*3dec9fcdSqs  * ETHERTYPE_AARP	(0x80f3)
50*3dec9fcdSqs  * ETHERTYPE_IPV6	(0x86dd)
51*3dec9fcdSqs  * ETHERTYPE_SLOW	(0x8809)
52*3dec9fcdSqs  * ETHERTYPE_PPPOED	(0x8863)
53*3dec9fcdSqs  * ETHERTYPE_PPPOES	(0x8864)
54*3dec9fcdSqs  * ETHERTYPE_MAX	(0xffff)
55*3dec9fcdSqs  */
56*3dec9fcdSqs 
57*3dec9fcdSqs /*
58*3dec9fcdSqs  * Used for ip class tcam key config
59*3dec9fcdSqs  */
60*3dec9fcdSqs #define	HXGE_CLASS_TCAM_LOOKUP		0x10000
61*3dec9fcdSqs #define	HXGE_CLASS_DISCARD		0x20000
62*3dec9fcdSqs #define	HXGE_CLASS_VALID		0x40000
63*3dec9fcdSqs #define	HXGE_CLASS_ETHER_TYPE_MASK	0x0FFFF
64*3dec9fcdSqs 
65*3dec9fcdSqs typedef struct _tcam_flow_spec {
66*3dec9fcdSqs 	hxge_tcam_entry_t tce;
67*3dec9fcdSqs 	uint64_t flags;
68*3dec9fcdSqs 	uint64_t user_info;
69*3dec9fcdSqs } tcam_flow_spec_t, *p_tcam_flow_spec_t;
70*3dec9fcdSqs 
71*3dec9fcdSqs typedef struct {
72*3dec9fcdSqs 	uint16_t	ether_type;
73*3dec9fcdSqs 	int		count;	/* How many TCAM entries using this class. */
74*3dec9fcdSqs } hxge_class_usage_t;
75*3dec9fcdSqs 
76*3dec9fcdSqs #define	HXGE_PFC_HW_RESET	0x1
77*3dec9fcdSqs #define	HXGE_PFC_HW_INIT	0x2
78*3dec9fcdSqs #define	HXGE_PFC_SW_INIT	0x4
79*3dec9fcdSqs 
80*3dec9fcdSqs typedef struct _hxge_classify {
81*3dec9fcdSqs 	uint32_t 		tcam_size;
82*3dec9fcdSqs 	uint32_t		n_used;
83*3dec9fcdSqs 	uint32_t 		state;
84*3dec9fcdSqs 	p_hxge_pfc_stats_t	pfc_stats;
85*3dec9fcdSqs 
86*3dec9fcdSqs 	tcam_flow_spec_t	*tcam_entries;
87*3dec9fcdSqs 	uint8_t			tcam_location;
88*3dec9fcdSqs 	hxge_class_usage_t	class_usage[TCAM_CLASS_MAX];
89*3dec9fcdSqs } hxge_classify_t, *p_hxge_classify_t;
90*3dec9fcdSqs 
91*3dec9fcdSqs #ifdef	__cplusplus
92*3dec9fcdSqs }
93*3dec9fcdSqs #endif
94*3dec9fcdSqs 
95*3dec9fcdSqs #endif	/* _HXGE_CLASSIFY_H */
96