Merge commit '06307114472bd8aad5ff18ccdb8e25f128ae6652'
[unleashed.git] / kernel / drivers / net / nxge / nxge_hv.c
blob64f49de10137daa1a1af8198a87ba86850a1bb28
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * nxge_hv.c
30 * This file is Sun4v specific. It is the NXGE interface to the
31 * Sun4v Hypervisor.
35 #include <sys/nxge/nxge_impl.h>
36 #include <sys/nxge/nxge_hio.h>
39 * The HV VR functions are set up based on the
40 * the version number of the NIU API group.
41 * For version 2.0 and above, the NIU will be
42 * be referenced from the cfg-handle.
45 #if defined(sun4v)
47 void
48 nxge_hio_hv_init(nxge_t *nxge)
50 nxge_hio_data_t *nhd = (nxge_hio_data_t *)nxge->nxge_hw_p->hio;
52 nxhv_vr_fp_t *vr;
53 nxhv_dc_fp_t *tx;
54 nxhv_dc_fp_t *rx;
56 /* First, the HV VR functions. */
57 vr = &nhd->hio.vr;
59 /* HV Major 1 interfaces */
60 vr->assign = &hv_niu_vr_assign;
61 /* HV Major 2 interfaces */
62 vr->cfgh_assign = &hv_niu_cfgh_vr_assign;
64 vr->unassign = &hv_niu_vr_unassign;
65 vr->getinfo = &hv_niu_vr_getinfo;
67 // -------------------------------------------------------------
68 /* Find the transmit functions. */
69 tx = &nhd->hio.tx;
71 tx->assign = &hv_niu_tx_dma_assign;
72 tx->unassign = &hv_niu_tx_dma_unassign;
73 tx->get_map = &hv_niu_vr_get_txmap;
75 /* HV Major 1 interfaces */
76 tx->lp_conf = &hv_niu_tx_logical_page_conf;
77 tx->lp_info = &hv_niu_tx_logical_page_info;
78 /* HV Major 2 interfaces */
79 tx->lp_cfgh_conf = &hv_niu_cfgh_tx_logical_page_conf;
80 tx->lp_cfgh_info = &hv_niu_cfgh_tx_logical_page_info;
82 tx->getinfo = &hv_niu_vrtx_getinfo;
84 /* Now find the Receive functions. */
85 rx = &nhd->hio.rx;
87 rx->assign = &hv_niu_rx_dma_assign;
88 rx->unassign = &hv_niu_rx_dma_unassign;
89 rx->get_map = &hv_niu_vr_get_rxmap;
91 /* HV Major 1 interfaces */
92 rx->lp_conf = &hv_niu_rx_logical_page_conf;
93 rx->lp_info = &hv_niu_rx_logical_page_info;
94 /* HV Major 2 interfaces */
95 rx->lp_cfgh_conf = &hv_niu_cfgh_rx_logical_page_conf;
96 rx->lp_cfgh_info = &hv_niu_cfgh_rx_logical_page_info;
98 rx->getinfo = &hv_niu_vrrx_getinfo;
101 #endif /* defined(sun4v) */