? dc395x_trm.c.debug_nmi ? dc395x_trm.h.131 ? .dc395x_trm.o.flags ? .kversion ? dc395x_trm.c.new ? Rules.make ? dc395x_trm.c.126 ? dc395x_trm.c.131 Index: dc395x_trm.c =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.c,v retrieving revision 1.71 retrieving revision 1.73 diff -u -r1.71 -r1.73 --- dc395x_trm.c 2001/11/14 00:19:38 1.71 +++ dc395x_trm.c 2001/12/11 17:57:33 1.73 @@ -12,7 +12,7 @@ //* Kurt Garloff //* (C) 1999-2000 Kurt Garloff //* License: GNU GPL -//* $Id: dc395x_trm.c,v 1.71 2001/11/14 00:19:38 garloff Exp $ +//* $Id: dc395x_trm.c,v 1.73 2001/12/11 17:57:33 garloff Exp $ //*********************************************************************** //* Tekram PCI SCSI adapter (DC395/U/UW/F or DC315/U) revision history //* @@ -92,6 +92,7 @@ //* Cleanup DOP0/DIP0 handling a bit. //* Try to work around extraneous 2 DOP bytes. //* Merge SG segments if possible. +//* 1.35 01/12/06 KG Fix residual calculation. Add MODULE_LICENSE. //*********************************************************************** /* ************************************************************************* @@ -1428,6 +1429,10 @@ MODULE_SUPPORTED_DEVICE("sd,sr,sg,st"); #endif +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif + /* Delaying after a reset */ static char __initdata DC395x_interpd [] = {1,3,5,10,16,30,60,120}; /* Convert EEprom value to seconds */ @@ -3535,6 +3540,14 @@ pDCB = pSRB->pSRBDCB; scsi_status = *pscsi_status; + /* + * KG: We need to drain the buffers before we draw any conclusions! + * This means telling the DMA to push the rest into SCSI, telling + * SCSI to push the rest to the bus. + * However, the device might have been the one to stop us (phase + * change), the the data in transit just needs to be accounted so + * it can be retransmitted.) + */ /* * KG: Stop DMA engine pushing more data into the SCSI FIFO * If we need more data, the DMA SG list will be freshly set up, anyway @@ -3716,7 +3729,11 @@ * We should wait for the FIFOs to be emptied by that (is there any way to * 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! */ + * having all bytes transferred! + * Also we should make sure that all data from the DMA engine buffer's really + * made its way to the system memory! Some documentation on this would not + * seem to be a bad idea, actually. + */ if( !(pSRB->SRBState & SRB_XFERPAD) ) { if( scsi_status & PARITYERROR ) { @@ -3729,7 +3746,7 @@ // 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 +#if 1 int ctr = 6000000; printk ("DC395x: DIP0: Wait for DMA FIFO to flush ...\n"); //DC395x_write16 (TRM_S1040_DMA_CONTROL, STOPDMAXFER); @@ -3852,10 +3869,11 @@ 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); +#if 0 //def DC395x_DEBUG_KG + printk ("DC395x: DIP0: DMA not yet ready: %02x: %i -> %i bytes\n", + DC395x_read8(TRM_S1040_DMA_STATUS), pSRB->SRBTotalXferLength, dLeftCounter); #endif + pSRB->SRBTotalXferLength = dLeftCounter; } else /* phase changed */ { @@ -4434,6 +4452,7 @@ pSRB->SGIndex = 0; if( pSRB->pcmd->use_sg ) { + /* NOTE: This is wrong, since we have segment merging nowadays ... */ pSRB->SGcount = (BYTE) pSRB->pcmd->use_sg; pSRB->pSegmentList = (PSGL) pSRB->pcmd->request_buffer; psgl = pSRB->pSegmentList; @@ -5096,7 +5115,7 @@ pcmd = pSRB->pcmd; TRACEPRINTF("DONE *"); - + ptr = (PSCSI_INQDATA) (pcmd->request_buffer); if( pcmd->use_sg ) ptr = (PSCSI_INQDATA) (((PSGL) ptr)->address); @@ -5158,6 +5177,8 @@ #ifdef DC395x_DEBUG0 printk(KERN_INFO "AUTO_REQSENSE2..............\n "); #endif + // Restore SG stuff + //printk ("Auto_ReqSense finished: Restore Counters ...\n"); pSRB->SRBTotalXferLength = pSRB->Xferred; pSRB->SegmentX[0].address = pSRB->SgSenseTemp.address; pSRB->SegmentX[0].length = pSRB->SgSenseTemp.length; Index: dc395x_trm.h =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- dc395x_trm.h 2001/11/14 00:19:38 1.33 +++ dc395x_trm.h 2001/12/06 20:46:02 1.34 @@ -8,7 +8,7 @@ ** ********************************************************************** */ -/* $Id: dc395x_trm.h,v 1.33 2001/11/14 00:19:38 garloff Exp $ */ +/* $Id: dc395x_trm.h,v 1.34 2001/12/06 20:46:02 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.34, 2001-11-14" +#define DC395x_VERSION "1.35, 2001-12-06" /* Kernel version autodetection */ #include