xref: /titanic_51/usr/src/uts/common/io/hxge/hpi_vmac.h (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _HPI_MAC_H
27 #define	_HPI_MAC_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #include <hpi.h>
34 #include <hxge_vmac_hw.h>
35 
36 hpi_status_t hpi_tx_vmac_reset(hpi_handle_t handle);
37 hpi_status_t hpi_rx_vmac_reset(hpi_handle_t handle);
38 hpi_status_t hpi_vmac_tx_config(hpi_handle_t handle, config_op_t op,
39     uint64_t config, uint16_t max_frame_length);
40 hpi_status_t hpi_vmac_rx_config(hpi_handle_t handle, config_op_t op,
41     uint64_t config, uint16_t max_frame_length);
42 hpi_status_t hpi_vmac_clear_rx_int_stat(hpi_handle_t handle);
43 hpi_status_t hpi_vmac_clear_tx_int_stat(hpi_handle_t handle);
44 hpi_status_t hpi_pfc_set_rx_int_stat_mask(hpi_handle_t handle,
45     boolean_t overflow_cnt, boolean_t frame_cnt);
46 hpi_status_t hpi_pfc_set_tx_int_stat_mask(hpi_handle_t handle,
47     boolean_t overflow_cnt, boolean_t frame_cnt);
48 hpi_status_t hpi_vmac_rx_set_framesize(hpi_handle_t handle,
49     uint16_t max_frame_length);
50 
51 #define	CFG_VMAC_TX_EN			0x00000001
52 #define	CFG_VMAC_TX_CRC_INSERT		0x00000002
53 #define	CFG_VMAC_TX_PAD			0x00000004
54 
55 #define	CFG_VMAC_RX_EN			0x00000001
56 #define	CFG_VMAC_RX_CRC_CHECK_DISABLE	0x00000002
57 #define	CFG_VMAC_RX_STRIP_CRC		0x00000004
58 #define	CFG_VMAC_RX_PASS_FLOW_CTRL_FR	0x00000008
59 #define	CFG_VMAC_RX_PROMIXCUOUS_GROUP	0x00000010
60 #define	CFG_VMAC_RX_PROMISCUOUS_MODE	0x00000020
61 #define	CFG_VMAC_RX_LOOP_BACK		0x00000040
62 
63 #ifdef	__cplusplus
64 }
65 #endif
66 
67 #endif	/* _HPI_MAC_H */
68