rsm.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_RSM_RSM_H
#define _SYS_RSM_RSM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define RSM_IOCTL_CONTROLLER 0x00
#define RSM_IOCTL_EXPORT_SEG 0x10
#define RSM_IOCTL_IMPORT_SEG 0x20
#define RSM_IOCTL_QUEUE 0x30
#define RSM_IOCTL_TOPOLOGY 0x40
#define RSM_IOCTL_BAR 0x50
#define RSM_IOCTL_ERRCNT 0x60
#define RSM_IOCTL_BELL 0x70
#define RSM_IOCTL_IOVEC 0x80
#define RSM_IOCTL_MAP_ADDR 0x90
#define RSM_MAX_IOVLEN 4
/*
* DEBUG message categories
* 0xABCD: A=module, B=functionality C=operation D=misc
*
*/
#define RSM_MODULE_ALL 0xF000
#define RSM_FUNC_ALL 0x0F00
#define RSM_OPER_ALL 0x00F0
/*
* DEBUG message levels
*/
#define RSM_DEBUG_VERBOSE 6
#define RSM_DEBUG_LVL2 5
#define RSM_DEBUG_LVL1 4
#define RSM_DEBUG 3
#define RSM_NOTICE 2
#define RSM_WARNING 1
#define RSM_ERR 0
#ifdef DEBUG
#else
#define DBG_PRINTF(message)
#endif /* DEBUG */
typedef uint16_t rsm_gnum_t;
/*
* data struct used between rsm base library and kernel agent for IOCTLS
*/
typedef struct {
/* following fields should be identical to rsmapi_controller_attr_t */
/* following fields are for internal use */
#ifdef _SYSCALL32
typedef struct {
/* following fields should be identical to rsmapi_controller_attr_t */
/* the following fields are for internal use */
#endif
/* kernel agent equivalents of rsm_iovec_t and rsm_scat_gath_t */
typedef struct {
int io_type;
union {
} local;
#ifdef _SYSCALL32
typedef struct {
#endif
/*
* The following 2 structures represent the scatter-gather structures used
* within the kernel agent. Note that the io_residual_count and the flags fields
* fields must be contiguous within these structures due to this assumption
* made by the kernel agent when updating them in ddi_copyout.
*/
typedef struct {
#ifdef _SYSCALL32
typedef struct {
#endif
/*
* Define the number of pollfds upto which we don't allocate memory on heap
*
*/
#define RSM_MAX_POLLFDS 4
typedef struct {
int fdsidx; /* index of the fd in the pollfd array */
int revent; /* returned event */
#ifdef _SYSCALL32
typedef struct {
#endif
typedef struct {
#ifdef _SYSCALL32
typedef struct {
#endif
typedef struct {
int cnum;
int cname_len;
int len; /* size as well */
int off;
int acl_len;
#ifdef _SYSCALL32
typedef struct {
#endif
/*
* Remote messaging structures
*/
/* cookie to exchange between sender and receiver */
typedef union {
struct {
} ic;
/* IPC msg types */
#define RSMIPC_MSG_SEGCONNECT 0 /* connect seg */
#define RSMIPC_MSG_IMPORTING 2
#define RSMIPC_MSG_NOTIMPORTING 3
/*
* Dummy message header
*/
typedef struct rsmipc_msg {
int rsmipc_version;
int rsmipc_type;
#define RSM_NO_REPLY 0 /* for rsmipc_send when no reply is expected */
/*
* Request message of connect operation
*/
typedef struct rsmipc_request {
void *rsmipc_segment_cookie;
/*
* Message format of the flow control messages
*/
typedef struct rsmipc_controlmsg {
/*
* Reply message for connect operation
*/
typedef struct rsmipc_reply {
short rsmipc_status; /* error code of remote call */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_RSM_RSM_H */