Print this page
5719 Add support for LSI Fury adapters

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mr_sas/ld_pd_map.c
          +++ new/usr/src/uts/common/io/mr_sas/ld_pd_map.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   *              Manju R
  15   15   *              Rasheed
  16   16   *              Shakeel Bukhari
  17   17   *
  18   18   *
  19   19   * This module contains functions for device drivers
  20   20   * to get pd-ld mapping information.
  21   21   *
  22   22   * **********************************************************************
  23   23   */
       24 +/*
       25 + * Copyright 2015 Garrett D'Amore <garrett@damore.org>
       26 + */
  24   27  
  25   28  #include <sys/scsi/scsi.h>
  26   29  #include "mr_sas.h"
  27   30  #include "ld_pd_map.h"
  28   31  
  29   32  /*
  30   33   * This function will check if FAST IO is possible on this logical drive
  31   34   * by checking the EVENT information available in the driver
  32   35   */
  33   36  #define MR_LD_STATE_OPTIMAL 3
↓ open down ↓ 168 lines elided ↑ open up ↑
 202  205  {
 203  206          MR_LD_RAID      *raid = MR_LdRaidGet(ld, map);
 204  207          U32             pd, arRef;
 205  208          U8              physArm, span;
 206  209          U64             row;
 207  210          int             error_code = 0;
 208  211          U8              retval = TRUE;
 209  212          U32             rowMod;
 210  213          U32             armQ;
 211  214          U32             arm;
      215 +        U16             devid = instance->device_id;
 212  216  
 213  217          ASSERT(raid->rowDataSize != 0);
 214  218  
 215  219          row = (stripRow / raid->rowDataSize);
 216  220  
 217  221          if (raid->level == 6) {
 218  222                  U32 logArm =  (stripRow % (raid->rowDataSize));
 219  223  
 220  224                  if (raid->rowSize == 0) {
 221  225                          return (FALSE);
↓ open down ↓ 22 lines elided ↑ open up ↑
 244  248          /* Get the array on which this span is present. */
 245  249          arRef           = MR_LdSpanArrayGet(ld, span, map);
 246  250          /* Get the Pd. */
 247  251          pd              = MR_ArPdGet(arRef, physArm, map);
 248  252          /* Get dev handle from Pd. */
 249  253          if (pd != MR_PD_INVALID) {
 250  254                  *pDevHandle     = MR_PdDevHandleGet(pd, map);
 251  255          } else {
 252  256                  *pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */
 253  257                  if ((raid->level >= 5) &&
 254      -                    ((instance->device_id != PCI_DEVICE_ID_LSI_INVADER) ||
 255      -                    (instance->device_id == PCI_DEVICE_ID_LSI_INVADER &&
      258 +                    ((devid != PCI_DEVICE_ID_LSI_INVADER) ||
      259 +                    ((devid == PCI_DEVICE_ID_LSI_INVADER ||
      260 +                    (devid == PCI_DEVICE_ID_LSI_FURY)) &&
 256  261                      raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) {
 257  262                          pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE;
 258  263                  } else if (raid->level == 1) {
 259  264                          /* Get Alternate Pd. */
 260  265                          pd = MR_ArPdGet(arRef, physArm + 1, map);
 261  266                          /* Get dev handle from Pd. */
 262  267                          if (pd != MR_PD_INVALID)
 263  268                                  *pDevHandle = MR_PdDevHandleGet(pd, map);
 264  269                  }
 265  270          }
↓ open down ↓ 125 lines elided ↑ open up ↑
 391  396  
 392  397                  if (endStrip == endRow * raid->rowDataSize) {
 393  398                          regSize += ref_in_end_stripe + 1;
 394  399                  } else {
 395  400                          regSize += stripSize;
 396  401                  }
 397  402          }
 398  403  
 399  404          pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec;
 400  405  
 401      -        if (instance->device_id == PCI_DEVICE_ID_LSI_INVADER) {
      406 +        if ((instance->device_id == PCI_DEVICE_ID_LSI_INVADER) ||
      407 +            (instance->device_id == PCI_DEVICE_ID_LSI_FURY)) {
 402  408                  pRAID_Context->regLockFlags = (isRead) ?
 403  409                      raid->regTypeReqOnRead : raid->regTypeReqOnWrite;
 404  410          } else {
 405  411                  pRAID_Context->regLockFlags = (isRead) ?
 406  412                      REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite;
 407  413          }
 408  414  
 409  415          pRAID_Context->ldTargetId = raid->targetId;
 410  416          pRAID_Context->regLockRowLBA = regStart;
 411  417          pRAID_Context->regLockLength = regSize;
↓ open down ↓ 128 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX