rsmka_path_int.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 (c) 1999-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_RSM_RSMKA_PATH_INT_H
#define _SYS_RSM_RSMKA_PATH_INT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Taskq setup
* Only one taskq thread is created and only one task is executed
* the task is executed as an infinite loop
*/
#define RSMKA_ONE_THREAD 1
#define RSMKA_ONE_TASK 1
/* Path (path_t) States */
#define RSMKA_PATH_DOWN 1
#define RSMKA_PATH_UP 2
#define RSMKA_PATH_ACTIVE 3
#define RSMKA_PATH_GOING_DOWN 4
#define RSMKA_OPCODE_TYPES 2
/*
* Deferred Work Token Index
*/
#define RSMKA_IPC_DOWN_INDEX 0
#define RSMKA_IPC_UP_INDEX 1
/* Deferred Work Opcodes */
#define RSMKA_IPC_DOWN 1
#define RSMKA_IPC_UP 2
/* Flags */
#define RSMKA_NO_SLEEP 1
#define RSMKA_USE_COOKIE 2
#define RSMKA_NOHOLD 4
/*
* A work token is enqueued on the workqueue (singly linked list)
* when pathup or pathdown processing is to be done by the deferred work
* thread. Token are enqueued at the end of the queue and processed
* from the front of the queue.
*/
typedef struct work_token {
int opcode; /* opcode for work to do */
} work_token_t;
typedef struct workqueue {
} work_queue_t;
/*
* a pointer to srv_handler_arg is registered along with the handler
* and is passed to the rsm_srv_func - the service handler when it
* is invoked.
*/
typedef struct srv_handler_arg {
char adapter_name[MAXNAMELEN];
int adapter_instance;
typedef struct msgbuf_elem {
/*
* receive buffer object
* procmsg_cnt - receivers count of messages processed since sending credits
* msgbuf_queue - an array-based circular queue of messages received
* msgbuf_head - index pointing to the head of msgbuf_queue
* msgbuf_head - index pointing to the tail of msgbuf_queue
* msgbuf_cnt - number of valid entries in msgbuf_queue
*/
typedef struct recv_info {
int procmsg_cnt;
int rem_sendq_ready;
int msgbuf_head;
int msgbuf_tail;
int msgbuf_cnt;
} recv_info_t;
/*
* sendq_tokens are inserted in a circular list of the ipc_info descriptor
* when a path is added for a remote node. When the path is active the
* rsmpi_sendq_handle will be valid and the sendq token can be used for
* ipc. The sendq_tokens are used in a round robin fashion.
*
* msgbuf_avail - used by sender, number of avail slots in recvrs msgbuf_queue
*/
typedef struct sendq_token {
struct sendq_token *next;
int ref_cnt;
int msgbuf_avail;
typedef struct path {
int remote_devinst;
int state;
int flags;
struct adapter *local_adapter;
#define RSM_UNKNOWN_INCN 0
int ref_cnt;
} path_t;
typedef struct adapter {
struct adapter_listhead *listhead;
int ref_cnt;
int instance;
} adapter_t;
/*
* typedef struct {
* adapter_t *next_chunk;
* int base;
* int next_index;
* int used_count;
* adapter_t *phys_adapters[MAX_CHUNK_INDEX];
* } adapter_map_chunks_t;
*/
/*
* There is one adapter_listhead for each adapter devname. This
* adapter_listhead stores the number of adapters belonging to
* it. It also stores the number of paths for all the adapters
* belonging to it.
*/
typedef struct adapter_listhead {
struct adapter_listhead *next_listhead;
char adapter_devname[MAXNAMELEN];
int ref_cnt;
int adapter_count;
int path_count;
struct adapter_listhead_list {
};
/*
* One ipc_info descriptor for each remote node
*/
typedef struct ipc_info {
int ref_cnt;
} ipc_info_t;
#define SQ_TOKEN_TO_PATH(token) \
/*
* Descriptor Reference Count macros
*/
#define ADAPTER_HOLD(adapter) { \
}
#define ADAPTER_RELE(adapter) { \
}
#define ADAPTER_RELE_NOLOCK(adapter) { \
}
}
#define PATH_HOLD_NOLOCK(path) { \
}
}
#define PATH_RELE_NOLOCK(path) { \
}
#define SENDQ_TOKEN_HOLD(path) { \
}
#define SENDQ_TOKEN_RELE(path) { \
}
#define IPCINFO_HOLD(ipc_info) { \
mutex_enter(&ipc_info_lock); \
mutex_exit(&ipc_info_lock); \
}
#define IPCINFO_HOLD_NOLOCK(ipc_info) { \
}
#define IPCINFO_RELE(ipc_info) { \
mutex_enter(&ipc_info_lock); \
mutex_exit(&ipc_info_lock); \
}
#define IPCINFO_RELE_NOLOCK(ipc_info) { \
}
/*
* Topology data structures - The primary structure is struct rsm_topology_t
* The key interconnect data required for segment operations includes the
* cluster nodeids and the controllers (name, hardware address); with
* the fundamental constraint that the controller specified for a segment
* import must have a physical connection with the contorller used in the
* export of the segment. To facilitate applications in the establishment
* of proper and efficient export and import policies, a delineation of the
* interconnect topology is provided by these data structures.
*
* A pointer to an instance of this structure type is returned by a call
* to rsm_get_interconnect_topology(). The application is responsible for
* calling rsm_free_interconnect_topology() to free the allocated memory.
*
* Note: the rsmka_connections_t structure should be always double-word
* aligned.
*/
#define RSM_CONNECTION_ACTIVE 3
typedef struct {
int local_cntlr_count;
typedef struct {
char cntlr_name[MAXNAMELEN];
int remote_cntlr_count;
/*
* An application must not attempt to use a connection unless the
* the connection_state element of struct remote_cntlr_t is equal to
* RSM_CONNECTION_ACTIVE
*/
typedef struct {
char remote_cntlrname[MAXNAMELEN];
/*
* The actual size of the remote_cntlr array is equal to the remote_cntlr_count
* of the connections_hdr_t struct.
*/
typedef struct {
/*
* A pointer to an instance of this structure type is returned by a call
* to rsm_get_interconnect_topology(). The actual size of the connections
* array is equal to the local_cntlr_count of the topology_hdr_t struct.
*/
typedef struct {
#ifdef _SYSCALL32
typedef struct {
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_RSM_RSMKA_PATH_INT_H */