? dc395x_trm.c.debug_nmi ? dc395x_trm.h.131 ? .dc395x_trm.o.flags ? .kversion ? Rules.make ? dc395x_trm.c.126 ? dc395x_trm.c.131 Index: README.dc395x =================================================================== RCS file: /home/cvsroot/dc395/README.dc395x,v retrieving revision 1.13 retrieving revision 1.15 diff -u -r1.13 -r1.15 --- README.dc395x 2001/07/09 19:37:21 1.13 +++ README.dc395x 2001/11/14 00:19:38 1.15 @@ -2,7 +2,7 @@ ========================================== Preliminary. 2000-02-14 Kurt Garloff -$Id: README.dc395x,v 1.13 2001/07/09 19:37:21 garloff Exp $ +$Id: README.dc395x,v 1.15 2001/11/14 00:19:38 garloff Exp $ This driver is similar to the DC390/AM53c974 driver (tmscsim), so you might want to have a look into the README.tmscsim. @@ -182,15 +182,16 @@ 4 0x10 16 Immediate return on BIOS seek command. (Not used) (*)5 0x20 32 Check for LUNs >= 1. -If you set AdapterID, the adapter will use conservative ("safe") default -settings instead. +If you set AdapterID to -1, the adapter will use conservative ("safe") +default settings instead; more precisely, dc395x_trm=-1 is a shortcut for +dc395x_trm=7,4,9,15,2,10 If you specify -2 for a value, it will be ignored. You don't need to specify all six parameters. Note, that you can also influence the behaviour of the host adapter at -runtime by echoing values to /proc/scsi/dc395x_trm/?. Have a loo at -README.tmscsim for explanation and examples. The syntex is the same, except +runtime by echoing values to /proc/scsi/dc395x_trm/?. Have a look at +README.tmscsim for explanation and examples. The syntax is the same, except for the added "Wide" setting. Index: dc395x_trm.c =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.c,v retrieving revision 1.69 retrieving revision 1.71 diff -u -r1.69 -r1.71 --- dc395x_trm.c 2001/07/04 13:38:29 1.69 +++ dc395x_trm.c 2001/11/14 00:19:38 1.71 @@ -12,7 +12,7 @@ //* Kurt Garloff //* (C) 1999-2000 Kurt Garloff //* License: GNU GPL -//* $Id: dc395x_trm.c,v 1.69 2001/07/04 13:38:29 garloff Exp $ +//* $Id: dc395x_trm.c,v 1.71 2001/11/14 00:19:38 garloff Exp $ //*********************************************************************** //* Tekram PCI SCSI adapter (DC395/U/UW/F or DC315/U) revision history //* @@ -86,6 +86,12 @@ //* 1.31 00/11/24 KG Fix another NULL ptr. Allow overriding of //* BIOS settings by cmd ln params. //* 1.32 00/12/02 KG Another 2.4 fix: Remove TYPE_NODEV devices +//* 1.33 01/07/09 KG Compile fixes for newer gccs (preproc.) +//* 1.34 01/11/14 KG Fix SG list length != sum length segments (!) +//* case (contributed by Dag Nygren ) +//* Cleanup DOP0/DIP0 handling a bit. +//* Try to work around extraneous 2 DOP bytes. +//* Merge SG segments if possible. //*********************************************************************** /* ************************************************************************* @@ -1144,7 +1150,7 @@ /* **************************************** */ -#define TRM_S1040_DMA_XCNT 0xA8 /* DMA Transfer Counter (R/W) */ +#define TRM_S1040_DMA_XCNT 0xA8 /* DMA Transfer Counter (R/W), 24bits */ /* **************************************** */ @@ -1908,6 +1914,7 @@ int i,max; PSGE0 sgp; struct scatterlist *sl; + DWORD request_size; #ifdef DC395x_DEBUG0 printk(KERN_INFO "DC395x_BuildSRB..............\n "); @@ -1922,6 +1929,11 @@ pSRB->SRBSGCount = pcmd->use_sg; pSRB->SRBSGListPointer=(PSGE0) &pSRB->SegmentX[0]; sgp = pSRB->SRBSGListPointer; + request_size = pcmd->request_bufflen; +#ifdef DC395x_SGPARANOIA + printk(KERN_INFO "DC395x: BuildSRB: Bufflen = %d, buffer = %p, use_sg = %d\n", + pcmd->request_bufflen, pcmd->request_buffer, pcmd->use_sg); +#endif sl = (struct scatterlist *) pcmd->request_buffer; max = pcmd->use_sg; if(max > DC395x_MAX_SG_LISTENTRY) @@ -1929,11 +1941,40 @@ printk(KERN_INFO "DC395x: cmd->use_sg=%4d bigger then DC395x_MAX_SG_LISTENTRY=%4d for pid %li\n", pcmd->use_sg,DC395x_MAX_SG_LISTENTRY,pcmd->pid); } - for (i = 0; i < max; i++,sgp++) + for (i = 0; i < max; i++, sgp++) { - sgp->address = (DWORD) virt_to_bus( sl[i].address ); - sgp->length = (DWORD) sl[i].length; - len += (DWORD) sl[i].length; + DWORD busaddr = (DWORD) virt_to_bus (sl[i].address); + DWORD seglen = (DWORD) sl[i].length; + if (i > 0 && ((sgp-1)->address + (sgp-1)->length) == busaddr && + (sgp-1)->length + seglen <= 131072) { + sgp--; +#if defined(DC395x_DEBUG_KG) || defined (DC395x_SGPARANOIA) + printk (KERN_INFO "DC395x: Merge SG segment %i(%08x) to %i(%08x) (%d->%d)\n", + i, busaddr, i-1, sgp->address, + sgp->length, sgp->length+seglen); +#endif + sgp->length += seglen; + len += seglen; + pSRB->SRBSGCount--; + } else { + sgp->address = busaddr; + sgp->length = seglen; + len += seglen; + } +#ifdef DC395x_SGPARANOIA + printk(KERN_INFO "DC395x: Setting up sgp %d, address = 0x%08x, length = %d, tot len = %d\n", + i, busaddr, seglen, len); +#endif + } + sgp--; + /* Fixup for last buffer too big as it is allocated on even page boundaries */ + if (len > request_size) { +#if defined(DC395x_DEBUG_KG) || defined (DC395x_SGPARANOIA) + printk(KERN_INFO "DC395x: Fixup SG total length: %d->%d, last seg %d->%d\n", + len, request_size, sgp->length, sgp->length - (len - request_size)); +#endif + sgp->length -= (len - request_size); + len = request_size; } /* WIDE padding */ if (pDCB->SyncPeriod & WIDE_SYNC && len%2) @@ -1941,7 +1982,7 @@ len++; sgp->length++; } - pSRB->SRBTotalXferLength = len; + pSRB->SRBTotalXferLength = len; //? } else if( pcmd->request_buffer ) { @@ -3401,7 +3442,7 @@ DWORD Xferred; BYTE Idx; -#ifdef DC395x_DEBUG0 +#ifdef DC395x_DEBUG_KG printk ("DC395x: Update SG: Total %i, Left %i\n", pSRB->SRBTotalXferLength, Left); #endif @@ -3488,7 +3529,7 @@ PDCB pDCB = pSRB->pSRBDCB; #ifdef DC395x_DEBUG0 - printk(KERN_INFO "DC395x_DataOutPhase0..... "); + printk(KERN_INFO "DC395x_DataOutPhase0.....\n "); #endif TRACEPRINTF("DOP0*"); pDCB = pSRB->pSRBDCB; @@ -3499,11 +3540,11 @@ * If we need more data, the DMA SG list will be freshly set up, anyway */ #ifdef DC395x_DEBUGPIO - printk ("DC395x: DOP1: DMA_CNT: %04x, SCSI_FCNT: %02x, CTR %06x, stat %04x, Tot: %06x\n", + printk ("DC395x: DOP1: DMA_FCNT: %04x, SCSI_FCNT: %02x, CTR %06x, stat %04x, Tot: %06x\n", DC395x_read16 (TRM_S1040_DMA_FIFOCNT), DC395x_read8 (TRM_S1040_SCSI_FIFOCNT), DC395x_read32 (TRM_S1040_SCSI_COUNTER), - *pscsi_status, pSRB->SRBTotalXferLength); + scsi_status, pSRB->SRBTotalXferLength); #endif DC395x_write16 (TRM_S1040_DMA_CONTROL, STOPDMAXFER | CLRXFIFO); @@ -3525,7 +3566,8 @@ dLeftCounter = (DWORD) (DC395x_read8(TRM_S1040_SCSI_FIFOCNT) & 0x1F); if (pDCB->SyncPeriod & WIDE_SYNC) dLeftCounter <<= 1; -#ifdef DC395x_DEBUG0 + +#ifdef DC395x_DEBUG_KG printk ("DC395x: Debug: SCSI FIFO contains %i %s in DOP0\n", DC395x_read8(TRM_S1040_SCSI_FIFOCNT), (pDCB->SyncPeriod & WIDE_SYNC)? "words": "bytes"); @@ -3548,19 +3590,21 @@ ** .....TRM_S1040_SCSI_COUNTER (24bits) ** The counter always decrement by one for every SCSI byte transfer. ** .....TRM_S1040_SCSI_FIFOCNT ( 5bits) - ** The counter is SCSI FIFO offset counter (in units of bytes or words) + ** The counter is SCSI FIFO offset counter (in units of bytes or! words) */ if (pSRB->SRBTotalXferLength > DC395x_LASTPIO) dLeftCounter += DC395x_read32(TRM_S1040_SCSI_COUNTER); - TRACEPRINTF ("%05x *", dLeftCounter); + TRACEPRINTF ("%06x *", dLeftCounter); /* Is this a good idea? */ - //DC395x_clrfifo (pACB, "DOP0"); + //DC395x_clrfifo (pACB, "DOP1"); /* KG: What is this supposed to be useful for? WIDE padding stuff? */ - if ( dLeftCounter == 1 ) + if ( dLeftCounter == 1 && + pDCB->SyncPeriod & WIDE_SYNC && + pSRB->pcmd->request_bufflen % 2) { dLeftCounter = 0; - printk ("DC395x: DOP0: Discard 1 byte.\n"); + printk ("DC395x: DOP0: Discard 1 byte. (%02x)\n", scsi_status); } /* KG: Oops again. Same thinko as above: The SCSI might have been * faster than the DMA engine, so that it ran out of data. @@ -3589,6 +3633,15 @@ ** SCSI transfer counter not empty */ DC395x_update_SGlist (pSRB, dLeftCounter); + /* KG: Most ugly hack! Apparently, this works around a chip bug */ + if (pDCB->SyncPeriod & WIDE_SYNC && + pSRB->SRBSGListPointer[pSRB->SRBSGIndex].length == 2 && + pSRB->SRBSGIndex + 2 == pSRB->SRBSGCount) { + printk ("DC395x: Work around chip bug?\n"); + //dLeftCounter -= 2; + pSRB->SRBTotalXferLength -= 2; + pSRB->SRBSGIndex++; + } } } #if 0 @@ -3620,7 +3673,7 @@ { #ifdef DC395x_DEBUG0 - printk(KERN_INFO "DC395x_DataOutPhase1..... "); + printk(KERN_INFO "DC395x_DataOutPhase1.....\n"); #endif //1.25 TRACEPRINTF("DOP1*"); @@ -3645,7 +3698,6 @@ */ void DC395x_DataInPhase0( PACB pACB, PSRB pSRB, PWORD pscsi_status) { - BYTE TempDMAstatus; WORD scsi_status; DWORD dLeftCounter = 0; //PDCB pDCB = pSRB->pSRBDCB; @@ -3665,26 +3717,65 @@ * enforce this?) and then stop the DMA engine, because it might think, that * there are more bytes to follow. Yes, the device might disconnect prior to * having all bytes transferred! */ - - if( !(pSRB->SRBState & SRB_XFERPAD) ) - { - if( scsi_status & PARITYERROR ) - { + + if( !(pSRB->SRBState & SRB_XFERPAD) ) { + if( scsi_status & PARITYERROR ) { printk("DC395x: Parity Error (pid %li, target %02i-%i)\n", pSRB->pcmd->pid, pSRB->pcmd->target, pSRB->pcmd->lun); pSRB->SRBStatus |= PARITY_ERROR; } -#if DC395x_LASTPIO + // KG: We should wait for the DMA FIFO to be empty ... + // but: it would be better to wait first for the SCSI FIFO and then the + // the DMA FIFO to become empty? How do we know, that the device not already + // sent data to the FIFO in a MsgIn phase, eg.? + if (!(DC395x_read16 (TRM_S1040_DMA_FIFOCNT) & 0x8000)) { +#if 0 + int ctr = 6000000; + printk ("DC395x: DIP0: Wait for DMA FIFO to flush ...\n"); + //DC395x_write16 (TRM_S1040_DMA_CONTROL, STOPDMAXFER); + //DC395x_write32 (TRM_S1040_SCSI_COUNTER, 7); + //DC395x_write8 (TRM_S1040_SCSI_COMMAND, SCMD_DMA_IN); + while (!(DC395x_read16 (TRM_S1040_DMA_FIFOCNT) & 0x8000) && --ctr); + if (ctr < 6000000-1) printk ("DC395x: Debug: DIP0: Had to wait for DMA ...\n"); + if (!ctr) printk (KERN_ERR "DC395x: Deadlock in DIP0 waiting for DMA FIFO empty!!\n"); + //DC395x_write32 (TRM_S1040_SCSI_COUNTER, 0); +#endif +#ifdef DC395x_DEBUG_KG + printk ("DC395x: DIP0: DMA_FIFO: %04x\n", + DC395x_read16 (TRM_S1040_DMA_FIFOCNT)); +#endif + } + /* Now: Check remainig data: The SCSI counters should tell us ... */ + dLeftCounter = DC395x_read32 (TRM_S1040_SCSI_COUNTER) + + ((DC395x_read8(TRM_S1040_SCSI_FIFOCNT) & 0x1f) + << ((pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC)? 1: 0)); + +#ifdef DC395x_DEBUG_KG + printk ("DC395x: Debug: SCSI FIFO contains %i %s in DIP0\n", + DC395x_read8(TRM_S1040_SCSI_FIFOCNT) & 0x1f, + (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC)? "words": "bytes"); + printk ("DC395x: SCSI FIFOCNT %02x, SCSI CTR %08x\n", + DC395x_read8 (TRM_S1040_SCSI_FIFOCNT), + DC395x_read32 (TRM_S1040_SCSI_COUNTER)); + printk ("DC395x: DMA FIFOCNT %04x, DMA CTR %08x\n", + DC395x_read16 (TRM_S1040_DMA_FIFOCNT), + DC395x_read32 (TRM_S1040_DMA_CXCNT)); + printk ("DC395x: Remaining: TotXfer: %i, SCSI FIFO+Ctr: %i\n", + pSRB->SRBTotalXferLength, dLeftCounter); +#endif +#if DC395x_LASTPIO /* KG: Less than or equal to 4 bytes can not be transfered via DMA, it seems. */ - if (pSRB->SRBTotalXferLength <= DC395x_LASTPIO) + if (dLeftCounter && pSRB->SRBTotalXferLength <= DC395x_LASTPIO) { //DWORD addr = (pSRB->SRBSGListPointer[pSRB->SRBSGIndex].address); - char *ptr = bus_to_virt(pSRB->SRBSGListPointer[pSRB->SRBSGIndex].address); + char *ptr; + DC395x_update_SGlist (pSRB, dLeftCounter); + ptr = bus_to_virt(pSRB->SRBSGListPointer[pSRB->SRBSGIndex].address); DEBUGPIO( - printk ("DC395x: DIP0: Try to do PIO (%i %s) for remaining %i bytes:", + printk ("DC395x: DIP0: PIO (%i %s) to %p for remaining %i bytes:", DC395x_read8(TRM_S1040_SCSI_FIFOCNT) & 0x1f, (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC)? "words": "bytes", - pSRB->SRBTotalXferLength); + ptr, pSRB->SRBTotalXferLength); ) if (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC) @@ -3695,6 +3786,12 @@ BYTE byte = DC395x_read8 (TRM_S1040_SCSI_FIFO); *ptr++ = byte; DEBUGPIO(printk (" %02x", byte);) pSRB->SRBTotalXferLength--; + pSRB->SRBSGListPointer[pSRB->SRBSGIndex].length--; + if (pSRB->SRBTotalXferLength && !pSRB->SRBSGListPointer[pSRB->SRBSGIndex].length) { + DEBUGPIO(printk (" (next segment)");) + pSRB->SRBSGIndex++; + ptr = bus_to_virt(pSRB->SRBSGListPointer[pSRB->SRBSGIndex].address); + } } if (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC) { @@ -3734,7 +3831,7 @@ } #endif - dLeftCounter += DC395x_read32(TRM_S1040_SCSI_COUNTER); + //dLeftCounter += DC395x_read32(TRM_S1040_SCSI_COUNTER); #if 0 printk ("DC395x: DIP0: ctr=%08x, DMA_FIFO=%04x, SCSI_FIFO=%02x\n", dLeftCounter, DC395x_read16 (TRM_S1040_DMA_FIFOCNT), @@ -3742,36 +3839,23 @@ printk ("DC395x: DIP0: DMAStat %02x\n", DC395x_read8 (TRM_S1040_DMA_STATUS)); #endif - - // KG: We should wait for the DMA FIFO to be empty ... - // but: it would be better to wait first for the SCSI FIFO and then the - // the DMA FIFO to become empty? How do we know, that the device not already - // sent data to the FIFO in a MsgIn phase, eg.? - if (!(DC395x_read16 (TRM_S1040_DMA_FIFOCNT) & 0x8000)) - { - //int ctr = 6000000; - DEBUG0(printk ("DC395x: DIP0: Wait for DMA FIFO to flush ...\n");) -#if 0 - //DC395x_write16 (TRM_S1040_DMA_CONTROL, STOPDMAXFER); - DC395x_write32 (TRM_S1040_SCSI_COUNTER, 7); - DC395x_write8 (TRM_S1040_SCSI_COMMAND, SCMD_DMA_IN); - while (!(DC395x_read16 (TRM_S1040_DMA_FIFOCNT) & 0x8000) && --ctr); - if (ctr < 6000000-1) printk ("DC395x: Debug: DIP0: Had to wait for DMA ...\n"); - if (!ctr) printk (KERN_ERR "DC395x: Deadlock in DIP0 waiting for DMA FIFO empty!!\n"); - DC395x_write32 (TRM_S1040_SCSI_COUNTER, 0); -#endif - } + // KG: This should not be needed any more! if((dLeftCounter == 0) || (scsi_status & SCSIXFERCNT_2_ZERO) ) - { + { +#if 0 int ctr = 6000000; - do - { + BYTE TempDMAstatus; + do { TempDMAstatus = DC395x_read8(TRM_S1040_DMA_STATUS); - } - while( !(TempDMAstatus & DMAXFERCOMP) && --ctr); + } while( !(TempDMAstatus & DMAXFERCOMP) && --ctr); if (!ctr) printk (KERN_ERR "DC395x: Deadlock in DataInPhase0 waiting for DMA!!\n"); pSRB->SRBTotalXferLength = 0; +#endif +#ifdef DC395x_DEBUG_KG + printk ("DC395x: DIP0: DMA not yet ready: %02x: %i bytes\n", + DC395x_read8(TRM_S1040_DMA_STATUS), pSRB->SRBTotalXferLength); +#endif } else /* phase changed */ { @@ -3791,11 +3875,11 @@ //printk ("DC395x: Debug: Clean up after Data In ...\n"); DC395x_cleanup_after_transfer (pACB, pSRB); } - + #if 0 /* KG: Make sure, no previous transfers are pending! */ bval = DC395x_read8 (TRM_S1040_SCSI_FIFOCNT); - if (!(bval & 0x40)) + if (!(bval & 0x40)) { bval &= 0x1f; printk ("DC395x: DIP0(%li): %i bytes in SCSI FIFO (stat %04x) (left %08x)!!\n", @@ -3807,7 +3891,7 @@ } #endif //DC395x_write8 (TRM_S1040_DMA_CONTROL, CLRXFIFO | ABORTXFER); - + //DC395x_clrfifo (pACB, "DIP0"); //DC395x_write16 (TRM_S1040_SCSI_CONTROL, DO_DATALATCH); TRACEPRINTF(".*"); @@ -3853,9 +3937,9 @@ PDCB pDCB; #ifdef DC395x_DEBUG0 - printk(KERN_INFO "DC395x: DataIO_transfer %c (pid %li): len = %i, SG: %i", + printk(KERN_INFO "DC395x: DataIO_transfer %c (pid %li): len = %i, SG: %i/%i\n", (ioDir == XFERDATAOUT? 'w': 'r'), pSRB->pcmd->pid, - pSRB->SRBTotalXferLength, pSRB->SRBSGCount - pSRB->SRBSGIndex); + pSRB->SRBTotalXferLength, pSRB->SRBSGIndex, pSRB->SRBSGCount); #endif TRACEPRINTF("%05x(%i/%i)*", pSRB->SRBTotalXferLength, pSRB->SRBSGIndex, pSRB->SRBSGCount); @@ -3918,12 +4002,19 @@ int ln = pSRB->SRBTotalXferLength; if (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC) DC395x_write8 (TRM_S1040_SCSI_CONFIG2, CFG2_WIDEFIFO); - DEBUGPIO(printk ("DC395x: DOP1: PIO %i bytes:", pSRB->SRBTotalXferLength);) + DEBUGPIO(printk ("DC395x: DOP1: PIO %i bytes from %p:", + pSRB->SRBTotalXferLength, ptr);) while (pSRB->SRBTotalXferLength) { DEBUGPIO(printk (" %02x", (unsigned char)*ptr);) DC395x_write8 (TRM_S1040_SCSI_FIFO, *ptr++); pSRB->SRBTotalXferLength--; + pSRB->SRBSGListPointer[pSRB->SRBSGIndex].length--; + if (pSRB->SRBTotalXferLength && !pSRB->SRBSGListPointer[pSRB->SRBSGIndex].length) { + DEBUGPIO(printk (" (next segment)");) + pSRB->SRBSGIndex++; + ptr = bus_to_virt (pSRB->SRBSGListPointer[pSRB->SRBSGIndex].address); + } } if (pSRB->pSRBDCB->SyncPeriod & WIDE_SYNC) { if (ln % 2) { @@ -5004,15 +5095,19 @@ //DWORD drv_flags=0; pcmd = pSRB->pcmd; -#ifdef DC395x_DEBUG_KG - printk(KERN_INFO "DC395x: SRBdone (pid %li, target %02i-%i): ", - pSRB->pcmd->pid, pSRB->pcmd->target, pSRB->pcmd->lun); -#endif TRACEPRINTF("DONE *"); ptr = (PSCSI_INQDATA) (pcmd->request_buffer); if( pcmd->use_sg ) ptr = (PSCSI_INQDATA) (((PSGL) ptr)->address); +#ifdef DC395x_SGPARANOIA + printk (KERN_INFO "DC395x: SRBdone SG=%i (%i/%i), req_buf = %p, adr = %p\n", + pcmd->use_sg, pSRB->SRBSGIndex, pSRB->SRBSGCount, pcmd->request_buffer, ptr); +#endif +#ifdef DC395x_DEBUG_KG + printk(KERN_INFO "DC395x: SRBdone (pid %li, target %02i-%i): ", + pSRB->pcmd->pid, pSRB->pcmd->target, pSRB->pcmd->lun); +#endif status = pSRB->TargetStatus; if(pSRB->SRBFlag & AUTO_REQSENSE) { @@ -5084,9 +5179,6 @@ */ if( status_byte(status) == CHECK_CONDITION ) { -#ifdef DC395x_DEBUG_KG - printk ("RqSense!\n"); -#endif DC395x_RequestSense( pACB, pDCB, pSRB ); return; } @@ -5208,10 +5300,11 @@ { DEBUG0(int i;) #ifdef DC395x_DEBUG0 - printk ("\nDC395x: Inquiry result:"); - for (i = 0; i < 8; i++) printk (" %02x", ((PBYTE)ptr)[i]); + printk ("DC395x: Inquiry result:"); + for (i = 0; i < 8; i++) + printk (" %02x", ((PBYTE)ptr)[i]); ((PBYTE)ptr)[96] = 0; - printk ("\nDC395x: %s\n", (char*)ptr + 8); + printk ("DC395x: %s\n", (char*)ptr + 8); #endif if ( (ptr->Vers & 0x07) >= 2 || (ptr->RDF & 0x0F) == 2 ) pDCB->Inquiry7 = ptr->Flags; @@ -5243,7 +5336,7 @@ /* This may be interpreted by sb. or not ... */ pcmd->SCp.this_residual = pSRB->SRBTotalXferLength; pcmd->SCp.buffers_residual = 0; -#if 0 +#ifdef DC395x_DEBUG_KG if (pSRB->SRBTotalXferLength && !DCB_removed) printk ("\nDC395x: pid %li: %02x (%02i-%i): Missed %i bytes\n", pcmd->pid, pcmd->cmnd[0], pcmd->target, pcmd->lun, pSRB->SRBTotalXferLength); @@ -5255,7 +5348,7 @@ else DC395x_Free_insert (pACB, pSRB); - DEBUG0(printk (KERN_DEBUG "\nDC395x: SRBdone: done pid %li\n", pcmd->pid);) + DEBUG0(printk (KERN_DEBUG "DC395x: SRBdone: done pid %li\n", pcmd->pid);) #ifdef DC395x_DEBUG_KG printk (" 0x%08x\n", pcmd->result); #endif @@ -5758,8 +5851,10 @@ for (i = 0; i < DC395x_MAX_SCSI_ID; i++) pACB->DCBmap[i] = 0; #ifdef DC395x_DEBUG0 - printk(KERN_INFO "DC395x: pACB = %8x, pDCBmap = %8x, pSRB_array = %8x\n",(UINT) pACB, (UINT) pACB->DCBmap, (UINT) pACB->SRB_array); - printk(KERN_INFO "DC395x: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",sizeof(DC395X_TRM_ACB), sizeof(DC395X_TRM_DCB), sizeof(DC395X_TRM_SRB) ); + printk(KERN_INFO "DC395x: pACB = %p, pDCBmap = %p, pSRB_array = %p\n", + pACB, pACB->DCBmap, pACB->SRB_array); + printk(KERN_INFO "DC395x: ACB size= %04x, DCB size= %04x, SRB size= %04x\n", + sizeof(DC395X_TRM_ACB), sizeof(DC395X_TRM_DCB), sizeof(DC395X_TRM_SRB) ); #endif } @@ -5846,6 +5941,7 @@ pACB->Config |= HCC_SCSI_RESET; if (pACB->Config & HCC_SCSI_RESET) { + printk (KERN_INFO "DC395: Performing initial SCSI bus reset\n"); DC395x_write8 (TRM_S1040_SCSI_CONTROL, DO_RSTSCSI); //while (!( DC395x_read8(TRM_S1040_SCSI_INTSTATUS) & INT_SCSIRESET )); //spin_unlock_irq (&io_request_lock); Index: dc395x_trm.h =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- dc395x_trm.h 2001/07/09 19:21:19 1.32 +++ dc395x_trm.h 2001/11/14 00:19:38 1.33 @@ -8,7 +8,7 @@ ** ********************************************************************** */ -/* $Id: dc395x_trm.h,v 1.32 2001/07/09 19:21:19 garloff Exp $ */ +/* $Id: dc395x_trm.h,v 1.33 2001/11/14 00:19:38 garloff Exp $ */ /* ***************************************************** ** Tekram TRM_S1040 for DC395x driver, header file @@ -20,7 +20,7 @@ #include #define DC395x_BANNER "Tekram DC395U/UW/F DC315/U" -#define DC395x_VERSION "1.33, 2001-07-09" +#define DC395x_VERSION "1.34, 2001-11-14" /* Kernel version autodetection */ #include