scftimer.c 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
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Timer control table and control flag
*/
/*
* Timer value
*/
/* SCF command busy watch timer */
/* SCF command completion watch timer */
/* SCF online watch timer */
/* Next receive wait timer */
/* DSCP interface TxACK watch timer */
/* DSCP interface TxEND watch timer */
/* DSCP interface busy watch timer */
/* DSCP interface callback timer */
/*
* Function list
*/
void scf_timer_init(void);
void scf_timer_start(int tmcd);
void scf_timer_stop(int tmcd);
void scf_timer_all_stop(void);
int scf_timer_check(int tmcd);
/*
* External function
*/
extern void scf_cmdbusy_tout(void);
extern void scf_cmdend_tout(void);
extern void scf_online_wait_tout(void);
extern void scf_next_rxdata_get(void);
extern void scf_dscp_ack_tout(void);
extern void scf_dscp_end_tout(void);
extern void scf_dscp_busy_tout(void);
extern void scf_dscp_callback_tout(void);
extern void scf_report_send_wait_tout(void);
/*
* scf_timer_init()
*
* Description: Timer initialization processing.
*
*/
void
scf_timer_init(void)
{
#define SCF_FUNC_NAME "scf_timer_init() "
/* Set timer code and timer value */
}
/*
* scf_timer_start()
*
* Description: Timer start subroutine.
*
*/
void
scf_timer_start(int tmcd)
{
#define SCF_FUNC_NAME "scf_timer_start() "
/* Check timer code */
if (tmcd >= SCF_TIMERCD_MAX) {
goto END_timer_start;
}
/* Get timer table address */
/* Check timer value and timer start flag */
goto END_timer_start;
}
/* Check timer stop flag */
/*
* Timer start and judgment
*/
/* Change timer table side */
/* timer start */
/* Timer start flag ON */
} else {
/*
* Timer restart and judgment
*/
/* Check current table timer use */
/* Change timer table side */
}
/* Timer start and restart flag ON */
}
/*
* END_timer_start
*/
}
/*
* scf_timer_stop()
*
* Description: Timer stop subroutine.
*
*/
void
scf_timer_stop(int tmcd)
{
#define SCF_FUNC_NAME "scf_timer_stop() "
/* Check timer code */
if (tmcd < SCF_TIMERCD_MAX) {
/* Get timer table address */
/* Check timer start flag */
/*
* Timer start and judgment
*/
/* Timer start and restart flag OFF */
/* Timer stop flag ON */
}
}
}
/*
* scf_timer_all_stop()
*
* Description: Timer all stop subroutine.
*
*/
void
scf_timer_all_stop(void)
{
#define SCF_FUNC_NAME "scf_timer_all_stop() "
int tm_cd;
}
}
/*
* scf_timer_check()
*
* Description: Timer status check subroutine.
*
*/
int
scf_timer_check(int tmcd)
{
#define SCF_FUNC_NAME "scf_timer_check() "
/* Check timer code */
if (tmcd < SCF_TIMERCD_MAX) {
/* Get timer table address */
/* Check timer start flag */
/* Timer exec state */
}
}
return (ret);
}
/*
* scf_timer_value_get()
*
* Description: Timer value get subroutine.
*
*/
scf_timer_value_get(int tmcd)
{
#define SCF_FUNC_NAME "scf_timer_value_get() "
/* Check timer code */
if (tmcd < SCF_TIMERCD_MAX) {
/* Set timer value */
}
return (ret);
}
/*
* scf_tout()
*
* Description: Timeout main processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_tout() "
int tm_stop_cnt;
/* Lock driver mutex */
/* Get timer table address */
/* Check timer exec state */
/* Timer flag OFF and timer id clear */
/* Check timer code */
case SCF_TIMERCD_CMDBUSY:
/* SCF command busy watch timeout */
break;
case SCF_TIMERCD_CMDEND:
/* SCF command completion watch timeout */
break;
case SCF_TIMERCD_ONLINE:
/* SCF online watch timeout */
break;
case SCF_TIMERCD_NEXTRECV:
/* Next receive wait timeout */
break;
case SCF_TIMERCD_DSCP_ACK:
/* DSCP interface TxACK watch timeout */
break;
case SCF_TIMERCD_DSCP_END:
/* DSCP interface TxEND watch timeout */
break;
case SCF_TIMERCD_DSCP_BUSY:
/* DSCP interface busy watch timeout */
break;
/* DSCP interface callback timeout */
break;
case SCF_TIMERCD_BUF_FUL:
/* SCF command BUF_FUL timeout */
case SCF_TIMERCD_RCI_BUSY:
/* SCF command RCI_BUSY timeout */
break;
default:
/* NOP */
break;
}
} else {
/* Timer flag OFF and timer id clear */
/* Check timer restart flag */
/*
* Timer start and judgment
*/
/* timer start */
/* Timer start flag is already ON */
/* Timer restart flag OFF */
}
}
/* Collect the timers which need to be stopped */
/* Unlock driver mutex */
/* Timer stop */
if (tm_stop_cnt != 0) {
}
}
/*
* scf_timer_stop_collect()
*
* Description: Collect the timers which need to be stopped.
*
*/
int
{
#define SCF_FUNC_NAME "scf_timer_stop_collect() "
int ii; /* Working value : counter */
int tm_stop_cnt = 0; /* Timer stop counter */
/* Clear save timer table */
/* Check timer stop factor */
if (scf_timer_stop_flag == FLAG_OFF) {
goto END_timer_stop_collect;
}
/* Timer stop flag OFF */
/* Get timer table address */
/* Check all timer table */
/* Check timer stop flag */
/* Timer stop flag OFF */
/* Check timer side 0 table timer use */
/* Save stop timer id */
/* Timer id clear */
sizeof (ii));
}
/* Check timer side 1 table timer use */
/* Save stop timer id */
/* Timer id clear */
sizeof (ii));
}
}
/* Check timer restart flag */
/*
* Timer start and judgment
*/
/* timer start */
/* Timer start flag ON */
sizeof (ii));
}
}
/*
* END_timer_stop_collect
*/
return (tm_stop_cnt);
}
/*
* scf_timer_untimeout()
*
* Description: Timer stop subroutine.
*
*/
void
{
#define SCF_FUNC_NAME "scf_timer_untimeout() "
int ii; /* Working value : counter */
/* Save timer id stop */
}
}
}