Subject: Unresolved symbols in Pmax SCSI drivers without DEBUG
To: None <port-pmax@sun-lamp.cs.berkeley.edu>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 08/25/1994 17:45:59
If a pmax/3max kernel is configured without DEBUG,
src/arch/pmax/dev/asc.c and src/arch/pmax/dev/sii.c contain unresolved
references to asc_DumpLog() and sii_DumpLog(). These functions
are only defined when   DEBUG is #defined.

These functions were referenced after unexpected conditions
occur with the SCSI chips. I simply wrapped them "#ifdef DEBUG".
A patch follows.

I wonder if perhaps the error messages remaining shouldn't
be surrounded with "#ifdef DIAGNOSTIC", also?

--Jonathan

*** asc.c.DIST	Thu Aug 25 17:40:50 1994
--- asc.c	Thu Aug 25 17:38:11 1994
***************
*** 1142,1148 ****
--- 1142,1150 ----
  	 */
  	if ((data = regs->asc_flags & ASC_FLAGS_FIFO_CNT) != 2) {
  		printf("asc_get_status: fifo cnt %d\n", data); /* XXX */
+ #ifdef DEBUG
  		asc_DumpLog("get_status"); /* XXX */
+ #endif
  		if (data < 2) {
  			asc->regs->asc_cmd = ASC_CMD_MSG_ACPT;
  			readback(asc->regs->asc_cmd);
*** sii.c.DIST	Thu Aug 25 17:40:50 1994
--- sii.c	Thu Aug 25 17:39:25 1994
***************
*** 741,747 ****
--- 741,749 ----
  				sc->sc_target = regs->destat;
  				state->prevComm = 0;
  			} else {
+ #ifdef DEBUG
  				sii_DumpLog();
+ #endif
  				panic("sc_target 2");
  			}
  		}
***************
*** 1529,1535 ****
--- 1531,1539 ----
  	}
  	if (dstat & SII_DNE) { /* XXX */
  		printf("sii_GetByte: DNE set 5\n");
+ #ifdef DEBUG
  		sii_DumpLog();
+ #endif
  		regs->dstat = SII_DNE;
  	}
  	data = regs->data;
***************
*** 1652,1658 ****
--- 1656,1664 ----
  	if ((dstat & (SII_DNE | SII_TCZ)) != (SII_DNE | SII_TCZ)) {
  		printf("sii_DoSync: ds %x cm %x i %d lotc %d\n",
  			dstat, regs->comm, i, regs->dmlotc); /* XXX */
+ #ifdef DEBUG
  		sii_DumpLog(); /* XXX */
+ #endif
  		return;
  	}
  	/* clear the DNE, other errors handled later */
***************
*** 1685,1691 ****
--- 1691,1699 ----
  	if (regs->dstat & SII_DNE) { /* XXX */
  		regs->dstat = SII_DNE;
  		printf("sii_StartDMA: DNE set\n");
+ #ifdef DEBUG
  		sii_DumpLog();
+ #endif
  	}
  	regs->dmaddrl = ((u_long)dmaAddr >> 1);
  	regs->dmaddrh = ((u_long)dmaAddr >> 17) & 03;


------------------------------------------------------------------------------