--- old/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c	Mon Aug  5 17:31:27 2019
+++ new/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c	Mon Aug  5 17:31:27 2019
@@ -22,6 +22,7 @@
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
  * Copyright (c) 2017, Joyent, Inc.
  */
@@ -137,6 +138,36 @@
 	case MPI25_MFGPAGE_DEVID_SAS3108_5:
 	case MPI25_MFGPAGE_DEVID_SAS3108_6:
 		return ("SAS3108");
+	case MPI26_MFGPAGE_DEVID_SAS3216:
+	case MPI26_MFGPAGE_DEVID_SAS3316_1:
+	case MPI26_MFGPAGE_DEVID_SAS3316_2:
+	case MPI26_MFGPAGE_DEVID_SAS3316_3:
+	case MPI26_MFGPAGE_DEVID_SAS3316_4:
+		return ("SAS3216");
+	case MPI26_MFGPAGE_DEVID_SAS3224:
+	case MPI26_MFGPAGE_DEVID_SAS3324_1:
+	case MPI26_MFGPAGE_DEVID_SAS3324_2:
+	case MPI26_MFGPAGE_DEVID_SAS3324_3:
+	case MPI26_MFGPAGE_DEVID_SAS3324_4:
+		return ("SAS3224");
+	case MPI26_MFGPAGE_DEVID_SAS3408:
+		return ("SAS3408");
+	case MPI26_MFGPAGE_DEVID_SAS3416:
+		return ("SAS3416");
+	case MPI26_MFGPAGE_DEVID_SAS3508:
+	case MPI26_MFGPAGE_DEVID_SAS3508_1:
+		return ("SAS3508");
+	case MPI26_MFGPAGE_DEVID_SAS3516:
+	case MPI26_MFGPAGE_DEVID_SAS3516_1:
+		return ("SAS3516");
+	case MPI26_MFGPAGE_DEVID_SAS3616:
+		return ("SAS3616");
+	case MPI26_MFGPAGE_DEVID_SAS3708:
+		return ("SAS3708");
+	case MPI26_MFGPAGE_DEVID_SAS3716:
+		return ("SAS3716");
+	case MPI26_MFGPAGE_DEVID_SAS4008:
+		return ("SAS4008");
 	default:
 		return ("?");
 	}
@@ -219,7 +250,7 @@
 		return (DDI_FAILURE);
 	}
 
-	if (iocstatus = ddi_get16(accessp, &factsreply->IOCStatus)) {
+	if ((iocstatus = ddi_get16(accessp, &factsreply->IOCStatus)) != 0) {
 		mptsas_log(mpt, CE_WARN, "mptsas_ioc_do_get_facts_reply: "
 		    "IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
 		    ddi_get32(accessp, &factsreply->IOCLogInfo));
@@ -238,7 +269,7 @@
 	    ddi_get8(accessp, &factsreply->FWVersion.Struct.Minor),
 	    ddi_get8(accessp, &factsreply->FWVersion.Struct.Unit),
 	    ddi_get8(accessp, &factsreply->FWVersion.Struct.Dev));
-	mptsas_log(mpt, CE_NOTE, "?MPT Firmware version v%s (%s)\n",
+	mptsas_log(mpt, CE_NOTE, "MPT Firmware version v%s (%s)",
 	    buf, mptsas_devid_type_string(mpt));
 	(void) ddi_prop_update_string(DDI_DEV_T_NONE, mpt->m_dip,
 	    "firmware-version", buf);
@@ -308,12 +339,11 @@
 	 */
 	msgversion = ddi_get16(accessp, &factsreply->MsgVersion);
 	if (msgversion >= MPI2_VERSION_02_05) {
-		mptsas_log(mpt, CE_NOTE, "?mpt_sas%d SAS 3 Supported\n",
-		    mpt->m_instance);
+		mptsas_log(mpt, CE_NOTE, "SAS 3 supported Version (0x%x)",
+		    msgversion);
 		mpt->m_MPI25 = TRUE;
 	} else {
-		mptsas_log(mpt, CE_NOTE, "?mpt_sas%d MPI Version 0x%x\n",
-		    mpt->m_instance, msgversion);
+		mptsas_log(mpt, CE_NOTE, "MPI Version 0x%x", msgversion);
 	}
 
 	/*
@@ -432,7 +462,7 @@
 		return (DDI_FAILURE);
 	}
 
-	if (iocstatus = ddi_get16(accessp, &factsreply->IOCStatus)) {
+	if ((iocstatus = ddi_get16(accessp, &factsreply->IOCStatus)) != 0) {
 		mptsas_log(mpt, CE_WARN, "mptsas_ioc_do_get_port_facts_reply: "
 		    "IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
 		    ddi_get32(accessp, &factsreply->IOCLogInfo));
@@ -512,7 +542,7 @@
 		return (DDI_FAILURE);
 	}
 
-	if (iocstatus = ddi_get16(accessp, &portreply->IOCStatus)) {
+	if ((iocstatus = ddi_get16(accessp, &portreply->IOCStatus)) != 0) {
 		mptsas_log(mpt, CE_WARN, "mptsas_ioc_do_enable_port_reply: "
 		    "IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
 		    ddi_get32(accessp, &portreply->IOCLogInfo));
@@ -594,7 +624,7 @@
 		return (DDI_FAILURE);
 	}
 
-	if (iocstatus = ddi_get16(accessp, &eventsreply->IOCStatus)) {
+	if ((iocstatus = ddi_get16(accessp, &eventsreply->IOCStatus)) != 0) {
 		mptsas_log(mpt, CE_WARN,
 		    "mptsas_ioc_do_enable_event_notification_reply: "
 		    "IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
@@ -721,7 +751,7 @@
 		return (DDI_FAILURE);
 	}
 
-	if (iocstatus = ddi_get16(accessp, &initreply->IOCStatus)) {
+	if ((iocstatus = ddi_get16(accessp, &initreply->IOCStatus)) != 0) {
 		mptsas_log(mpt, CE_WARN, "mptsas_do_ioc_init_reply: "
 		    "IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
 		    ddi_get32(accessp, &initreply->IOCLogInfo));
@@ -730,8 +760,7 @@
 
 	if ((ddi_get32(mpt->m_datap, &mpt->m_reg->Doorbell)) &
 	    MPI2_IOC_STATE_OPERATIONAL) {
-		mptsas_log(mpt, CE_NOTE,
-		    "?mpt%d: IOC Operational.\n", mpt->m_instance);
+		mptsas_log(mpt, CE_NOTE, "IOC Operational");
 	} else {
 		return (DDI_FAILURE);
 	}
