xref: /illumos-gate/usr/src/uts/common/io/nxge/nxge_hv.c (revision 46b592853d0f4f11781b6b0a7533f267c6aee132)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * nxge_hv.c
29  *
30  * This file is Sun4v specific.  It is the NXGE interface to the
31  * Sun4v Hypervisor.
32  *
33  */
34 
35 #include <sys/nxge/nxge_impl.h>
36 #include <sys/nxge/nxge_hio.h>
37 
38 #if defined(sun4v)
39 
40 void
41 nxge_hio_hv_init(nxge_t *nxge)
42 {
43 	nxge_hio_data_t *nhd = (nxge_hio_data_t *)nxge->nxge_hw_p->hio;
44 
45 	nxhv_vr_fp_t *vr;
46 	nxhv_dc_fp_t *tx;
47 	nxhv_dc_fp_t *rx;
48 
49 	/* First, the HV VR functions. */
50 	vr = &nhd->hio.vr;
51 
52 	vr->assign = &hv_niu_vr_assign;
53 	vr->unassign = &hv_niu_vr_unassign;
54 	vr->getinfo = &hv_niu_vr_getinfo;
55 
56 	// -------------------------------------------------------------
57 	/* Find the transmit functions. */
58 	tx = &nhd->hio.tx;
59 
60 	tx->assign = &hv_niu_tx_dma_assign;
61 	tx->unassign = &hv_niu_tx_dma_unassign;
62 	tx->get_map = &hv_niu_vr_get_txmap;
63 
64 	tx->lp_conf = &hv_niu_tx_logical_page_conf;
65 	tx->lp_info = &hv_niu_tx_logical_page_info;
66 
67 	tx->getinfo = &hv_niu_vrtx_getinfo;
68 
69 	// -------------------------------------------------------------
70 	/* Now find the Receive functions. */
71 	rx = &nhd->hio.rx;
72 
73 	rx->assign = &hv_niu_rx_dma_assign;
74 	rx->unassign = &hv_niu_rx_dma_unassign;
75 	rx->get_map = &hv_niu_vr_get_rxmap;
76 
77 	rx->lp_conf = &hv_niu_rx_logical_page_conf;
78 	rx->lp_info = &hv_niu_rx_logical_page_info;
79 
80 	rx->getinfo = &hv_niu_vrrx_getinfo;
81 }
82 
83 #endif /* defined(sun4v) */
84