Print this page
5719 Add support for LSI Fury adapters


  28  *    specific prior written permission.
  29  *
  30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  33  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  34  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  35  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  36  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  37  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  38  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  39  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  40  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  41  * DAMAGE.
  42  */
  43 
  44 /*
  45  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  46  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
  47  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.

  48  */
  49 
  50 #include <sys/types.h>
  51 #include <sys/param.h>
  52 #include <sys/file.h>
  53 #include <sys/errno.h>
  54 #include <sys/open.h>
  55 #include <sys/cred.h>
  56 #include <sys/modctl.h>
  57 #include <sys/conf.h>
  58 #include <sys/devops.h>
  59 #include <sys/cmn_err.h>
  60 #include <sys/kmem.h>
  61 #include <sys/stat.h>
  62 #include <sys/mkdev.h>
  63 #include <sys/pci.h>
  64 #include <sys/scsi/scsi.h>
  65 #include <sys/ddi.h>
  66 #include <sys/sunddi.h>
  67 #include <sys/atomic.h>


 556                 command = pci_config_get16(instance->pci_handle,
 557                     PCI_CONF_COMM);
 558 
 559                 if (!(command & PCI_COMM_ME)) {
 560                         command |= PCI_COMM_ME;
 561 
 562                         pci_config_put16(instance->pci_handle,
 563                             PCI_CONF_COMM, command);
 564 
 565                         con_log(CL_ANN, (CE_CONT, "mr_sas%d: "
 566                             "enable bus-mastering", instance_no));
 567                 } else {
 568                         con_log(CL_DLEVEL1, (CE_CONT, "mr_sas%d: "
 569                             "bus-mastering already set", instance_no));
 570                 }
 571 
 572                 /* initialize function pointers */
 573                 switch (device_id) {
 574                 case PCI_DEVICE_ID_LSI_TBOLT:
 575                 case PCI_DEVICE_ID_LSI_INVADER:

 576                         con_log(CL_ANN, (CE_NOTE,
 577                             "mr_sas: 2208 T.B. device detected"));
 578 
 579                         instance->func_ptr =
 580                             &mrsas_function_template_fusion;
 581                         instance->tbolt = 1;
 582                         break;
 583 
 584                 case PCI_DEVICE_ID_LSI_SKINNY:
 585                 case PCI_DEVICE_ID_LSI_SKINNY_NEW:
 586                         /*
 587                          * FALLTHRU to PPC-style functions, but mark this
 588                          * instance as Skinny, because the register set is
 589                          * slightly different (See WR_IB_PICK_QPORT), and
 590                          * certain other features are available to a Skinny
 591                          * HBA.
 592                          */
 593                         instance->skinny = 1;
 594                         /* FALLTHRU */
 595 




  28  *    specific prior written permission.
  29  *
  30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  33  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  34  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  35  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  36  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  37  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  38  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  39  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  40  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  41  * DAMAGE.
  42  */
  43 
  44 /*
  45  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  46  * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
  47  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
  48  * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  49  */
  50 
  51 #include <sys/types.h>
  52 #include <sys/param.h>
  53 #include <sys/file.h>
  54 #include <sys/errno.h>
  55 #include <sys/open.h>
  56 #include <sys/cred.h>
  57 #include <sys/modctl.h>
  58 #include <sys/conf.h>
  59 #include <sys/devops.h>
  60 #include <sys/cmn_err.h>
  61 #include <sys/kmem.h>
  62 #include <sys/stat.h>
  63 #include <sys/mkdev.h>
  64 #include <sys/pci.h>
  65 #include <sys/scsi/scsi.h>
  66 #include <sys/ddi.h>
  67 #include <sys/sunddi.h>
  68 #include <sys/atomic.h>


 557                 command = pci_config_get16(instance->pci_handle,
 558                     PCI_CONF_COMM);
 559 
 560                 if (!(command & PCI_COMM_ME)) {
 561                         command |= PCI_COMM_ME;
 562 
 563                         pci_config_put16(instance->pci_handle,
 564                             PCI_CONF_COMM, command);
 565 
 566                         con_log(CL_ANN, (CE_CONT, "mr_sas%d: "
 567                             "enable bus-mastering", instance_no));
 568                 } else {
 569                         con_log(CL_DLEVEL1, (CE_CONT, "mr_sas%d: "
 570                             "bus-mastering already set", instance_no));
 571                 }
 572 
 573                 /* initialize function pointers */
 574                 switch (device_id) {
 575                 case PCI_DEVICE_ID_LSI_TBOLT:
 576                 case PCI_DEVICE_ID_LSI_INVADER:
 577                 case PCI_DEVICE_ID_LSI_FURY:
 578                         con_log(CL_ANN, (CE_NOTE,
 579                             "mr_sas: 2208 T.B. device detected"));
 580 
 581                         instance->func_ptr =
 582                             &mrsas_function_template_fusion;
 583                         instance->tbolt = 1;
 584                         break;
 585 
 586                 case PCI_DEVICE_ID_LSI_SKINNY:
 587                 case PCI_DEVICE_ID_LSI_SKINNY_NEW:
 588                         /*
 589                          * FALLTHRU to PPC-style functions, but mark this
 590                          * instance as Skinny, because the register set is
 591                          * slightly different (See WR_IB_PICK_QPORT), and
 592                          * certain other features are available to a Skinny
 593                          * HBA.
 594                          */
 595                         instance->skinny = 1;
 596                         /* FALLTHRU */
 597