changed some logMsgs to printfs
This commit is contained in:
@@ -120,7 +120,7 @@ reportBB()
|
||||
{
|
||||
int i;
|
||||
|
||||
logMsg("Debugging flag is set to %d\n", bbDebug);
|
||||
printf("Debugging flag is set to %d\n", bbDebug);
|
||||
|
||||
if (init_called)
|
||||
{
|
||||
@@ -128,17 +128,17 @@ reportBB()
|
||||
{
|
||||
if (pBbLink[i])
|
||||
{
|
||||
logMsg("Link %d (address 0x%08.8X) present and initialized.\n", i, pXvmeLink[i]->bbRegs);
|
||||
printf("Link %d (address 0x%08.8X) present and initialized.\n", i, pXvmeLink[i]->bbRegs);
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg("Link %d not installed.\n", i);
|
||||
printf("Link %d not installed.\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg("BB driver has not yet been initialized.\n");
|
||||
printf("BB driver has not yet been initialized.\n");
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ initBB()
|
||||
|
||||
if (init_called)
|
||||
{
|
||||
logMsg("initBB(): BB devices already initialized!\n");
|
||||
printf("initBB(): BB devices already initialized!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
/* figure out where the short address space is */
|
||||
@@ -173,11 +173,11 @@ initBB()
|
||||
|
||||
if (bbDebug)
|
||||
{
|
||||
logMsg("BB driver package initializing\n");
|
||||
logMsg("short_base 0x%08.8X\n", short_base);
|
||||
logMsg("ram_base 0x%08.8X\n", ram_base);
|
||||
logMsg("BB_SHORT_OFF 0x%08.8X\n", BB_SHORT_OFF);
|
||||
logMsg("BB_NUM_LINKS 0x%08.8X\n", BB_NUM_LINKS);
|
||||
printf("BB driver package initializing\n");
|
||||
printf("short_base 0x%08.8X\n", short_base);
|
||||
printf("ram_base 0x%08.8X\n", ram_base);
|
||||
printf("BB_SHORT_OFF 0x%08.8X\n", BB_SHORT_OFF);
|
||||
printf("BB_NUM_LINKS 0x%08.8X\n", BB_NUM_LINKS);
|
||||
}
|
||||
|
||||
probeValue = XVME_RESET;
|
||||
@@ -191,7 +191,7 @@ initBB()
|
||||
pBbLink[i] = (struct bbLink *) NULL;
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("Probing of address 0x%08.8X failed\n", pXvmeRegs);
|
||||
printf("Probing of address 0x%08.8X failed\n", pXvmeRegs);
|
||||
}
|
||||
else
|
||||
{ /* BB board found... reserve space for structures */
|
||||
@@ -199,13 +199,13 @@ initBB()
|
||||
xvmeReset(pXvmeRegs, i); /* finish resetting the xvme module */
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("BB card found at address 0x%08.8X\n", pXvmeRegs);
|
||||
printf("BB card found at address 0x%08.8X\n", pXvmeRegs);
|
||||
|
||||
if ((pBbLink[i] = (struct bbLink *) malloc(sizeof(struct bbLink))) == NULL
|
||||
)
|
||||
{ /* This better never happen! */
|
||||
/* errMsg( BUG -- figure out how to use this thing ); */
|
||||
logMsg("Can't malloc memory for link data structures!\n");
|
||||
printf("Can't malloc memory for link data structures!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
pBbLink[i]->linkType = BITBUS_IO; /* spec'd in link.h */
|
||||
@@ -230,7 +230,7 @@ initBB()
|
||||
if ((pXvmeLink[i] = (struct xvmeLink *) malloc(sizeof(struct xvmeLink))) == NULL)
|
||||
{
|
||||
/* errMsg( BUG -- figure out how to use this thing ); */
|
||||
logMsg("Can't malloc memory for link data structures!\n");
|
||||
printf("Can't malloc memory for link data structures!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ initBB()
|
||||
/* start a task to manage the link */
|
||||
if (taskSpawn("bbLink", 46, VX_FP_TASK|VX_STDIO, 2000, xvmeLinkTask, i) == ERROR)
|
||||
{
|
||||
logMsg("initBB: failed to start link task for link %d\n", i);
|
||||
printf("initBB: failed to start link task for link %d\n", i);
|
||||
/*errMsg()*/
|
||||
}
|
||||
}
|
||||
@@ -285,7 +285,7 @@ int link;
|
||||
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("xvmeReset(%08.8X, %d): Resetting xvme module\n", xvmeRegs, link);
|
||||
printf("xvmeReset(%08.8X, %d): Resetting xvme module\n", xvmeRegs, link);
|
||||
|
||||
xvmeRegs->fifo_stat = XVME_RESET; /* assert the reset pulse */
|
||||
taskDelay(1);
|
||||
@@ -298,7 +298,7 @@ int link;
|
||||
|
||||
if (!j)
|
||||
{
|
||||
logMsg("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
printf("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -308,13 +308,13 @@ int link;
|
||||
|
||||
if (!j)
|
||||
{
|
||||
logMsg("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
printf("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
if ((xvmeRegs->fifo_stat & XVME_FSVALID) != XVME_FSIDLE)
|
||||
{
|
||||
logMsg("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
printf("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
return(OK);
|
||||
@@ -599,7 +599,7 @@ int link;
|
||||
int prio;
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("xvmeLinkTask started for link %d\n", link);
|
||||
printf("xvmeLinkTask started for link %d\n", link);
|
||||
|
||||
plink = pBbLink[link];
|
||||
|
||||
@@ -611,12 +611,12 @@ int link;
|
||||
FASTLOCK(&(plink->linkEventSem));
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("xvmeLinkTask(%d): got an event\n", link);
|
||||
printf("xvmeLinkTask(%d): got an event\n", link);
|
||||
|
||||
if (pXvmeLink[link]->watchDogFlag)
|
||||
{ /* Time to age the busy list members */
|
||||
if (bbDebug)
|
||||
logMsg("xvmeLinkTask(%d): (Watchdog) checking busy list\n", link);
|
||||
printf("xvmeLinkTask(%d): (Watchdog) checking busy list\n", link);
|
||||
|
||||
pXvmeLink[link]->watchDogFlag = 0;
|
||||
|
||||
@@ -629,20 +629,20 @@ int link;
|
||||
{
|
||||
pnode->ageLimit--;
|
||||
if(bbDebug)
|
||||
logMsg("xvmeLinkTask(%d): (Watchdog) node 0x%08.8X.ageLimit=%d\n", link, pnode, pnode->ageLimit);
|
||||
printf("xvmeLinkTask(%d): (Watchdog) node 0x%08.8X.ageLimit=%d\n", link, pnode, pnode->ageLimit);
|
||||
if (pnode->ageLimit <= 0)
|
||||
{ /* This node has been on the busy list for too long */
|
||||
npnode = (struct dpvtBitBusHead *) lstNext(pnode);
|
||||
if ((intMask & XVME_TX_INT) && (pXvmeLink[link]->txDpvtHead == pnode))
|
||||
{ /* Uh oh... Transmitter is stuck while sending this xact */
|
||||
logMsg("xvmeLinkTask(%d): transmitter looks stuck, link dead\n", link);
|
||||
printf("xvmeLinkTask(%d): transmitter looks stuck, link dead\n", link);
|
||||
taskDelay(60); /* waste some time /
|
||||
/* BUG -- This should probably reset the xvme card here */
|
||||
}
|
||||
else
|
||||
{ /* Get rid of the request and set error status etc... */
|
||||
lstDelete(&(plink->busyList), pnode);
|
||||
logMsg("xvmeLinkTask(%d): TIMEOUT on xact 0x%08.8X\n", link, pnode);
|
||||
printf("xvmeLinkTask(%d): TIMEOUT on xact 0x%08.8X\n", link, pnode);
|
||||
pnode->status = BB_TIMEOUT;
|
||||
(plink->deviceStatus[pnode->txMsg->node])--; /* fix node status */
|
||||
if(pnode->finishProc != NULL)
|
||||
@@ -664,7 +664,7 @@ int link;
|
||||
{ /* the rcvr is busy on something... check it out too */
|
||||
if (--(pXvmeLink[link]->rxDpvtHead->ageLimit) < 0)
|
||||
{ /* old, but busy... and we even gave it an extra tick. Rcvr stuck. */
|
||||
logMsg("xvmeLinkTask(%d): receiver looks stuck, link dead\n", link);
|
||||
printf("xvmeLinkTask(%d): receiver looks stuck, link dead\n", link);
|
||||
taskDelay(60);
|
||||
/* BUG -- This should probably reset the xvme card */
|
||||
}
|
||||
@@ -673,7 +673,7 @@ int link;
|
||||
if (lstCount(&(plink->busyList))) /* If list not empty, start watch dog */
|
||||
{
|
||||
if (bbDebug)
|
||||
logMsg("xvmeLinkTask(%d): restarting watch dog timer\n", link);
|
||||
printf("xvmeLinkTask(%d): restarting watch dog timer\n", link);
|
||||
wdStart(pXvmeLink[link]->watchDogId, BB_WD_INTERVAL, xvmeTmoHandler, link);
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ int link;
|
||||
FASTUNLOCK(&(plink->queue[prio].sem));
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("xvmeLinkTask(%d): got xact, pnode= 0x%08.8X\n", link, pnode);
|
||||
printf("xvmeLinkTask(%d): got xact, pnode= 0x%08.8X\n", link, pnode);
|
||||
|
||||
/* Count the outstanding messages */
|
||||
(plink->deviceStatus[pnode->txMsg->node])++;
|
||||
@@ -763,7 +763,7 @@ int prio;
|
||||
FASTUNLOCK(&(pBbLink[link]->linkEventSem));
|
||||
|
||||
if (bbDebug)
|
||||
logMsg("qbbreq(%d, 0x%08.8X, %d): transaction queued\n", link, pdpvt, prio);
|
||||
printf("qbbreq(%d, 0x%08.8X, %d): transaction queued\n", link, pdpvt, prio);
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
@@ -209,17 +209,17 @@ reportGpib()
|
||||
{
|
||||
if (pNiLink[i])
|
||||
{
|
||||
logMsg("Link %d (address 0x%08.8X) present and initialized.\n", i, pNiLink[i]->ibregs);
|
||||
printf("Link %d (address 0x%08.8X) present and initialized.\n", i, pNiLink[i]->ibregs);
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg("Link %d not installed.\n", i);
|
||||
printf("Link %d not installed.\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg("Gpib driver has not yet been initialized.\n");
|
||||
printf("Gpib driver has not yet been initialized.\n");
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
@@ -248,7 +248,7 @@ initGpib()
|
||||
|
||||
if (init_called)
|
||||
{
|
||||
logMsg("initGpib(): Gpib devices already initialized!\n");
|
||||
printf("initGpib(): Gpib devices already initialized!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ initGpib()
|
||||
if ((pNiLink[i] = (struct niLink *) malloc(sizeof(struct niLink))) == NULL)
|
||||
{ /* This better never happen! */
|
||||
/* errMsg( BUG -- figure out how to use this thing ); */
|
||||
logMsg("Can't malloc memory for NI-link data structures!\n");
|
||||
printf("Can't malloc memory for NI-link data structures!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ int prio;
|
||||
semGive(pNiLink[link]->ibLink.linkEventSem);
|
||||
break;
|
||||
default: /* invalid priority */
|
||||
logMsg("invalid priority requested in call to qgpibreq(%d, %08.8X, %d)\n", link, pdpvt, prio);
|
||||
printf("invalid priority requested in call to qgpibreq(%d, %08.8X, %d)\n", link, pdpvt, prio);
|
||||
return(ERROR);
|
||||
}
|
||||
if (ibDebug)
|
||||
@@ -611,7 +611,7 @@ int length;
|
||||
if (!(tooLong--))
|
||||
{
|
||||
/* errMsg() */
|
||||
logMsg("niGpibCmd(%d, 0x%08.8X, %d): Timeout writing command >%s<\n", link, buffer, length, buffer);
|
||||
printf("niGpibCmd(%d, 0x%08.8X, %d): Timeout writing command >%s<\n", link, buffer, length, buffer);
|
||||
pNiLink[link]->ibregs->auxmr = AUX_GTS;
|
||||
return(ERROR);
|
||||
}
|
||||
@@ -637,7 +637,7 @@ int length;
|
||||
}
|
||||
}
|
||||
/* errMsg() */
|
||||
logMsg("niGpibCmd(%d, 0x%08.8X, %d): Timeout after writing command >%s<\n", link, buffer, length, buffer);
|
||||
printf("niGpibCmd(%d, 0x%08.8X, %d): Timeout after writing command >%s<\n", link, buffer, length, buffer);
|
||||
pNiLink[link]->ibregs->auxmr = AUX_GTS;
|
||||
return(ERROR);
|
||||
}
|
||||
@@ -901,7 +901,7 @@ int length; /* number of bytes to transfer */
|
||||
if ((b->ch0.csr & D_ERR) || (b->ch1.csr & D_ERR))
|
||||
{
|
||||
/* errMsg() */
|
||||
logMsg("DMAC error initialization on link %d.\n", link);
|
||||
printf("DMAC error initialization on link %d.\n", link);
|
||||
return (ERROR);
|
||||
}
|
||||
if (cnt)
|
||||
@@ -937,7 +937,7 @@ int length; /* number of bytes to transfer */
|
||||
pNiLink[link]->ibregs->ch1.csr = D_CLEAR;
|
||||
/* errMsg() */
|
||||
if (!timeoutSquelch)
|
||||
logMsg("TIMEOUT GPIB DEVICE on link %d\n", link);
|
||||
printf("TIMEOUT GPIB DEVICE on link %d\n", link);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -945,12 +945,12 @@ int length; /* number of bytes to transfer */
|
||||
status = OK;
|
||||
if (b->ch0.csr & D_ERR)
|
||||
{
|
||||
logMsg("DMAC error on link %d, channel 0 = %x\n", link, b->ch0.cer);
|
||||
printf("DMAC error on link %d, channel 0 = %x\n", link, b->ch0.cer);
|
||||
status = ERROR;
|
||||
}
|
||||
if (b->ch1.csr & D_ERR)
|
||||
{
|
||||
logMsg("DMAC error on link %d, channel 1 = %x\n", link, b->ch1.cer);
|
||||
printf("DMAC error on link %d, channel 1 = %x\n", link, b->ch1.cer);
|
||||
status = ERROR;
|
||||
}
|
||||
}
|
||||
@@ -999,7 +999,7 @@ int gpibAddr;
|
||||
{
|
||||
if (niCheckLink(link) == ERROR)
|
||||
{
|
||||
logMsg("drvGpib: niSrqPollInhibit(%d, %d): invalid link number specified\n", link, gpibAddr);
|
||||
printf("drvGpib: niSrqPollInhibit(%d, %d): invalid link number specified\n", link, gpibAddr);
|
||||
return(ERROR);
|
||||
}
|
||||
pollInhibit[link][gpibAddr] = 1; /* mark it as inhibited */
|
||||
@@ -1166,7 +1166,7 @@ struct ibLink *plink;
|
||||
/* Start a task to manage the link */
|
||||
if (taskSpawn("gpibLink", 46, VX_FP_TASK|VX_STDIO, 2000, ibLinkTask, plink, plink->linkId) == ERROR)
|
||||
{
|
||||
logMsg("ibLinkStart(): failed to start link task for link %d\n", plink->linkId);
|
||||
printf("ibLinkStart(): failed to start link task for link %d\n", plink->linkId);
|
||||
return(ERROR);
|
||||
}
|
||||
return(OK);
|
||||
@@ -1272,7 +1272,7 @@ int link;
|
||||
}
|
||||
else
|
||||
{
|
||||
logMsg("ibLinkTask(%d, %d): got an SRQ, but have no pollable devices!\n", plink->linkType, link);
|
||||
printf("ibLinkTask(%d, %d): got an SRQ, but have no pollable devices!\n", plink->linkType, link);
|
||||
}
|
||||
/* The srqIntFlag should still be set if the SRQ line is again/still */
|
||||
/* active, otherwise we have a possible srq interrupt processing */
|
||||
@@ -1369,7 +1369,7 @@ int verbose; /* set to 1 if should log any errors */
|
||||
if (readIb(plink->linkType, plink->linkId, plink->bug, gpibAddr, pollResult, sizeof(pollResult)) == ERROR)
|
||||
{
|
||||
if(verbose)
|
||||
logMsg("pollIb(%d, %d): data read error\n", plink->linkId, gpibAddr);
|
||||
printf("pollIb(%d, %d): data read error\n", plink->linkId, gpibAddr);
|
||||
status = ERROR;
|
||||
}
|
||||
else
|
||||
@@ -1514,7 +1514,7 @@ int gpibAddr; /* the device address the handler is for */
|
||||
return(bbSrqPollInhibit(link, bug, gpibAddr));
|
||||
}
|
||||
|
||||
logMsg("drvGpib: srqPollInhibit(%d, %d, %d, %d): invalid link type specified\n", linkType, link, bug, gpibAddr);
|
||||
printf("drvGpib: srqPollInhibit(%d, %d, %d, %d): invalid link type specified\n", linkType, link, bug, gpibAddr);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1543,7 +1543,7 @@ caddr_t parm; /* so caller can have a parm passed back */
|
||||
{
|
||||
if (checkLink(linkType, linkId, bug) == ERROR)
|
||||
{
|
||||
logMsg("drvGpib: registerSrqCallback(): invalid link number specified\n");
|
||||
printf("drvGpib: registerSrqCallback(): invalid link number specified\n");
|
||||
return(ERROR);
|
||||
}
|
||||
(pNiLink[linkId]->ibLink.srqHandler)[gpibAddr] = handler;
|
||||
@@ -1557,7 +1557,7 @@ caddr_t parm; /* so caller can have a parm passed back */
|
||||
return(bbRegisterSrqCallback(linkId, bug, gpibAddr, handler, parm));
|
||||
}
|
||||
|
||||
logMsg("drvGpib: registerSrqCallback(%d, %d, %d, %d, 0x%08.8X, %d): invalid link type specified\n", linkType, linkId, bug, gpibAddr, handler, parm);
|
||||
printf("drvGpib: registerSrqCallback(%d, %d, %d, %d, 0x%08.8X, %d): invalid link type specified\n", linkType, linkId, bug, gpibAddr, handler, parm);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1754,7 +1754,7 @@ int link;
|
||||
char *buffer;
|
||||
int length;
|
||||
{
|
||||
logMsg("Read attempted to a bitbus->gpib link\n");
|
||||
printf("Read attempted to a bitbus->gpib link\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1764,7 +1764,7 @@ int link;
|
||||
char *buffer;
|
||||
int length;
|
||||
{
|
||||
logMsg("Write attempted to a bitbus->gpib link\n");
|
||||
printf("Write attempted to a bitbus->gpib link\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1774,7 +1774,7 @@ int link;
|
||||
char *buffer;
|
||||
int length;
|
||||
{
|
||||
logMsg("Command write sent to a bitbus->gpib link\n");
|
||||
printf("Command write sent to a bitbus->gpib link\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1783,7 +1783,7 @@ bbCheckLink(link, bug)
|
||||
int link;
|
||||
int bug;
|
||||
{
|
||||
logMsg("bbCheckLink called for link %d, bug %d\n", link, bug);
|
||||
printf("bbCheckLink called for link %d, bug %d\n", link, bug);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1793,7 +1793,7 @@ int link;
|
||||
int bug;
|
||||
int gpibAddr;
|
||||
{
|
||||
logMsg("bbSrqPollInhibit called for link %d, bug %d, device %d\n", link, bug, gpibAddr);
|
||||
printf("bbSrqPollInhibit called for link %d, bug %d, device %d\n", link, bug, gpibAddr);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1805,7 +1805,7 @@ int gpibAddr;
|
||||
int (*handler)();
|
||||
caddr_t parm;
|
||||
{
|
||||
logMsg("bbRegisterSrqCallback called for link %d, bug %d, device %d\n",
|
||||
printf("bbRegisterSrqCallback called for link %d, bug %d, device %d\n",
|
||||
link, bug, gpibAddr);
|
||||
return(ERROR);
|
||||
}
|
||||
@@ -1849,7 +1849,7 @@ int bug;
|
||||
|
||||
if ((bbLink = (struct bbLink *) malloc(sizeof(struct bbLink))) == NULL)
|
||||
{
|
||||
logMsg("bbGenLink(%d, %d): can't malloc memory for link structure\n", link, bug);
|
||||
printf("bbGenLink(%d, %d): can't malloc memory for link structure\n", link, bug);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1883,7 +1883,7 @@ int v;
|
||||
|
||||
if (cmd != IBGENLINK && bbCheckLink(link, -1) == ERROR)
|
||||
{
|
||||
logMsg("bbGpibIoctl(%d, %d, %d, %08.8X): invalid link specified\n", link, bug, cmd, v);
|
||||
printf("bbGpibIoctl(%d, %d, %d, %08.8X): invalid link specified\n", link, bug, cmd, v);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -1902,7 +1902,7 @@ int v;
|
||||
stat = bbGenLink(link, bug);
|
||||
break;
|
||||
default:
|
||||
logMsg("bbGpibIoctl(%d, %d, %d, %08.8X): invalid command requested\n", link, bug, cmd, v);
|
||||
printf("bbGpibIoctl(%d, %d, %d, %08.8X): invalid command requested\n", link, bug, cmd, v);
|
||||
}
|
||||
|
||||
return(stat);
|
||||
@@ -1921,6 +1921,6 @@ int link;
|
||||
struct dpvtGpibHead *pdpvt;
|
||||
int prio;
|
||||
{
|
||||
logMsg("bbQGpibReq called for a bitbug->gpib link\n");
|
||||
printf("bbQGpibReq called for a bitbug->gpib link\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user