Print this page
5719 Add support for LSI Fury adapters

@@ -15,10 +15,11 @@
  *              Shakeel Bukhari
  */
 
 /*
  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  */
 
 
 #include <sys/types.h>
 #include <sys/file.h>

@@ -1229,10 +1230,11 @@
         uint32_t                numElements, endElement;
         Mpi25IeeeSgeChain64_t   *ieeeChainElement = NULL;
         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__));
 
         /* Calulate SGE size in number of Words(32bit) */

@@ -1272,11 +1274,12 @@
 
         /* prepare the scatter-gather list for the firmware */
         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;
 
                 ddi_put8(acc_handle, &sgl_ptr_end->Flags, 0);
         }

@@ -1288,11 +1291,12 @@
                 ddi_put32(acc_handle, &scsi_raid_io_sgl_ieee->Length,
                     acmd->cmd_dmacookies[i].dmac_size);
 
                 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,
                                     IEEE_SGE_FLAGS_END_OF_LIST);
                         }

@@ -1316,11 +1320,12 @@
         /* check if chained SGL required */
         if (i < numElements) {
 
                 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);
 
                         if ((ioFlags &
                             MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) !=

@@ -1339,11 +1344,12 @@
                 /* prepare physical chain element */
                 ieeeChainElement = scsi_raid_io_sgl_ieee;
 
                 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 {
                         ddi_put8(acc_handle, &ieeeChainElement->Flags,
                             (IEEE_SGE_FLAGS_CHAIN_ELEMENT |

@@ -1374,11 +1380,12 @@
                         ddi_put32(acc_handle, &scsi_raid_io_sgl_ieee->Length,
                             acmd->cmd_dmacookies[i].dmac_size);
 
                         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,
                                             IEEE_SGE_FLAGS_END_OF_LIST);
                                 }

@@ -1414,10 +1421,11 @@
         uint8_t         fp_possible = 0;
         uint32_t        index;
         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;
         struct scsa_cmd                 *acmd = PKT2CMD(pkt);
         MRSAS_REQUEST_DESCRIPTOR_UNION  *ReqDescUnion;

@@ -1639,11 +1647,12 @@
 
                         ReqDescUnion->SCSIIO.RequestFlags =
                             (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,
                                     &scsi_raid_io->IoFlags);
 

@@ -1702,11 +1711,12 @@
 
                         ddi_put16(acc_handle,
                             &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);
 
                                 if (regLockFlags == REGION_TYPE_UNUSED) {
                                         ReqDescUnion->SCSIIO.RequestFlags =

@@ -2253,11 +2263,12 @@
         cmd->request_desc = ReqDescUnion;
 
         /* 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;
                 ddi_put8(acc_handle, &sgl_ptr_end->Flags, 0);
         }