/*
* 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
*/
/*
* Link upper_path_table structure
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
void
{
} else {
}
}
/*
* Unlink upper_path_table structure
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
} else {
if (*first) {
}
}
if (*last) {
}
}
}
}
/*
* Link lower_path_table structure
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : M
* -. uinst_t->c_lock : A
*/
void
{
} else {
}
}
/*
* Unlink lower_path_table structure
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
} else {
if (*first) {
}
}
if (*last) {
}
}
}
}
/*
* Link msgb structure of high priority
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A [It depends on caller]
* -. uinst_t->c_lock : A [It depends on caller]
*/
void
{
} else {
}
}
/*
* Check whether lower path is usable by lower path info table address
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : M
* -. uinst_t->c_lock : P
*/
int
{
while (lpath) {
break;
}
}
return (rval);
}
/*
* Search upath_t by path number
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : P
*/
upath_t *
{
while (upath) {
break;
}
}
return (upath);
}
/*
* Send M_IOCACK(or M_IOCNAK) message to stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
if (errno) { /* Error */
} else { /* Good */
}
}
/*
* Delete all upath_t
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
void
oplmsu_delete_upath_info(void)
{
while (upath) {
upath = next_upath;
}
}
/*
* Set queue and ioctl to lpath_t
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : M
* -. uinst_t->c_lock : P
*/
int
{
if (hndl_queue == NULL) {
} else {
}
} else {
}
} else {
}
return (rval);
}
/*
* Clear queue and ioctl to lpath_t
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : M
* -. uinst_t->c_lock : P
*/
void
{
}
/*
* Get instanse status from status of upath_t
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : P
*/
int
oplmsu_get_inst_status(void)
{
while (upath) {
} else {
}
}
}
return (pre_sts);
}
/*
* Search path of "online:standby" status
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : P
*/
upath_t *
oplmsu_search_standby(void)
{
while (upath) {
if ((max_pathnum == UNDEFINED) ||
altn_upath = upath;
}
}
}
return (altn_upath);
}
/*
* Search path of "offline:stop" status, and minimum path number
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
int active_flag = 0;
while (upath) {
active_flag = 1;
break;
}
}
}
}
}
if (active_flag == 0) {
}
}
/*
* Get the total number of serial paths
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
int
oplmsu_get_pathnum(void)
{
int total_num = 0;
while (upath) {
total_num++;
}
}
return (total_num);
}
/*
* Put XOFF/ XON message on write queue
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
int
{
/* Send M_START */
/* Send M_DATA(XOFF, XON) */
} else {
}
} else {
}
return (rval);
}
/*
* Put XOFF message on write queue for all standby paths
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : M
* -. uinst_t->c_lock : P
*/
void
{
while (upath) {
continue;
}
(void) oplmsu_cmn_put_xoffxon(
}
}
/*
* Set M_FLUSH message
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : A [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
void
{
}
/*
* Set status informations of upath_t
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : M
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
void
{
}
/*
* Allocate a message block
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
int rw_flag)
{
} else {
}
return (rval);
}
/*
* Copy a message
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
int rw_flag)
{
}
return (rval);
}
/*
* bufcall request
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
if (rw_flag == MSU_WRITE_SIDE) {
return;
}
return;
}
}
} else if (rw_flag == MSU_READ_SIDE) {
} else {
}
} else {
}
return;
}
return;
}
}
}
}
/*
* Previous sequence for active path change
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
int *term_ioctl, int *term_stat)
{
rw_flag) == -1) {
return (FAILURE);
}
rw_flag) == -1) {
return (FAILURE);
}
*term_ioctl = TIOCMSET;
rw_flag) == -1) {
return (FAILURE);
}
*term_ioctl = TIOCSPPS;
return (FAILURE);
}
*term_ioctl = TIOCSWINSZ;
return (FAILURE);
}
} else {
}
return (SUCCESS);
}
/*
* Pick up termios to re-set
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : A
*/
int
{
return (FAILURE);
}
return (FAILURE);
}
*term_ioctl = TIOCMSET;
return (FAILURE);
}
*term_ioctl = TIOCSPPS;
return (FAILURE);
}
*term_ioctl = TIOCSWINSZ;
== NULL) {
return (FAILURE);
}
} else {
}
return (SUCCESS);
}
/*
* Previous sequence for active path change termio
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
{
if ((prev_flag == MSU_TIOS_TCSETS) &&
return (FAILURE);
}
} else if ((prev_flag <= MSU_TIOS_MSET) &&
return (FAILURE);
}
} else if ((prev_flag <= MSU_TIOS_PPS) &&
return (FAILURE);
}
} else if ((prev_flag <= MSU_TIOS_WINSZP) &&
return (FAILURE);
}
} else if (prev_flag <= MSU_TIOS_SOFTCAR) {
}
return (SUCCESS);
}
/*
* Pull up messages
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
{
return (FAILURE);
} else {
}
}
return (SUCCESS);
}
/*
* Wake up flow control
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
}
}
/*
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
queue_t *q;
int lq_flag = 0;
while (lpath) {
} else {
} else {
}
if (oplmsu_queue_flag == 1) {
lq_flag = 1;
oplmsu_queue_flag = 0;
}
if (lq_flag == 1) {
oplmsu_queue_flag = 1;
}
}
return;
}
}
return;
}
}
return;
}
}
}
/*
* bufcall() or timeout() callback post handling for write stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : M
*/
void
{
queue_t *q;
int lq_flag = 0;
return;
}
} else {
}
if (oplmsu_queue_flag == 1) {
lq_flag = 1;
oplmsu_queue_flag = 0;
}
if (lq_flag == 1) {
oplmsu_queue_flag = 1;
}
}
/*
* COMMON FUNCTIONS FOR WRITE STREAM
*/
/*
* Check control node and driver privilege
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : P
*/
int
{
return (EINVAL);
}
/* Check super-user by oplmsu.conf */
if (oplmsu_check_su != 0) {
return (EPERM);
}
}
return (SUCCESS);
}
/*
* Flush handle for write side stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
}
} else {
}
} else {
}
}
/*
* Through message handle for write side stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
{
} else {
} else {
}
return (SUCCESS);
}
} else {
"Active path doesn't exist");
} else {
}
return (SUCCESS);
}
} else {
} else {
return (FAILURE);
}
}
} else {
"Inappropriate message for this node");
} else {
}
}
return (SUCCESS);
}
/*
* Get high priority message from buffer for upper write stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : A
* -. uinst_t->c_lock : P
*/
mblk_t *
{
} else {
}
}
return (mp);
}
/*
* putbq() function for normal priority message of write stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
}
/*
* Restart queuing for high priority message of write stream when flow control
* failed
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER or RW_WRITER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
if (oplmsu_queue_flag == 1) {
return;
}
/* Handle high priority message */
continue;
}
return;
}
}
}
/*
* COMMON FUNCTIONS FOR READ STREAM
*/
/*
* Flush handle for read side stream
*
* Requires lock ( M: mandatory P: prohibited A: allowed
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
/* Remove only data messages from read queue */
}
} else {
} else {
}
}
} else {
} else {
}
}
}
/*
* Through message handle for read side stream
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : M [RW_READER]
* -. uinst_t->u_lock : A
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
int
{
int act_flag;
} else {
}
} else {
return (SUCCESS);
}
} else {
} else {
/*
* Place a normal priority message at the head of
* read queue
*/
return (FAILURE);
}
}
return (SUCCESS);
}
/*
* Restart queuing for high priority message of read stream
* when flow control failed
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
int rval;
for (;;) { /* Handle high priority message */
break;
}
} else {
}
case M_IOCACK : /* FALLTHRU */
case M_IOCNAK :
case TCSETS : /* FALLTHRU */
case TCSETSW : /* FALLTHRU */
case TCSETSF : /* FALLTHRU */
case TIOCMSET : /* FALLTHRU */
case TIOCSPPS : /* FALLTHRU */
case TIOCSWINSZ : /* FALLTHRU */
case TIOCSSOFTCAR :
break;
default :
return;
}
}
break;
case M_ERROR :
break;
case M_FLUSH :
oplmsu_rcmn_flush_hndl(q, mp);
break;
default :
return;
}
}
break;
}
}
qenable(q); /* Enable lower read queue */
}
#ifdef DEBUG
/*
* Online trace
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
return;
}
if (oplmsu_debug_mode & MSU_DPRINT_ON) {
}
/* Trace current counter */
if (oplmsu_ltrc_cur == oplmsu_ltrc_tail) {
} else {
}
oplmsu_ltrc_cur->q = q;
switch (op) {
case MSU_TRC_UI :
break;
case MSU_TRC_UO :
break;
case MSU_TRC_LI :
break;
case MSU_TRC_LO :
break;
case MSU_TRC_OPN :
break;
case MSU_TRC_CLS :
break;
}
} else {
oplmsu_ltrc_cur->pathno = 0;
}
oplmsu_ltrc_cur->msg_type = 0;
oplmsu_ltrc_cur->msg_cmd = 0;
oplmsu_ltrc_cur->data = 0;
case MSU_NODE_USER :
break;
case MSU_NODE_META :
break;
}
} else {
} else {
oplmsu_ltrc_cur->data = 0;
}
} else {
oplmsu_ltrc_cur->msg_cmd = 0;
oplmsu_ltrc_cur->data = 0;
} else {
}
}
}
}
/*
* Display message log to console
*
* Requires Lock (( M: Mandatory, P: Prohibited, A: Allowed ))
* -. uinst_t->lock : P
* -. uinst_t->u_lock : P
* -. uinst_t->l_lock : P
* -. uinst_t->c_lock : P
*/
void
{
char *bufp;
return;
}
switch (direction) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
return;
}
count = 0;
*bufp = ' ';
bufp++;
}
bufp += 2;
cur++;
count++;
break;
}
}
*bufp = '\0';
break;
}
}
}
}
void
{
"Active path change to path => %s", pathname));
}
#endif