Index: dc390//dc390.h =================================================================== RCS file: /usr/local/cvsroot/dc390/dc390.h,v retrieving revision 2.26 retrieving revision 2.28 diff -u -r2.26 -r2.28 --- dc390//dc390.h 1999/06/21 07:02:08 2.26 +++ dc390//dc390.h 1999/07/04 20:37:22 2.28 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 2.26 1999/06/21 07:02:08 garloff Exp $ */ +/* $Id: dc390.h,v 2.28 1999/07/04 20:37:22 garloff Exp $ */ #include @@ -16,7 +16,7 @@ #define DC390_H #define DC390_BANNER "Tekram DC390/AM53C974" -#define DC390_VERSION "2.0d10 1999/06/20" +#define DC390_VERSION "2.0d12 1999/07/04" #if defined(HOSTS_C) || defined(MODULE) Index: dc390//scsiiom.c =================================================================== RCS file: /usr/local/cvsroot/dc390/scsiiom.c,v retrieving revision 2.36 retrieving revision 2.40 diff -u -r2.36 -r2.40 --- dc390//scsiiom.c 1999/06/21 07:33:04 2.36 +++ dc390//scsiiom.c 1999/07/04 20:37:22 2.40 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390 (T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: scsiiom.c,v 2.36 1999/06/21 07:33:04 garloff Exp $ */ +/* $Id: scsiiom.c,v 2.40 1999/07/04 20:37:22 garloff Exp $ */ static void __inline__ dc390_freetag (PDCB pDCB, PSRB pSRB) @@ -278,21 +278,39 @@ { printk ("DC390: Illegal Operation detected (%08lx)!\n", dc390_laststatus); dc390_dumpinfo (pACB, pACB->pActiveDCB, pACB->pActiveDCB->pActiveSRB); - }; + } - if(istatus & DISCONNECTED) + else if (istatus & INVALID_CMD) { + dc390_InvalidCmd( pACB ); + goto unlock; + } + + if (istatus & SCSI_RESET) + { + dc390_ScsiRstDetect( pACB ); + goto unlock; + } + + if (istatus & DISCONNECTED) + { dc390_Disconnect( pACB ); goto unlock; } - else if(istatus & RESELECTED) + else if (istatus & RESELECTED) { dc390_Reselect( pACB ); goto unlock; } + + else if (istatus & (SELECTED | SEL_ATTENTION)) + { + printk (KERN_ERR "DC390: Target mode not supported!\n"); + goto unlock; + } - else if( istatus & (SUCCESSFUL_OP|SERVICE_REQUEST) ) + if (istatus & (SUCCESSFUL_OP|SERVICE_REQUEST) ) { pDCB = pACB->pActiveDCB; if (!pDCB) @@ -317,24 +335,6 @@ goto unlock; } - else if(istatus & INVALID_CMD) - { - dc390_InvalidCmd( pACB ); - goto unlock; - } - - else if(istatus & SCSI_RESET) - { - dc390_ScsiRstDetect( pACB ); - goto unlock; - } - - else if(istatus & (SELECTED | SEL_ATTENTION)) - { - printk (KERN_ERR "DC390: Target mode not supported!\n"); - goto unlock; - } - unlock: DC390_LOCK_DRV_NI; DC390_UNLOCK_ACB; @@ -1136,7 +1136,7 @@ if( (pSRB->SRBState & (SRB_START_+SRB_MSGOUT)) || !(pSRB->SRBState & (SRB_DISCONNECT+SRB_COMPLETED)) ) { /* Selection time out */ - if( !(1/*pACB->scan_devices*/) ) + if( !(pACB->scan_devices) ) { pSRB->SRBState = SRB_READY; dc390_freetag (pDCB, pSRB); @@ -1376,9 +1376,9 @@ } #endif //pcmd->result = MK_RES(DRIVER_SENSE,DID_OK,0,status); - if(status == CHECK_CONDITION << 1) + if (status == (CHECK_CONDITION << 1)) { - pcmd->result = MK_RES_LNX(0,DID_BAD_TARGET,0,CHECK_CONDITION); + pcmd->result = MK_RES_LNX(0,DID_BAD_TARGET,0,/*CHECK_CONDITION*/0); goto ckc_e; } if(pSRB->RetryCnt == 0) @@ -1500,7 +1500,10 @@ } else { /* Report error */ - pcmd->result = MK_RES(0, DID_ERROR, pSRB->EndMessage, status); + //pcmd->result = MK_RES(0, DID_ERROR, pSRB->EndMessage, status); + SET_RES_DID(pcmd->result,DID_ERROR); + SET_RES_MSG(pcmd->result,pSRB->EndMessage); + SET_RES_TARGET(pcmd->result,status); } } } @@ -1515,7 +1518,9 @@ } else if( pSRB->SRBStatus & PARITY_ERROR) { - pcmd->result = MK_RES(0,DID_PARITY,pSRB->EndMessage,0); + //pcmd->result = MK_RES(0,DID_PARITY,pSRB->EndMessage,0); + SET_RES_DID(pcmd->result,DID_PARITY); + SET_RES_MSG(pcmd->result,pSRB->EndMessage); } else /* No error */ { @@ -1532,7 +1537,7 @@ { #ifdef DC390_DEBUG0 printk (KERN_INFO "DC390: Test_Unit_Ready: result: %08x", pcmd->result); - if (pcmd->result & DRIVER_SENSE << 24) printk (" (sense: %02x %02x %02x %02x)\n", + if (pcmd->result & (DRIVER_SENSE << 24)) printk (" (sense: %02x %02x %02x %02x)\n", pcmd->sense_buffer[0], pcmd->sense_buffer[1], pcmd->sense_buffer[2], pcmd->sense_buffer[3]); else printk ("\n"); @@ -1559,8 +1564,10 @@ } } - if( pSRB->pcmd->cmnd[0] == INQUIRY && - (host_byte(pcmd->result) == DID_OK || status_byte(pcmd->result) & CHECK_CONDITION) ) + //if( pSRB->pcmd->cmnd[0] == INQUIRY && + // (host_byte(pcmd->result) == DID_OK || status_byte(pcmd->result) & CHECK_CONDITION) ) + if( pSRB->pcmd->cmnd[0] == INQUIRY && + (pcmd->result == (DID_OK << 16) || status_byte(pcmd->result) & CHECK_CONDITION) ) { ptr = (PSCSI_INQDATA) (pcmd->request_buffer); if( pcmd->use_sg ) Index: dc390//tmscsim.c =================================================================== RCS file: /usr/local/cvsroot/dc390/tmscsim.c,v retrieving revision 2.41 retrieving revision 2.43 diff -u -r2.41 -r2.43 --- dc390//tmscsim.c 1999/06/21 07:02:08 2.41 +++ dc390//tmscsim.c 1999/07/04 20:37:22 2.43 @@ -7,7 +7,7 @@ ***********************************************************************/ /* (C) Copyright: put under GNU GPL in 10/96 (see README.tmscsim) * *************************************************************************/ -/* $Id: tmscsim.c,v 2.41 1999/06/21 07:02:08 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.43 1999/07/04 20:37:22 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -120,6 +120,8 @@ * 2.0d1099/06/20 KG TagMaxNo changes now honoured! Queueing * * clearified (renamed ..) TagMask handling* * cleaned. * + * 2.0d1199/06/28 KG cmd->result now identical to 2.0d2 * + * 2.0d1299/07/04 KG Changed order of processing in IRQ * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -2512,6 +2514,7 @@ for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB; printk (KERN_NOTICE " DC390: Remove DCB for Dev(Idx) %i SCSI ID %i LUN %i\n", dev, pDCB->UnitSCSIID, pDCB->UnitSCSILUN); + /* TO DO: We should make sure no pending commands are left */ dc390_remove_dev (pACB, pDCB); DC390_UNLOCK_ACB; DC390_UNLOCK_IO;