Compare commits
12 Commits
R3.12.0-be
...
R3.12.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4f720482b | ||
|
|
8f3b1cce16 | ||
|
|
a94db92c29 | ||
|
|
b6a46820e9 | ||
|
|
cf7307f399 | ||
|
|
fb0a164de1 | ||
|
|
8d9d7a126a | ||
|
|
67378ebaa1 | ||
|
|
0859173047 | ||
|
|
0f1c9c357a | ||
|
|
a4cfb43ba1 | ||
|
|
6c620894f5 |
@@ -1,6 +1,10 @@
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.4 1994/10/28 20:15:10 jbk
|
||||
* increased the USP packet time-out to 250ms, added a parm to the configure()
|
||||
* routine to let user specify it.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
@@ -653,7 +657,23 @@ static void TSerrorHandler(int Card, int ErrorNum)
|
||||
Could put the slave on the vxworks timer until next sync
|
||||
*/
|
||||
|
||||
logMsg("***TSerrorHandler: error number %d=n",ErrorNum,0,0,0,0,0);
|
||||
if(MAKE_DEBUG)
|
||||
{
|
||||
switch(ErrorNum)
|
||||
{
|
||||
case 1:
|
||||
logMsg("***TSerrorHandler: event system error: TAXI violation",0,0,0,0,0,0);
|
||||
break;
|
||||
case 2:
|
||||
logMsg("***TSerrorHandler: event system error: lost heartbeat",0,0,0,0,0,0);
|
||||
break;
|
||||
case 3:
|
||||
logMsg("***TSerrorHandler: event system error: lost events",0,0,0,0,0,0);
|
||||
break;
|
||||
default:
|
||||
logMsg("***TSerrorHandler: unknown error %d from event system", ErrorNum,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -772,9 +772,10 @@ static long initDatabase(void)
|
||||
* Severity/No Maximize Severity(MS/NMS), and output NMS
|
||||
* links ... The following code checks for this.
|
||||
*/
|
||||
if (plink->value.db_link.process_passive
|
||||
if (errVerbose &&
|
||||
(plink->value.db_link.process_passive
|
||||
|| (pfldDes->field_type == DBF_OUTLINK
|
||||
&& plink->value.db_link.maximize_sevr))
|
||||
&& plink->value.db_link.maximize_sevr)))
|
||||
{
|
||||
/*
|
||||
* Link PP and/or Outlink MS ...
|
||||
@@ -789,7 +790,7 @@ static long initDatabase(void)
|
||||
strcat(message," PP and/or MS illegal");
|
||||
status = S_db_badField;
|
||||
errMessage(status,message);
|
||||
if(rtnval==OK) rtnval=status;
|
||||
status = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static long init_record(pmbbo)
|
||||
case (VME_IO) :
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
pmbbo->shft = pvmeio->signal;
|
||||
pmbbo->mask = pmbbo->shft;
|
||||
pmbbo->mask <<= pmbbo->shft;
|
||||
status = xy220_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
else status = 2;
|
||||
|
||||
@@ -83,7 +83,7 @@ static long init_record(pmbbo)
|
||||
case (VME_IO) :
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
pmbbo->shft = pvmeio->signal;
|
||||
pmbbo->mask = pmbbo->shft;
|
||||
pmbbo->mask <<= pmbbo->shft;
|
||||
status = xy220_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
else status = 2;
|
||||
|
||||
@@ -7,13 +7,20 @@ USR_INCLUDES = -I../../drv
|
||||
SRCS.c = \
|
||||
../devAnalytekGpib.c ../devXxDg535Gpib.c ../devBBInteract.c \
|
||||
../devGpibInteract.c ../devXxSr620Gpib.c ../devK486Gpib.c \
|
||||
../devXxK196Gpib.c ../devXxDc5009Gpib.c ../devXxK263Gpib.c
|
||||
../devXxK196Gpib.c ../devXxDc5009Gpib.c ../devXxK263Gpib.c \
|
||||
../devXxSkeletonGpib.c
|
||||
|
||||
PROD = \
|
||||
OBJS = \
|
||||
devAnalytekGpib.o devXxDg535Gpib.o devBBInteract.o \
|
||||
devGpibInteract.o devXxSr620Gpib.o devK486Gpib.o \
|
||||
devXxK196Gpib.o devXxDc5009Gpib.o devXxK263Gpib.o
|
||||
devXxK196Gpib.o devXxDc5009Gpib.o devXxK263Gpib.o \
|
||||
devXxSkeletonGpib.o
|
||||
|
||||
PROD = devLibOpt $(OBJS)
|
||||
|
||||
include $(EPICS)/config/RULES.Vx
|
||||
|
||||
devLibOpt: $(OBJS)
|
||||
$(RM) $@
|
||||
$(LINK.c) $@ $(OBJS) $(LDLIBS)
|
||||
|
||||
|
||||
@@ -404,9 +404,9 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest(phwpvt->unsolicitedDpvt);
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
* This driver currently needs work on error message generation.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.35 1994/12/12 16:02:57 winans
|
||||
* Rewrote the init code so that it always returns a zero (don't kill the
|
||||
* startup.cmd file.) It is possible that this could cause some confusion
|
||||
* to the database, should it decide to then use a link that did not init
|
||||
* properly.
|
||||
*
|
||||
* Revision 1.34 1994/10/19 18:31:22 winans
|
||||
* ANSIfied the bitbus driver so that the compiler stopped warning about
|
||||
* exery third line of code.
|
||||
@@ -163,7 +169,7 @@ int XycomMaxOutstandMsgs = XYCOM_BB_MAX_OUTSTAND_MSGS;
|
||||
* To disable this feature, set one of them to -1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int bbDebug = 0;
|
||||
int bbDebug = 1;
|
||||
int bbDebugLink=-1;
|
||||
int bbDebugNode=-1;
|
||||
|
||||
@@ -434,7 +440,7 @@ STATIC long reportBB(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (bbDebug)
|
||||
if (bbDebug>1)
|
||||
printf("Bitbus debugging flag is set to %d\n", bbDebug);
|
||||
|
||||
for (i=0; i< BB_NUM_LINKS; i++)
|
||||
@@ -483,8 +489,10 @@ pepReset(int link)
|
||||
|
||||
taskDelay(20); /* give the 80152 time to self check */
|
||||
|
||||
if ((pBBLink[link]->l.PepLink.bbRegs->stat_ctl & 0x10) != 0x0) {
|
||||
printf("pepReset(%d): PB-BIT firmware reset failed!\n", link);
|
||||
if ((pBBLink[link]->l.PepLink.bbRegs->stat_ctl & 0x10) != 0x0)
|
||||
{
|
||||
if (bbDebug)
|
||||
printf("pepReset(%d): PB-BIT firmware reset failed!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -495,7 +503,8 @@ pepReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("pepReset(%d): receive fifo will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepReset(%d): receive fifo will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -547,7 +556,8 @@ STATIC int xvmeReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -557,13 +567,15 @@ STATIC int xvmeReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
if ((pBBLink[link]->l.XycomLink.bbRegs->fifo_stat & XVME_FSVALID) != XVME_FSIDLE)
|
||||
{
|
||||
printf("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -861,7 +873,8 @@ xvmeRxTask(int link)
|
||||
{ /* something bad happened... inject a delay to the */
|
||||
/* requested timeout duration. */
|
||||
|
||||
printf("xvmeRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[2]);
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[2]);
|
||||
(pBBLink[link]->syntheticDelay[rxDpvtHead->txMsg.node]) = rxDpvtHead->retire;
|
||||
pBBLink[link]->DelayCount++;
|
||||
}
|
||||
@@ -907,17 +920,6 @@ xvmeRxTask(int link)
|
||||
|
||||
rxDpvtHead->status = BB_OK; /* OK, unless BB_LENGTH */
|
||||
rxState = BBRX_DATA; /* finish reading till RCMD */
|
||||
|
||||
#if 0
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("xvmeRxTask(%d): msg from node %d unsolicited!\nHeader:", link, rxHead[2]);
|
||||
rxDpvtHead->rxMsg.length = 7; /* we just have the header now */
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
}
|
||||
semGive(pXvmeLink[link]->pbbLink->busyList.sem);
|
||||
rxState = BBRX_IGN; /* nothing waiting... toss it */
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -950,7 +952,8 @@ xvmeRxTask(int link)
|
||||
if (rxDpvtHead == NULL)
|
||||
{
|
||||
ch = pBBLink[link]->l.XycomLink.bbRegs->cmnd;
|
||||
printf("xvmeRxTask(%d): got unexpected XVME_RCMD\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): got unexpected XVME_RCMD\n", link);
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_RX_URCMD);
|
||||
#endif
|
||||
@@ -960,7 +963,7 @@ xvmeRxTask(int link)
|
||||
rxDpvtHead->status = BB_OK;
|
||||
rxDpvtHead->rxCmd = pBBLink[link]->l.XycomLink.bbRegs->cmnd;
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("xvmeRxTask(%d): msg from node %d unsolicited:", link, rxDpvtHead->rxMsg.node);
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
@@ -1023,14 +1026,14 @@ xvmeRxTask(int link)
|
||||
/* Tell the watch dog I am ready for the reset (reset in the dog task) */
|
||||
pBBLink[link]->rxAbortAck = 1;
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
/* wait for link state to become active again */
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME);
|
||||
|
||||
/* if bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
}
|
||||
@@ -1149,7 +1152,7 @@ xvmeWdTask(int link)
|
||||
/* Get rid of the request and set error status etc... */
|
||||
listDel(&(pBBLink[link]->busyList), pnode);
|
||||
|
||||
/*if (bbDebug)*/
|
||||
if (bbDebug)
|
||||
{
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_WD_TIMEOUT);
|
||||
@@ -1187,7 +1190,8 @@ xvmeWdTask(int link)
|
||||
{ /* Send out a RAC_NODE_OFFLINE to the controller */
|
||||
semGive(pBBLink[link]->busyList.sem);
|
||||
|
||||
printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
if (bbDebug)
|
||||
printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
|
||||
semTake(pBBLink[link]->queue[BB_Q_HIGH].sem, WAIT_FOREVER);
|
||||
listAddHead(&(pBBLink[link]->queue[BB_Q_HIGH]), &resetNode);
|
||||
@@ -1197,7 +1201,8 @@ printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
|
||||
if (semTake(syncSem, sysClkRateGet()/4) == ERROR)
|
||||
{
|
||||
printf("xvmeWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
pBBLink[link]->nukeEm = 1;
|
||||
|
||||
pBBLink[link]->abortFlag = 1; /* Start the abort sequence */
|
||||
@@ -1301,13 +1306,13 @@ xvmeTxTask(int link)
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME); /* wait for link to reset */
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
else
|
||||
@@ -1340,7 +1345,8 @@ xvmeTxTask(int link)
|
||||
if ((pBBLink[link]->syntheticDelay[pnode->txMsg.node] != 0)
|
||||
&& (pBBLink[link]->syntheticDelay[pnode->txMsg.node] < now))
|
||||
{
|
||||
printf("xvmeTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--;
|
||||
pBBLink[link]->syntheticDelay[pnode->txMsg.node] = 0;
|
||||
pBBLink[link]-> DelayCount--;
|
||||
@@ -1412,7 +1418,7 @@ xvmeTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_RESET);
|
||||
#endif
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): RAC_RESET_SLAVE sent, resetting node %d\n", link, pnode->txMsg.node);
|
||||
|
||||
pnode->status = BB_OK;
|
||||
@@ -1486,8 +1492,11 @@ xvmeTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
printf("Message in progress when abort issued:\n");
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("Message in progress when abort issued:\n");
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
}
|
||||
}
|
||||
/* BUG -- I don't really need this */
|
||||
/* break;*/ /* stop checking the fifo queues */
|
||||
@@ -1510,7 +1519,7 @@ xvmeTxTask(int link)
|
||||
******************************************************************************/
|
||||
STATIC int txStuck(int link)
|
||||
{
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("bitbus transmitter task stuck, resetting link %d\n", link);
|
||||
|
||||
bbReset(link);
|
||||
@@ -1538,14 +1547,6 @@ STATIC long qBBReq(struct dpvtBitBusHead *pdpvt, int prio)
|
||||
errMessage(S_BB_badPrio, message);
|
||||
return(ERROR);
|
||||
}
|
||||
#if 0
|
||||
if (checkLink(pdpvt->link) == ERROR)
|
||||
{
|
||||
sprintf(message, "invalid link requested in call to qbbreq(%8.8X, %d)\n", pdpvt, prio);
|
||||
errMessage(S_BB_rfu1, message);
|
||||
return(ERROR);
|
||||
}
|
||||
#else
|
||||
if (checkLink(pdpvt->link) == ERROR)
|
||||
{
|
||||
if (pdpvt->link >= BB_NUM_LINKS)
|
||||
@@ -1561,7 +1562,6 @@ STATIC long qBBReq(struct dpvtBitBusHead *pdpvt, int prio)
|
||||
}
|
||||
return(ERROR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(pdpvt->link, pdpvt, XACT_HIST_STATE_QUEUE);
|
||||
@@ -1960,7 +1960,8 @@ pepRxTask(int link)
|
||||
if (rxHead[6] == 0x91)
|
||||
{ /* something bad happened... inject a delay to the */
|
||||
/* requested timeout duration. */
|
||||
printf("pepRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[4]);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[4]);
|
||||
(pBBLink[link]->syntheticDelay[rxDpvtHead->txMsg.node]) = rxDpvtHead->retire;
|
||||
pBBLink[link]->DelayCount++;
|
||||
}
|
||||
@@ -2005,21 +2006,6 @@ pepRxTask(int link)
|
||||
|
||||
rxDpvtHead->status = BB_OK; /* OK, unless BB_LENGTH */
|
||||
rxState = BBRX_DATA; /* finish reading till RCMD */
|
||||
|
||||
#if 0 /* relocated to later spot in function */
|
||||
if (rxDpvtHead == NULL)
|
||||
{
|
||||
if (bbDebug > 9)
|
||||
{
|
||||
printf("pepRxTask(%d): msg from node %d unsolicited!\n",
|
||||
link, rxHead[4]);
|
||||
printf("contents: %2.2x %2.2x %2.2x %2.2x %2.2x\n",rxHead[2],
|
||||
rxHead[3],rxHead[4],rxHead[5],rxHead[6]);
|
||||
}
|
||||
semGive(pXvmeLink[link]->pbbLink->busyList.sem);
|
||||
rxState = BBRX_IGN; /* nothing waiting... toss it */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2059,7 +2045,7 @@ pepRxTask(int link)
|
||||
else if (rxDpvtHead == &UselessMsg)
|
||||
{
|
||||
rxDpvtHead->status = BB_OK;
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("pepRxTask(%d): msg from node %d unsolicited:\n", link, rxDpvtHead->rxMsg.node);
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
@@ -2122,15 +2108,15 @@ pepRxTask(int link)
|
||||
/* Tell the watch dog I am ready for the reset (reset in the dog task) */
|
||||
pBBLink[link]->rxAbortAck = 1;
|
||||
|
||||
/* if (bbDebug) */
|
||||
printf("pepRxTask(%d): resetting due to abort status\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
/* wait for link state to become active again */
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME);
|
||||
|
||||
/* if bbDebug) */
|
||||
printf("pepRxTask(%d): restarting after abort\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2248,9 +2234,11 @@ STATIC int pepWdTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_WD_TIMEOUT);
|
||||
#endif
|
||||
/* printf("pepWdTask(%d): TIMEOUT on xact 0x%8.8X\n", link, pnode);*/
|
||||
printf("pepWdTask(%d): TIMEOUT on bitbus message:\n", link);
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("pepWdTask(%d): TIMEOUT on bitbus message:\n", link);
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
}
|
||||
|
||||
/* BUG -- do this here or defer until RX gets a response? */
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--; /* fix device status */
|
||||
@@ -2299,8 +2287,11 @@ STATIC int pepWdTask(int link)
|
||||
|
||||
semGive(pBBLink[link]->linkEventSem); /* Tell TxTask to send the messages */
|
||||
|
||||
if (semTake(syncSem, (sysClkRateGet()) ) == ERROR) {
|
||||
printf("pepWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
if (semTake(syncSem, (sysClkRateGet()) ) == ERROR)
|
||||
{
|
||||
if (bbDebug)
|
||||
printf("pepWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
|
||||
pBBLink[link]->nukeEm = 1;
|
||||
pBBLink[link]->abortFlag = 1;
|
||||
semGive(pBBLink[link]->linkEventSem);
|
||||
@@ -2388,7 +2379,7 @@ STATIC int pepTxTask(int link)
|
||||
register int x;
|
||||
unsigned long now;
|
||||
|
||||
if (bbDebug)
|
||||
if (bbDebug>1)
|
||||
printf("pepTxTask started for link %d\n", link);
|
||||
|
||||
while(1) {
|
||||
@@ -2400,12 +2391,14 @@ STATIC int pepTxTask(int link)
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
|
||||
printf("pepTxTask(%d): resetting due to abort status\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME); /* wait for link to reset */
|
||||
|
||||
printf("pepTxTask(%d): restarting after abort\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2435,7 +2428,8 @@ STATIC int pepTxTask(int link)
|
||||
if ((pBBLink[link]->syntheticDelay[pnode->txMsg.node] != 0)
|
||||
&& (pBBLink[link]->syntheticDelay[pnode->txMsg.node] < now))
|
||||
{
|
||||
printf("pepTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--;
|
||||
pBBLink[link]->syntheticDelay[pnode->txMsg.node] = 0;
|
||||
pBBLink[link]->DelayCount--;
|
||||
@@ -2519,7 +2513,8 @@ STATIC int pepTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_RESET);
|
||||
#endif
|
||||
printf("pepTxTask(%d): RAC_RESET_SLAVE sent\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): RAC_RESET_SLAVE sent\n", link);
|
||||
|
||||
pnode->status = BB_OK;
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ PROD = iocCore vxWorks vxWorks.sym
|
||||
include $(EPICS)/config/RULES.Vx
|
||||
|
||||
vxWorks: $(VX_IMAGE)
|
||||
$(RM) $@
|
||||
cp $< .
|
||||
chmod 444 $@
|
||||
|
||||
vxWorks.sym: $(VX_IMAGE_SYM)
|
||||
$(RM) $@
|
||||
cp $< .
|
||||
chmod 444 $@
|
||||
|
||||
iocCore: $(IOC_CORE_OBJS)
|
||||
$(LINK.c) $@ $(IOC_CORE_OBJS)
|
||||
|
||||
@@ -235,7 +235,7 @@ static long get_enum_strs(paddr,pes)
|
||||
{
|
||||
struct biRecord *pbi=(struct biRecord *)paddr->precord;
|
||||
|
||||
pes->no_str = 0;
|
||||
pes->no_str = 2;
|
||||
memset(pes->strs,'\0',sizeof(pes->strs));
|
||||
strncpy(pes->strs[0],pbi->znam,sizeof(pbi->znam));
|
||||
if(*pbi->znam!=0) pes->no_str=1;
|
||||
|
||||
@@ -368,7 +368,8 @@ static long get_enum_strs(paddr,pes)
|
||||
{
|
||||
struct boRecord *pbo=(struct boRecord *)paddr->precord;
|
||||
|
||||
pes->no_str = 0;
|
||||
/*SETTING no_str=0 breaks channel access clients*/
|
||||
pes->no_str = 2;
|
||||
memset(pes->strs,'\0',sizeof(pes->strs));
|
||||
strncpy(pes->strs[0],pbo->znam,sizeof(pbo->znam));
|
||||
if(*pbo->znam!=0) pes->no_str=1;
|
||||
|
||||
@@ -43,9 +43,11 @@
|
||||
* .07 10-21-94 nda changed linear scan parameter algorithms so changing
|
||||
* start/end modifies step/width unless frozen. This
|
||||
* seems more intuitive.
|
||||
* .08 12-06-94 nda added support for .FFO .When set to 1, frzFlag values
|
||||
* are saved in recPvtStruct. Restored when FFO set to 0.
|
||||
*/
|
||||
|
||||
#define VERSION 1.07
|
||||
#define VERSION 1.08
|
||||
|
||||
|
||||
|
||||
@@ -144,6 +146,28 @@ struct recPvtStruct {
|
||||
struct p_limits *pP2Limits;
|
||||
struct p_limits *pP3Limits;
|
||||
struct p_limits *pP4Limits;
|
||||
short pffo; /* previouss state of ffo */
|
||||
short fpts; /* backup copy of all freeze flags */
|
||||
short p1fs;
|
||||
short p1fi;
|
||||
short p1fc;
|
||||
short p1fe;
|
||||
short p1fw;
|
||||
short p2fs;
|
||||
short p2fi;
|
||||
short p2fc;
|
||||
short p2fe;
|
||||
short p2fw;
|
||||
short p3fs;
|
||||
short p3fi;
|
||||
short p3fc;
|
||||
short p3fe;
|
||||
short p3fw;
|
||||
short p4fs;
|
||||
short p4fi;
|
||||
short p4fc;
|
||||
short p4fe;
|
||||
short p4fw;
|
||||
unsigned long tickStart; /* used to time the scan */
|
||||
unsigned char scanErr;
|
||||
unsigned char nptsCause; /* who caused the "# of points to change:
|
||||
@@ -208,6 +232,9 @@ static void adjLinParms();
|
||||
static void changedNpts();
|
||||
static void checkScanLimits();
|
||||
static void drawPos1Scan();
|
||||
static void saveFrzFlags();
|
||||
static void resetFrzFlags();
|
||||
static void restoreFrzFlags();
|
||||
/* variables ... */
|
||||
long scanRecDebug=0;
|
||||
long viewScanPos=0;
|
||||
@@ -286,6 +313,11 @@ static long init_record(pscan,pass)
|
||||
precPvt->nptsCause = 0; /* resolve all positioner parameters */
|
||||
changedNpts(pscan);
|
||||
|
||||
if(pscan->ffo) {
|
||||
saveFrzFlags(pscan);
|
||||
resetFrzFlags(pscan);
|
||||
}
|
||||
|
||||
/* init field values */
|
||||
pscan->exsc = 0;
|
||||
pscan->pxsc = 0;
|
||||
@@ -344,6 +376,7 @@ static long special(paddr,after)
|
||||
unsigned char prevAlrt;
|
||||
|
||||
if(!after) {
|
||||
precPvt->pffo = pscan->ffo; /* save previous ffo flag */
|
||||
return(0);
|
||||
}
|
||||
switch(special_type) {
|
||||
@@ -417,6 +450,25 @@ static long special(paddr,after)
|
||||
}
|
||||
break;
|
||||
|
||||
case(SPC_SC_FFO):
|
||||
/* Freeze Flag Override field */
|
||||
if((pscan->ffo) && (!precPvt->pffo)) {
|
||||
saveFrzFlags(pscan);
|
||||
resetFrzFlags(pscan);
|
||||
}
|
||||
else if(!pscan->ffo && precPvt->pffo) /* only on 1->0 */
|
||||
restoreFrzFlags(pscan);
|
||||
|
||||
break;
|
||||
|
||||
case(SPC_SC_F):
|
||||
/* Freeze Flag Override field */
|
||||
if(pscan->ffo)
|
||||
resetFrzFlags(pscan);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
/* recGblDbaddrError(S_db_badChoice,paddr,"scan: special");
|
||||
return(S_db_badChoice);
|
||||
@@ -1993,3 +2045,267 @@ static void drawPos1Scan(pscan)
|
||||
}
|
||||
|
||||
|
||||
static void saveFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* save state of each freeze flag */
|
||||
precPvt->fpts = pscan->fpts;
|
||||
precPvt->p1fs = pscan->p1fs;
|
||||
precPvt->p1fi = pscan->p1fi;
|
||||
precPvt->p1fc = pscan->p1fc;
|
||||
precPvt->p1fe = pscan->p1fe;
|
||||
precPvt->p1fw = pscan->p1fw;
|
||||
precPvt->p2fs = pscan->p2fs;
|
||||
precPvt->p2fi = pscan->p2fi;
|
||||
precPvt->p2fc = pscan->p2fc;
|
||||
precPvt->p2fe = pscan->p2fe;
|
||||
precPvt->p2fw = pscan->p2fw;
|
||||
precPvt->p3fs = pscan->p3fs;
|
||||
precPvt->p3fi = pscan->p3fi;
|
||||
precPvt->p3fc = pscan->p3fc;
|
||||
precPvt->p3fe = pscan->p3fe;
|
||||
precPvt->p3fw = pscan->p3fw;
|
||||
precPvt->p4fs = pscan->p4fs;
|
||||
precPvt->p4fi = pscan->p4fi;
|
||||
precPvt->p4fc = pscan->p4fc;
|
||||
precPvt->p4fe = pscan->p4fe;
|
||||
precPvt->p4fw = pscan->p4fw;
|
||||
}
|
||||
|
||||
static void resetFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* reset each frzFlag, post monitor if changed */
|
||||
|
||||
if(pscan->fpts) {
|
||||
pscan->fpts = 0;
|
||||
db_post_events(pscan,&pscan->fpts, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fs) {
|
||||
pscan->p1fs = 0;
|
||||
db_post_events(pscan,&pscan->p1fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fi) {
|
||||
pscan->p1fi = 0;
|
||||
db_post_events(pscan,&pscan->p1fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fc) {
|
||||
pscan->p1fc = 0;
|
||||
db_post_events(pscan,&pscan->p1fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fe) {
|
||||
pscan->p1fe = 0;
|
||||
db_post_events(pscan,&pscan->p1fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fw) {
|
||||
pscan->p1fw = 0;
|
||||
db_post_events(pscan,&pscan->p1fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fs) {
|
||||
pscan->p2fs = 0;
|
||||
db_post_events(pscan,&pscan->p2fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fi) {
|
||||
pscan->p2fi = 0;
|
||||
db_post_events(pscan,&pscan->p2fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fc) {
|
||||
pscan->p2fc = 0;
|
||||
db_post_events(pscan,&pscan->p2fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fe) {
|
||||
pscan->p2fe = 0;
|
||||
db_post_events(pscan,&pscan->p2fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fw) {
|
||||
pscan->p2fw = 0;
|
||||
db_post_events(pscan,&pscan->p2fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fs) {
|
||||
pscan->p3fs = 0;
|
||||
db_post_events(pscan,&pscan->p3fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fi) {
|
||||
pscan->p3fi = 0;
|
||||
db_post_events(pscan,&pscan->p3fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fc) {
|
||||
pscan->p3fc = 0;
|
||||
db_post_events(pscan,&pscan->p3fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fe) {
|
||||
pscan->p3fe = 0;
|
||||
db_post_events(pscan,&pscan->p3fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fw) {
|
||||
pscan->p3fw = 0;
|
||||
db_post_events(pscan,&pscan->p3fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fs) {
|
||||
pscan->p4fs = 0;
|
||||
db_post_events(pscan,&pscan->p4fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fi) {
|
||||
pscan->p4fi = 0;
|
||||
db_post_events(pscan,&pscan->p4fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fc) {
|
||||
pscan->p4fc = 0;
|
||||
db_post_events(pscan,&pscan->p4fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fe) {
|
||||
pscan->p4fe = 0;
|
||||
db_post_events(pscan,&pscan->p4fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fw) {
|
||||
pscan->p4fw = 0;
|
||||
db_post_events(pscan,&pscan->p4fw, DBE_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Restores Freeze Flags to the state they were in */
|
||||
static void restoreFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* restore state of each freeze flag, post if changed */
|
||||
pscan->fpts = precPvt->fpts;
|
||||
if(pscan->fpts) {
|
||||
db_post_events(pscan,&pscan->fpts, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fs = precPvt->p1fs;
|
||||
if(pscan->p1fs) {
|
||||
db_post_events(pscan,&pscan->p1fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fi = precPvt->p1fi;
|
||||
if(pscan->p1fi) {
|
||||
db_post_events(pscan,&pscan->p1fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fc = precPvt->p1fc;
|
||||
if(pscan->p1fc) {
|
||||
db_post_events(pscan,&pscan->p1fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fe = precPvt->p1fe;
|
||||
if(pscan->p1fe) {
|
||||
db_post_events(pscan,&pscan->p1fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fw = precPvt->p1fw;
|
||||
if(pscan->p1fw) {
|
||||
db_post_events(pscan,&pscan->p1fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fs = precPvt->p2fs;
|
||||
if(pscan->p2fs) {
|
||||
db_post_events(pscan,&pscan->p2fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fi = precPvt->p2fi;
|
||||
if(pscan->p2fi) {
|
||||
db_post_events(pscan,&pscan->p2fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fc = precPvt->p2fc;
|
||||
if(pscan->p2fc) {
|
||||
db_post_events(pscan,&pscan->p2fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fe = precPvt->p2fe;
|
||||
if(pscan->p2fe) {
|
||||
db_post_events(pscan,&pscan->p2fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fw = precPvt->p2fw;
|
||||
if(pscan->p2fw) {
|
||||
db_post_events(pscan,&pscan->p2fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fs = precPvt->p3fs;
|
||||
if(pscan->p3fs) {
|
||||
db_post_events(pscan,&pscan->p3fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fi = precPvt->p3fi;
|
||||
if(pscan->p3fi) {
|
||||
db_post_events(pscan,&pscan->p3fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fc = precPvt->p3fc;
|
||||
if(pscan->p3fc) {
|
||||
db_post_events(pscan,&pscan->p3fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fe = precPvt->p3fe;
|
||||
if(pscan->p3fe) {
|
||||
db_post_events(pscan,&pscan->p3fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fw = precPvt->p3fw;
|
||||
if(pscan->p3fw) {
|
||||
db_post_events(pscan,&pscan->p3fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fs = precPvt->p4fs;
|
||||
if(pscan->p4fs) {
|
||||
db_post_events(pscan,&pscan->p4fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fi = precPvt->p4fi;
|
||||
if(pscan->p4fi) {
|
||||
db_post_events(pscan,&pscan->p4fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fc = precPvt->p4fc;
|
||||
if(pscan->p4fc) {
|
||||
db_post_events(pscan,&pscan->p4fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fe = precPvt->p4fe;
|
||||
if(pscan->p4fe) {
|
||||
db_post_events(pscan,&pscan->p4fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fw = precPvt->p4fw;
|
||||
if(pscan->p4fw) {
|
||||
db_post_events(pscan,&pscan->p4fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.4 1994/10/28 20:15:10 jbk
|
||||
* increased the USP packet time-out to 250ms, added a parm to the configure()
|
||||
* routine to let user specify it.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
@@ -653,7 +657,23 @@ static void TSerrorHandler(int Card, int ErrorNum)
|
||||
Could put the slave on the vxworks timer until next sync
|
||||
*/
|
||||
|
||||
logMsg("***TSerrorHandler: error number %d=n",ErrorNum,0,0,0,0,0);
|
||||
if(MAKE_DEBUG)
|
||||
{
|
||||
switch(ErrorNum)
|
||||
{
|
||||
case 1:
|
||||
logMsg("***TSerrorHandler: event system error: TAXI violation",0,0,0,0,0,0);
|
||||
break;
|
||||
case 2:
|
||||
logMsg("***TSerrorHandler: event system error: lost heartbeat",0,0,0,0,0,0);
|
||||
break;
|
||||
case 3:
|
||||
logMsg("***TSerrorHandler: event system error: lost events",0,0,0,0,0,0);
|
||||
break;
|
||||
default:
|
||||
logMsg("***TSerrorHandler: unknown error %d from event system", ErrorNum,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -404,9 +404,9 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest(phwpvt->unsolicitedDpvt);
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user