libdlib.h revision c87dd6b73ce417a1c364f2b85436755e8e3ade21
53089ab7c84db6fb76c16ca50076c147cda11757eschrock/*
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * CDDL HEADER START
53089ab7c84db6fb76c16ca50076c147cda11757eschrock *
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * The contents of this file are subject to the terms of the
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * Common Development and Distribution License (the "License").
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * You may not use this file except in compliance with the License.
53089ab7c84db6fb76c16ca50076c147cda11757eschrock *
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * or http://www.opensolaris.org/os/licensing.
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * See the License for the specific language governing permissions
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * and limitations under the License.
53089ab7c84db6fb76c16ca50076c147cda11757eschrock *
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * When distributing Covered Code, include this CDDL HEADER in each
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * If applicable, add the following below this CDDL HEADER, with the
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * fields enclosed by brackets "[]" replaced with your own identifying
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * information: Portions Copyright [yyyy] [name of copyright owner]
53089ab7c84db6fb76c16ca50076c147cda11757eschrock *
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * CDDL HEADER END
53089ab7c84db6fb76c16ca50076c147cda11757eschrock */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock/*
53089ab7c84db6fb76c16ca50076c147cda11757eschrock * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
ca0cc3918a1789fa839194af2a9245f801a06b1aMatthew Ahrens */
a6f561b4aee75d0d028e7b36b151c8ed8a86bc76Sašo Kiselkov
810e43b2eb0e320833671a403fdda51917e8b036Bill Pijewski#ifndef _LIBDLIB_H
b8289d24d866c1af02d7007348f7f057693c15d3Daniil Lunev#define _LIBDLIB_H
c3d26abc9ee97b4f60233556aadeb57e0bd30bb9Matthew Ahrens
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#ifdef __cplusplus
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern "C" {
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#endif
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#include <sys/types.h>
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#include <sys/ib/ib_types.h>
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#define MAXPKEYSTRSZ 968
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#define MAXPKEYLEN 6
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#define IBGUIDSTRLEN 16
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#define IBPORTSTRLEN 5
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#define DLADM_PART_FORCE_CREATE 0x1
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrocktypedef struct dladm_ib_attr_s {
53089ab7c84db6fb76c16ca50076c147cda11757eschrock datalink_id_t dia_physlinkid; /* IB Phys link datalink ID */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock datalink_id_t dia_partlinkid; /* IB Partition datalink ID */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ib_pkey_t dia_pkey; /* IB partitions P_Key */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock uint32_t dia_flags;
53089ab7c84db6fb76c16ca50076c147cda11757eschrock uint_t dia_portnum; /* IB Phys link's HCA port number */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock int dia_instance; /* IP over IB driver instance number */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ib_guid_t dia_hca_guid; /* IB HCA GUID */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ib_guid_t dia_port_guid; /* IB HCA Port GUID */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock uint_t dia_port_pkey_tbl_sz;
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ib_pkey_t *dia_port_pkeys; /* Ptr to the P_Key table */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock} dladm_ib_attr_t;
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrocktypedef struct dladm_ib_attr_s dladm_part_attr_t;
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrocktypedef enum {
53089ab7c84db6fb76c16ca50076c147cda11757eschrock DLADM_PART_UD_MODE = 0,
53089ab7c84db6fb76c16ca50076c147cda11757eschrock DLADM_PART_CM_MODE
53089ab7c84db6fb76c16ca50076c147cda11757eschrock} dladm_part_linkmode_t;
b515258426fed6c7311fd3f1dea697cfbd4085c6Matthew Ahrens
b515258426fed6c7311fd3f1dea697cfbd4085c6Matthew Ahrensextern dladm_status_t dladm_part_create(dladm_handle_t, datalink_id_t,
53089ab7c84db6fb76c16ca50076c147cda11757eschrock ib_pkey_t, uint32_t, char *, datalink_id_t *, dladm_arg_list_t *);
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern dladm_status_t dladm_part_delete(dladm_handle_t, datalink_id_t, int);
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern dladm_status_t dladm_part_up(dladm_handle_t, datalink_id_t, uint32_t);
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern dladm_status_t dladm_part_info(dladm_handle_t, datalink_id_t,
53089ab7c84db6fb76c16ca50076c147cda11757eschrock dladm_part_attr_t *, uint32_t);
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern dladm_status_t dladm_ib_info(dladm_handle_t, datalink_id_t,
53089ab7c84db6fb76c16ca50076c147cda11757eschrock dladm_ib_attr_t *, uint32_t);
53089ab7c84db6fb76c16ca50076c147cda11757eschrockextern void dladm_free_ib_info(dladm_ib_attr_t *);
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#ifdef __cplusplus
53089ab7c84db6fb76c16ca50076c147cda11757eschrock}
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#endif
53089ab7c84db6fb76c16ca50076c147cda11757eschrock
53089ab7c84db6fb76c16ca50076c147cda11757eschrock#endif /* _LIBDLIB_H */
53089ab7c84db6fb76c16ca50076c147cda11757eschrock