linuxtorvalds / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
b37f23
From 60eded7faed3769b20a519c65a04d9eb9dd48332 Mon Sep 17 00:00:00 2001
b37f23
From: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
b37f23
Date: Wed, 26 Oct 2016 13:34:37 +0530
b37f23
Subject: [PATCH 06/11] scsi: mpt3sas: Added Device ID's for SAS35 devices and
b37f23
 updated MPI header.
b37f23
b37f23
Added Device ID's for SAS35 devices (Ventura, Crusader, Harpoon &
b37f23
Tomcat) and updated mpi header file for the same. Also added
b37f23
"is_gen35_ioc" to MPT3SAS_ADAPTER structure for identifying SAS35 adapters.
b37f23
b37f23
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
b37f23
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com>
b37f23
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
b37f23
Reviewed-by: Hannes Reinecke <hare@suse.com>
b37f23
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
b37f23
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
b37f23
---
b37f23
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h |  7 +++++++
b37f23
 drivers/scsi/mpt3sas/mpt3sas_base.h  |  1 +
b37f23
 drivers/scsi/mpt3sas/mpt3sas_ctl.c   |  5 ++++-
b37f23
 drivers/scsi/mpt3sas/mpt3sas_ctl.h   |  1 +
b37f23
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 31 +++++++++++++++++++++++++++++++
b37f23
 5 files changed, 44 insertions(+), 1 deletion(-)
b37f23
b37f23
diff --git a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
b37f23
index 95356a8..fa61baf 100644
b37f23
--- a/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
b37f23
+++ b/drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
b37f23
@@ -478,6 +478,13 @@ typedef struct _MPI2_CONFIG_REPLY {
b37f23
 #define MPI26_MFGPAGE_DEVID_SAS3324_3               (0x00C2)
b37f23
 #define MPI26_MFGPAGE_DEVID_SAS3324_4               (0x00C3)
b37f23
 
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3516                 (0x00AA)
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3516_1               (0x00AB)
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3416                 (0x00AC)
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3508                 (0x00AD)
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3508_1               (0x00AE)
b37f23
+#define MPI26_MFGPAGE_DEVID_SAS3408                 (0x00AF)
b37f23
+
b37f23
 /*Manufacturing Page 0 */
b37f23
 
b37f23
 typedef struct _MPI2_CONFIG_PAGE_MAN_0 {
b37f23
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h
b37f23
index 66cfa0f..c3a39e8 100644
b37f23
--- a/drivers/scsi/mpt3sas/mpt3sas_base.h
b37f23
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.h
b37f23
@@ -1205,6 +1205,7 @@ struct MPT3SAS_ADAPTER {
b37f23
 	struct SL_WH_MPI_TRIGGERS_T diag_trigger_mpi;
b37f23
 	void		*device_remove_in_progress;
b37f23
 	u16		device_remove_in_progress_sz;
b37f23
+	u8		is_gen35_ioc;
b37f23
 };
b37f23
 
b37f23
 typedef u8 (*MPT_CALLBACK)(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
b37f23
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
b37f23
index a75f8a3..a66c0c8 100644
b37f23
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
b37f23
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
b37f23
@@ -1101,7 +1101,10 @@ _ctl_getiocinfo(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
b37f23
 		break;
b37f23
 	case MPI25_VERSION:
b37f23
 	case MPI26_VERSION:
b37f23
-		karg.adapter_type = MPT3_IOCTL_INTERFACE_SAS3;
b37f23
+		if (ioc->is_gen35_ioc)
b37f23
+			karg.adapter_type = MPT3_IOCTL_INTERFACE_SAS35;
b37f23
+		else
b37f23
+			karg.adapter_type = MPT3_IOCTL_INTERFACE_SAS3;
b37f23
 		strcat(karg.driver_version, MPT3SAS_DRIVER_VERSION);
b37f23
 		break;
b37f23
 	}
b37f23
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.h b/drivers/scsi/mpt3sas/mpt3sas_ctl.h
b37f23
index 8940835..f3e17a8 100644
b37f23
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.h
b37f23
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.h
b37f23
@@ -143,6 +143,7 @@ struct mpt3_ioctl_pci_info {
b37f23
 #define MPT2_IOCTL_INTERFACE_SAS2	(0x04)
b37f23
 #define MPT2_IOCTL_INTERFACE_SAS2_SSS6200	(0x05)
b37f23
 #define MPT3_IOCTL_INTERFACE_SAS3	(0x06)
b37f23
+#define MPT3_IOCTL_INTERFACE_SAS35	(0x07)
b37f23
 #define MPT2_IOCTL_VERSION_LENGTH	(32)
b37f23
 
b37f23
 /**
b37f23
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
b37f23
index c6aa172..eaef45c 100644
b37f23
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
b37f23
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
b37f23
@@ -8722,6 +8722,12 @@ _scsih_determine_hba_mpi_version(struct pci_dev *pdev)
b37f23
 	case MPI26_MFGPAGE_DEVID_SAS3324_2:
b37f23
 	case MPI26_MFGPAGE_DEVID_SAS3324_3:
b37f23
 	case MPI26_MFGPAGE_DEVID_SAS3324_4:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3508:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3508_1:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3408:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3516:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3516_1:
b37f23
+	case MPI26_MFGPAGE_DEVID_SAS3416:
b37f23
 		return MPI26_VERSION;
b37f23
 	}
b37f23
 	return 0;
b37f23
@@ -8777,6 +8783,18 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
b37f23
 		ioc->hba_mpi_version_belonged = hba_mpi_version;
b37f23
 		ioc->id = mpt3_ids++;
b37f23
 		sprintf(ioc->driver_name, "%s", MPT3SAS_DRIVER_NAME);
b37f23
+		switch (pdev->device) {
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3508:
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3508_1:
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3408:
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3516:
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3516_1:
b37f23
+		case MPI26_MFGPAGE_DEVID_SAS3416:
b37f23
+			ioc->is_gen35_ioc = 1;
b37f23
+			break;
b37f23
+		default:
b37f23
+			ioc->is_gen35_ioc = 0;
b37f23
+		}
b37f23
 		if ((ioc->hba_mpi_version_belonged == MPI25_VERSION &&
b37f23
 			pdev->revision >= SAS3_PCI_DEVICE_C0_REVISION) ||
b37f23
 			(ioc->hba_mpi_version_belonged == MPI26_VERSION))
b37f23
@@ -9186,6 +9204,19 @@ static const struct pci_device_id mpt3sas_pci_table[] = {
b37f23
 		PCI_ANY_ID, PCI_ANY_ID },
b37f23
 	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3324_4,
b37f23
 		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	/* Ventura, Crusader, Harpoon & Tomcat ~ 3516, 3416, 3508 & 3408*/
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3508,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3508_1,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3408,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3516,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3516_1,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
+	{ MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3416,
b37f23
+		PCI_ANY_ID, PCI_ANY_ID },
b37f23
 #endif /* MPT2SAS_SCSI */
b37f23
 	{0}     /* Terminating entry */
b37f23
 };
b37f23
-- 
b37f23
1.8.3.1
b37f23