scfhandler.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"
/*
* Function list
*/
int len);
void scf_next_rxdata_get(void);
void scf_online_wait_tout(void);
void scf_cmdbusy_tout(void);
void scf_cmdend_tout(void);
void scf_report_send_wait_tout(void);
void scf_panic_callb(int code);
void scf_shutdown_callb(int code);
void scf_cmdwait_status_set(void);
/*
* External function
*/
extern void scf_dscp_callback(void);
extern void do_shutdown(void);
/*
* scf_intr()
*
* Description: Interrupt handler entry processing.
*
*/
{
#define SCF_FUNC_NAME "scf_intr() "
int path_change = 0;
int tm_stop_cnt;
/* Lock driver mutex */
/* Path status check */
goto END_intr;
}
/* PANIC exec status */
if (scf_panic_exec_flag) {
/* SCF interrupt disable(CR) */
/* Register read sync */
/* SCF Status register interrupt(STR) : clear */
/* SCF Status extended register(STExR) : interrupt clear */
/* DSCP buffer status register(DSR) : interrupt clear */
/* SCF interrupt status register(ISR) : interrupt clear */
goto END_intr;
}
/* Check hard error after or interrupt disable status */
/* Interrupt disable */
/* SCF Status register interrupt(STR) : clear */
/* SCF Status extended register(STExR) : interrupt clear */
/* DSCP buffer status register(DSR) : interrupt clear */
/* SCF interrupt status register(ISR) : interrupt clear */
goto END_intr;
}
/* Get SCF interrupt register */
sizeof (statep->reg_int_st));
/* SCF interrupt register interrupt clear */
sizeof (statep->reg_int_st));
/* Register read sync */
/* Get SCF status register */
sizeof (statep->reg_status));
/* Get SCF status extended register */
sizeof (statep->reg_status_exr));
/* Get SCF command register */
sizeof (statep->reg_command));
/* Get SCF command extended register */
sizeof (statep->reg_command_exr));
/* SRAM trace */
/* Check SCF path change interrupt */
/* Check interrupt SCF path */
path_change = 1;
goto END_intr;
}
}
/* Check Alive Interrupt */
/* Check interrupt SCF path */
/* Alive check interrupt */
} else {
/* not active SCF path */
"intr ", 8);
/* Alive interrupt disable */
}
}
/* Check SCF interrupt */
/* Check active SCF path */
/* Mode changed bit valid */
/* Check secure mode status */
/* Mode status LOCK */
if (((scf_comtbl.scf_mode_sw &
STATUS_MODE_LOCK) &&
SCF_ALIVE_START)) {
/* Alive check start */
}
} else {
}
(statep->reg_status &
}
/* Check command complete */
if ((scf_comtbl.scf_cmd_exec_flag) &&
/* SCF command complete processing */
if (path_change) {
goto END_intr;
}
}
} else {
/* SCF Status register interrupt clear */
&statep->reg_status,
sizeof (statep->reg_status));
/* Register read sync */
/* SCF Status extended register interrupt clear */
sizeof (statep->reg_status_exr));
/* Register read sync */
goto END_intr;
}
/* Check SCF status change */
/* SCF status change processing */
}
/* SCF Status register interrupt clear */
sizeof (statep->reg_status));
/* Register read sync */
/* SCF Status extended register interrupt clear */
sizeof (statep->reg_status_exr));
/* Register read sync */
if (statep->reg_status &
}
/* POWER_FAILURE save */
}
/* Check next receive data timer exec */
if (scf_timer_check(SCF_TIMERCD_NEXTRECV) ==
/* Next command send check */
}
}
/* Check next command send */
if ((scf_comtbl.scf_cmd_exec_flag == 0) &&
(scf_comtbl.cmd_busy_wait != 0)) {
scf_comtbl.cmd_busy_wait = 0;
/* Signal to command wait */
sizeof (kcondvar_t));
}
/* Check DSCP Communication Buffer Interrupt */
/* Check interrupt SCF path */
} else {
/* not active SCF path */
"intr ", 8);
/* DSCP buffer status register interrupt clear */
/* Register read sync */
}
}
/* Unclamed counter up */
/* Get control register */
sizeof (statep->reg_control));
/* Get SCF command register */
sizeof (statep->reg_command));
/* Get SCF status register */
sizeof (statep->reg_status));
/* Get SCF status extended register */
sizeof (statep->reg_status_exr));
/* Get DSR register */
}
/*
* END_intr
*/
/* Check SCF path change */
if (path_change) {
}
/* Collect the timers which need to be stopped */
/* Unlock driver mutex */
/* Timer stop */
if (tm_stop_cnt != 0) {
}
return (ret);
}
/*
* scf_intr_cmdcmp()
*
* Description: SCF command complete processing.
*
*/
int
{
#define SCF_FUNC_NAME "scf_intr_cmdcmp() "
uint_t rxbuff_flag = 0;
char sumerr_msg[16];
int info_size;
int ii;
int ret = 0;
if (scf_comtbl.scf_exec_cmd_id) {
/* SCF command start for ioctl */
} else {
/* SCF command start for interrupt */
}
statep->cmd_to_rcnt = 0;
/* SRAM trace */
/* Check command return value */
case NORMAL_END:
/* Norman end */
statep->tesum_rcnt = 0;
/* Make Rx register sum */
}
/* Check Rx register sum */
"intr ", 8);
statep->resum_rcnt++;
goto CHECK_rxsum_start;
}
/*
* SCF_USE_SLBUF
*/
/* Invalid receive data length */
"Invalid receive data length = 0x%08x",
"intr ", 8);
statep->resum_rcnt++;
goto CHECK_rxsum_start;
}
statep->resum_rcnt = 0;
goto CHECK_rxsum_start;
}
/* Check receive data division mode */
if ((scf_comtbl.scf_exec_cmd_id) &&
rxbuff_flag = 1;
} else {
rxbuff_flag = 0;
}
/* Receive data copy */
}
/* SRAM trace */
if (rxbuff_cnt > scf_sram_trace_data_size) {
} else {
rcount = rxbuff_cnt;
}
while (rcount != 0) {
} else {
}
}
/* Check receive data division mode */
if (rxbuff_flag != 0) {
goto CHECK_rxsum_start;
}
/* Make SRAM data sum */
}
}
/* Check SRAM data sum */
statep->resum_rcnt = 0;
} else {
"Rx sum failure 0x%08x 0x%08x",
statep->resum_rcnt++;
}
} else {
/*
*/
} else {
}
if (wkleng != 0) {
/* Receive data copy */
}
} else {
/*
*/
}
statep->resum_rcnt = 0;
}
/*
* CHECK_rxsum_start
*/
/* Check Rx sum re-try out */
/* SRAM trace */
"intr ", 8);
"%s,Failed the receive data SUM of %s. "
"SCF command = 0x%02x%02x\n",
ret = 1;
goto END_intr_cmdcmp;
}
break;
case INTERFACE:
/* Interface error */
/* SRAM trace */
statep->tesum_rcnt++;
/* Check interface error re-try out */
"%s,Detected the interface error by XSCF. "
"SCF command = 0x%02x%02x\n",
ret = 1;
goto END_intr_cmdcmp;
}
break;
case BUF_FUL:
/* Buff full */
/* SRAM trace */
break;
case RCI_BUSY:
/* RCI busy */
/* SRAM trace */
break;
case E_NOT_SUPPORT:
/* SRAM trace */
"%s,Detected the not support command by XSCF. "
"SCF command = 0x%02x%02x\n",
break;
case E_PARAM:
/* Parameter error */
/* Check command is SB configuration change */
SUB_SB_CONF_CHG)) {
/* Receive data copy */
} else {
}
if (wkleng != 0) {
}
} else {
"intr ", 8);
/* SRAM trace */
"%s,Detected the invalid parameter by XSCF. "
"SCF command = 0x%02x%02x\n",
}
break;
case E_RCI_ACCESS:
/* RCI access error */
/* SRAM trace */
"%s,RCI access error occurred in XSCF. "
"SCF command = 0x%02x%02x\n",
break;
case E_SCFC_NOPATH:
/* No SCFC path */
/* SRAM trace */
if (scf_comtbl.scf_exec_p) {
scf_comtbl.scf_exec_p = 0;
}
break;
case RCI_NS:
/* Not support RCI */
"%s,Cannot use RCI interface. "
"SCF command = 0x%02x%02x\n",
break;
default:
/* SRAM trace */
"%s,Invalid status value was notified from XSCF. "
"SCF command = 0x%02x%02x, Status value = 0x%04x\n",
break;
}
/* Check SCF command start for interrupt */
if (scf_comtbl.scf_exec_cmd_id == 0) {
/* SCF command start for interrupt processing */
} else {
/* Check ioctl command end wait */
if (scf_comtbl.cmd_end_wait != 0) {
/* Check command return value */
case NORMAL_END:
case BUF_FUL:
case RCI_BUSY:
case E_NOT_SUPPORT:
case E_PARAM:
case E_RCI_ACCESS:
case RCI_NS:
} else {
}
}
(rxbuff_flag)) {
break;
}
scf_comtbl.cmd_end_wait = 0;
/* Signal to command end wait */
sizeof (kcondvar_t));
break;
default:
/* INTERFACE */
/* E_SCFC_NOPATH */
/* Rx DATA SUM ERROR */
/* Set command retry send flag */
break;
}
}
}
/* Check receive data division mode */
if (rxbuff_flag == 1) {
/* Next receive data timer start */
}
/*
* END_intr_cmdcmp
*/
return (ret);
}
/*
* scf_intr_cmdcmp_driver()
*
* Description: SCF command complete. start for interrupt processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_intr_cmdcmp_driver() "
int shutdown_flag = 0;
int poff_flag;
/* Check command code */
case CMD_SCFI_PATH: /* SCF Path change command */
/* Check command return value */
/* Set command retry send flag */
break;
}
/* Check SCF path change status */
/* FMEMA interface */
}
/* Check Alive check exec */
} else {
scf_comtbl.suspend_wait = 0;
sizeof (kcondvar_t));
}
}
/* DSCP interface start */
break;
case CMD_PART_POW_CTR: /* power control command */
/* Check command return value */
case BUF_FUL:
case RCI_BUSY:
case E_NOT_SUPPORT:
case E_PARAM:
case E_RCI_ACCESS:
case RCI_NS:
break;
default:
/* INTERFACE */
/* E_SCFC_NOPATH */
/* Rx DATA SUM ERROR */
/* Set command retry send flag */
break;
}
break;
}
poff_flag = 0;
0xFF000000) >> 24);
/* PANEL */
/* Not LOCK */
"intr ", 8);
if (scf_comtbl.scf_shutdownreason == 0) {
poff_flag = 1;
}
"%s: System shutdown by panel "
"request.\n", scf_driver_name);
}
POFF_ID_RCI) {
/* RCI */
if (scf_comtbl.scf_shutdownreason == 0) {
poff_flag = 1;
}
"%s: System shutdown from RCI.\n",
/* XSCF */
if (scf_comtbl.scf_shutdownreason == 0) {
poff_flag = 1;
}
"%s: System shutdown by XSCF "
"request.\n", scf_driver_name);
}
if (poff_flag) {
"%s: Shutdown was executed.\n",
/* System shutdown start */
do_shutdown();
}
break;
case CMD_INT_REASON: /* Event information command */
/* Check command return value */
case BUF_FUL:
case RCI_BUSY:
case E_NOT_SUPPORT:
case E_PARAM:
case E_RCI_ACCESS:
case RCI_NS:
break;
default:
/* INTERFACE */
/* E_SCFC_NORATH */
if (scf_comtbl.scf_shut_event_sub ==
} else {
}
/* Set command retry send flag */
break;
}
break;
}
/* Check factor detail disp */
/* Send detail re-disp */
if (scf_comtbl.scf_shut_event_sub ==
} else {
}
break;
}
/*
* Event interrupt factor check
* processing
*/
} else {
if (scf_comtbl.scf_shut_event_sub ==
}
}
if (shutdown_flag == DEV_SENSE_SHUTDOWN) {
"%s: Shutdown was executed.\n",
/* System shutdown start */
do_shutdown();
}
break;
case CMD_ALIVE_CHECK: /* Alive check command */
/* Check command return value */
case NORMAL_END:
case BUF_FUL:
case RCI_BUSY:
case E_NOT_SUPPORT:
case E_PARAM:
case E_SCFC_NOPATH:
case E_RCI_ACCESS:
case RCI_NS:
} else {
}
}
if ((scf_comtbl.scf_alive_event_sub ==
(scf_comtbl.suspend_wait)) {
/* Signal to suspend wait */
scf_comtbl.suspend_wait = 0;
sizeof (kcondvar_t));
}
if ((scf_comtbl.scf_alive_event_sub ==
}
break;
default:
/* INTERFACE */
/* Rx DATA SUM ERROR */
} else {
}
/* Set command retry send flag */
}
break;
}
break;
case CMD_REPORT: /* Report command */
/* Check command return value */
case NORMAL_END:
case BUF_FUL:
case RCI_BUSY:
case E_NOT_SUPPORT:
case E_PARAM:
case E_SCFC_NOPATH:
case E_RCI_ACCESS:
case RCI_NS:
/* Check Alive check exec */
}
if ((scf_comtbl.scf_report_event_sub ==
}
if (scf_comtbl.report_buf_ful_rcnt !=
} else {
}
} else {
}
if (scf_comtbl.report_rci_busy_rcnt !=
} else {
}
} else {
}
break;
default:
/* INTERFACE */
/* Rx DATA SUM ERROR */
if (scf_comtbl.scf_report_event_sub ==
/* Set command retry send flag */
} else {
/* Set command retry send flag */
}
break;
}
break;
}
}
/*
* scf_intr_dsens()
*
* Description: Event factor check processing.
*
*/
/* ARGSUSED */
int
{
#define SCF_FUNC_NAME "scf_intr_dsens() "
int ret = 0;
int ent = 0;
int getevent_flag;
int max_ent;
if (max_ent > 4) {
max_ent = 4;
}
/* entry count loop */
/* Save last event */
/* Check SCFIOCEVENTLIST */
if (getevent_flag == 0) {
/* wake up waiting thread */
}
/* get category code of the sense */
"SENSE = 0x%08x 0x%08x 0x%08x 0x%08x",
switch (category_code) {
case DEV_SENSE_FANUNIT:
/* fan unit failure */
"intr_dse", 8);
if (category_type == DEV_SENSE_ATTR_OWN) {
"%s: fan unit failure"
", sub status = 0x%02x\n",
if ((sub_status & DEV_SENSE_SHUTDOWN) &&
(scf_comtbl.scf_shutdownreason == 0)) {
}
} else {
"%s: fan unit failure on "
"RCI(addr = 0x%08x)"
", FAN#%d, sub status = 0x%02x,\n"
"sense info ="
" 0x%02x 0x%02x 0x%02x 0x%02x"
" 0x%02x 0x%02x 0x%02x 0x%02x\n",
rbuf->four_bytes_access[0],
}
break;
case DEV_SENSE_PWRUNIT:
/* power unit failure */
"intr_dse", 8);
if (category_type == DEV_SENSE_ATTR_OWN) {
"%s: power supply unit failure"
", sub status = 0x%02x\n",
if ((sub_status & DEV_SENSE_SHUTDOWN) &&
(scf_comtbl.scf_shutdownreason == 0)) {
}
} else {
"%s: power supply unit failure on "
"RCI(addr = 0x%08x)"
", FEP#%d, sub status = 0x%02x,\n"
"sense info ="
" 0x%02x 0x%02x 0x%02x 0x%02x"
" 0x%02x 0x%02x 0x%02x 0x%02x\n",
rbuf->four_bytes_access[0],
rbuf->b[11],
}
break;
case DEV_SENSE_UPS:
/* UPS failure */
"intr_dse", 8);
if (category_type != DEV_SENSE_ATTR_OWN) {
break;
}
case DEV_SENSE_UPS_LOWBAT:
"intr_dse", 8);
"%s: UPS low battery"
" was detected, sub status = 0x%02x\n",
break;
default:
"%s: UPS failure"
" was detected, sub status = 0x%02x\n",
break;
}
if ((sub_status & DEV_SENSE_SHUTDOWN) &&
(scf_comtbl.scf_shutdownreason == 0)) {
}
break;
case DEV_SENSE_THERMAL:
/* thermal failure */
"intr_dse", 8);
if (category_type == DEV_SENSE_ATTR_OWN) {
"%s: thermal alarm"
", sub status = 0x%02x\n",
if ((sub_status & DEV_SENSE_SHUTDOWN) &&
(scf_comtbl.scf_shutdownreason == 0)) {
}
} else {
"%s: thermal alarm on "
"RCI(addr = 0x%08x)"
", SENSOR#%d, sub status = 0x%02x,\n"
"sense info ="
" 0x%02x 0x%02x 0x%02x 0x%02x"
" 0x%02x 0x%02x 0x%02x 0x%02x\n",
rbuf->four_bytes_access[0],
}
break;
case DEV_SENSE_PWRSR:
/* power stop */
"intr_dse", 8);
if (category_type != DEV_SENSE_ATTR_OWN) {
break;
}
"intr_dse", 8);
"%s: Input power down was detected. "
"UPS is activated"
", sub status = 0x%02x\n",
if (sub_status & DEV_SENSE_SHUTDOWN) {
if (scf_comtbl.shutdown_start_reported == 0) {
}
if (scf_comtbl.scf_shutdownreason == 0) {
}
}
break;
case DEV_SENSE_NODE:
/* node error */
"intr_dse", 8);
if (category_type == DEV_SENSE_ATTR_OWN) {
break;
}
"%s: node error on RCI(addr = 0x%08x)"
", sub status = 0x%02x,\n"
"sense info ="
" 0x%02x 0x%02x 0x%02x 0x%02x"
" 0x%02x 0x%02x 0x%02x 0x%02x\n",
rbuf->four_bytes_access[0],
rbuf->four_bytes_access[0];
rbuf->b[9];
rbuf->b[10];
rbuf->b[11];
ddi_get_time();
/* wake up waiting thread */
sizeof (kcondvar_t));
}
break;
case DEV_SENSE_SYS_REPORT:
/* system status report */
timestamp = ddi_get_time();
/* wake up waiting thread */
break;
case DEV_SENSE_PANIC_REQ:
/* panic request */
"%s: panic request from RCI(addr = 0x%08x)\n",
rbuf->four_bytes_access[0]);
break;
case DEV_SENSE_IONODESTAT:
/* I/O node status */
if (category_type == DEV_SENSE_ATTR_OWN) {
break;
}
"%s: I/O node status sense from "
"RCI(addr = 0x%08x), "
"sub status = 0x%02x,\n"
"sense info = 0x%02x 0x%02x 0x%02x 0x%02x"
" 0x%02x 0x%02x 0x%02x 0x%02x\n",
rbuf->four_bytes_access[0],
break;
case DEV_SENSE_STATUS_RPT:
/* Deveice status print */
if (scf_comtbl.rdctrl_end_wait) {
/* rdctrl devsense? (for SCFIOCRDCTRL) */
/* keep devsense info */
(void *)&scf_comtbl.rdctrl_sense[0],
sizeof (kcondvar_t));
}
break;
default:
/* Devive status print */
/* rdctrl devsense (for SCFIOCRDCTRL) */
/* keep devsense info */
(void *)&scf_comtbl.rdctrl_sense[0],
sizeof (kcondvar_t));
}
break;
}
/*
* NEXT_intr_dsens
*/
ent++;
}
return (ret);
}
/*
* scf_status_change()
*
* Description: SCF status change processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_status_change() "
/* Check SCF status */
/*
* SCF online
*/
}
/* SRAM trace */
/* Check online wait timer exec */
/* DCSP interface re-start */
} else {
/* DCSP interface start */
/* SCF online timer stop */
/* Check SCF command exec */
if (scf_comtbl.scf_cmd_exec_flag) {
/* Set command wait status */
}
/* Check Alive check exec */
}
}
} else {
/*
* SCF offline
*/
scf_unit = 1;
} else {
scf_unit = 0;
}
"%s: SCF went to offline mode. unit=%d",
}
/* SRAM trace */
/* Check online wait timer exec */
/* DCSP interface stop */
statep->online_to_rcnt = 0;
/* SCF online timer start */
}
}
}
/*
* scf_next_cmd_check()
*
* Description: Next command send and check processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_next_cmd_check() "
int offline_ret;
int cmdbusy_ret;
/* Check suspend send stop */
if (scf_comtbl.scf_suspend_sendstop) {
goto END_next_cmd_check;
}
}
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* send comannd for interrupt */
if ((offline_ret != SCF_PATH_ONLINE) ||
(cmdbusy_ret != SCF_COMMAND_READY)) {
goto END_next_cmd_check;
}
}
/* Check SCF Path change request */
if ((scf_comtbl.scf_cmd_exec_flag == 0) &&
/* Send SCF Path change command */
}
}
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* Check shutdown event information request */
(~(STATUS_SHUTDOWN | STATUS_EVENT));
}
/* Send event information command */
if (scf_comtbl.int_reason_retry == 0) {
} else {
}
0) {
}
}
}
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* Check power off factor request */
}
/* Send power off factor command */
0) {
}
}
}
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* Check event information request */
}
/* Send event information command */
if (scf_comtbl.int_reason_retry == 0) {
} else {
}
0) {
}
}
}
if ((scf_comtbl.scf_cmd_exec_flag == 0) &&
SCF_TIMER_NOT_EXEC))) {
/* Check report request */
if (scf_comtbl.scf_report_event_sub ==
/* Send report(System running) command */
if ((scf_comtbl.scf_cmd_resend_req &
RESEND_REPORT_RUN) != 0) {
}
} else if (scf_comtbl.scf_report_event_sub ==
/* Send report(Shutdown start) command */
scf_comtbl.scf_sbuf[0] =
if ((scf_comtbl.scf_cmd_resend_req &
RESEND_REPORT_SHUT) != 0) {
}
}
}
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* Check alive check request */
/* Send alive check start command */
0) {
}
} else if (scf_comtbl.scf_alive_event_sub ==
/* Send alive check stop command */
0) {
}
}
}
/* Check send wait */
}
}
/* Signal to command wait */
if ((scf_comtbl.scf_cmd_exec_flag == 0) &&
(scf_comtbl.cmd_busy_wait != 0)) {
scf_comtbl.cmd_busy_wait = 0;
sizeof (kcondvar_t));
}
/*
* END_next_cmd_check
*/
}
/*
* scf_next_rxdata_get()
*
* Description: Next receive data Read processing.
*
*/
void
scf_next_rxdata_get(void)
{
#define SCF_FUNC_NAME "scf_next_rxdata_get() "
int path_ret;
int ii;
/* Check command send exec */
if (scf_comtbl.scf_cmd_exec_flag == 0) {
goto END_next_rxdata_get;
}
/* Get SCF path status */
/* Check SCF path status */
if (path_ret != SCF_PATH_ONLINE) {
goto END_next_rxdata_get;
}
/* Check remainder receive data size */
if (scf_comtbl.scf_rem_rxbuff_size == 0) {
goto END_next_rxdata_get;
}
} else {
}
/* Receive data copy */
wk_in_p);
}
/* Check remainder receive data size */
if (scf_comtbl.scf_rem_rxbuff_size != 0) {
/* Next receive data timer start */
goto END_next_rxdata_get;
}
/* Remainder receive data end */
/* Make SRAM data sum */
}
}
/* Check SRAM data sum */
statep->resum_rcnt = 0;
scf_comtbl.cmd_end_wait = 0;
/* Signal to command end wait */
sizeof (kcondvar_t));
/* Next command send check */
} else {
statep->resum_rcnt++;
/* Check Rx sum re-try out */
/* SRAM trace */
"%s,Failed the receive data SUM of "
"SRAM. SCF command =0x%02x%02x\n",
} else {
/* Set command wait status */
/* Next command send check */
}
}
/*
* END_next_rxdata_get
*/
}
/*
* scf_online_wait_tout()
*
* Description: SCF online monitor timeout processing.
*
*/
void
scf_online_wait_tout(void)
{
#define SCF_FUNC_NAME "scf_online_wait_tout() "
int online_flag = 0;
int ii;
/* Get SCF path status */
}
/* Check SCF path status */
goto END_online_wait_tout;
}
/* Get SCF status extended register */
/* Check SCF status */
/*
* SCF online
*/
}
/* SRAM trace */
/* DCSP interface start */
/* Check Alive check exec */
}
/* Check command send exec */
if (scf_comtbl.scf_cmd_exec_flag) {
/* Set command wait status */
}
/* Next command send check */
/* Check next command send */
if (scf_comtbl.cmd_busy_wait != 0) {
scf_comtbl.cmd_busy_wait = 0;
/* Signal to command wait */
}
} else {
/*
* SCF offline
*/
/* Check standby path */
/* Get SCF status extended register */
sizeof (wkstatep->reg_status_exr));
/* Check SCF status */
if ((wkstatep->reg_status_exr &
/* SCF path change process */
online_flag = 1;
break;
}
/* SCF path change */
/* Check standby path */
/* Not change path */
break;
}
if (wkstatep != wait_top_statep) {
/* Next SCF path */
continue;
} else {
/* Not change path */
break;
}
}
}
if (online_flag != 0) {
goto END_online_wait_tout;
}
statep->online_to_rcnt++;
/* Check re-try out */
/* SCF online timer start */
goto END_online_wait_tout;
}
/* SRAM trace */
/* Timer stop */
if (scf_comtbl.suspend_wait) {
/* Signal to suspend wait */
scf_comtbl.suspend_wait = 0;
sizeof (kcondvar_t));
}
if (scf_comtbl.cmd_end_wait != 0) {
/* Signal to command end wait */
scf_comtbl.cmd_end_wait = 0;
sizeof (kcondvar_t));
}
if (scf_comtbl.cmd_busy_wait != 0) {
/* Signal to command wait */
scf_comtbl.cmd_busy_wait = 0;
sizeof (kcondvar_t));
}
/* DCSP interface stop */
}
/*
* END_online_wait_tout
*/
}
/*
* scf_cmdbusy_tout()
*
* Description: SCF command busy monitor timeout processing.
*
*/
void
scf_cmdbusy_tout(void)
{
#define SCF_FUNC_NAME "scf_cmdbusy_tout() "
int path_ret;
/* Get SCF path status */
/* Check SCF path status */
goto END_cmdbusy_tout;
}
/* SRAM trace */
/* Get SCF command register */
sizeof (wk_int8));
/* Check busy flag */
/* Next command send check */
} else {
/* Check re-try out */
/* SCF online timer start */
goto END_cmdbusy_tout;
}
"%s,Busy state of SCF command is "
} else {
"%s,Busy state of XSCF is not released.\n",
}
}
/*
* END_cmdbusy_tout
*/
}
/*
* scf_cmdend_tout()
*
* Description: SCF command complete monitor timeout processing.
*
*/
void
scf_cmdend_tout(void)
{
#define SCF_FUNC_NAME "scf_cmdend_tout() "
int path_ret;
/* Get SCF path status */
/* Check SCF path status */
goto END_cmdend_tout;
}
/* SRAM trace */
/* error memo */
if (scf_comtbl.scf_exec_cmd_id) {
/* Comand send for ioctl */
} else {
/* Comand send for interrupt */
}
statep->cmd_to_rcnt++;
/* Check re-try out */
/* Set command wait status */
/* Next command send check */
} else {
"%s,SCF command timeout occurred. "
"SCF command = 0x%02x%02x\n",
}
/*
* END_cmdend_tout
*/
}
/*
* scf_report_send_wait_tout()
*
* Description: Report command send wait timeout processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_report_send_wait_tout() "
int next_send = 0;
/* Get SCF path status */
(void) scf_path_check(&statep);
/* Check SCF path status */
/* Last send report send */
next_send = 1;
} else if (scf_comtbl.scf_last_report ==
next_send = 1;
}
if (next_send) {
/* Next command send check */
}
}
}
/*
* scf_alivecheck_intr()
*
* Description: Alive check timeout interrupt processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_alivecheck_intr() "
/* Check alive check exec */
if (scf_comtbl.scf_alive_int_count == 0) {
/* Alive check register set */
/* Register read sync */
}
}
}
/*
* scf_path_change()
*
* Description: SCF pass change processing.
*
*/
void
{
#define SCF_FUNC_NAME "scf_path_change() "
uint_t path_change = 0;
act_statep = statep;
/* Interrupt disable */
/* Change statep */
} else {
}
}
}
} else {
/* SCF path change interrupt or SCF online wait timeout */
}
/* Interrupt disable */
/* Interrupt enable */
}
}
if (path_change) {
/* FMEMA interface */
/* Check standby path */
if (path_change == FACTOR_PATH_HALT) {
/* Check SCF path change retry */
if (scf_comtbl.path_change_rcnt <
} else {
/* SCF path change retry over */
}
}
} else {
/* Not change path */
}
if (halt_flag == 0) {
if (wkstatep != act_statep) {
"%s: SCFC path changed. (%s --> %s)\n",
&act_statep->pathname[0],
}
/* Timer stop */
/* Set command wait status */
/* Send path change */
/* DCSP interface stop */
}
}
if (halt_flag) {
/* Timer stop */
if (scf_comtbl.suspend_wait) {
/* Signal to suspend wait */
scf_comtbl.suspend_wait = 0;
sizeof (kcondvar_t));
}
if (scf_comtbl.cmd_end_wait != 0) {
/* Signal to command end wait */
scf_comtbl.cmd_end_wait = 0;
}
if (scf_comtbl.cmd_busy_wait != 0) {
/* Signal to command wait */
scf_comtbl.cmd_busy_wait = 0;
}
/* DCSP interface stop */
if (halt_flag == FACTOR_PATH_HALT) {
/* Not change path(SCF HALT) */
/* FMEMA interface */
"%s: SCF HALT was detected.\n",
/* SCF HALT after processing */
}
}
}
/*
* scf_halt()
*
*
*/
void
{
#define SCF_FUNC_NAME "scf_halt() "
switch (mode) {
case HALTPROC_SHUTDOWN:
"%s: Shutdown was executed.\n",
/* System shutdown start */
if (scf_comtbl.scf_shutdownreason == 0) {
do_shutdown();
}
break;
case HALTPROC_PANIC:
/* System panic */
"%s: Executed panic by SCF HALT.\n",
break;
default:
break;
}
}
/*
* scf_panic_callb()
*
* Description: Panic entry processing.
*
*/
/* ARGSUSED */
void
scf_panic_callb(int code)
{
#define SCF_FUNC_NAME "scf_panic_callb() "
unsigned short status;
int counter;
int report_succeeded = 0;
int path_flag = 0;
int path_counter = 0;
int report_counter = 0;
int ii = 0;
int new_report = 0;
code);
/* Check panic after */
if (scf_panic_reported) {
return;
}
/* Check double panic */
if (scf_panic_exec_flag) {
return;
}
/* Check shutdown exec */
if (scf_comtbl.scf_shutdown_exec_flag) {
return;
}
/* Set panic exec flag */
scf_panic_exec_flag = 1;
/* wait */
/* Exec SCF path interrupt disable */
/* SCF interrupt disable(CR) */
/* Register read sync */
/* SCF Status register interrupt(STR) : clear */
/* SCF Status extended register(STExR) : interrupt clear */
/* DSCP buffer status register(DSR) : interrupt clear */
/* SCF interrupt status register(ISR) : interrupt clear */
}
/* Path change SCF path interrupt disable */
/* SCF interrupt disable(CR) */
/* Register read sync */
/* SCF Status register interrupt(STR) : clear */
/* SCF Status extended register(STExR) : interrupt clear */
/* DSCP buffer status register(DSR) : interrupt clear */
/* SCF interrupt status register(ISR) : interrupt clear */
}
/* SCF interrupt disable(CR) */
/* Register read sync */
/* SCF Status register interrupt(STR) : clear */
/* SCF Status extended register(STExR) : interrupt clear */
/* DSCP buffer status register(DSR) : interrupt clear */
/* SCF interrupt status register(ISR) : interrupt clear */
}
status = 0;
/* Check comand exec */
if (scf_comtbl.scf_cmd_exec_flag == 0) {
/* Not use SCF path */
goto END_scf_panic_callb;
}
path_flag = 1;
}
}
goto START_scf_panic;
}
goto END_scf_panic_callb;
}
/* wait */
path_flag = 1;
}
}
if (path_flag == 0) {
/* wait */
/* Get SCF status register */
if (status & STATUS_CMD_COMPLETE) {
/* Command complete */
break;
}
}
}
/*
* START_scf_panic
*/
do {
/*
* START_scf_panic_loop
*/
/* Check SCF path change */
if (path_flag == 0) {
goto START_report_send;
}
sbuf.b[0] = REPORT_STAT_PANIC;
/* Check command complete */
/* wait */
/* Get SCF status register */
if (status & STATUS_CMD_COMPLETE) {
/* Command complete */
break;
}
}
if (ii == scf_cmdend_wait_rcnt_panic) {
/* Not command complete */
if (path_counter < 1) {
path_counter++;
goto START_scf_panic_loop;
}
goto END_scf_panic_callb;
}
case NORMAL_END:
path_flag = 0;
report_counter = 0;
break;
default:
if (path_counter < 1) {
path_flag = 1;
path_counter++;
goto START_scf_panic_loop;
}
goto END_scf_panic_callb;
}
/*
* START_report_send
*/
if (new_report) {
/* new report panic */
} else {
/* report panic */
}
sbuf.b[0] = REPORT_STAT_PANIC;
scf_panic_exec_flag2 = 1;
/* Check command complete */
/* wait */
/* Get SCF status register */
if (status & STATUS_CMD_COMPLETE) {
/* Command complete */
break;
}
}
if (ii == scf_cmdend_wait_rcnt_panic) {
/* Not command complete */
if (report_counter < 1) {
goto START_scf_panic_loop;
}
goto END_scf_panic_callb;
}
case NORMAL_END:
/* command success */
report_succeeded = 1;
goto END_scf_panic_callb;
case BUF_FUL:
counter--;
if (counter > 0) {
}
break;
case RCI_BUSY:
counter--;
if (counter > 0) {
}
break;
case INTERFACE:
counter--;
break;
case E_SCFC_NOPATH:
if (new_report == 0) {
path_flag = 1;
path_counter = 0;
goto START_scf_panic_loop;
}
default:
/* E_NOT_SUPPORT */
/* E_PARAM */
/* E_RCI_ACCESS */
/* RCI_NS */
goto END_scf_panic_callb;
}
} while (counter > 0);
/*
* END_scf_panic_callb
*/
if (report_succeeded) {
scf_panic_reported = 1;
} else {
}
}
/*
* scf_shutdown_callb()
*
* Description: Shutdown entry processing.
*
*/
/* ARGSUSED */
void
scf_shutdown_callb(int code)
{
#define SCF_FUNC_NAME "scf_shutdown_callb() "
int ret;
code);
/* Check panic exec or shutdown exec */
goto END_scf_shutdown_callb99;
}
/* SCF command transmit sync stop */
if (ret != 0) {
goto END_scf_shutdown_callb;
}
sbuf.b[0] = REPORT_STAT_SHUTDOWN_START;
if (ret != 0) {
goto END_scf_shutdown_callb;
}
/* SCF command send sync re-stop */
if (ret != 0) {
goto END_scf_shutdown_callb;
}
/* Check alive check exec */
if (ret != 0) {
"shutdown", 8);
goto END_scf_shutdown_callb;
}
/* SCF command send sync re-stop */
}
/*
* END_scf_shutdown_callb
*/
}
scf_comtbl.scf_exec_p = 0;
scf_comtbl.scf_path_p = 0;
if (statep) {
/* Exec device interrupt disable */
}
while (scf_comtbl.scf_wait_p) {
/* Standby device interrupt disable */
}
/* SCF command send sync start */
/* DCSP interface stop */
/*
* END_scf_shutdown_callb99
*/
}
/*
* scf_softintr()
*
* Description: Soft interrupt entry processing. (for DSCP callback)
*
*/
/* ARGSUSED */
{
#define SCF_FUNC_NAME "scf_softintr() "
/* Lock driver mutex */
/* Check panic exec and shutdown exec */
if ((scf_panic_exec_flag == 0) &&
(scf_comtbl.scf_shutdown_exec_flag == 0)) {
}
/* Unlock driver mutex */
}
return (ret);
}
/*
* scf_cmdwait_status_set()
*
* Description: Check and setting command status.
*
*/
void
scf_cmdwait_status_set(void)
{
#define SCF_FUNC_NAME "scf_cmdwait_status_set() "
/* Set command wait status */
/* Set command retry send flag */
}
/* Set command retry send flag */
}
switch (scf_comtbl.scf_shut_event_sub) {
case EVENT_SUB_SHUT_EXEC:
/* Set command retry send flag */
break;
case EVENT_SUB_EXEC:
/* Set command retry send flag */
break;
default:
break;
}
switch (scf_comtbl.scf_alive_event_sub) {
case EVENT_SUB_ALST_EXEC:
/* Set command retry send flag */
break;
case EVENT_SUB_ALSP_EXEC:
/* Set command retry send flag */
break;
default:
break;
}
switch (scf_comtbl.scf_report_event_sub) {
/* Set command retry send flag */
break;
/* Set command retry send flag */
break;
default:
break;
}
if (scf_comtbl.scf_cmd_exec_flag) {
if (scf_comtbl.cmd_end_wait) {
/* Set command retry send flag */
}
}
}