changeset 2959:54668e3addac

6479396 scsa has incorrect test for tran_setcap 6479415 scsa unnecessarily calls scsi_consistent_comp
author taylor
date Fri, 20 Oct 2006 16:46:58 -0700
parents 98aa41c076f5
children 0a0e45155fbd
files usr/src/uts/common/io/scsi/impl/scsi_capabilities.c usr/src/uts/common/io/scsi/impl/scsi_transport.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/impl/scsi_capabilities.c	Fri Oct 20 16:37:58 2006 -0700
+++ b/usr/src/uts/common/io/scsi/impl/scsi_capabilities.c	Fri Oct 20 16:46:58 2006 -0700
@@ -48,7 +48,7 @@
 	int cidx;
 
 	rval = (*A_TO_TRAN(ap)->tran_setcap)(ap, cap, value, whom);
-	if (rval == 0) {
+	if (rval == 1) {
 		cidx = scsi_hba_lookup_capstr(cap);
 		if (cidx == SCSI_CAP_SECTOR_SIZE) {
 			/*
--- a/usr/src/uts/common/io/scsi/impl/scsi_transport.c	Fri Oct 20 16:37:58 2006 -0700
+++ b/usr/src/uts/common/io/scsi/impl/scsi_transport.c	Fri Oct 20 16:46:58 2006 -0700
@@ -79,8 +79,7 @@
 
 	pkt->pkt_comp = pcw->pcw_orig_comp;
 	scsi_sync_pkt(pkt);
-	if (pkt->pkt_comp)
-		(*pkt->pkt_comp)(pkt);
+	(*pkt->pkt_comp)(pkt);
 }
 
 /*
@@ -102,6 +101,7 @@
 
 	/* determine if we need to sync the data on the HBA's behalf */
 	if ((pkt->pkt_dma_flags & DDI_DMA_CONSISTENT) &&
+	    ((pkt->pkt_comp) != NULL) &&
 	    ((P_TO_TRAN(pkt)->tran_setup_pkt) != NULL)) {
 		struct scsi_pkt_cache_wrapper *pcw =
 			(struct scsi_pkt_cache_wrapper *)pkt;