changeset 14999:d82162494740

fixes #164 Need support for LSI Fury Adapters
author Garrett D'Amore <garrett@damore.org>
date Fri, 09 Jan 2015 07:13:55 -0800
parents dd9761e65159
children e36682bdcf24
files usr/src/pkg/manifests/driver-storage-mr_sas.mf usr/src/uts/common/io/mr_sas/ld_pd_map.c usr/src/uts/common/io/mr_sas/mr_sas.c usr/src/uts/common/io/mr_sas/mr_sas.h usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c
diffstat 5 files changed, 35 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkg/manifests/driver-storage-mr_sas.mf	Thu Jan 08 08:26:27 2015 -0800
+++ b/usr/src/pkg/manifests/driver-storage-mr_sas.mf	Fri Jan 09 07:13:55 2015 -0800
@@ -22,6 +22,7 @@
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2015 Garrett D'Amore <garrett@damore.org>
 #
 
 #
@@ -46,6 +47,7 @@
     alias=pci1000,79 \
     alias=pciex1000,5b \
     alias=pciex1000,5d \
+    alias=pciex1000,5f \
     alias=pciex1000,71 \
     alias=pciex1000,73 \
     alias=pciex1000,78 \
@@ -53,6 +55,7 @@
 $(i386_ONLY)driver name=mr_sas class=scsi-self-identifying \
     alias=pciex1000,5b \
     alias=pciex1000,5d \
+    alias=pciex1000,5f \
     alias=pciex1000,71 \
     alias=pciex1000,73 \
     alias=pciex1000,78 \
--- a/usr/src/uts/common/io/mr_sas/ld_pd_map.c	Thu Jan 08 08:26:27 2015 -0800
+++ b/usr/src/uts/common/io/mr_sas/ld_pd_map.c	Fri Jan 09 07:13:55 2015 -0800
@@ -21,6 +21,9 @@
  *
  * **********************************************************************
  */
+/*
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
+ */
 
 #include <sys/scsi/scsi.h>
 #include "mr_sas.h"
@@ -209,6 +212,7 @@
 	U32		rowMod;
 	U32		armQ;
 	U32		arm;
+	U16		devid = instance->device_id;
 
 	ASSERT(raid->rowDataSize != 0);
 
@@ -251,8 +255,9 @@
 	} else {
 		*pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */
 		if ((raid->level >= 5) &&
-		    ((instance->device_id != PCI_DEVICE_ID_LSI_INVADER) ||
-		    (instance->device_id == PCI_DEVICE_ID_LSI_INVADER &&
+		    ((devid != PCI_DEVICE_ID_LSI_INVADER) ||
+		    ((devid == PCI_DEVICE_ID_LSI_INVADER ||
+		    (devid == PCI_DEVICE_ID_LSI_FURY)) &&
 		    raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) {
 			pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE;
 		} else if (raid->level == 1) {
@@ -398,7 +403,8 @@
 
 	pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec;
 
-	if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+	if ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) ||
+	    (instance->device_id == PCI_DEVICE_ID_LSI_FURY)) {
 		pRAID_Context->regLockFlags = (isRead) ?
 		    raid->regTypeReqOnRead : raid->regTypeReqOnWrite;
 	} else {
--- a/usr/src/uts/common/io/mr_sas/mr_sas.c	Thu Jan 08 08:26:27 2015 -0800
+++ b/usr/src/uts/common/io/mr_sas/mr_sas.c	Fri Jan 09 07:13:55 2015 -0800
@@ -45,6 +45,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 #include <sys/types.h>
@@ -573,6 +574,7 @@
 		switch (device_id) {
 		case PCI_DEVICE_ID_LSI_TBOLT:
 		case PCI_DEVICE_ID_LSI_INVADER:
+		case PCI_DEVICE_ID_LSI_FURY:
 			con_log(CL_ANN, (CE_NOTE,
 			    "mr_sas: 2208 T.B. device detected"));
 
--- a/usr/src/uts/common/io/mr_sas/mr_sas.h	Thu Jan 08 08:26:27 2015 -0800
+++ b/usr/src/uts/common/io/mr_sas/mr_sas.h	Fri Jan 09 07:13:55 2015 -0800
@@ -44,6 +44,7 @@
 /*
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 #ifndef	_MR_SAS_H_
@@ -95,6 +96,7 @@
 #define	PCI_DEVICE_ID_LSI_SKINNY_NEW		0x0073
 #define	PCI_DEVICE_ID_LSI_TBOLT			0x005b
 #define	PCI_DEVICE_ID_LSI_INVADER		0x005d
+#define	PCI_DEVICE_ID_LSI_FURY			0x005f
 
 /*
  * Register Index for 2108 Controllers.
--- a/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c	Thu Jan 08 08:26:27 2015 -0800
+++ b/usr/src/uts/common/io/mr_sas/mr_sas_tbolt.c	Fri Jan 09 07:13:55 2015 -0800
@@ -17,6 +17,7 @@
 
 /*
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 
@@ -1231,6 +1232,7 @@
 	Mpi25IeeeSgeChain64_t	*scsi_raid_io_sgl_ieee = NULL;
 	ddi_acc_handle_t acc_handle =
 	    instance->mpi2_frame_pool_dma_obj.acc_handle;
+	uint16_t		devid = instance->device_id;
 
 	con_log(CL_ANN1, (CE_NOTE,
 	    "chkpnt: Building Chained SGL :%d", __LINE__));
@@ -1274,7 +1276,8 @@
 	scsi_raid_io_sgl_ieee =
 	    (Mpi25IeeeSgeChain64_t *)&scsi_raid_io->SGL.IeeeChain;
 
-	if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+	if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+	    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 		Mpi25IeeeSgeChain64_t *sgl_ptr_end = scsi_raid_io_sgl_ieee;
 		sgl_ptr_end += instance->max_sge_in_main_msg - 1;
 
@@ -1290,7 +1293,8 @@
 
 		ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, 0);
 
-		if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+		if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+		    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 			if (i == (numElements - 1)) {
 				ddi_put8(acc_handle,
 				    &scsi_raid_io_sgl_ieee->Flags,
@@ -1318,7 +1322,8 @@
 
 		con_log(CL_ANN1, (CE_NOTE, "[Chain Element index]:%x", i));
 
-		if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+		if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+		    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 			uint16_t ioFlags =
 			    ddi_get16(acc_handle, &scsi_raid_io->IoFlags);
 
@@ -1341,7 +1346,8 @@
 
 		ddi_put8(acc_handle, &ieeeChainElement->NextChainOffset, 0);
 
-		if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+		if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+		    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 			ddi_put8(acc_handle, &ieeeChainElement->Flags,
 			    IEEE_SGE_FLAGS_CHAIN_ELEMENT);
 		} else {
@@ -1376,7 +1382,8 @@
 
 			ddi_put8(acc_handle, &scsi_raid_io_sgl_ieee->Flags, 0);
 
-			if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+			if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+			    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 				if (i == (numElements - 1)) {
 					ddi_put8(acc_handle,
 					    &scsi_raid_io_sgl_ieee->Flags,
@@ -1416,6 +1423,7 @@
 	uint32_t	lba_count = 0;
 	uint32_t	start_lba_hi = 0;
 	uint32_t	start_lba_lo = 0;
+	uint16_t	devid = instance->device_id;
 	ddi_acc_handle_t acc_handle =
 	    instance->mpi2_frame_pool_dma_obj.acc_handle;
 	struct mrsas_cmd		*cmd = NULL;
@@ -1641,7 +1649,8 @@
 			    (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY <<
 			    MPI2_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
 
-			if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+			if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+			    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 				uint8_t regLockFlags = ddi_get8(acc_handle,
 				    &scsi_raid_io->RaidContext.regLockFlags);
 				uint16_t IoFlags = ddi_get16(acc_handle,
@@ -1704,7 +1713,8 @@
 			    &scsi_raid_io->RaidContext.timeoutValue,
 			    local_map_ptr->raidMap.fpPdIoTimeoutSec);
 
-			if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+			if ((devid == PCI_DEVICE_ID_LSI_INVADER) ||
+			    (devid == PCI_DEVICE_ID_LSI_FURY)) {
 				uint8_t regLockFlags = ddi_get8(acc_handle,
 				    &scsi_raid_io->RaidContext.regLockFlags);
 
@@ -2255,7 +2265,8 @@
 	/* get raid message frame pointer */
 	scsi_raid_io = (Mpi2RaidSCSIIORequest_t *)cmd->scsi_io_request;
 
-	if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
+	if ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) ||
+	    (instance->device_id == PCI_DEVICE_ID_LSI_FURY)) {
 		Mpi25IeeeSgeChain64_t *sgl_ptr_end = (Mpi25IeeeSgeChain64_t *)
 		    &scsi_raid_io->SGL.IeeeChain;
 		sgl_ptr_end += instance->max_sge_in_main_msg - 1;