ldc.h revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* 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
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LDC_H
#define _LDC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/processor.h>
/* Types */
/* LDC transport mode */
typedef enum {
LDC_MODE_RAW, /* Raw mode */
LDC_MODE_UNRELIABLE, /* Unreliable packet mode */
LDC_MODE_RELIABLE, /* Reliable packet mode */
LDC_MODE_STREAM /* Reliable byte stream */
} ldc_mode_t;
/* LDC message payload sizes */
#define LDC_PAYLOAD_SIZE_RAW (LDC_PACKET_SIZE)
/* LDC Channel Status */
typedef enum {
LDC_OPEN, /* Channel open */
LDC_READY, /* Channel peer opened (hw-link-up) */
LDC_UP /* Channel UP - ready for data xfer */
} ldc_status_t;
/* Callback return values */
#define LDC_SUCCESS 0
#define LDC_FAILURE 1
/* LDC callback mode */
typedef enum {
LDC_CB_ENABLE, /* Enable callbacks */
LDC_CB_DISABLE /* Disable callbacks */
/* Callback events */
/* LDC device classes */
typedef enum {
LDC_DEV_BLK, /* block device, eg. vdc */
LDC_DEV_BLK_SVC, /* block device service, eg. vds */
LDC_DEV_NT, /* network device, eg. vnet */
LDC_DEV_NT_SVC, /* network service eg. vsw */
LDC_DEV_SERIAL /* serial device eg. vldc, vcc */
} ldc_dev_t;
/* Channel nexus registration */
typedef struct ldc_cnex {
int (*reg_chan)(); /* interface for channel register */
int (*unreg_chan)(); /* interface for channel unregister */
int (*add_intr)(); /* interface for adding interrupts */
int (*rem_intr)(); /* interface for removing interrupts */
int (*clr_intr)(); /* interface for clearing interrupts */
} ldc_cnex_t;
/* LDC attribute structure */
/*
* FIXME: Attribute passed in should be an MTU size
* Allocate the queue internally to ldc module to accomodate
* based on MTU size. For streaming mode, size can be zero.
*/
typedef struct ldc_attr {
} ldc_attr_t;
/* LDC memory cookie */
typedef struct ldc_mem_cookie {
/*
* LDC Memory Map Type
* Specifies how shared memory being created is shared with its
*/
/* LDC Memory Access Permissions */
/* LDC Memory Copy Direction */
typedef enum {
LDC_UNBOUND, /* Memory handle is unbound */
LDC_BOUND, /* Memory handle is bound */
LDC_MAPPED /* Memory handle is mapped */
/* LDC [dring] memory info */
typedef struct ldc_mem_info {
/* API functions */
#ifdef __cplusplus
}
#endif
#endif /* _LDC_H */