oplmsu.h revision 25cf1a301a396c38e8adf52c15f537b80d2483f7
/*
* 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
*/
/*
* All Rights Reserved, Copyright (c) FUJITSU LIMITED 2006
*/
#ifndef _OPLMSU_H
#define _OPLMSU_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* ack_flag */
#define ACK_RES 0
#define NAK_RES -1
/* active_flag */
#define ACTIVE_RES 0
#define NOT_ACTIVE_RES -1
/* undefined path number */
#define UNDEFINED -1
/* sleep and wakeup control flag */
#define CV_WAKEUP 0
#define CV_SLEEP 1
#define MSU_WRITE_SIDE 0
#define MSU_READ_SIDE 1
/* message priority */
#define MSU_HIGH 1
#define MSU_NORM 0
/* miscellaneous */
#define SUCCESS 0
#define FAILURE -1
#if !defined(BUSY) /* warning: macro redefined */
#define BUSY -2
#endif
/* timeout interval */
#define MSU_XON 0x11
#define MSU_XOFF 0x13
/* main path code used by MSU_CMD_START ioctl */
#define MAINPATHCODE 0x1000
#define MSU_OBP_CONSOLE -2
/* maximum number of minor device number */
#define MAXDEVMINOR 256
/* node mask */
/* node_flag */
#define MSU_NODE_USER 0 /* user control node */
/* node_flag check macro */
#define MSU_NODE_TYPE(dev) \
/* termio_flag */
/* binding name */
#define MSU_CMUCH_FF "pci10cf,138f"
#define MSU_CMUCH_DC "pci10cf,1390"
#ifdef DEBUG
#define MSU_CMUCH_DBG "pci108e,8000"
#endif
/* tty-port# properties */
#define MSU_TTY_PORT_PROP "tty-port#"
/* board# properties */
#define MSU_BOARD_PROP "board#"
/*
* oplmsu command code
*/
/*
* oplmsu path status for status member on upper path info table
*/
#define MSU_PSTAT_EMPTY 0
#define MSU_PSTAT_ACTIVE 1
#define MSU_PSTAT_STANDBY 2
#define MSU_PSTAT_STOP 3
#define MSU_PSTAT_FAIL 4
#define MSU_PSTAT_DISCON 5
#define MSU_PSTAT_ENCAP 6
/*
* oplmsu additional status for traditional_status member on
* upper path info table
*/
#define MSU_UNLINK 0 /* initial state */
/*
* oplmsu instance status for inst_status member on
* upper instance info talbe
*/
/*
* oplmsu lower path Info table ext status for ext member on
* lower path info table
*/
/* MSU_CMD_START */
#define MSU_PATHNAME_SIZE 128
/* control block(path parameter) */
struct msu_path {
int num; /* total number of paths */
int reserved; /* reserved */
};
/* control block(device parameter) */
struct msu_dev {
};
/* serial device control block */
typedef struct serial_devcb {
int lsb; /* LSB number */
} ser_devcb_t;
/* serial device countrl block list */
typedef struct serial_devlist {
struct serial_devlist *next;
} ser_devl_t;
/* upper path table */
typedef struct upper_path_table {
struct upper_path_table *u_next;
struct upper_path_table *u_prev;
struct lower_path_table *lpath;
int path_no;
int reserved;
int status;
int prev_status;
} upath_t;
/* lower path table */
typedef struct lower_path_table {
struct lower_path_table *l_next;
struct lower_path_table *l_prev;
struct upper_instance_table *uinst;
char *abt_char;
long status;
int path_no;
int link_id;
int uwq_flag;
int sw_flag;
} lpath_t;
/* control table */
typedef struct control_table {
struct control_table *c_next;
struct control_table *c_prev;
int node_type;
int lrq_flag;
int sleep_flag;
} ctrl_t;
/* upper instance table */
typedef struct upper_instance_table {
int inst_status;
int path_num;
int reserved[2];
char abts[MSU_MAX_ABTSLEN];
} uinst_t;
/* queue table for bufcall() and timeout() */
struct buf_tbl {
queue_t *q;
int rw_flag;
};
/* rwlock macro */
#define OPLMSU_RWLOCK_UPGRADE() { \
} \
}
#ifdef DEBUG
typedef struct tracedata {
queue_t *q;
char op[3];
int pathno;
int msg_cmd;
} msu_trc_t;
/* oplmsu_trace_on */
#define MSU_TRACE_OFF 0
#define MSU_TRACE_ON 1
/* oplmsu_debug_mode */
/* op type */
#define MSU_TRC_UI 0 /* upper input */
/* trace macro */
if (oplmsu_trace_on == MSU_TRACE_ON) { \
} \
}
/* debug print macro */
if (oplmsu_debug_mode & MSU_DPRINT_ON) { \
} \
}
#else /* ! DEBUG */
/* trace macro */
/* debug print macro */
#endif
#ifdef __cplusplus
}
#endif
#endif /* _OPLMSU_H */