Print this page
NEX-17006 backport mpt_sas tri-mode parts support change
9044 Need support for mpt_sas tri-mode parts
9045 Clean up mpt_sas compiler warnings
9046 mptsas_handle_topo_change can return without its locks held
9047 workaround SAS3408 firmware issue
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Reviewed by: Albert Lee <trisk@forkgnu.org>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Approved by: Richard Lowe <richlowe@richlowe.net>
4500 mptsas_hash_traverse() is unsafe, leads to missing devices
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Approved by: Albert Lee <trisk@nexenta.com>
backout 4500 mptsas_hash_traverse() is unsafe, leads to missing devices
4500 mptsas_hash_traverse() is unsafe, leads to missing devices
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Approved by: Albert Lee <trisk@nexenta.com>
4499 ::mptsas should show slot/enclosure for targets
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Approved by: Albert Lee <trisk@nexenta.com>


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright 2014 Joyent, Inc.  All rights reserved.
  28  * Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
  29  */
  30 
  31 #include <limits.h>
  32 #include <sys/mdb_modapi.h>
  33 #include <sys/sysinfo.h>
  34 #include <sys/sunmdi.h>
  35 #include <sys/list.h>
  36 #include <sys/scsi/scsi.h>
  37 
  38 #pragma pack(1)
  39 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_type.h>
  40 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2.h>
  41 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_cnfg.h>
  42 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_init.h>
  43 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_ioc.h>
  44 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_sas.h>
  45 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_raid.h>
  46 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h>
  47 #pragma pack()


 699                 case MPI2_MFGPAGE_DEVID_SAS2208_6:
 700                         mdb_printf("(SAS2208) ");
 701                         break;
 702                 case MPI2_MFGPAGE_DEVID_SAS2308_1:
 703                 case MPI2_MFGPAGE_DEVID_SAS2308_2:
 704                 case MPI2_MFGPAGE_DEVID_SAS2308_3:
 705                         mdb_printf("(SAS2308) ");
 706                         break;
 707                 case MPI25_MFGPAGE_DEVID_SAS3004:
 708                         mdb_printf("(SAS3004) ");
 709                         break;
 710                 case MPI25_MFGPAGE_DEVID_SAS3008:
 711                         mdb_printf("(SAS3008) ");
 712                         break;
 713                 case MPI25_MFGPAGE_DEVID_SAS3108_1:
 714                 case MPI25_MFGPAGE_DEVID_SAS3108_2:
 715                 case MPI25_MFGPAGE_DEVID_SAS3108_5:
 716                 case MPI25_MFGPAGE_DEVID_SAS3108_6:
 717                         mdb_printf("(SAS3108) ");
 718                         break;








































 719                 default:
 720                         mdb_printf("(SAS????) ");
 721                         break;
 722         }
 723         mdb_printf("0x%02x 0x%04x\n", mp->m_revid, mp->m_ssid);
 724         mdb_printf("%s\n", device_path);
 725 
 726 }
 727 
 728 void
 729 dump_debug_log(void)
 730 {
 731         uint32_t idx;
 732         size_t  linecnt, linelen;
 733         char    *logbuf;
 734         int     i;
 735 
 736         if (mdb_readsym(&idx, sizeof (uint32_t), "mptsas_dbglog_idx") == -1) {
 737                 mdb_warn("No debug log buffer present");
 738                 return;




   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2017 Joyent, Inc.
  28  * Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
  29  */
  30 
  31 #include <limits.h>
  32 #include <sys/mdb_modapi.h>
  33 #include <sys/sysinfo.h>
  34 #include <sys/sunmdi.h>
  35 #include <sys/list.h>
  36 #include <sys/scsi/scsi.h>
  37 
  38 #pragma pack(1)
  39 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_type.h>
  40 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2.h>
  41 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_cnfg.h>
  42 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_init.h>
  43 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_ioc.h>
  44 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_sas.h>
  45 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_raid.h>
  46 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h>
  47 #pragma pack()


 699                 case MPI2_MFGPAGE_DEVID_SAS2208_6:
 700                         mdb_printf("(SAS2208) ");
 701                         break;
 702                 case MPI2_MFGPAGE_DEVID_SAS2308_1:
 703                 case MPI2_MFGPAGE_DEVID_SAS2308_2:
 704                 case MPI2_MFGPAGE_DEVID_SAS2308_3:
 705                         mdb_printf("(SAS2308) ");
 706                         break;
 707                 case MPI25_MFGPAGE_DEVID_SAS3004:
 708                         mdb_printf("(SAS3004) ");
 709                         break;
 710                 case MPI25_MFGPAGE_DEVID_SAS3008:
 711                         mdb_printf("(SAS3008) ");
 712                         break;
 713                 case MPI25_MFGPAGE_DEVID_SAS3108_1:
 714                 case MPI25_MFGPAGE_DEVID_SAS3108_2:
 715                 case MPI25_MFGPAGE_DEVID_SAS3108_5:
 716                 case MPI25_MFGPAGE_DEVID_SAS3108_6:
 717                         mdb_printf("(SAS3108) ");
 718                         break;
 719                 case MPI26_MFGPAGE_DEVID_SAS3216:
 720                 case MPI26_MFGPAGE_DEVID_SAS3316_1:
 721                 case MPI26_MFGPAGE_DEVID_SAS3316_2:
 722                 case MPI26_MFGPAGE_DEVID_SAS3316_3:
 723                 case MPI26_MFGPAGE_DEVID_SAS3316_4:
 724                         mdb_printf("(SAS3216) ");
 725                         break;
 726                 case MPI26_MFGPAGE_DEVID_SAS3224:
 727                 case MPI26_MFGPAGE_DEVID_SAS3324_1:
 728                 case MPI26_MFGPAGE_DEVID_SAS3324_2:
 729                 case MPI26_MFGPAGE_DEVID_SAS3324_3:
 730                 case MPI26_MFGPAGE_DEVID_SAS3324_4:
 731                         mdb_printf("(SAS3224) ");
 732                         break;
 733                 case MPI26_MFGPAGE_DEVID_SAS3408:
 734                         mdb_printf("(SAS3408) ");
 735                         break;
 736                 case MPI26_MFGPAGE_DEVID_SAS3416:
 737                         mdb_printf("(SAS3416) ");
 738                         break;
 739                 case MPI26_MFGPAGE_DEVID_SAS3508:
 740                 case MPI26_MFGPAGE_DEVID_SAS3508_1:
 741                         mdb_printf("(SAS3508) ");
 742                         break;
 743                 case MPI26_MFGPAGE_DEVID_SAS3516:
 744                 case MPI26_MFGPAGE_DEVID_SAS3516_1:
 745                         mdb_printf("(SAS3516) ");
 746                         break;
 747                 case MPI26_MFGPAGE_DEVID_SAS3616:
 748                         mdb_printf("(SAS3616) ");
 749                         break;
 750                 case MPI26_MFGPAGE_DEVID_SAS3708:
 751                         mdb_printf("(SAS3708) ");
 752                         break;
 753                 case MPI26_MFGPAGE_DEVID_SAS3716:
 754                         mdb_printf("(SAS3716) ");
 755                         break;
 756                 case MPI26_MFGPAGE_DEVID_SAS4008:
 757                         mdb_printf("(SAS4008) ");
 758                         break;
 759                 default:
 760                         mdb_printf("(SAS????) ");
 761                         break;
 762         }
 763         mdb_printf("0x%02x 0x%04x\n", mp->m_revid, mp->m_ssid);
 764         mdb_printf("%s\n", device_path);
 765 
 766 }
 767 
 768 void
 769 dump_debug_log(void)
 770 {
 771         uint32_t idx;
 772         size_t  linecnt, linelen;
 773         char    *logbuf;
 774         int     i;
 775 
 776         if (mdb_readsym(&idx, sizeof (uint32_t), "mptsas_dbglog_idx") == -1) {
 777                 mdb_warn("No debug log buffer present");
 778                 return;