summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4v/sys
diff options
context:
space:
mode:
authorMike Christensen <Michael.Christensen@Sun.COM>2008-09-25 17:36:37 -0700
committerMike Christensen <Michael.Christensen@Sun.COM>2008-09-25 17:36:37 -0700
commit30588217a56ff2c9137248fb2e5065c4f0101459 (patch)
tree08b89b75fb363ad2fb24e241c8c3c64fdce586e1 /usr/src/uts/sun4v/sys
parent88294e09b5c27cbb12b6735e2fb247a86b76666d (diff)
downloadillumos-joyent-30588217a56ff2c9137248fb2e5065c4f0101459.tar.gz
PSARC 2008/568 Logical Domain's Domain Services
6689118 LDoms Domain Services (DS) extensions for user program API
Diffstat (limited to 'usr/src/uts/sun4v/sys')
-rw-r--r--usr/src/uts/sun4v/sys/Makefile6
-rw-r--r--usr/src/uts/sun4v/sys/ds.h3
-rw-r--r--usr/src/uts/sun4v/sys/ds_impl.h249
-rw-r--r--usr/src/uts/sun4v/sys/vlds.h245
4 files changed, 485 insertions, 18 deletions
diff --git a/usr/src/uts/sun4v/sys/Makefile b/usr/src/uts/sun4v/sys/Makefile
index 87babddd2c..e08bd67f5a 100644
--- a/usr/src/uts/sun4v/sys/Makefile
+++ b/usr/src/uts/sun4v/sys/Makefile
@@ -19,10 +19,9 @@
# CDDL HEADER END
#
-# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
#
# uts/sun4v/sys/Makefile
#
@@ -91,7 +90,8 @@ HDRS= \
prom_plat.h \
qcn.h \
soft_state.h \
- traptrace.h
+ traptrace.h \
+ vlds.h
CLOSED_HDRS= \
memtestio_ni.h \
diff --git a/usr/src/uts/sun4v/sys/ds.h b/usr/src/uts/sun4v/sys/ds.h
index cd5efa807f..e5f479638c 100644
--- a/usr/src/uts/sun4v/sys/ds.h
+++ b/usr/src/uts/sun4v/sys/ds.h
@@ -20,14 +20,13 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DS_H
#define _DS_H
-#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Domain Services Client Interface
diff --git a/usr/src/uts/sun4v/sys/ds_impl.h b/usr/src/uts/sun4v/sys/ds_impl.h
index 101918b903..8d0e68fbb3 100644
--- a/usr/src/uts/sun4v/sys/ds_impl.h
+++ b/usr/src/uts/sun4v/sys/ds_impl.h
@@ -20,19 +20,19 @@
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DS_IMPL_H
#define _DS_IMPL_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#ifdef __cplusplus
extern "C" {
#endif
+
+
/*
* The Domain Services Protocol
*
@@ -56,7 +56,7 @@ typedef struct ds_hdr {
* DS Fixed Message Types
*/
#define DS_INIT_REQ 0x0 /* initiate DS connection */
-#define DS_INIT_ACK 0x1 /* initiation acknowledgment */
+#define DS_INIT_ACK 0x1 /* initiation acknowledgement */
#define DS_INIT_NACK 0x2 /* initiation negative acknowledgment */
/*
@@ -79,10 +79,10 @@ typedef struct ds_init_nack {
* DS Message Types for Version 1.0
*/
#define DS_REG_REQ 0x3 /* register a service */
-#define DS_REG_ACK 0x4 /* register acknowledgment */
+#define DS_REG_ACK 0x4 /* register acknowledgement */
#define DS_REG_NACK 0x5 /* register failed */
#define DS_UNREG 0x6 /* unregister a service */
-#define DS_UNREG_ACK 0x7 /* unregister acknowledgment */
+#define DS_UNREG_ACK 0x7 /* unregister acknowledgement */
#define DS_UNREG_NACK 0x8 /* unregister failed */
#define DS_DATA 0x9 /* data message */
#define DS_NACK 0xa /* data error */
@@ -176,15 +176,32 @@ typedef struct ds_ldc {
ldc_status_t state; /* current LDC state */
} ds_ldc_t;
+typedef uint64_t ds_domain_hdl_t;
+
+#define DS_DHDL_INVALID ((ds_domain_hdl_t)0xffffffff)
+
+/* port flags */
+#define DS_PORT_MUTEX_INITED 0x1 /* mutexes inited? */
+
typedef struct ds_port {
- kmutex_t lock; /* port lock */
+ uint32_t flags; /* port flags */
+ kmutex_t lock; /* port and service state lock */
+ kmutex_t tx_lock; /* tx port lock */
+ kmutex_t rcv_lock; /* rcv port lock */
uint64_t id; /* port id from MD */
ds_port_state_t state; /* state of the port */
ds_ver_t ver; /* DS protocol version in use */
uint32_t ver_idx; /* index of version during handshake */
ds_ldc_t ldc; /* LDC for this port */
+ ds_domain_hdl_t domain_hdl; /* LDOMs domain hdl assoc. with port */
+ char *domain_name; /* LDOMs domain name assoc. with port */
} ds_port_t;
+#define IS_DS_PORT(port) 1 /* VBSC code compatability */
+#define PORTID(port) ((ulong_t)((port)->id))
+#define PTR_TO_LONG(ptr) ((uint64_t)(ptr))
+
+
/*
* A DS portset is a bitmap that represents a collection of DS
* ports. Each bit represent a particular port id. The current
@@ -192,7 +209,9 @@ typedef struct ds_port {
*/
typedef uint64_t ds_portset_t;
+#ifndef DS_MAX_PORTS
#define DS_MAX_PORTS ((sizeof (ds_portset_t)) * 8)
+#endif
#define DS_MAX_PORT_ID (DS_MAX_PORTS - 1)
#define DS_PORT_SET(port) (1UL << (port))
@@ -200,12 +219,25 @@ typedef uint64_t ds_portset_t;
#define DS_PORTSET_ADD(set, port) ((void)((set) |= DS_PORT_SET(port)))
#define DS_PORTSET_DEL(set, port) ((void)((set) &= ~DS_PORT_SET(port)))
#define DS_PORTSET_ISNULL(set) ((set) == 0)
+#define DS_PORTSET_SETNULL(set) ((void)((set) = 0))
#define DS_PORTSET_DUP(set1, set2) ((void)((set1) = (set2)))
+#define DS_PORTSET_NOT(set1, set2) ((void)((set1) = ~(set2)))
+#define DS_PORTSET_AND(set1, set2) ((void)((set1) &= (set2)))
+
+/*
+ * A DS event consists of a buffer on a port. We explictly use a link to
+ * enequeue/dequeue on non-Solaris environments. On Solaris we use taskq.
+ */
+typedef struct ds_event {
+ ds_port_t *port;
+ char *buf;
+ size_t buflen;
+} ds_event_t;
/*
* LDC Information
*/
-#define DS_STREAM_MTU 4096
+#define DS_STREAM_MTU 4096
/*
* Machine Description Constants
@@ -229,36 +261,75 @@ typedef enum {
DS_SVC_FREE, /* svc structure not in use */
DS_SVC_INACTIVE, /* svc not registered */
DS_SVC_REG_PENDING, /* register message sent */
- DS_SVC_ACTIVE /* register message acknowledged */
+ DS_SVC_ACTIVE, /* register message acknowledged */
+ DS_SVC_UNREG_PENDING /* unregister is pending */
} ds_svc_state_t;
+/* ds_svc flags bits */
+#define DSSF_ISCLIENT 0x0001 /* client service */
+#define DSSF_ISUSER 0x0002 /* user land service */
+#define DSSF_REGCB_VALID 0x0004 /* ops register callback is valid */
+#define DSSF_UNREGCB_VALID 0x0008 /* ops unregister callback is valid */
+#define DSSF_DATACB_VALID 0x0010 /* ops data callback is valid */
+#define DSSF_LOOPBACK 0x0020 /* loopback */
+#define DSSF_PEND_UNREG 0x0040 /* pending unregister */
+#define DSSF_ANYCB_VALID (DSSF_REGCB_VALID | DSSF_UNREGCB_VALID | \
+ DSSF_DATACB_VALID)
+#define DSSF_USERFLAGS (DSSF_ISCLIENT | DSSF_ISUSER | DSSF_ANYCB_VALID)
+
typedef struct ds_svc {
ds_capability_t cap; /* capability information */
ds_clnt_ops_t ops; /* client ops vector */
ds_svc_hdl_t hdl; /* handle assigned by DS */
+ ds_svc_hdl_t svc_hdl; /* remote svc hdl if client svc */
ds_svc_state_t state; /* current service state */
ds_ver_t ver; /* svc protocol version in use */
uint_t ver_idx; /* index into client version array */
ds_port_t *port; /* port for this service */
ds_portset_t avail; /* ports available to this service */
+ ds_portset_t tried; /* ports tried by this service */
+ int fixed; /* is svc fixed to port */
+ uint_t flags; /* service flags */
+ ds_cb_arg_t uarg; /* user arg for user callbacks */
+ uint_t drvi; /* driver instance */
+ void *drv_psp; /* driver per svc ptr */
} ds_svc_t;
+typedef struct ds_svcs {
+ ds_svc_t **tbl; /* ptr to table */
+ kmutex_t lock;
+ uint_t maxsvcs; /* size of the table */
+ uint_t nsvcs; /* current number of items */
+} ds_svcs_t;
+
#define DS_SVC_ISFREE(svc) ((svc == NULL) || (svc->state == DS_SVC_FREE))
+#ifndef DS_MAXSVCS_INIT
+#define DS_MAXSVCS_INIT 32
+#endif
/*
- * A service handle is a 64 bit value with two pieces of information
+ * A service handle is a 64 bit value with three pieces of information
* encoded in it. The upper 32 bits is the index into the table of
- * a particular service structure. The lower 32 bits is a counter
- * that is incremented each time a service structure is reused.
+ * a particular service structure. Bit 31 indicates whether the handle
+ * represents a service privider or service client. The lower 31 bits is
+ * a counter that is incremented each time a service structure is reused.
*/
#define DS_IDX_SHIFT 32
-#define DS_COUNT_MASK 0xfffffffful
+#define DS_COUNT_MASK 0x7fffffffull
+#define DS_HDL_ISCLIENT_BIT 0x80000000ull
#define DS_ALLOC_HDL(_idx, _count) (((uint64_t)_idx << DS_IDX_SHIFT) | \
((uint64_t)(_count + 1) & \
DS_COUNT_MASK))
#define DS_HDL2IDX(hdl) (hdl >> DS_IDX_SHIFT)
#define DS_HDL2COUNT(hdl) (hdl & DS_COUNT_MASK)
+#define DS_HDL_ISCLIENT(hdl) ((hdl) & DS_HDL_ISCLIENT_BIT)
+#define DS_HDL_SET_ISCLIENT(hdl) ((hdl) |= DS_HDL_ISCLIENT_BIT)
+
+#define DS_INVALID_INSTANCE (-1)
+
+/* enable/disable taskq processing */
+extern boolean_t ds_enabled;
/*
* DS Message Logging
@@ -326,6 +397,158 @@ typedef struct ds_log_entry {
#define DS_IS_POOL_ENTRY(ep) (((ep) >= ds_log_entry_pool) && \
((ep) <= &(ds_log_entry_pool[DS_LOG_NPOOL])))
+/* VBSC code compatability related defines */
+
+/* VBSC malloc/free are similar to user malloc/free */
+#define DS_MALLOC(size) kmem_zalloc(size, KM_SLEEP)
+#define DS_FREE(ptr, size) kmem_free(ptr, size)
+
+/* VBSC debug print needs newline, Solaris cmn_err doesn't */
+#define DS_EOL
+
+/*
+ * Results of checking version array with ds_vers_isvalid()
+ */
+typedef enum {
+ DS_VERS_OK,
+ DS_VERS_INCREASING_MAJOR_ERR,
+ DS_VERS_INCREASING_MINOR_ERR
+} ds_vers_check_t;
+
+/* System specific interfaces */
+extern void ds_sys_port_init(ds_port_t *port);
+extern void ds_sys_port_fini(ds_port_t *port);
+extern void ds_sys_drain_events(ds_port_t *port);
+extern int ds_sys_dispatch_func(void (func)(void *), void *arg);
+extern void ds_sys_ldc_init(ds_port_t *port);
+
+/* vlds cb access to svc structure */
+void ds_cbarg_get_hdl(ds_cb_arg_t arg, ds_svc_hdl_t *hdlp);
+void ds_cbarg_get_flags(ds_cb_arg_t arg, uint32_t *flagsp);
+void ds_cbarg_get_drv_info(ds_cb_arg_t arg, int *drvip);
+void ds_cbarg_get_drv_per_svc_ptr(ds_cb_arg_t arg, void **dpspp);
+void ds_cbarg_get_domain(ds_cb_arg_t arg, ds_domain_hdl_t *dhdlp);
+void ds_cbarg_get_service_id(ds_cb_arg_t arg, char **servicep);
+void ds_cbarg_set_drv_per_svc_ptr(ds_cb_arg_t arg, void *dpsp);
+int ds_hdl_get_cbarg(ds_svc_hdl_t hdl, ds_cb_arg_t *cbargp);
+void ds_cbarg_set_cookie(ds_svc_t *svc);
+int ds_is_my_hdl(ds_svc_hdl_t hdl, int instance);
+
+/* initialization functions */
+void ds_common_init(void);
+int ds_ldc_fini(ds_port_t *port);
+void ds_init_svcs_tbl(uint_t nentries);
+
+/* message sending functions */
+void ds_send_init_req(ds_port_t *port);
+int ds_send_unreg_req(ds_svc_t *svc);
+
+/* walker functions */
+typedef int (*svc_cb_t)(ds_svc_t *svc, void *arg);
+int ds_walk_svcs(svc_cb_t svc_cb, void *arg);
+int ds_svc_ismatch(ds_svc_t *svc, void *arg);
+int ds_svc_free(ds_svc_t *svc, void *arg);
+int ds_svc_register(ds_svc_t *svc, void *arg);
+
+/* service utilities */
+ds_svc_t *ds_alloc_svc(void);
+ds_svc_t *ds_sys_find_svc_by_id_port(char *svc_id, ds_port_t *port,
+ int is_client);
+ds_svc_t *ds_get_svc(ds_svc_hdl_t hdl);
+
+/* port utilities */
+void ds_port_common_init(ds_port_t *port);
+void ds_port_common_fini(ds_port_t *port, int is_fini);
+
+/* misc utilities */
+ds_vers_check_t ds_vers_isvalid(ds_ver_t *vers, int nvers);
+char *ds_errno_to_str(int ds_errno, char *ebuf);
+char *ds_strdup(char *str);
+boolean_t negotiate_version(int num_versions, ds_ver_t *sup_versionsp,
+ uint16_t req_major, uint16_t *new_majorp, uint16_t *new_minorp);
+
+/* log functions */
+int ds_log_add_msg(int32_t dest, uint8_t *msg, size_t sz);
+
+/* vlds driver interfaces to ds module */
+int ds_ucap_init(ds_capability_t *cap, ds_clnt_ops_t *ops, uint_t flags,
+ int instance, ds_svc_hdl_t *hdlp);
+int ds_unreg_hdl(ds_svc_hdl_t hdl);
+int ds_hdl_lookup(char *service, uint_t is_client, ds_svc_hdl_t *hdlp,
+ uint_t maxhdls, uint_t *nhdlsp);
+int ds_service_lookup(ds_svc_hdl_t hdl, char **servicep, uint_t *is_client);
+int ds_domain_lookup(ds_svc_hdl_t hdl, ds_domain_hdl_t *dhdlp);
+int ds_hdl_isready(ds_svc_hdl_t hdl, uint_t *is_ready);
+void ds_unreg_all(int instance);
+int ds_dom_name_to_hdl(char *domain_name, ds_domain_hdl_t *dhdlp);
+int ds_dom_hdl_to_name(ds_domain_hdl_t dhdl, char **domain_namep);
+int ds_add_port(uint64_t port_id, uint64_t ldc_id, ds_domain_hdl_t dhdl,
+ char *dom_name, int verbose);
+int ds_remove_port(uint64_t portid, int is_fini);
+
+/* ds_ucap_init flags */
+#define DS_UCAP_CLNT 0x0 /* Service is Client */
+#define DS_UCAP_SVC 0x1 /* Service is Server */
+
+/*
+ * Error buffer size for ds_errno_to_str
+ */
+#define DS_EBUFSIZE 80
+
+/*
+ * Debugging Features
+ */
+#ifdef DEBUG
+
+#define DS_DBG_BASIC 0x001
+#define DS_DBG_FLAG_LDC 0x002
+#define DS_DBG_FLAG_LOG 0x004
+#define DS_DBG_DUMP_LDC_MSG 0x008
+#define DS_DBG_FLAG_MD 0x010
+#define DS_DBG_FLAG_USR 0x020
+#define DS_DBG_FLAG_VLDS 0x040
+#define DS_DBG_FLAG_PRCL 0x080
+#define DS_DBG_FLAG_RCVQ 0x100
+#define DS_DBG_FLAG_LOOP 0x200
+
+#define DS_DBG if (ds_debug & DS_DBG_BASIC) cmn_err
+#define DS_DBG_LDC if (ds_debug & DS_DBG_FLAG_LDC) cmn_err
+#define DS_DBG_LOG if (ds_debug & DS_DBG_FLAG_LOG) cmn_err
+#define DS_DBG_MD if (ds_debug & DS_DBG_FLAG_MD) cmn_err
+#define DS_DBG_USR if (ds_debug & DS_DBG_FLAG_USR) cmn_err
+#define DS_DBG_VLDS if (ds_debug & DS_DBG_FLAG_VLDS) cmn_err
+#define DS_DBG_PRCL if (ds_debug & DS_DBG_FLAG_PRCL) cmn_err
+#define DS_DBG_RCVQ if (ds_debug & DS_DBG_FLAG_RCVQ) cmn_err
+#define DS_DBG_LOOP if (ds_debug & DS_DBG_FLAG_LOOP) cmn_err
+
+#define DS_DUMP_MSG(flags, buf, len) if (ds_debug & (flags)) \
+ ds_dump_msg(buf, len)
+
+extern uint_t ds_debug;
+void ds_dump_msg(void *buf, size_t len);
+
+#define DS_BADHDL1 (ds_svc_hdl_t)(0xdeadbed1deadbed1ull)
+#define DS_BADHDL2 (ds_svc_hdl_t)(0x2deadbed2deadbedull)
+
+#else /* DEBUG */
+
+#define DS_DBG if (0) cmn_err
+#define DS_DBG_LDC DS_DBG
+#define DS_DBG_LOG DS_DBG
+#define DS_DBG_MD DS_DBG
+#define DS_DBG_USR DS_DBG
+#define DS_DBG_VLDS DS_DBG
+#define DS_DBG_PRCL DS_DBG
+#define DS_DBG_RCVQ DS_DBG
+#define DS_DBG_LOOP DS_DBG
+#define DS_DUMP_MSG(flags, buf, len)
+#define DS_DUMP_LDC_MSG(buf, len)
+
+#define DS_BADHDL1 NULL
+#define DS_BADHDL2 NULL
+
+#endif /* DEBUG */
+
#ifdef __cplusplus
}
#endif
diff --git a/usr/src/uts/sun4v/sys/vlds.h b/usr/src/uts/sun4v/sys/vlds.h
new file mode 100644
index 0000000000..3ad53ca7d3
--- /dev/null
+++ b/usr/src/uts/sun4v/sys/vlds.h
@@ -0,0 +1,245 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_VLDS_H_
+#define _SYS_VLDS_H_
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * LDOMS Domain Services Device Driver
+ */
+
+/*
+ * ioctl info for vlds device
+ */
+
+#define VLDSIOC ('d' << 16 | 's' << 8)
+
+#define VLDS_SVC_REG (VLDSIOC | 1) /* Register DS Service */
+#define VLDS_UNREG_HDL (VLDSIOC | 2) /* Unregister DS Service by Handle */
+#define VLDS_HDL_LOOKUP (VLDSIOC | 3) /* Lookup DS Handle(s) by Service id */
+#define VLDS_DMN_LOOKUP (VLDSIOC | 4) /* Lookup DS Domain id by Handle */
+#define VLDS_SEND_MSG (VLDSIOC | 5) /* Send DS Message by Handle */
+#define VLDS_RECV_MSG (VLDSIOC | 6) /* Receive DS Message by Handle */
+#define VLDS_HDL_ISREADY (VLDSIOC | 7) /* Handle ready for data transfers */
+#define VLDS_DOM_NAM2HDL (VLDSIOC | 8) /* Domain Name to Handle translation */
+#define VLDS_DOM_HDL2NAM (VLDSIOC | 9) /* Handle ready for data transfers */
+
+/* vlds_reg_flags */
+#define VLDS_REG_CLIENT 0x01 /* Register as client */
+#define VLDS_REGCB_VALID 0x02 /* User supplied Register callback */
+#define VLDS_UNREGCB_VALID 0x04 /* User supplied Unregister callback */
+#define VLDS_DATACB_VALID 0x08 /* User supplied Data callback */
+#define VLDS_ANYCB_VALID (VLDS_REGCB_VALID | VLDS_UNREGCB_VALID | \
+ VLDS_DATACB_VALID)
+
+#define VLDS_MAX_VERS 20 /* Max no. of vlds_ver_t entries */
+
+/*
+ * The following are declared so that they are size-invariant.
+ */
+
+/* String arguments to ioctl */
+typedef struct vlds_string_arg {
+ uint64_t vlds_strp;
+ uint64_t vlds_strlen;
+} vlds_string_t;
+
+/* Version array (used by VLDS_SVC_REG) */
+typedef struct vlds_ver {
+ uint16_t vlds_major;
+ uint16_t vlds_minor;
+} vlds_ver_t;
+
+/* Capability structure (used by VLDS_SVC_REG) */
+typedef struct vlds_cap {
+ vlds_string_t vlds_service;
+ uint64_t vlds_nver;
+ uint64_t vlds_versp;
+} vlds_cap_t;
+
+/*
+ * VLDS_SVC_REG
+ */
+typedef struct vlds_svc_reg_arg {
+ uint64_t vlds_hdlp; /* DS Service Handle ptr. (returned) */
+ uint64_t vlds_capp; /* DS Capability Structure ptr. */
+ uint64_t vlds_reg_flags; /* DS reg flags */
+} vlds_svc_reg_arg_t;
+
+/*
+ * VLDS_UNREG_HDL
+ */
+typedef struct vlds_unreg_hdl_arg {
+ uint64_t vlds_hdl; /* DS Service Handle */
+} vlds_unreg_hdl_arg_t;
+
+/*
+ * VLDS_DMN_LOOKUP
+ */
+typedef struct vlds_dmn_lookup_arg {
+ uint64_t vlds_hdl; /* DS Service Handle */
+ uint64_t vlds_dhdlp; /* DS Domain hdl ptr. (returned) */
+} vlds_dmn_lookup_arg_t;
+
+/*
+ * VLDS_HDL_LOOKUP
+ */
+typedef struct vlds_hdl_lookup_arg {
+ vlds_string_t vlds_service; /* DS Service Name */
+ uint64_t vlds_isclient; /* DS Client flag */
+ uint64_t vlds_hdlsp; /* DS Handle array ptr */
+ uint64_t vlds_maxhdls; /* DS Max no. of hdls to return */
+ uint64_t vlds_nhdlsp; /* DS No. of hdls returned */
+} vlds_hdl_lookup_arg_t;
+
+/*
+ * VLDS_SEND_MSG
+ */
+typedef struct vlds_send_msg_arg {
+ uint64_t vlds_hdl; /* DS Service Handle */
+ uint64_t vlds_bufp; /* buffer */
+ uint64_t vlds_buflen; /* message length/buffer size */
+} vlds_send_msg_arg_t;
+
+/*
+ * VLDS_RECV_MSG
+ */
+typedef struct vlds_recv_msg_arg {
+ uint64_t vlds_hdl; /* DS Service Handle */
+ uint64_t vlds_bufp; /* buffer */
+ uint64_t vlds_buflen; /* message length/buffer size */
+ uint64_t vlds_msglenp; /* ptr to returned message length */
+} vlds_recv_msg_arg_t;
+
+/*
+ * VLDS_HDL_ISREADY
+ */
+typedef struct vlds_hdl_isready_arg {
+ uint64_t vlds_hdl; /* DS Service Handle */
+ uint64_t vlds_isreadyp; /* Ptr to isready flag */
+} vlds_hdl_isready_arg_t;
+
+/*
+ * VLDS_DOM_NAM2HDL
+ */
+typedef struct vlds_dom_nam2hdl_arg {
+ vlds_string_t vlds_domain_name; /* Domain Name string */
+ uint64_t vlds_dhdlp; /* ptr to returned Domain Handle */
+} vlds_dom_nam2hdl_arg_t;
+
+/*
+ * VLDS_DOM_HDL2NAM
+ */
+typedef struct vlds_dom_hdl2nam_arg {
+ uint64_t vlds_dhdl; /* Domain Handle */
+ vlds_string_t vlds_domain_name; /* returned Domain Name string */
+} vlds_dom_hdl2nam_arg_t;
+
+/*
+ * Machine Description Constants for vlds driver.
+ */
+#define VLDS_MD_ROOT_NODE_NAME "domain-services"
+#define VLDS_MD_PORT_NODE_NAME "domain-services-port"
+
+/*
+ * VLDS Sysevent defines.
+ * VLDS System Event Channel names are of the form:
+ * sun.com:vlds:pid<pid_number>
+ */
+#define VLDS_SYSEV_CHAN_FMT "sun.com:vlds:pid%06d"
+#define VLDS_SYSEV_MAX_CHAN_NAME 32
+
+#define EC_VLDS "EC_vlds" /* LDOMS Domain Services event class */
+
+/*
+ * EC_VLDS subclass definitions - supporting attributes (name/value pairs) are
+ * found in sys/sysevent/vlds.h
+ */
+#define ESC_VLDS_REGISTER "ESC_VLDS_register"
+#define ESC_VLDS_UNREGISTER "ESC_VLDS_unregister"
+#define ESC_VLDS_DATA "ESC_VLDS_data"
+
+/*
+ * Event type EC_VLDS
+ * Event Class - EC_VLDS
+ * Event Sub-Class - ESC_VLDS_REGISTER
+ * Event Publisher - SUNW:kern:[ds_module_name]
+ * Attribute Name - VLDS_HDL
+ * Attribute Type - SE_DATA_TYPE_UINT64
+ * Attribute Value - [Domain Service Handle]
+ * Attribute Name - VLDS_VER_MAJOR
+ * Attribute Type - SE_DATA_TYPE_UINT16
+ * Attribute Value - [major version of the DS interface]
+ * Attribute Name - VLDS_VER_MINOR
+ * Attribute Type - SE_DATA_TYPE_UINT16
+ * Attribute Value - [minor version of the DS interface]
+ * Attribute Name - VLDS_DOMAIN_HDL
+ * Attribute Type - SE_DATA_TYPE_UINT64
+ * Attribute Value - [Domain handle of registered service]
+ * Attribute Name - VLDS_SERVICE_ID
+ * Attribute Type - SE_DATA_TYPE_STRING
+ * Attribute Value - [Service name of registered service]
+ * Attribute Name - VLDS_ISCLIENT
+ * Attribute Type - SE_DATA_TYPE_BOOLEAN_VALUE
+ * Attribute Value - [Service is client or provider]
+ *
+ * Event Class - EC_VLDS
+ * Event Sub-Class - ESC_VLDS_UNREGISTER
+ * Event Publisher - SUNW:kern:[ds_module_name]
+ * Attribute Name - VLDS_HDL
+ * Attribute Type - SE_DATA_TYPE_UINT64
+ * Attribute Value - [Domain Service Handle]
+ *
+ * Event Class - EC_VLDS
+ * Event Sub-Class - ESC_VLDS_DATA
+ * Event Publisher - SUNW:kern:[ds_module_name]
+ * Attribute Name - VLDS_HDL
+ * Attribute Type - SE_DATA_TYPE_UINT64
+ * Attribute Value - [Domain Service Handle]
+ * Attribute Name - VLDS_DATA
+ * Attribute Type - SE_DATA_TYPE_BYTE_ARRAY
+ * Attribute Value - [Data array passed to user]
+ */
+
+#define VLDS_HDL "vlds_hdl" /* service handle */
+#define VLDS_VER_MAJOR "vlds_ver_major" /* major version */
+#define VLDS_VER_MINOR "vlds_ver_minor" /* minor version */
+#define VLDS_DOMAIN_HDL "vlds_domain_hdl" /* domain handle */
+#define VLDS_SERVICE_ID "vlds_service_id" /* service id */
+#define VLDS_ISCLIENT "vlds_isclient" /* service is client */
+#define VLDS_DATA "vlds_data" /* data buffer */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_VLDS_H_ */