├── AUTHORS ├── COPYING ├── COVERAGE ├── CREDITS ├── ChangeLog ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── README.freebsd ├── README.linux ├── README.solaris ├── autogen.sh ├── bootstrap ├── build_debian.sh ├── configure.ac ├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── libsmputils1-1.install ├── libsmputils1-dev.install ├── rules └── smp-utils.install ├── doc ├── Makefile.am ├── bsg_sas_smp.txt ├── smp_conf_general.8 ├── smp_conf_phy_event.8 ├── smp_conf_route_info.8 ├── smp_conf_zone_man_pass.8 ├── smp_conf_zone_perm_tbl.8 ├── smp_conf_zone_phy_info.8 ├── smp_discover.8 ├── smp_discover_list.8 ├── smp_ena_dis_zoning.8 ├── smp_phy_control.8 ├── smp_phy_test.8 ├── smp_read_gpio.8 ├── smp_rep_broadcast.8 ├── smp_rep_exp_route_tbl.8 ├── smp_rep_general.8 ├── smp_rep_manufacturer.8 ├── smp_rep_phy_err_log.8 ├── smp_rep_phy_event.8 ├── smp_rep_phy_event_list.8 ├── smp_rep_phy_sata.8 ├── smp_rep_route_info.8 ├── smp_rep_self_conf_stat.8 ├── smp_rep_zone_man_pass.8 ├── smp_rep_zone_perm_tbl.8 ├── smp_utils.8 ├── smp_write_gpio.8 ├── smp_zone_activate.8 ├── smp_zone_lock.8 ├── smp_zone_unlock.8 └── smp_zoned_broadcast.8 ├── examples ├── README ├── def_pconf.txt ├── def_permf.txt ├── dis_zoning_ex.sh ├── pconf_2i2t.txt ├── pconf_all10.txt ├── permf_8i9i.txt ├── permf_t10annex.txt ├── rep_nocom_permf_8i9i.txt ├── rep_permf_8i9i.txt ├── t10annex_zoning_ex.sh └── zoning_ex.sh ├── include ├── Makefile.am ├── Makefile.in ├── dummy │ └── linux │ │ └── bsg.h ├── sg_pr2serr.h ├── sg_unaligned.h └── smp_lib.h ├── lib ├── Makefile.am ├── Makefile.in ├── README_lin_mpt ├── aacraid.h ├── mpi.h ├── mpi_sas.h ├── mpi_type.h ├── mptctl.h ├── smp_aac_io.c ├── smp_aac_io.h ├── smp_dummy.c ├── smp_fre_cam.c ├── smp_lib.c ├── smp_lin_bsg.c ├── smp_lin_bsg.h ├── smp_lin_sel.c ├── smp_mptctl_glue.h ├── smp_mptctl_io.c ├── smp_mptctl_io.h └── smp_sol_usmp.c ├── ltmain.sh ├── smp_utils.spec └── src ├── Makefile.am ├── smp_conf_general.c ├── smp_conf_phy_event.c ├── smp_conf_route_info.c ├── smp_conf_zone_man_pass.c ├── smp_conf_zone_perm_tbl.c ├── smp_conf_zone_phy_info.c ├── smp_discover.c ├── smp_discover_list.c ├── smp_ena_dis_zoning.c ├── smp_phy_control.c ├── smp_phy_test.c ├── smp_read_gpio.c ├── smp_rep_broadcast.c ├── smp_rep_exp_route_tbl.c ├── smp_rep_general.c ├── smp_rep_manufacturer.c ├── smp_rep_phy_err_log.c ├── smp_rep_phy_event.c ├── smp_rep_phy_event_list.c ├── smp_rep_phy_sata.c ├── smp_rep_route_info.c ├── smp_rep_self_conf_stat.c ├── smp_rep_zone_man_pass.c ├── smp_rep_zone_perm_tbl.c ├── smp_write_gpio.c ├── smp_zone_activate.c ├── smp_zone_lock.c ├── smp_zone_unlock.c └── smp_zoned_broadcast.c /AUTHORS: -------------------------------------------------------------------------------- 1 | Douglas Gilbert 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2009 Douglas Gilbert. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. The name of the author may not be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /COVERAGE: -------------------------------------------------------------------------------- 1 | Function coverage 2 | ================= 3 | The following table lists SAS Serial Management Protocol (SMP) functions 4 | in alphabetical order in the left column. The second column is the 5 | standard or draft that the function first appeared in or was extended. 6 | The final column is the utility in the smp_utils package that invokes 7 | that function on a given SMP target. 8 | 9 | SMP Function Standard smp_utils utility 10 | ------------------------------------ --------------- --------------------- 11 | CONFIGURE GENERAL 2 smp_conf_general 12 | CONFIGURE PHY EVENT 2 smp_conf_phy_event 13 | CONFIGURE ROUTE INFORMATION 1, 2 smp_conf_route_info 14 | CONFIGURE ZONE MANAGER PASSWORD 2 smp_conf_zone_man_pass 15 | CONFIGURE ZONE PERMISSION TABLE 2 smp_conf_zone_perm_tbl 16 | CONFIGURE ZONE PHY INFORMATION 2 smp_conf_zone_phy_info 17 | DISCOVER 1, 1.1, 2 smp_discover 18 | DISCOVER LIST 2 smp_discover_list 19 | ENABLE DISABLE ZONING 2 smp_ena_dis_zoning 20 | PHY CONTROL 1, 2 smp_phy_control 21 | PHY TEST FUNCTION 1.1, 2 smp_phy_test 22 | READ GPIO REGISTER SFF-8485* smp_read_gpio 23 | READ GPIO REGISTER ENHANCED SFF-8485* smp_read_gpio 24 | REPORT BROADCAST 2 smp_rep_broadcast 25 | REPORT EXPANDER ROUTE TABLE LIST 2 smp_rep_exp_route_tbl 26 | REPORT GENERAL 1, 1.1, 2 smp_rep_general 27 | REPORT MANUFACTURER INFORMATION 1, 1.1, 2 smp_rep_manufacturer 28 | /* REPORT PHY BROADCAST COUNTS 2 removed in sas2r13 */ 29 | REPORT PHY ERROR LOG 1, 2 smp_rep_phy_err_log 30 | REPORT PHY EVENT 2 smp_rep_phy_event 31 | REPORT PHY EVENT LIST 2 smp_rep_phy_event_list 32 | REPORT PHY SATA 1, 2 smp_rep_phy_sata 33 | REPORT ROUTE INFORMATION 1, 2 smp_rep_route_info 34 | REPORT SELF-CONFIGURATION STATUS 2 smp_rep_self_conf_stat 35 | REPORT ZONE MANAGER PASSWORD 2 smp_rep_zone_man_pass 36 | REPORT ZONE PERMISSION TABLE 2 smp_rep_zone_perm_tbl 37 | WRITE GPIO REGISTER SFF-8485* smp_write_gpio 38 | WRITE GPIO REGISTER ENHANCED SFF-8485* smp_write_gpio 39 | ZONE ACTIVATE 2 smp_zone_activate 40 | ZONE LOCK 2 smp_zone_lock 41 | ZONE UNLOCK 2 smp_zone_unlock 42 | ZONED BROADCAST 2 smp_zoned_broadcast 43 | 44 | * in sas2r16 the non-ENHANCED versions are marked as obsolete but the 45 | ENHANCED version are not yet defined in the most recent SFF-8485 46 | (rev 0.7). In SAS-2.1 (spl-r07) and SAS-3 (spl2r03) these 4 functions 47 | are not defined (the ENHANCED function codes are "restricted for 48 | SFF"). 49 | 50 | The sas-r05.pdf draft is taken to represent the original SAS standard 51 | (ANSI INCITS 376-2003). The sas1r10.pdf draft is taken to represent the 52 | SAS-1.1 standard (ANSI INCITS 417-2006). The sas2r16.pdf draft is taken 53 | to represent the SAS-2 standard (ANSI INCITS 457-2010). 54 | 55 | After the SAS-2.1 standard the standard was split in two: SAS and SPL 56 | where the latter stands for SAS Protocol Layer. The SMP functions are 57 | now found in the SPL standard (under application layer, management 58 | application layer) and drafts. Work on the SAS-4 (24 or 22.5 Gbps) standard 59 | is almost complete and the most recent SPL standard is SPL-3 (ANSI INCITS 60 | 492-2015). The latest SPL-4 draft is revision 11 (spl4r11.pdf at t10). 61 | 62 | 63 | Doug Gilbert 64 | 4th October 2017 65 | -------------------------------------------------------------------------------- /CREDITS: -------------------------------------------------------------------------------- 1 | The author of smp_utils would like to thank the following people who 2 | have made contributions: 3 | 4 | Eric Moore help with mptctl 5 | interface [20061129] 6 | 7 | FUJITA Tomonori 8 | implementing sgv4 with working examples [20071220] 9 | 10 | Hannes Reinecke 11 | mpt3sas support [20130925] 12 | 13 | Luben Tuikov 'smp_discover --multiple' format 14 | and various other suggestions and testing [20060801] 15 | 16 | Monty Montgomery 17 | Fix memory overwrite in smp_acc_io.c [both 20210311] 18 | Initialize i_params to avoid decisions based on stack garbage 19 | 20 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | 2 | To build and install using the tarball, extract the files from 3 | the tarball, change directory to the top level within the 4 | extracted tree, and then: 5 | # ./autogen.sh 6 | # ./configure 7 | # make 8 | # make install 9 | 10 | The './bootstrap' script can be used in place of './autogen.sh' . 11 | The last command will most likely require root privileges and will 12 | place the binaries in the /usr/local/bin directory. Since the utilities 13 | need root (superuser) permissions some distrubutions prefer to place the 14 | binaries in the /usr/sbin directory. To do that and place the man pages 15 | in their normal (Linux) location the ./configure line could be expanded 16 | to: 17 | # ./configure --prefix=/usr --bindir=/usr/sbin 18 | 19 | To clean up after a build use the following command: 20 | # make distclean 21 | 22 | 23 | The build depends on libtool since a shared library is produced. A static 24 | library is also produced. By default the binaries (i.e. the utilities 25 | in this package) will depend on that shared library. The binaries can 26 | be linked instead with the static library with this invocation: 27 | # ./configure --disable-shared 28 | 29 | 30 | Douglas Gilbert 31 | 26th August 2023 32 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = include \ 3 | lib \ 4 | src \ 5 | doc 6 | 7 | EXTRA_DIST=autogen.sh COVERAGE CREDITS 8 | 9 | distclean-local: 10 | rm -rf autom4te.cache 11 | rm -f build-stamp configure-stamp 12 | 13 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | See ChangeLog, README and INSTALL files. 2 | There is also a html page at http://sg.danny.cz/sg/smp_utils.html 3 | and an overview man page in this file: doc/smp_utils.8 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is a package of command line utilities. Each utility sends a Serial 2 | Attached SCSI (SAS) Serial Management Protocol (SMP) request to an SMP 3 | target. If the request fails then the error is decoded. If the request 4 | succeeds then the response is either decoded, printed out in hexadecimal 5 | or output in binary. This package was written using the Linux 2.6 and 6 | 3 series; it has been ported to FreeBSD and Solaris. 7 | 8 | For specific information about Linux see README.linux; for FreeBSD see 9 | README.freebsd and for Solaris see README.solaris . 10 | 11 | See COVERAGE file for more information about the coverage of various 12 | SMP functions. 13 | 14 | Each utility in the smp_utils package has a corresponding man page. These 15 | are found in the doc directory. Additionally there is 'smp_utils' man page 16 | that contains common information, including options used by most or all 17 | utilities plus the various exit status values. There is also a Linux 18 | specific 'bsg_sas_smp.txt' file that discusses the use of the bsg driver 19 | to send SMP requests. 20 | 21 | There are examples of setting up and disabling zoning in the examples 22 | directory. 23 | 24 | 25 | The reference documents are: 26 | sas-r05.pdf www.t10.org draft prior to original SAS spec: 27 | SAS ANSI INCITS 376-2003 28 | sas1r10.pdf www.t10.org draft prior to SAS 1.1 spec: 29 | SAS-1.1 ANSI INCITS 417-2006 30 | sas2r16.pdf www.t10.org draft prior to SAS-2: 31 | SAS-2 ANSI INCITS 457-2010, 32 | SAS-2.1 ANSI INCITS 478-2011 33 | sas3r06.pdf www.t10.org draft prior to SAS-3 34 | SAS-3 ANSI INCITS 519-2014 35 | sas4r09.pdf www.t10.org current draft 36 | spl-r07.pdf www.t10.org draft prior to SPL ANSI INCITS 476-2011 37 | spl2r04c.pdf www.t10.org draft prior to SPL-2: 38 | SPL-2 ANSI INCITS 505-2013 39 | spl3r07.pdf www.t10.org draft prior to SPL-3 40 | SPL-3 ANSI INCITS 492-2015 41 | spl4r13.pdf www.t10.org draft prior to SPL-4 42 | spl5r02.pdf www.t10.org current draft 43 | SFF_8485.PDF www.sffcommittee.com SGPIO revision 0.7 44 | 45 | In SAS-2.1 the physical layer was put into a document of that name 46 | (i.e. SAS-2.1) while the higher layers were put in a new document called 47 | the SAS Protocol Layer (SPL). 48 | 49 | 50 | Doug Gilbert 51 | 8th December 2017 52 | -------------------------------------------------------------------------------- /README.freebsd: -------------------------------------------------------------------------------- 1 | Build 2 | ----- 3 | For general build information see the INSTALL file. Requires 4 | FreeBSD version 9.0 or later as earlier versions do not support the CAM 5 | SMP pass-through. 6 | 7 | The traditional './autogen.sh ; ./configure ; make ; make install' sequence 8 | from the top level of the unpacked tarball will work on FreeBSD. But the 9 | man pages will be placed under the /usr/local/share/man directory which 10 | unfortunately is not on the standard manpath. One solution is to add this 11 | path by creating a file with a name like local_share.conf in the 12 | /usr/local/etc/man.d/ directory and placing this line in it: 13 | MANPATH /usr/local/share/man 14 | 15 | This package was too new to be included in the "ports" collection of FreeBSD 16 | 9.0 RELEASE. This package can be found in FreeBSD 9.1 RELEASE ports 17 | collection in the /usr/ports/sysutils/smp_utils directory . 18 | 19 | 20 | Device names 21 | ------------ 22 | FreeBSD uses its CAM subsystem to access SAS expanders. In FreeBSD 9.0 CAM 23 | does not recognize SAS expanders directly. It assumes that a SAS expander 24 | is tightly coupled with a SES target device. This seems to be true for SAS-2 25 | expanders but is not necessarily the case with SAS-1 expanders. 26 | 27 | So if a SES target device is paired with a SAS expander then in FreeBSD 28 | that expander can be accessed like this: 29 | # smp_discover /dev/ses0 30 | 31 | This also assumes that the SAS expander is connected to a SAS HBA that 32 | supports the CAM SAS SMP pass-through. 33 | 34 | 35 | References 36 | ---------- 37 | Alexander Motin has a useful presentation online about Enclosure Management 38 | and how it is reflected in FreeBSD devices and user space tools. See: 39 | https://people.freebsd.org/~mav/Enclosure_Management_en.pdf 40 | 41 | 42 | Douglas Gilbert 43 | 26th April 2023 44 | -------------------------------------------------------------------------------- /README.linux: -------------------------------------------------------------------------------- 1 | Build 2 | ----- 3 | For general build information see the INSTALL file. 4 | 5 | A "spec" file is included for building rpm packages. It is called 6 | smp_utils.spec . To build binary and source rpms place a copy of the 7 | gzipped tarball in the "SOURCES" directory and place a copy of 8 | smp_utils.spec in the "SPEC" directory. These directories are found under 9 | /usr/src/redhat on redhat/fedora distributions. Then from the "SPEC" 10 | directory execute "rpmbuild -ba --target i386 smp_utils.spec". If all goes 11 | well a source rpm should be found in the SRPMS directory and binary rpms 12 | in the RPMS/i386 directory (for i386 architecture). When the smp_utils 13 | binary rpm is installed the executables and their associated man pages 14 | should be placed in appropriate places. 15 | 16 | To build debian "deb" (binary) packages, first untar the tarball, then 17 | change directory to the top level within the smp_utils source. Then: 18 | # chmod +x debian/rules 19 | # dpkg-buildpackage -b -rfakeroot 20 | The binary deb packages will be placed in the parent directory (of 21 | the smp_utils source directory) if all goes well. The 22 | build_debian.sh script contains the above commands. 23 | 24 | Device names 25 | ------------ 26 | All of the man page examples and the scripts in the examples directory 27 | use Linux device names for accessing SAS expanders. The preferred 28 | interface is through the bsg driver. Examples of the bsg driver's device 29 | node names are /dev/bsg/expander-6:0 and /dev/bsg/sas_host6 . 30 | 31 | Alternatively MPT Fusion HBAs can use the mpt*sas driver's interface 32 | whose device node has the form "/dev/mptctl[,N]", "/dev/mpt2ctl[,N]" 33 | or "/dev/mpt3ctl[,N]" depending on the SAS generation of the HBA. 34 | 35 | For Adaptec/PMC SAS RAID controllers that use the Linux aacraid driver, 36 | the bsg interface is not available. Their pass-through has device node 37 | names of the form /dev/aac[N[,E_ID]] where "N" is the raid controller 38 | number (typically 0) and "E_ID" is the expander identifier (typically 0). 39 | Both "N" and "E_ID" default to 0 so on a system with one Adaptec/PMC SAS 40 | RAID controller with one attached expander, "/dev/aac" should access it. 41 | 42 | 43 | Douglas Gilbert 44 | 26th May 2014 45 | -------------------------------------------------------------------------------- /README.solaris: -------------------------------------------------------------------------------- 1 | Build 2 | ----- 3 | For general build information see the INSTALL file. 4 | 5 | 6 | Device names 7 | ------------ 8 | Solaris uses the USMP mechanism to access SAS expanders. SAS 9 | expanders have device node names of the form: /dev/smp/expd 10 | 11 | 12 | Douglas Gilbert 13 | 6th August 2011 14 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./autogen.sh "$@" 4 | -------------------------------------------------------------------------------- /build_debian.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "./autogen.sh" 4 | ./autogen.sh 5 | 6 | echo "chmod +x debian/rules" 7 | chmod +x debian/rules 8 | 9 | # in some environments the '-rfakeroot' can cause a failure (e.g. when 10 | # building as root). If so, remove that argument from the following: 11 | echo "dpkg-buildpackage -b -rfakeroot -us -uc" 12 | dpkg-buildpackage -b -rfakeroot -us -uc 13 | 14 | # If the above succeeds then the ".deb" binary package is placed in the 15 | # parent directory. 16 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT(smp_utils, 1.00, dgilbert@interlog.com) 2 | 3 | AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 4 | AM_MAINTAINER_MODE 5 | AM_CONFIG_HEADER(config.h) 6 | 7 | AC_PROG_CC 8 | # AC_PROG_CXX 9 | AC_PROG_INSTALL 10 | 11 | # AM_PROG_AR is supported and needed since automake v1.12+ 12 | ifdef([AM_PROG_AR], [AM_PROG_AR], []) 13 | 14 | # Adding libtools to the build seems to bring in C++ environment 15 | AC_PROG_LIBTOOL 16 | 17 | # check for headers 18 | AC_HEADER_STDC 19 | 20 | # check for functions 21 | AC_CHECK_FUNCS(posix_memalign) 22 | 23 | AC_CANONICAL_HOST 24 | 25 | AC_DEFINE_UNQUOTED(SMP_UTILS_BUILD_HOST, "${host}", [smp_utils Build Host]) 26 | 27 | check_for_linux_nvme_headers() { 28 | AC_CHECK_HEADERS([linux/types.h linux/bsg.h linux/kdev_t.h], [], [], 29 | [[#ifdef HAVE_LINUX_TYPES_H 30 | # include 31 | #endif 32 | ]]) 33 | } 34 | 35 | case "${host}" in 36 | *-*-android*) 37 | AC_DEFINE_UNQUOTED(SMP_LIB_ANDROID, 1, [smp_utils on android]) 38 | AC_DEFINE_UNQUOTED(SMP_LIB_LINUX, 1, [smp_utils on linux]) 39 | check_for_linux_nvme_headers;; 40 | *-*-freebsd*|*-*-kfreebsd*-gnu*) 41 | AC_DEFINE_UNQUOTED(SMP_LIB_FREEBSD, 1, [smp_utils on FreeBSD]) 42 | LIBS="$LIBS -lcam";; 43 | *-*-solaris*) 44 | AC_DEFINE_UNQUOTED(SMP_UTILS_SOLARIS, 1, [smp_utils on Solaris]);; 45 | *-*-linux-gnu* | *-*-linux* | *) 46 | AC_DEFINE_UNQUOTED(SMP_LIB_LINUX, 1, [smp_utils on linux]) 47 | check_for_linux_nvme_headers;; 48 | esac 49 | 50 | # Define platform-specific symbol. 51 | AM_CONDITIONAL(OS_FREEBSD, [echo $host_os | grep 'freebsd' > /dev/null]) 52 | AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null]) 53 | AM_CONDITIONAL(OS_SOLARIS, [echo $host_os | grep '^solaris' > /dev/null]) 54 | AM_CONDITIONAL(OS_ANDROID, [echo $host_os | grep 'android' > /dev/null]) 55 | 56 | AC_CHECK_LIB(smputils1, smp_send_req, 57 | [SMPUTILS_LIBS="-lsmputils1"; have_smputils=yes], have_smputils=no) 58 | AC_SUBST(SMPUTILS_LIBS) 59 | AM_CONDITIONAL(HAVE_SMPUTILS, test x"$have_smputils" = xyes) 60 | 61 | AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile) 62 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | smp-utils (1.00-0.1) unstable; urgency=low 2 | 3 | * ongoing support for G5 (22.5 Gbps, SAS-4, SPL-5) 4 | 5 | -- Douglas Gilbert Wed, 01 Feb 2023 14:00:00 -0500 6 | 7 | smp-utils (0.99-0.1) unstable; urgency=low 8 | 9 | * add support for G5 (22.5 Gbps, SAS-4, SPL-5) 10 | 11 | -- Douglas Gilbert Thu, 05 Mar 2020 19:00:00 -0500 12 | 13 | smp-utils (0.98-0.1) unstable; urgency=low 14 | 15 | * switch binaries back to /usr/bin (or /usr/local/bin); add aac interface 16 | 17 | -- Douglas Gilbert Mon, 26 May 2014 16:00:00 -0400 18 | 19 | smp-utils (0.97-0.1) unstable; urgency=low 20 | 21 | * switch to autotools style build 22 | 23 | -- Douglas Gilbert Fri, 20 Jan 2012 11:00:00 -0500 24 | 25 | smp-utils (0.96-0.1) unstable; urgency=low 26 | 27 | * add zoning for SAS-2 28 | 29 | -- Douglas Gilbert Sun, 19 Jun 2011 16:00:00 -0400 30 | 31 | smp-utils (0.95-0.1) unstable; urgency=low 32 | 33 | * discover changes in spl-r04 34 | 35 | -- Douglas Gilbert Tue, 16 Nov 2010 21:00:00 -0500 36 | 37 | smp-utils (0.94-0.1) unstable; urgency=low 38 | 39 | * make sgv4 includes more robust for lk 2.6.27 40 | 41 | -- Douglas Gilbert Mon, 29 Dec 2008 12:30:00 -0500 42 | 43 | smp-utils (0.93-0.1) unstable; urgency=low 44 | 45 | * add affiliation contexts (new in sas2r08), sync to sas2r12 46 | 47 | -- Douglas Gilbert Sun, 06 Jan 2008 11:00:00 -0500 48 | 49 | smp-utils (0.92-0.1) unstable; urgency=low 50 | 51 | * sync against sas2r07, add smp_conf_general 52 | 53 | -- Douglas Gilbert Fri, 08 Dec 2006 13:00:00 -0500 54 | 55 | smp-utils (0.91-0.1) unstable; urgency=low 56 | 57 | * add smp_phy_test and smp_discover_list, uniform exit status values 58 | 59 | -- Douglas Gilbert Tue, 22 Aug 2006 16:00:00 -0400 60 | 61 | smp-utils (0.90-0.1) unstable; urgency=low 62 | 63 | * Initial release 64 | 65 | -- Douglas Gilbert Mon, 10 Jun 2006 19:00:00 -0400 66 | 67 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: smp-utils 2 | Section: admin 3 | Priority: optional 4 | Maintainer: Douglas Gilbert 5 | Build-Depends: debhelper (>= 7.0.50~) 6 | Standards-Version: 3.8.4 7 | Homepage: http://sg.danny.cz/sg/smp_utils.html 8 | 9 | Package: smp-utils 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: SAS Expander (SMP) utilities for SAS/SATA disk arrays 13 | Utilities that send Serial Attached SCSI (SAS) Serial Management 14 | Protocol (SMP) requests to a SMP target. If the request fails then 15 | the error is decoded. If the request succeeds then the response is 16 | either decoded, printed out in hexadecimal or output in binary. 17 | Support for SAS-2 features including phy based zoning. 18 | 19 | Package: libsmputils1-1 20 | Section: libs 21 | Depends: ${shlibs:Depends} 22 | Architecture: any 23 | Conflicts: libsmputils1 24 | Replaces: libsmputils1 25 | Suggests: smp-utils 26 | Description: utilities for SAS SMP control of expanders (shared libraries) 27 | Shared library used by the utilities in the smp-utils package. 28 | 29 | Package: libsmputils1-dev 30 | Section: libdevel 31 | Architecture: any 32 | Depends: libsmputils1-1 (= ${binary:Version}), ${shlibs:Depends}, ${kfreebsd:Depends} 33 | Conflicts: libsmputils1-dev 34 | Suggests: smp-utils 35 | Description: utilities for SAS SMP control of expanders (developer files) 36 | Developer files (i.e. headers and a static library) which are associated with 37 | the utilities in the smp-utils package. 38 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Douglas Gilbert on 2 | Sat, 10 Jun 2006 19:00:00 -0400. 3 | 4 | It was downloaded from http://sg.danny.cz/sg/p/smp_utils-0.90.tgz 5 | 6 | Copyright Holder: Douglas Gilbert 7 | 8 | License: 9 | Redistribution and use in source and binary forms, with or without 10 | modification, are permitted under the terms of the BSD License. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 16 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 17 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 18 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 19 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 20 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 22 | SUCH DAMAGE. 23 | 24 | On Debian systems, the complete text of the BSD License can be 25 | found in `/usr/share/common-licenses/BSD'. 26 | 27 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | COPYING 3 | CREDITS 4 | INSTALL 5 | NEWS 6 | README 7 | -------------------------------------------------------------------------------- /debian/libsmputils1-1.install: -------------------------------------------------------------------------------- 1 | usr/lib/*.so.* 2 | -------------------------------------------------------------------------------- /debian/libsmputils1-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/scsi 2 | usr/lib/*.so 3 | usr/lib/*.la 4 | usr/lib/*.a 5 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Sample debian/rules that uses debhelper. 3 | # GNU copyright 1997 by Joey Hess. 4 | # 5 | # This version is for a hypothetical package that builds an 6 | # architecture-dependant package, as well as an architecture-independent 7 | # package. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | # export DH_VERBOSE=1 11 | 12 | DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) 13 | 14 | configure: configure-stamp 15 | configure-stamp: 16 | dh_testdir 17 | # Add here commands to configure the package. 18 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man 19 | touch configure-stamp 20 | 21 | build: configure-stamp build-stamp 22 | build-stamp: 23 | dh_testdir 24 | 25 | # Add here commands to compile the package. 26 | PREFIX=/usr MANDIR=/usr/share/man $(MAKE) -e 27 | 28 | touch build-stamp 29 | 30 | clean: 31 | dh_testdir 32 | dh_testroot 33 | 34 | # Add here commands to clean up after the build process. 35 | -$(MAKE) distclean 36 | 37 | rm -f build-stamp configure-stamp debian/substvars 38 | 39 | dh_clean 40 | 41 | install: DH_OPTIONS= 42 | install: build 43 | dh_testdir 44 | dh_testroot 45 | dh_clean 46 | dh_installdirs 47 | 48 | # Add here commands to install the package into debian/tmp 49 | $(MAKE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr 50 | 51 | dh_install --autodest --sourcedir=debian/tmp 52 | 53 | dh_installman 54 | 55 | # Build architecture-independent files here. 56 | # Pass -i to all debhelper commands in this target to reduce clutter. 57 | binary-indep: build install 58 | # nothing to do here 59 | 60 | # Build architecture-dependent files here. 61 | binary-arch: build install 62 | dh_testdir -a 63 | dh_testroot -a 64 | dh_installdocs -a 65 | dh_installexamples -a 66 | dh_installmenu -a 67 | dh_installchangelogs ChangeLog -a 68 | dh_strip -a 69 | dh_link -a 70 | dh_compress -a -X archive -X .c -X .h 71 | dh_fixperms -a 72 | dh_makeshlibs -V -v 73 | dh_installdeb -a 74 | ifeq ($(DEB_HOST_ARCH_OS),kfreebsd) 75 | echo kfreebsd:Depends=libcam-dev >>debian/libsmputils1-dev.substvars 76 | endif 77 | dh_shlibdeps -ldebian/tmp/usr/lib -L libsmputils1 78 | dh_gencontrol -a 79 | dh_md5sums -a 80 | dh_builddeb -a 81 | 82 | binary: binary-indep binary-arch 83 | .PHONY: build clean binary-indep binary-arch binary install configure 84 | -------------------------------------------------------------------------------- /debian/smp-utils.install: -------------------------------------------------------------------------------- 1 | usr/bin/* 2 | usr/share/man/man8/* 3 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | ## Copied from sg3_utils. Some remnants left commented out as examples 3 | ## if OS_LINUX 4 | 5 | man_MANS = \ 6 | smp_conf_general.8 smp_conf_phy_event.8 smp_conf_route_info.8 \ 7 | smp_conf_zone_man_pass.8 smp_conf_zone_perm_tbl.8 \ 8 | smp_conf_zone_phy_info.8 smp_discover.8 smp_discover_list.8 \ 9 | smp_ena_dis_zoning.8 smp_phy_control.8 smp_phy_test.8 \ 10 | smp_read_gpio.8 smp_rep_broadcast.8 smp_rep_exp_route_tbl.8 \ 11 | smp_rep_general.8 smp_rep_manufacturer.8 smp_rep_phy_err_log.8 \ 12 | smp_rep_phy_event.8 smp_rep_phy_event_list.8 smp_rep_phy_sata.8 \ 13 | smp_rep_route_info.8 smp_rep_self_conf_stat.8 \ 14 | smp_rep_zone_man_pass.8 smp_rep_zone_perm_tbl.8 smp_utils.8 \ 15 | smp_write_gpio.8 smp_zone_activate.8 smp_zoned_broadcast.8 \ 16 | smp_zone_lock.8 smp_zone_unlock.8 17 | 18 | ## distclean-local: 19 | ## rm -f sg_scan.8 20 | 21 | ## sg_scan.8 : sg_scan.8.linux 22 | ## cp -p sg_scan.8.linux sg_scan.8 23 | 24 | ## endif 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/smp_conf_general.8: -------------------------------------------------------------------------------- 1 | .TH SMP_CONF_GENERAL "8" "November 2015" "smp_utils\-0.99" SMP_UTILS 2 | .SH NAME 3 | smp_conf_general \- invoke CONFIGURE GENERAL SMP function 4 | .SH SYNOPSIS 5 | .B smp_conf_general 6 | [\fI\-\-connect=CO\fR] [\fI\-\-expected=EX\fR] [\fI\-\-help\fR] 7 | [\fI\-\-hex\fR] [\fI\-\-inactivity=IN\fR] [\fI\-\-interface=PARAMS\fR] 8 | [\fI\-\-nexus=NE\fR] [\fI\-\-open=OP\fR] [\fI\-\-power=PD\fR] [\fI\-\-raw\fR] 9 | [\fI\-\-reduced=RE\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-ssp=CTL\fR] 10 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 11 | .SH DESCRIPTION 12 | .\" Add any additional description here 13 | .PP 14 | Sends a SAS Serial Management Protocol (SMP) CONFIGURE GENERAL function 15 | request to an SMP target. The SMP target is identified by 16 | the \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the 17 | interface, the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. 18 | The mpt interface uses \fISMP_DEVICE\fR 19 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 20 | differentiate between HBAs if there are multiple present. 21 | .SH OPTIONS 22 | Mandatory arguments to long options are mandatory for short options as well. 23 | .TP 24 | \fB\-c\fR, \fB\-\-connect\fR=\fICO\fR 25 | sets the "update STP maximum connect time limit" flag and the 26 | corresponding "STP maximum connect time limit" field to \fICO\fR. Unit of 27 | \fICO\fR is 100 microseconds. A \fICO\fR of zero is taken to mean no 28 | maximum connection time limit. 29 | .TP 30 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 31 | set the 'expected expander change count' field in the SMP request. 32 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 33 | value. When \fIEX\fR is greater than zero then if the value doesn't match 34 | the expander change count of the SMP target (i.e. the expander) when 35 | the request arrives then the target ignores the request and sets a 36 | function result of "invalid expander change count" in the response. 37 | .TP 38 | \fB\-h\fR, \fB\-\-help\fR 39 | output the usage message then exit. 40 | .TP 41 | \fB\-H\fR, \fB\-\-hex\fR 42 | output the response (less the CRC field) in hexadecimal. 43 | .TP 44 | \fB\-i\fR, \fB\-\-inactivity\fR=\fIIN\fR 45 | sets the "update STP bus inactivity time limit" flag and the 46 | corresponding "STP bus inactivity time limit" field to \fIIN\fR. Unit of 47 | \fIIN\fR is 100 microseconds. A \fIIN\fR of zero is taken to mean no bus 48 | inactivity time limit. 49 | .TP 50 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 51 | interface specific parameters. In this case "interface" refers to the 52 | path through the operating system to the SMP initiator. See the smp_utils 53 | man page for more information. 54 | .TP 55 | \fB\-n\fR, \fB\-\-nexus\fR=\fINE\fR 56 | sets the "update STP SMP I_T nexus loss time" flag and the 57 | corresponding "STP SMP I_T nexus loss time" field to \fINE\fR. Unit of 58 | \fINE\fR is one millisecond. A \fINE\fR of zero is taken to mean a vendor 59 | specific amount of time; a \fINE\fR of 65535 means the port shall never 60 | recognize an I_T nexus loss. 61 | .TP 62 | \fB\-o\fR, \fB\-\-open\fR=\fIOP\fR 63 | sets the "update STP reject to open limit" flag and the 64 | corresponding "STP reject to open limit" field to \fIOP\fR. Unit of 65 | \fIOP\fR is 10 microseconds. 66 | .TP 67 | \fB\-p\fR, \fB\-\-power\fR=\fIPD\fR 68 | sets the "update power done timeout" flag and the corresponding "power 69 | done timeout" field to \fIPD\fR. Unit of \fIPD\fR is 1 second. A \fIPD\fR 70 | value of 0 is interpreted as don't change the current value. The 71 | maximum value of \fIPD\fR is 255 and means the time limit is vendor 72 | specific. 73 | .TP 74 | \fB\-r\fR, \fB\-\-raw\fR 75 | send the response (less the CRC field) to stdout in binary. All error 76 | messages are sent to stderr. 77 | .TP 78 | \fB\-R\fR, \fB\-\-reduced\fR=\fIRE\fR 79 | sets the "update Initial time to reduced functionality" flag and the 80 | corresponding "Initial time to reduced functionality" field to \fIRE\fR. 81 | Unit of \fIRE\fR is 100 milliseconds. The maximum permitted \fIRE\fR value 82 | is 255 which corresponds to 25.5 seconds. 83 | .TP 84 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 85 | specifies the SAS address of the SMP target device. Typically this is an 86 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 87 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most SAS 88 | addresses are shown in hexadecimal. To give a number in hexadecimal either 89 | prefix it with '0x' or put a trailing 'h' on it. 90 | .TP 91 | \fB\-S\fR, \fB\-\-ssp\fR=\fICTL\fR 92 | sets the "update SSP time limit" flag and the corresponding "SSP maximum 93 | connect time limit" field to \fICTL\fR. Unit of \fICTL\fR is 100 microseconds. 94 | A \fICTL\fR of zero is taken to meanthat there is no SSP connect time limit. 95 | .TP 96 | \fB\-v\fR, \fB\-\-verbose\fR 97 | increase the verbosity of the output. Can be used multiple times 98 | .TP 99 | \fB\-V\fR, \fB\-\-version\fR 100 | print the version string and then exit. 101 | .SH CONFORMING TO 102 | The SMP CONFIGURE GENERAL function was introduced in SAS\-2 . 103 | .SH AUTHORS 104 | Written by Douglas Gilbert. 105 | .SH "REPORTING BUGS" 106 | Report bugs to . 107 | .SH COPYRIGHT 108 | Copyright \(co 2006\-2015 Douglas Gilbert 109 | .br 110 | This software is distributed under a FreeBSD license. There is NO 111 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 112 | .SH "SEE ALSO" 113 | .B smp_utils, smp_rep_general(smp_utils) 114 | -------------------------------------------------------------------------------- /doc/smp_conf_phy_event.8: -------------------------------------------------------------------------------- 1 | .TH SMP_CONF_PHY_EVENT "8" "December 2011" "smp_utils\-0.97" SMP_UTILS 2 | .SH NAME 3 | smp_conf_phy_event \- invoke CONFIGURE PHY EVENT function 4 | .SH SYNOPSIS 5 | .B smp_conf_phy_event 6 | [\fI\-\-clear\fR] [\fI\-\-enumerate\fR] [\fI\-\-expected=EX\fR] 7 | [\fI\-\-file=FILE\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 8 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-pes=PES,PES...\fR] 9 | [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 10 | [\fI\-\-thres=THR,THR...\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] 11 | \fISMP_DEVICE[,N]\fR 12 | .SH DESCRIPTION 13 | .\" Add any additional description here 14 | .PP 15 | Sends a SAS Serial Management Protocol (SMP) CONFIGURE PHY EVENT function 16 | request to an SMP target. The SMP target is identified by the 17 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 18 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 19 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 20 | needs the additional \fI,N\fR to differentiate between HBAs if there are 21 | multiple present. 22 | .PP 23 | The function request contains zero or more phy event configuration 24 | descriptors. Each descriptor is 8 byte long and contains a phy event 25 | source (one byte long) and optionally a peak value detector threshold which 26 | is 32 bits long (4 bytes). These values can either be supplied on the 27 | command line as the arguments to the \fI\-\-pes\fR and \fI\-\-thres\fR 28 | options, or within a \fIFILE\fR given to the \fI\-\-file\fR option. 29 | .PP 30 | Once a phy event source has been configured by this function, its counters 31 | should be readable with the REPORT PHY EVENT or REPORT PHY EVENT LIST 32 | functions. Peak value detector thresholds should only be non\-zero for phy 33 | event sources whose type is "peak value detector". If the threshold value 34 | is exceeded the expander will originate a Broadcast(Expander). 35 | .SH OPTIONS 36 | Mandatory arguments to long options are mandatory for short options as well. 37 | .TP 38 | \fB\-C\fR, \fB\-\-clear\fR 39 | sets the CLEAR PEAKS bit the in function request. This will cause all peak 40 | value detectors associated with this phy (i.e. \fIID\fR) to be cleared to 41 | zero. 42 | .TP 43 | \fB\-e\fR, \fB\-\-enumerate\fR 44 | enumerate all of the known Phy Event Source names, one per line preceded by 45 | its value in hex. Ignores \fISMP_DEVICE\fR if it is given; most other 46 | options are also ignored. Exits after displaying the names. 47 | .TP 48 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 49 | set the 'expected expander change count' field in the SMP request. 50 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 51 | value. When \fIEX\fR is greater than zero then if the value doesn't match 52 | the expander change count of the SMP target (i.e. the expander) when 53 | the request arrives then the target ignores the request and sets a 54 | function result of "invalid expander change count" in the response. 55 | .TP 56 | \fB\-f\fR, \fB\-\-file\fR=\fIFILE\fR 57 | where \fIFILE\fR is a file name containing pairs of values. The first 58 | member of each pair is a phy event source and the second member of the 59 | pair is a peak value detector threshold. Values are interpreted as 60 | decimal unless prefixed by '0x' or '0X' (or it has a trailing 'h' or 'H'). 61 | Everything from and including a "#" on a line is ignored as are blank lines. 62 | Values may be comma, space and tab separated or appear on separate lines. 63 | This option cannot be present with the \fI\-\-pes\fR option. 64 | .TP 65 | \fB\-h\fR, \fB\-\-help\fR 66 | output the usage message then exit. 67 | .TP 68 | \fB\-H\fR, \fB\-\-hex\fR 69 | output the response (less the CRC field) in hexadecimal. 70 | .TP 71 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 72 | interface specific parameters. In this case "interface" refers to the 73 | path through the operating system to the SMP initiator. See the smp_utils 74 | man page for more information. 75 | .TP 76 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 77 | phy identifier. \fIID\fR is a value between 0 and 254 (default 0). 78 | .TP 79 | \fB\-P\fR, \fB\-\-pes\fR=\fIPES,PES...\fR 80 | where \fIPES,PES...\fR is a string of comma (or space) separated values 81 | that are interpreted as phy event sources (each a value from 0 to 255). 82 | Each number is interpreted as decimal unless prefixed by '0x' or '0X' (or 83 | it has a trailing 'h' or 'H'). An argument that contains any space 84 | separators needs to be quoted (or otherwise escaped). When this option is 85 | given then the \fI\-\-thres\fR option may also be given and they should 86 | contain the same number of elements in their arguments. 87 | .TP 88 | \fB\-r\fR, \fB\-\-raw\fR 89 | send the response (less the CRC field) to stdout in binary. All error 90 | messages are sent to stderr. 91 | .TP 92 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 93 | specifies the SAS address of the SMP target device. The mpt interface needs 94 | this option and it will typically be an expander's SAS address. The 95 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 96 | To give a number in hexadecimal either prefix it with '0x' or put a 97 | trailing 'h' on it. 98 | .TP 99 | \fB\-T\fR, \fB\-\-thres\fR=\fITHR,THR...\fR 100 | where \fITHR,THR...\fR is a string of comma (or space) separated values 101 | that are interpreted as peak value detector thresholds (each a 32 bit value). 102 | Each number is interpreted as decimal unless prefixed by '0x' or '0X' (or 103 | it has a trailing 'h' or 'H'). An argument that contains any space 104 | separators needs to be quoted (or otherwise escaped). When this option is 105 | given then the \fI\-\-pes\fR option must also be given and they should 106 | contain the same number of elements in their arguments. 107 | .TP 108 | \fB\-v\fR, \fB\-\-verbose\fR 109 | increase the verbosity of the output. Can be used multiple times. 110 | .TP 111 | \fB\-V\fR, \fB\-\-version\fR 112 | print the version string and then exit. 113 | .SH CONFORMING TO 114 | The SMP CONFIGURE PHY EVENT function was introduced in SAS\-2 . 115 | .SH AUTHORS 116 | Written by Douglas Gilbert. 117 | .SH "REPORTING BUGS" 118 | Report bugs to . 119 | .SH COPYRIGHT 120 | Copyright \(co 2011 Douglas Gilbert 121 | .br 122 | This software is distributed under a FreeBSD license. There is NO 123 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 124 | .SH "SEE ALSO" 125 | .B smp_utils, smp_rep_phy_event, smp_rep_phy_event_list 126 | -------------------------------------------------------------------------------- /doc/smp_conf_route_info.8: -------------------------------------------------------------------------------- 1 | .TH SMP_CONF_ROUTE_INFO "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_conf_route_info \- invoke CONFIGURE ROUTE INFORMATION SMP function 4 | .SH SYNOPSIS 5 | .B smp_conf_route_info 6 | [\fI\-\-disable\fR] [\fI\-\-expected=EX\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-index=IN\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-phy=ID\fR] 8 | [\fI\-\-raw\fR] [\fI\-\-routed=R_SAS_ADDR\fR] [\fI\-\-sa=SAS_ADDR\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) CONFIGURE ROUTE INFORMATION 14 | function request to an SMP target. The SMP target is identified by 15 | the \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the 16 | interface, the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. 17 | The mpt interface uses \fISMP_DEVICE\fR 18 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 19 | differentiate between HBAs if there are multiple present. 20 | .PP 21 | There are two expander route table types: phy\-based and expander\-based. 22 | The expander\-based route table was introduced in SAS\-2 and supersedes the 23 | phy\-based route tables. The CONFIGURE ROUTE INFORMATION function is 24 | associated with a phy\-based route table. The REPORT ROUTE INFORMATION 25 | function is provided to report phy\-based route table entries. 26 | .PP 27 | Each phy in a SAS expander that has an associated routing attribute 28 | of "table" has a router table. The number of rows (or entries) in 29 | each router table is given by the "expander route indexes" field 30 | in the response of the REPORT GENERAL function. 31 | .SH OPTIONS 32 | Mandatory arguments to long options are mandatory for short options as well. 33 | .TP 34 | \fB\-d\fR, \fB\-\-disable\fR 35 | set the "disable expander route entry" flag in a row of the router table 36 | associated with \fI\-\-phy=ID\fR of the given SMP target (e.g. an expander). 37 | Within the router table the row that is disabled is identified by 38 | the expander route index given by \fI\-\-index=IN\fR. 39 | .TP 40 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 41 | set the 'expected expander change count' field in the SMP request. 42 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 43 | value. When \fIEX\fR is greater than zero then if the value doesn't match 44 | the expander change count of the SMP target (i.e. the expander) when 45 | the request arrives then the target ignores the request and sets a 46 | function result of "invalid expander change count" in the response. 47 | .TP 48 | \fB\-h\fR, \fB\-\-help\fR 49 | output the usage message then exit. 50 | .TP 51 | \fB\-H\fR, \fB\-\-hex\fR 52 | output the response (less the CRC field) in hexadecimal. 53 | .TP 54 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 55 | expander route index. \fIIN\fR is a value between 0 and 65535. Default is 0. 56 | More precisely the maximum index value is (expander_route_indexes \- 1). 57 | .TP 58 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 59 | interface specific parameters. In this case "interface" refers to the 60 | path through the operating system to the SMP initiator. See the smp_utils 61 | man page for more information. 62 | .TP 63 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 64 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 65 | .TP 66 | \fB\-r\fR, \fB\-\-raw\fR 67 | send the response (less the CRC field) to stdout in binary. All error 68 | messages are sent to stderr. 69 | .TP 70 | \fB\-R\fR, \fB\-\-routed\fR=\fIR_SAS_ADDR\fR 71 | specifies the SAS address to be placed in a row (given by \fI\-\-index=IN\fR) 72 | of the router table associated with \fI\-\-phy=ID\fR. Default value is 0. 73 | The \fIR_SAS_ADDR\fR is in decimal but most SAS addresses are given in 74 | hexadecimal. To give a number in hexadecimal either prefix it with '0x' or 75 | put a trailing 'h' on it. 76 | .TP 77 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 78 | specifies the SAS address of the SMP target device. Typically this is an 79 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 80 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 81 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 82 | either prefix it with '0x' or put a trailing 'h' on it. 83 | .TP 84 | \fB\-v\fR, \fB\-\-verbose\fR 85 | increase the verbosity of the output. Can be used multiple times 86 | .TP 87 | \fB\-V\fR, \fB\-\-version\fR 88 | print the version string and then exit. 89 | .SH CONFORMING TO 90 | The SMP CONFIGURE ROUTE INFORMATION function was introduced in SAS\-1 . 91 | The "Expander change count" field was added in SAS\-2 . 92 | .SH AUTHORS 93 | Written by Douglas Gilbert. 94 | .SH "REPORTING BUGS" 95 | Report bugs to . 96 | .SH COPYRIGHT 97 | Copyright \(co 2006\-2011 Douglas Gilbert 98 | .br 99 | This software is distributed under a FreeBSD license. There is NO 100 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 101 | .SH "SEE ALSO" 102 | .B smp_utils, smp_rep_general, smp_rep_route_info(smp_utils) 103 | -------------------------------------------------------------------------------- /doc/smp_conf_zone_man_pass.8: -------------------------------------------------------------------------------- 1 | .TH SMP_CONF_ZONE_MAN_PASS "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_conf_zone_man_pass \- invoke CONFIGURE ZONE MANAGER PASSWORD function 4 | .SH SYNOPSIS 5 | .B smp_conf_zone_man_pass 6 | [\fI\-\-expected=EX\fR] [\fI\-\-fpass=FP\fR] [\fI\-\-help\fR] 7 | [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-new\-fpass=NF\fR] 8 | [\fI\-\-new\-pass=NP\fR] [\fI\-\-password=PA\fR] [\fI\-\-raw\fR] 9 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-save=SAV\fR] [\fI\-\-verbose\fR] 10 | [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 11 | .SH DESCRIPTION 12 | .\" Add any additional description here 13 | .PP 14 | Sends a SAS Serial Management Protocol (SMP) CONFIGURE ZONE MANAGER PASSWORD 15 | function request to an SMP target. The SMP target is identified by the 16 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 17 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 18 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 19 | needs the additional \fI,N\fR to differentiate between HBAs if there are 20 | multiple present. 21 | .SH OPTIONS 22 | Mandatory arguments to long options are mandatory for short options as well. 23 | .TP 24 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 25 | set the 'expected expander change count' field in the SMP request. 26 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 27 | value. When \fIEX\fR is greater than zero then if the value doesn't match 28 | the expander change count of the SMP target (i.e. the expander) when 29 | the request arrives then the target ignores the request and sets a 30 | function result of "invalid expander change count" in the response. 31 | .TP 32 | \fB\-F\fR, \fB\-\-fpass\fR=\fIFP\fR 33 | where \fIFP\fR is the name of a file which contains the existing password. 34 | The password may be in ASCII in which case it is on one line surrounded by 35 | either single quotes are double quotes. Alternatively the password may be 36 | given in ASCII hexadecimal; either as bytes separated by space, tab, comma or 37 | newline, or as longer strings of hexadecimal bytes in which every 2 digits 38 | represents a byte. Empty lines and those starting with "#" are ignored. 39 | A line starting with '\-1' causes all remaining bytes in the password 40 | to be filled with 0xff. 41 | .TP 42 | \fB\-h\fR, \fB\-\-help\fR 43 | output the usage message then exit. 44 | .TP 45 | \fB\-H\fR, \fB\-\-hex\fR 46 | output the response (less the CRC field) in hexadecimal. 47 | .TP 48 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 49 | interface specific parameters. In this case "interface" refers to the 50 | path through the operating system to the SMP initiator. See the smp_utils 51 | man page for more information. 52 | .TP 53 | \fB\-N\fR, \fB\-\-new\-fpass\fR=\fINF\fR 54 | where \fINF\fR is the name of a file which contains the new password. The 55 | format of this file is the same as the file given in \fI\-\-fpass=FP\fR. 56 | .TP 57 | \fB\-n\fR, \fB\-\-new\-pass\fR=\fINP\fR 58 | where \fINP\fR is the new zone manager password which may be up to 32 59 | bytes long. This option cannot be give together with the 60 | \fI\-\-new\-fpass=NF\fR option. The default password is 32 NULLs (zero bytes) 61 | and \fIPA\fR is padded with NULLs to the right (to make it 32 bytes long in 62 | the request). 63 | .TP 64 | \fB\-P\fR, \fB\-\-password\fR=\fIPA\fR 65 | where \fIPA\fR is the existing zone manager password which may be up to 32 66 | bytes long. This option cannot be give together with the \fI\-\-fpass=FP\fR 67 | option. The default password is 32 NULLs (zero bytes) and \fIPA\fR is 68 | padded with NULLs to the right (to make it 32 bytes long in the request). 69 | .TP 70 | \fB\-r\fR, \fB\-\-raw\fR 71 | send the response (less the CRC field) to stdout in binary. All error 72 | messages are sent to stderr. 73 | .TP 74 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 75 | specifies the SAS address of the SMP target device. The mpt interface needs 76 | this option and it will typically be an expander's SAS address. The 77 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 78 | To give a number in hexadecimal either prefix it with '0x' or put a 79 | trailing 'h' on it. 80 | .TP 81 | \fB\-S\fR, \fB\-\-save\fR=\fISAV\fR 82 | set the 'save' field in the SMP request. \fISAV\fR may take these values: 83 | 0 for updating the shadow values (default), 1 for updating the saved values, 84 | 2 for updating shadow values and if available the saved values, 3 for 85 | updating both saved and shadow values. 86 | .TP 87 | \fB\-v\fR, \fB\-\-verbose\fR 88 | increase the verbosity of the output. Can be used multiple times. 89 | .TP 90 | \fB\-V\fR, \fB\-\-version\fR 91 | print the version string and then exit. 92 | .SH NOTES 93 | Hexadecimal bytes (or longer hexadecimal strings) should not have a 94 | leading "0x" or trailing "h" decoration. 95 | .PP 96 | The "well known" DISABLE password is 32 bytes of 0xff. The new password 97 | can only be DISABLED if physical presence is supported and asserted. 98 | .SH CONFORMING TO 99 | The SMP CONFIGURE ZONE MANAGER PASSWORD function was introduced in SAS\-2 . 100 | .SH AUTHORS 101 | Written by Douglas Gilbert. 102 | .SH "REPORTING BUGS" 103 | Report bugs to . 104 | .SH COPYRIGHT 105 | Copyright \(co 2011 Douglas Gilbert 106 | .br 107 | This software is distributed under a FreeBSD license. There is NO 108 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 109 | .SH "SEE ALSO" 110 | .B smp_utils, smp_zone_lock, smp_rep_zone_man_pass(smp_utils) 111 | -------------------------------------------------------------------------------- /doc/smp_conf_zone_phy_info.8: -------------------------------------------------------------------------------- 1 | .TH SMP_CONF_ZONE_PHY_INFO "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_conf_zone_phy_info \- invoke CONFIGURE ZONE PHY INFORMATION function 4 | .SH SYNOPSIS 5 | .B smp_conf_zone_phy_info 6 | [\fI\-\-expected=EX\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] \fI\-\-pconf=FN\fR [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-save=SAV\fR] [\fI\-\-verbose\fR] 9 | [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) CONFIGURE ZONE PHY INFORMATION 14 | function request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 16 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 17 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 18 | needs the additional \fI,N\fR to differentiate between HBAs if there are 19 | multiple present. 20 | .PP 21 | Each zone phy configuration descriptor is 4 bytes long. The first byte 22 | is a (expander) phy identifier. The second byte has 3 modifiable bits: bit 5 23 | is "inside ZPSDS persistent"; bit 4 is "requested inside ZPSDS"; and bit 2 24 | is "zone group persistent". The other bits in the second byte are reserved 25 | and should be 0. The third byte is reserved and should be 0. The fourth byte 26 | is the zone group. 27 | .SH OPTIONS 28 | Mandatory arguments to long options are mandatory for short options as well. 29 | .TP 30 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 31 | set the 'expected expander change count' field in the SMP request. 32 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 33 | value. When \fIEX\fR is greater than zero then if the value doesn't match 34 | the expander change count of the SMP target (i.e. the expander) when 35 | the request arrives then the target ignores the request and sets a 36 | function result of "invalid expander change count" in the response. 37 | .TP 38 | \fB\-h\fR, \fB\-\-help\fR 39 | output the usage message then exit. 40 | .TP 41 | \fB\-H\fR, \fB\-\-hex\fR 42 | output the response (less the CRC field) in hexadecimal. 43 | .TP 44 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 45 | interface specific parameters. In this case "interface" refers to the 46 | path through the operating system to the SMP initiator. See the smp_utils 47 | man page for more information. 48 | .TP 49 | \fB\-p\fR, \fB\-\-pconf\fR=\fIFN\fR 50 | \fIFN\fR is a file containing zone phy configuration descriptors in ASCII 51 | hexadecimal; either as bytes separated by space, tab, comma or newline, 52 | or as longer strings of hexadecimal bytes in which every 2 digits 53 | represents a byte. Empty lines and those starting with "#" are ignored. 54 | Since each zone phy configuration descriptor is 4 bytes long, the number 55 | of bytes in \fIFN\fR is expected to be a multiple of 4. 56 | .TP 57 | \fB\-r\fR, \fB\-\-raw\fR 58 | send the response (less the CRC field) to stdout in binary. All error 59 | messages are sent to stderr. 60 | .TP 61 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 62 | specifies the SAS address of the SMP target device. The mpt interface needs 63 | this option and it will typically be an expander's SAS address. The 64 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 65 | To give a number in hexadecimal either prefix it with '0x' or put a 66 | trailing 'h' on it. 67 | .TP 68 | \fB\-S\fR, \fB\-\-save\fR=\fISAV\fR 69 | set the 'save' field in the SMP request. \fISAV\fR may take these values: 70 | 0 for updating the shadow values (default), 1 for updating the saved values, 71 | 2 for updating shadow values and if available the saved values, 3 for 72 | updating both saved and shadow values. 73 | .TP 74 | \fB\-v\fR, \fB\-\-verbose\fR 75 | increase the verbosity of the output. Can be used multiple times. 76 | .TP 77 | \fB\-V\fR, \fB\-\-version\fR 78 | print the version string and then exit. 79 | .SH NOTES 80 | The expander phys that make up a wide port (2 or more attached to phys with 81 | the same SAS address) must be set to the same zone phy configuration 82 | settings (other than the phy id). 83 | .PP 84 | Zone phy information can be read back from an expander and placed in a file 85 | with the smp_discover_list utility's \fI\-\-zpi=FN\fR option. The format of 86 | that file should be suitable for this utility's \fI\-\-pconf=FN\fR option. 87 | .SH CONFORMING TO 88 | The SMP CONFIGURE ZONE PHY INFORMATION function was introduced in SAS\-2 . 89 | .SH AUTHORS 90 | Written by Douglas Gilbert. 91 | .SH "REPORTING BUGS" 92 | Report bugs to . 93 | .SH COPYRIGHT 94 | Copyright \(co 2011 Douglas Gilbert 95 | .br 96 | This software is distributed under a FreeBSD license. There is NO 97 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 98 | .SH "SEE ALSO" 99 | .B smp_utils, smp_conf_zone_perm_tbl, smp_zone_activate, 100 | .B smp_discover_list(smp_utils) 101 | -------------------------------------------------------------------------------- /doc/smp_ena_dis_zoning.8: -------------------------------------------------------------------------------- 1 | .TH SMP_ENA_DIS_ZONING "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_ena_dis_zoning \- invoke ENABLE DISABLE ZONING SMP function 4 | .SH SYNOPSIS 5 | .B smp_ena_dis_zoning 6 | [\fI\-\-disable\fR] [\fI\-\-ena\-dis=ED\fR] [\fI\-\-expected=EX\fR] 7 | [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] 8 | [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-save=SAV\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) ENABLE DISABLE ZONING function 14 | request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 16 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 17 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 18 | needs the additional \fI,N\fR to differentiate between HBAs if there are 19 | multiple present. 20 | .PP 21 | If neither \fI\-\-disable\fR nor \fI\-\-ena\-dis=ED\fR options are given then 22 | enable zoning (i.e. "\-\-ena\-dis=1") is assumed. 23 | .PP 24 | This function does not change the state of the current zoning enabled flag (as 25 | seen in the REPORT GENERAL response). Such a state change will occur on a 26 | subsequent invocation of the ZONE ACTIVATE function. 27 | .SH OPTIONS 28 | Mandatory arguments to long options are mandatory for short options as well. 29 | .TP 30 | \fB\-d\fR, \fB\-\-disable\fR 31 | set the 'enable disable zoning' field in the SMP request to 2 which will 32 | disable zoning. 33 | .TP 34 | \fB\-e\fR, \fB\-\-ena\-dis\fR=\fIED\fR 35 | set the 'enable disable zoning' field in the SMP request. \fIED\fR may 36 | take these values: 0 for no change, 1 for enable zoning (default) and 2 for 37 | disable zoning. If this option and the \fI\-\-disable\fR option are both 38 | given then they cannot contradict one another. 39 | .TP 40 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 41 | set the 'expected expander change count' field in the SMP request. 42 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 43 | value. When \fIEX\fR is greater than zero then if the value doesn't match 44 | the expander change count of the SMP target (i.e. the expander) when 45 | the request arrives then the target ignores the request and sets a 46 | function result of "invalid expander change count" in the response. 47 | .TP 48 | \fB\-h\fR, \fB\-\-help\fR 49 | output the usage message then exit. 50 | .TP 51 | \fB\-H\fR, \fB\-\-hex\fR 52 | output the response (less the CRC field) in hexadecimal. 53 | .TP 54 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 55 | interface specific parameters. In this case "interface" refers to the 56 | path through the operating system to the SMP initiator. See the smp_utils 57 | man page for more information. 58 | .TP 59 | \fB\-r\fR, \fB\-\-raw\fR 60 | send the response (less the CRC field) to stdout in binary. All error 61 | messages are sent to stderr. 62 | .TP 63 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 64 | specifies the SAS address of the SMP target device. The mpt interface needs 65 | this option and it will typically be an expander's SAS address. The 66 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 67 | To give a number in hexadecimal either prefix it with '0x' or put a 68 | trailing 'h' on it. 69 | .TP 70 | \fB\-S\fR, \fB\-\-save\fR=\fISAV\fR 71 | set the 'save' field in the SMP request. \fISAV\fR may take these values: 72 | 0 for updating the shadow values (default), 1 for updating the saved values, 73 | 2 for updating shadow values and if available the saved values, 3 for 74 | updating both saved and shadow values. 75 | .TP 76 | \fB\-v\fR, \fB\-\-verbose\fR 77 | increase the verbosity of the output. Can be used multiple times. 78 | .TP 79 | \fB\-V\fR, \fB\-\-version\fR 80 | print the version string and then exit. 81 | .SH CONFORMING TO 82 | The SMP ENABLE DISABLE ZONING function was introduced in SAS\-2 . 83 | .SH AUTHORS 84 | Written by Douglas Gilbert. 85 | .SH "REPORTING BUGS" 86 | Report bugs to . 87 | .SH COPYRIGHT 88 | Copyright \(co 2011 Douglas Gilbert 89 | .br 90 | This software is distributed under a FreeBSD license. There is NO 91 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 92 | .SH "SEE ALSO" 93 | .B smp_utils, smp_lock, smp_zone_activate, smp_zone_unlock(smp_utils) 94 | -------------------------------------------------------------------------------- /doc/smp_phy_test.8: -------------------------------------------------------------------------------- 1 | .TH SMP_PHY_TEST "8" "October 2017" "smp_utils\-0.99" SMP_UTILS 2 | .SH NAME 3 | smp_phy_test \- invoke PHY TEST FUNCTION SMP function 4 | .SH SYNOPSIS 5 | .B smp_phy_test 6 | [\fI\-\-control=CO\fR] [\fI\-\-dwords=DW\fR] [\fI\-\-expected=EX\fR] 7 | [\fI\-\-function=FN\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 8 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-linkrate=LR\fR] [\fI\-\-pattern=PA\fR] 9 | [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-sata\fR] 10 | [\fI\-\-spread=SC\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] 11 | \fISMP_DEVICE[,N]\fR 12 | .SH DESCRIPTION 13 | .\" Add any additional description here 14 | .PP 15 | Sends a SAS Serial Management Protocol (SMP) PHY TEST FUNCTION function 16 | request to an SMP target. The SMP target is identified by the 17 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 18 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 19 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 20 | additional \fI,N\fR to differentiate between HBAs if there are multiple 21 | present. 22 | .PP 23 | The PHY TEST FUNCTION function can be used to start and stop 24 | test pattern transmission. When a phy associated with an SMP 25 | target (most likely an expander) starts test pattern transmission 26 | then the attached phy (if there is one) sees a link down. 27 | .PP 28 | SAS phys associated with SSP targets (e.g. a SAS disk) can generate 29 | similar test patterns by using the SEND DIAGNOSTIC SCSI command 30 | with page code 3fh . See the sg_senddiag utility. 31 | .SH OPTIONS 32 | Mandatory arguments to long options are mandatory for short options as well. 33 | .TP 34 | \fB\-c\fR, \fB\-\-control\fR=\fICO\fR 35 | set the 'phy test pattern dwords control' field. The argument \fICO\fR can be 36 | from 0 to 255 inclusive, the default is 0 (each byte in 'dwords' sent as data 37 | byte (Dxx.y) without scrambling). Only active when 'pattern' is set to 38 | 40h (i.e. "two_dwords"). 39 | .TP 40 | \fB\-d\fR, \fB\-\-dwords\fR=\fIDW\fR 41 | set the 'phy test pattern dwords' field which is 8 bytes long. The argument 42 | \fIDW\fR would normally be entered in hex with a leading '0x' or a 43 | trailing 'h' (otherwise it would be interpreted as decimal). Due to a quirk in 44 | the command line parser, the argument value ffffffffffffffffh (i.e. all bits 45 | sets) needs to be entered as '\-1'. 46 | .TP 47 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 48 | set the 'expected expander change count' field in the SMP request. The value 49 | \fIEX\fR is from 0 to 65535 inclusive with 0 being the default value. When 50 | \fIEX\fR is greater than zero then if the value doesn't match the expander 51 | change count of the SMP target (i.e. the expander) when the request arrives 52 | then the target ignores the request and sets a function result of "invalid 53 | expander change count" in the response. 54 | .TP 55 | \fB\-f\fR, \fB\-\-function\fR=\fIFN\fR 56 | set the 'phy test function' field in the SMP request. Values between 0 and 57 | 255 are accepted with the default being 0. The value 0 stops the selected 58 | phy performing a phy test function. The value 1 starts the selected phy 59 | transmitting the test pattern (and anything that the phy receives is 60 | discarded). 61 | .TP 62 | \fB\-h\fR, \fB\-\-help\fR 63 | output the usage message then exit. 64 | .TP 65 | \fB\-H\fR, \fB\-\-hex\fR 66 | output the response (less the CRC field) in hexadecimal. 67 | .TP 68 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 69 | interface specific parameters. In this case "interface" refers to the 70 | path through the operating system to the SMP initiator. See the smp_utils 71 | man page for more information. 72 | .TP 73 | \fB\-l\fR, \fB\-\-linkrate\fR=\fILR\fR 74 | transmits the test pattern at the specified physical link rate: 75 | 8 \-> 1.5 Gbps, 9 \-> 3 Gbps, 10 \-> 6 Gbps, 11 \-> 12 Gbps. Default 76 | value is 0xa (i.e. 6 Gbps). Prior to version 0.99 the default value 77 | was 9 (i.e. 3 Gbps). 78 | .TP 79 | \fB\-P\fR, \fB\-\-pattern\fR=\fIPA\fR 80 | specifies the type of test pattern to transmit. SPL\-4 (rev 8) values are: 81 | 1 \-> JTPAT, 2 \-> CJTPAT, 3 \-> PRBS9, 4 \-> PRBS15, 10h \-> TRAIN, 82 | 11h \-> TRAIN_DONE, 12h \-> IDLE, 13h \-> SCRAMBLED_0, 40h \-> TWO_DWORDS. 83 | The default value is 2 (i.e. CJTPAT). 84 | .TP 85 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 86 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 87 | .TP 88 | \fB\-r\fR, \fB\-\-raw\fR 89 | send the response (less the CRC field) to stdout in binary. All error 90 | messages are sent to stderr. 91 | .TP 92 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 93 | specifies the SAS address of the SMP target device. Typically this is an 94 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 95 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 96 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 97 | either prefix it with '0x' or put a trailing 'h' on it. 98 | .TP 99 | \fB\-t\fR, \fB\-\-sata\fR 100 | set phy test function SATA bit. The default action is to leave that bit 101 | clear (zero). 102 | .TP 103 | \fB\-S\fR, \fB\-\-spread\fR=\fISC\fR 104 | set the phy test function Spread Spectrum Clocking (SSC) field to \fISC\fR. 105 | Default value is zero (no spreading). Other defined values are 1 for centre 106 | spreading and 2 for down spreading. 107 | .TP 108 | \fB\-v\fR, \fB\-\-verbose\fR 109 | increase the verbosity of the output. Can be used multiple times 110 | .TP 111 | \fB\-V\fR, \fB\-\-version\fR 112 | print the version string and then exit. 113 | .SH CONFORMING TO 114 | The SMP PHY TEST function was introduced in SAS\-1.1 and enhanced in SAS\-2 . 115 | .SH AUTHORS 116 | Written by Douglas Gilbert. 117 | .SH "REPORTING BUGS" 118 | Report bugs to . 119 | .SH COPYRIGHT 120 | Copyright \(co 2006\-2017 Douglas Gilbert 121 | .br 122 | This software is distributed under a FreeBSD license. There is NO 123 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 124 | .SH "SEE ALSO" 125 | .B smp_utils, sg_senddiag(sg3_utils) 126 | -------------------------------------------------------------------------------- /doc/smp_read_gpio.8: -------------------------------------------------------------------------------- 1 | .TH SMP_READ_GPIO "8" "August 2011" "smp_utils\-0.97" SMP_UTILS 2 | .SH NAME 3 | smp_read_gpio \- invoke READ GPIO REGISTER (ENHANCED) SMP function 4 | .SH SYNOPSIS 5 | .B smp_read_gpio 6 | [\fI\-\-count=CO\fR] [\fI\-\-enhanced\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-index=IN\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-type=TY\fR] [\fI\-\-verbose\fR] 9 | [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) READ GPIO REGISTER or READ 14 | GPIO REGISTER ENHANCED function request to an SMP target. The SMP target is 15 | identified by the \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the 16 | interface, the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The 17 | mpt interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 18 | needs the additional \fI,N\fR to differentiate between HBAs if there are 19 | multiple present. 20 | .PP 21 | This function is defined in SFF\-8485 ( see www.sffcommittee.com ) 22 | together with its corresponding WRITE GPIO REGISTER SMP function. 23 | The other SMP functions are defined in SAS documents at www.t10.org . 24 | SFF\-8485 defines a curious device called a "virtual SMP port" 25 | that lives in a host bus adapter (HBA) and allows SMP to manipulate 26 | the sideband signals on wide internal cables. To stop other initiators 27 | in a multi\-initiator domain from accessing those sideband signals, 28 | the virtual SMP (target) port is not indicated in a DISCOVER response. 29 | .PP 30 | For notes on the SMP READ GPIO REGISTER ENHANCED function see the section 31 | on the ENHANCED FUNCTION below. 32 | .SH OPTIONS 33 | Mandatory arguments to long options are mandatory for short options as well. 34 | .TP 35 | \fB\-c\fR, \fB\-\-count\fR=\fICO\fR 36 | where \fICO\fR is the register count. This is the number of (4 byte) 37 | registers to request. The default value is 1. 38 | .TP 39 | \fB\-E\fR, \fB\-\-enhanced\fR 40 | sends a READ GPIO REGISTER ENHANCED function request (default: send a READ 41 | GPIO REGISTER function request). 42 | .TP 43 | \fB\-h\fR, \fB\-\-help\fR 44 | output the usage message then exit. 45 | .TP 46 | \fB\-H\fR, \fB\-\-hex\fR 47 | output the response (less the CRC field) in hexadecimal. 48 | .TP 49 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 50 | where \fIIN\fR is the register index. This value is origin zero and its 51 | default value is 0. If the request succeeds, then \fI\-\-count=CO\fR 52 | registers starting from \fI\-\-index=IN\fR of the given \fI\-\-type=TY\fR 53 | should be in the response. 54 | .TP 55 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 56 | interface specific parameters. In this case "interface" refers to the 57 | path through the operating system to the SMP initiator. See the smp_utils 58 | man page for more information. 59 | .TP 60 | \fB\-r\fR, \fB\-\-raw\fR 61 | send the response (less the CRC field) to stdout in binary. All error 62 | messages are sent to stderr. 63 | .TP 64 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 65 | specifies the SAS address of the SMP target device. Typically this is an 66 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 67 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 68 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 69 | either prefix it with '0x' or put a trailing 'h' on it. 70 | .TP 71 | \fB\-t\fR, \fB\-\-type\fR=\fITY\fR 72 | where \fITY\fR is the register type. The default value is 0 (GPIO_CFG). 73 | If the request succeeds, then \fI\-\-count=CO\fR registers starting from 74 | \fI\-\-index=IN\fR of the given \fI\-\-type=TY\fR should be in the response. 75 | .TP 76 | \fB\-v\fR, \fB\-\-verbose\fR 77 | increase the verbosity of the output. Can be used multiple times 78 | .TP 79 | \fB\-V\fR, \fB\-\-version\fR 80 | print the version string and then exit. 81 | .SH ENHANCED FUNCTION 82 | In the technical review of SAS\-2 prior to standardization in this t10 83 | document: 08\-212r8.pdf (page 871 or 552) there is a comment that the 84 | READ GPIO REGISTER and WRITE GPIO REGISTER function headers (i.e. first 85 | 4 bytes) do not comply with all the other SMP functions in SAS\-2. 86 | .PP 87 | There is a suggestion that enhanced variants be introduced in the next 88 | version of the SFF\-8485 document. If that ever happened then it has 89 | not been made public. In SAS\-2.1 both the READ and WRITE GPIO REGISTER 90 | functions have been made obsolete and the corresponding ENHANCED function 91 | numbers are "restricted" for SFF\-8485. 92 | .PP 93 | If the \fI\-\-enhanced\fR option is given then the ENHANCED function 94 | number is sent; the register type, index and count fields (1 byte each) 95 | are increased by two byte positions leaving enough space for a compliant 96 | SAS\-2 SMP header to be built. 97 | .SH EXAMPLES 98 | See "Examples" section in http://sg.danny.cz/sg/smp_utils.html 99 | .SH CONFORMING TO 100 | The SMP READ GPIO REGISTER (ENHANCED) function is defined in SFF\-8485 (see 101 | www.sffcommittee.com ) together with its corresponding WRITE GPIO 102 | REGISTER (ENHANCED) SMP function. 103 | .SH AUTHORS 104 | Written by Douglas Gilbert. 105 | .SH "REPORTING BUGS" 106 | Report bugs to . 107 | .SH COPYRIGHT 108 | Copyright \(co 2006\-2011 Douglas Gilbert 109 | .br 110 | This software is distributed under a FreeBSD license. There is NO 111 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 112 | .SH "SEE ALSO" 113 | .B smp_utils, smp_write_gpio(smp_utils) 114 | -------------------------------------------------------------------------------- /doc/smp_rep_broadcast.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_BROADCAST "8" "February 2012" "smp_utils\-0.98" SMP_UTILS 2 | .SH NAME 3 | smp_rep_broadcast \- invoke REPORT BROADCAST SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_broadcast 6 | [\fI\-\-broadcast=BT\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 8 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] 9 | \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT BROADCAST function 14 | request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 16 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 17 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 18 | needs the additional \fI,N\fR to differentiate between HBAs if there are 19 | multiple present. 20 | .SH OPTIONS 21 | Mandatory arguments to long options are mandatory for short options as well. 22 | .TP 23 | \fB\-b\fR, \fB\-\-broadcast\fR=\fIBT\fR 24 | \fIBT\fR is the broadcast type, an integer in the range 0 (default) to 15. 25 | Broadcast (Change) corresponds to 0. Other known broadcast types are 26 | listed in the NOTES section. \fIBT\fR may be decimal (default) or 27 | hexadecimal prefixed by '0x' (or '0X') or with a 'h' (or 'H') suffix. 28 | .TP 29 | \fB\-h\fR, \fB\-\-help\fR 30 | output the usage message then exit. 31 | .TP 32 | \fB\-H\fR, \fB\-\-hex\fR 33 | output the response (less the CRC field) in hexadecimal. 34 | .TP 35 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 36 | interface specific parameters. In this case "interface" refers to the 37 | path through the operating system to the SMP initiator. See the smp_utils 38 | man page for more information. 39 | .TP 40 | \fB\-r\fR, \fB\-\-raw\fR 41 | send the response (less the CRC field) to stdout in binary. All error 42 | messages are sent to stderr. 43 | .TP 44 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 45 | specifies the SAS address of the SMP target device. The mpt interface needs 46 | this option and it will typically be an expander's SAS address. The 47 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 48 | To give a number in hexadecimal either prefix it with '0x' or put a 49 | trailing 'h' on it. 50 | .TP 51 | \fB\-v\fR, \fB\-\-verbose\fR 52 | increase the verbosity of the output. Can be used multiple times. 53 | .TP 54 | \fB\-V\fR, \fB\-\-version\fR 55 | print the version string and then exit. 56 | .SH NOTES 57 | The following is a list of broadcast types: 58 | .br 59 | 0 Broadcast (Change) 60 | .br 61 | 1 Broadcast (Reserved change 0) 62 | .br 63 | 2 Broadcast (Reserved change 1) 64 | .br 65 | 3 Broadcast (SES) 66 | .br 67 | 4 Broadcast (Expander) 68 | .br 69 | 5 Broadcast (Asynchronous event) 70 | .br 71 | 6 Broadcast (Reserved 3) 72 | .br 73 | 7 Broadcast (Reserved 4) 74 | .br 75 | 8 Broadcast (Zone activate) 76 | .PP 77 | The remaining zone types (9 to 15) may be issued by the ZONED BROADCAST 78 | function. 79 | .SH CONFORMING TO 80 | The SMP REPORT BROADCAST function was introduced in SAS\-2 . 81 | .SH AUTHORS 82 | Written by Douglas Gilbert. 83 | .SH "REPORTING BUGS" 84 | Report bugs to . 85 | .SH COPYRIGHT 86 | Copyright \(co 2011\-2012 Douglas Gilbert 87 | .br 88 | This software is distributed under a FreeBSD license. There is NO 89 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 90 | .SH "SEE ALSO" 91 | .B smp_utils, smp_zoned_broadcast(smp_utils) 92 | -------------------------------------------------------------------------------- /doc/smp_rep_exp_route_tbl.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_EXP_ROUTE_TBL "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_exp_route_tbl \- invoke REPORT EXPANDER ROUTE TABLE LIST SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_exp_route_tbl 6 | [\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-index=IN\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-num=NUM\fR] 8 | [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT EXPANDER ROUTE TABLE LIST 14 | function request to an SMP target and decodes or outputs the response. The 15 | SMP target is identified by the \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. 16 | Depending on the interface, the \fISAS_ADDR\fR may be deduced from the 17 | \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 18 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 19 | differentiate between HBAs if there are multiple present. 20 | .PP 21 | There are two expander route table types: phy\-based and expander\-based. 22 | The expander\-based route table was introduced in SAS\-2 and supersedes the 23 | phy\-based route tables. The REPORT EXPANDER ROUTE TABLE LIST function is 24 | associated with an expander\-based route table. There is no corresponding 25 | CONFIGURE function because a expander\-based route table is self\-configured. 26 | .SH OPTIONS 27 | Mandatory arguments to long options are mandatory for short options as well. 28 | .TP 29 | \fB\-b\fR, \fB\-\-brief\fR 30 | reduce the decoded response output. 31 | .TP 32 | \fB\-h\fR, \fB\-\-help\fR 33 | output the usage message then exit. 34 | .TP 35 | \fB\-H\fR, \fB\-\-hex\fR 36 | output the response (less the CRC field) in hexadecimal. 37 | .TP 38 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 39 | \fIIN\fR is the starting routed SAS address index. The default value is 0. 40 | .TP 41 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 42 | interface specific parameters. In this case "interface" refers to the 43 | path through the operating system to the SMP initiator. See the smp_utils 44 | man page for more information. 45 | .TP 46 | \fB\-n\fR, \fB\-\-num\fR=\fINUM\fR 47 | maximum number of descriptors to fetch (default is 62). Note that maximum SMP 48 | frame size is 1028 bytes (including a trailing 4 byte CRC) so 62 descriptors 49 | is the maximum number that can fit in one response. 50 | .TP 51 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 52 | starting phy identifier within bitmap. \fIID\fR should be one of 0 (the 53 | default), or a multiple of 48. Note there is only one expnder route 54 | table per expander, not one per phy. 55 | .TP 56 | \fB\-r\fR, \fB\-\-raw\fR 57 | send the response (less the CRC field) to stdout in binary. All error 58 | messages are sent to stderr. 59 | .TP 60 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 61 | specifies the SAS address of the SMP target device. Typically this is an 62 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 63 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 64 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 65 | either prefix it with '0x' or put a trailing 'h' on it. 66 | .TP 67 | \fB\-v\fR, \fB\-\-verbose\fR 68 | increase the verbosity of the output. Can be used multiple times 69 | .TP 70 | \fB\-V\fR, \fB\-\-version\fR 71 | print the version string and then exit. 72 | .SH CONFORMING TO 73 | The SMP REPORT EXPANDER ROUTE TABLE LIST function was introduced in SAS\-2 . 74 | .SH AUTHORS 75 | Written by Douglas Gilbert. 76 | .SH "REPORTING BUGS" 77 | Report bugs to . 78 | .SH COPYRIGHT 79 | Copyright \(co 2007\-2011 Douglas Gilbert 80 | .br 81 | This software is distributed under a FreeBSD license. There is NO 82 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 83 | .SH "SEE ALSO" 84 | .B smp_utils, smp_rep_route_info 85 | -------------------------------------------------------------------------------- /doc/smp_rep_general.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_GENERAL "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_general \- invoke REPORT GENERAL SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_general 6 | [\fI\-\-brief\fR] [\fI\-\-changecount\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 8 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zero\fR] 9 | \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT GENERAL function request 14 | to an SMP target. The SMP target is identified by the \fISMP_DEVICE\fR and 15 | the \fISAS_ADDR\fR. Depending on the interface, the \fISAS_ADDR\fR may be 16 | deduced from the \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 17 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 18 | differentiate between HBAs if there are multiple present. 19 | .SH OPTIONS 20 | Mandatory arguments to long options are mandatory for short options as well. 21 | .TP 22 | \fB\-b\fR, \fB\-\-brief\fR 23 | reports (prints to stdout) only a few important fields from the response. 24 | .TP 25 | \fB\-c\fR, \fB\-\-changecount\fR 26 | reports (prints to stdout) the value of the expander change count field from 27 | the response. The value is printed in decimal and is in the range 0 to 28 | 65535. Only expanders compliant with SAS\-1.1 (and earlier) should yield 29 | 0. [Expanders compliant with SAS\-2 (and later) should set the "long 30 | response" bit in the REPORT GENERAL response to 1.] 31 | .TP 32 | \fB\-h\fR, \fB\-\-help\fR 33 | output the usage message then exit. 34 | .TP 35 | \fB\-H\fR, \fB\-\-hex\fR 36 | output the response (less the CRC field) in hexadecimal. 37 | .TP 38 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 39 | interface specific parameters. In this case "interface" refers to the 40 | path through the operating system to the SMP initiator. See the smp_utils 41 | man page for more information. 42 | .TP 43 | \fB\-r\fR, \fB\-\-raw\fR 44 | send the response (less the CRC field) to stdout in binary. All error 45 | messages are sent to stderr. 46 | .TP 47 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 48 | specifies the SAS address of the SMP target device. Typically this is an 49 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 50 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 51 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 52 | either prefix it with '0x' or put a trailing 'h' on it. 53 | .TP 54 | \fB\-v\fR, \fB\-\-verbose\fR 55 | increase the verbosity of the output. Can be used multiple times 56 | .TP 57 | \fB\-V\fR, \fB\-\-version\fR 58 | print the version string and then exit. 59 | .TP 60 | \fB\-z\fR, \fB\-\-zero\fR 61 | zero the Allocated Response Length field in the request. This is required 62 | for strict SAS\-1.1 compliance. However this option should not be 63 | given in SAS\-2 and later; if it is given an abridged response may result. 64 | .SH EXAMPLES 65 | See "Examples" section in http://sg.danny.cz/sg/smp_utils.html 66 | .SH CONFORMING TO 67 | The SMP REPORT GENERAL function was introduced in SAS\-1, with small additions 68 | in SAS\-1.1 . There have been a large number of additions in SAS\-2 . 69 | .SH AUTHORS 70 | Written by Douglas Gilbert. 71 | .SH "REPORTING BUGS" 72 | Report bugs to . 73 | .SH COPYRIGHT 74 | Copyright \(co 2006\-2011 Douglas Gilbert 75 | .br 76 | This software is distributed under a FreeBSD license. There is NO 77 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 78 | .SH "SEE ALSO" 79 | .B smp_utils, smp_discover(smp_utils) 80 | -------------------------------------------------------------------------------- /doc/smp_rep_manufacturer.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_MANUFACTURER "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_manufacturer \- invoke REPORT MANUFACTURER INFORMATION SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_manufacturer 6 | [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] 7 | [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] 8 | [\fI\-\-version\fR] [\fI\-\-zero\fR] \fISMP_DEVICE[,N]\fR 9 | .SH DESCRIPTION 10 | .\" Add any additional description here 11 | .PP 12 | Sends a SAS Serial Management Protocol (SMP) REPORT MANUFACTURER INFORMATION 13 | function request to an SMP target. The SMP target is identified by the 14 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 15 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 16 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 17 | additional \fI,N\fR to differentiate between HBAs if there are multiple 18 | present. 19 | .SH OPTIONS 20 | Mandatory arguments to long options are mandatory for short options as well. 21 | .TP 22 | \fB\-h\fR, \fB\-\-help\fR 23 | output the usage message then exit. 24 | .TP 25 | \fB\-H\fR, \fB\-\-hex\fR 26 | output the response (less the CRC field) in hexadecimal. 27 | .TP 28 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 29 | interface specific parameters. In this case "interface" refers to the 30 | path through the operating system to the SMP initiator. See the smp_utils 31 | man page for more information. 32 | .TP 33 | \fB\-r\fR, \fB\-\-raw\fR 34 | send the response (less the CRC field) to stdout in binary. All error 35 | messages are sent to stderr. 36 | .TP 37 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 38 | specifies the SAS address of the SMP target device. Typically this is an 39 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 40 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 41 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 42 | either prefix it with '0x' or put a trailing 'h' on it. 43 | .TP 44 | \fB\-v\fR, \fB\-\-verbose\fR 45 | increase the verbosity of the output. Can be used multiple times 46 | .TP 47 | \fB\-V\fR, \fB\-\-version\fR 48 | print the version string and then exit. 49 | .TP 50 | \fB\-z\fR, \fB\-\-zero\fR 51 | zero the Allocated Response Length field in the request. This is required 52 | for strict SAS\-1.1 compliance. However this option should not be 53 | given in SAS\-2 and later; if it is given an abridged response may result. 54 | .SH CONFORMING TO 55 | The SMP REPORT MANUFACTURER function was introduced in SAS\-1, with small 56 | additions in SAS\-1.1 . This function remains unaltered in SAS\-2 and SPL\-1. 57 | .SH AUTHORS 58 | Written by Douglas Gilbert. 59 | .SH "REPORTING BUGS" 60 | Report bugs to . 61 | .SH COPYRIGHT 62 | Copyright \(co 2006\-2011 Douglas Gilbert 63 | .br 64 | This software is distributed under a FreeBSD license. There is NO 65 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 66 | .SH "SEE ALSO" 67 | .B smp_utils, smp_discover(smp_utils) 68 | -------------------------------------------------------------------------------- /doc/smp_rep_phy_err_log.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_PHY_ERR_LOG "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_phy_err_log \- invoke REPORT PHY ERROR LOG SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_phy_err_log 6 | [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] 7 | [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 8 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zero\fR] 9 | \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT PHY ERROR LOG function 14 | request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 16 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 17 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 18 | additional \fI,N\fR to differentiate between HBAs if there are multiple 19 | present. 20 | .SH OPTIONS 21 | Mandatory arguments to long options are mandatory for short options as well. 22 | .TP 23 | \fB\-h\fR, \fB\-\-help\fR 24 | output the usage message then exit. 25 | .TP 26 | \fB\-H\fR, \fB\-\-hex\fR 27 | output the response (less the CRC field) in hexadecimal. 28 | .TP 29 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 30 | interface specific parameters. In this case "interface" refers to the 31 | path through the operating system to the SMP initiator. See the smp_utils 32 | man page for more information. 33 | .TP 34 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 35 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 36 | .TP 37 | \fB\-r\fR, \fB\-\-raw\fR 38 | send the response (less the CRC field) to stdout in binary. All error 39 | messages are sent to stderr. 40 | .TP 41 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 42 | specifies the SAS address of the SMP target device. Typically this is an 43 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 44 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 45 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 46 | either prefix it with '0x' or put a trailing 'h' on it. 47 | .TP 48 | \fB\-v\fR, \fB\-\-verbose\fR 49 | increase the verbosity of the output. Can be used multiple times 50 | .TP 51 | \fB\-V\fR, \fB\-\-version\fR 52 | print the version string and then exit. 53 | .TP 54 | \fB\-z\fR, \fB\-\-zero\fR 55 | zero the Allocated Response Length field in the request. This option 56 | also zeros the Request Length field in the request. This is required 57 | for strict SAS\-1.1 compliance. However this option should not be 58 | given in SAS\-2 and later; if it is given an abridged response may result. 59 | .SH NOTES 60 | Similar information is maintained for SAS SSP target phys (e.g. on a SAS 61 | disk). It can be obtained from the Protocol Specific Port log page with 62 | the sg_logs utility. 63 | .PP 64 | Similar information may be obtained for SAS initiator phys (e.g. on a SAS 65 | HBA). As an example in Linux 2.6.28 error information can be found in this 66 | directory /sys/class/sas_phy/phy\-4:0 (for the phy 0 in SCSI/SAS host 4). 67 | .PP 68 | Similar information may be obtained for SATA device phys (e.g. on a SATA 69 | disk). If there is a SAT layer between OS and the SATA device then the 70 | sg_sat_phy_event utility can fetch the information. 71 | .SH CONFORMING TO 72 | The SMP REPORT PHY ERROR LOG function was introduced in SAS\-1 . 73 | The "Expander change count" field was added in SAS\-2 . 74 | .SH AUTHORS 75 | Written by Douglas Gilbert. 76 | .SH "REPORTING BUGS" 77 | Report bugs to . 78 | .SH COPYRIGHT 79 | Copyright \(co 2006\-2011 Douglas Gilbert 80 | .br 81 | This software is distributed under a FreeBSD license. There is NO 82 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 83 | .SH "SEE ALSO" 84 | .B smp_utils, smp_phy_control(smp_utils), sg_logs(sg3_utils), 85 | .B sg_sat_phy_event(sg3_utils) 86 | -------------------------------------------------------------------------------- /doc/smp_rep_phy_event.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_PHY_EVENT "8" "December 2011" "smp_utils\-0.97" SMP_UTILS 2 | .SH NAME 3 | smp_rep_phy_event \- invoke REPORT PHY EVENT SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_phy_event 6 | [\fI\-\-desc\fR] [\fI\-\-enumerate\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-long\fR] [\fI\-\-phy=ID\fR] 8 | [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] 9 | [\fI\-\-version\fR] [\fI\-\-zero\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT PHY EVENT function 14 | request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 16 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 17 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 18 | additional \fI,N\fR to differentiate between HBAs if there are multiple 19 | present. 20 | .PP 21 | Reports zero or more phy event descriptors. Each descriptor contains a phy 22 | event source, a phy event (i.e. a count) and a peak value detector threshold. 23 | At least one phy event should be maintained for each phy. 24 | .SH OPTIONS 25 | Mandatory arguments to long options are mandatory for short options as well. 26 | .TP 27 | \fB\-d\fR, \fB\-\-desc\fR 28 | precede each phy event descriptor with a line announcing its descriptor index 29 | number. Index numbers start at 1. 30 | .TP 31 | \fB\-e\fR, \fB\-\-enumerate\fR 32 | enumerate all of the known Phy Event Source names, one per line preceded by 33 | its value in hex. Ignores \fISMP_DEVICE\fR if it is given; most other 34 | options are also ignored. Exits after displaying the names. 35 | .TP 36 | \fB\-h\fR, \fB\-\-help\fR 37 | output the usage message then exit. 38 | .TP 39 | \fB\-H\fR, \fB\-\-hex\fR 40 | output the response (less the CRC field) in hexadecimal. 41 | .TP 42 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 43 | interface specific parameters. In this case "interface" refers to the 44 | path through the operating system to the SMP initiator. See the smp_utils 45 | man page for more information. 46 | .TP 47 | \fB\-l\fR, \fB\-\-long\fR 48 | prefix each phy event source string with its numeric identifier in hex. 49 | For example: "[0x1]: Invalid word count: 23" 50 | .TP 51 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 52 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 53 | .TP 54 | \fB\-r\fR, \fB\-\-raw\fR 55 | send the response (less the CRC field) to stdout in binary. All error 56 | messages are sent to stderr. 57 | .TP 58 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 59 | specifies the SAS address of the SMP target device. Typically this is an 60 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 61 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 62 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 63 | either prefix it with '0x' or put a trailing 'h' on it. 64 | .TP 65 | \fB\-v\fR, \fB\-\-verbose\fR 66 | increase the verbosity of the output. Can be used multiple times 67 | .TP 68 | \fB\-V\fR, \fB\-\-version\fR 69 | print the version string and then exit. 70 | .SH NOTES 71 | Similar information is maintained for SAS SSP target phys (e.g. on a SAS 72 | disk). It can be obtained from the Protocol Specific Port log page with 73 | the sg_logs utility. 74 | .PP 75 | Similar information may be obtained for SAS initiator phys (e.g. on a SAS 76 | HBA). As an example in Linux 2.6.28 error information can be found in this 77 | directory /sys/class/sas_phy/phy\-4:0 (for the phy 0 in SCSI/SAS host 4). 78 | .PP 79 | Similar information may be obtained for SATA device phys (e.g. on a SATA 80 | disk). If there is a SAT layer between OS and the SATA device then the 81 | sg_sat_phy_event utility can fetch the information. 82 | .SH CONFORMING TO 83 | The SMP REPORT PHY EVENT function was introduced in SAS\-2 . 84 | .SH AUTHORS 85 | Written by Douglas Gilbert. 86 | .SH "REPORTING BUGS" 87 | Report bugs to . 88 | .SH COPYRIGHT 89 | Copyright \(co 2011 Douglas Gilbert 90 | .br 91 | This software is distributed under a FreeBSD license. There is NO 92 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 93 | .SH "SEE ALSO" 94 | .B smp_utils, smp_phy_control, smp_rep_phy_event_list(smp_utils) 95 | .B sg_logs, sg_sat_phy_event(sg3_utils) 96 | -------------------------------------------------------------------------------- /doc/smp_rep_phy_event_list.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_PHY_EVENT_LIST "8" "December 2011" "smp_utils\-0.97" SMP_UTILS 2 | .SH NAME 3 | smp_rep_phy_event_list \- invoke REPORT PHY EVENT LIST SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_phy_event_list 6 | [\fI\-\-desc\fR] [\fI\-\-enumerate\fR] [\fI\-\-force\fR] [\fI\-\-help\fR] 7 | [\fI\-\-hex\fR] [\fI\-\-index=IN\fR] [\fI\-\-interface=PARAMS\fR] 8 | [\fI\-\-long\fR] [\fI\-\-nonz\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zero\fR] 10 | \fISMP_DEVICE[,N]\fR 11 | .SH DESCRIPTION 12 | .\" Add any additional description here 13 | .PP 14 | Sends a SAS Serial Management Protocol (SMP) REPORT PHY EVENT LIST function 15 | request to an SMP target. The SMP target is identified by the 16 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 17 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 18 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 19 | additional \fI,N\fR to differentiate between HBAs if there are multiple 20 | present. 21 | .PP 22 | Reports zero or more phy event list descriptors. Each descriptor contains a 23 | phy identifier, a phy event source, a phy event (i.e. a count) and a peak 24 | value detector threshold. At least one phy event should be maintained for 25 | each phy. 26 | .SH OPTIONS 27 | Mandatory arguments to long options are mandatory for short options as well. 28 | .TP 29 | \fB\-d\fR, \fB\-\-desc\fR 30 | precede each phy event descriptor with a line announcing its descriptor index 31 | number. Index numbers start at 1. 32 | .TP 33 | \fB\-e\fR, \fB\-\-enumerate\fR 34 | enumerate all of the known Phy Event Source names, one per line preceded by 35 | its value in hex. Ignores \fISMP_DEVICE\fR if it is given; most other 36 | options are also ignored. Exits after displaying the names. 37 | .TP 38 | \fB\-f\fR, \fB\-\-force\fR 39 | force the report to continue after the last descriptor index has been 40 | exceeded. The default action is too stop the report when the last descriptor 41 | index has been exceeded. 42 | at 1. 43 | .TP 44 | \fB\-h\fR, \fB\-\-help\fR 45 | output the usage message then exit. 46 | .TP 47 | \fB\-H\fR, \fB\-\-hex\fR 48 | output the response (less the CRC field) in hexadecimal. 49 | .TP 50 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 51 | starting phy event list descriptor index. \fIIN\fR is a value between 0 and 52 | 65535. The default is 1. If \fIIN\fR is 0 then the response should contain 53 | no phy event list descriptors but the 'last phy event list descriptor index' 54 | and 'phy event list descriptor length' fields in the response should be set 55 | appropriately. The last point was clarified in SPL\-2 revision 3. 56 | .TP 57 | \fB\-l\fR, \fB\-\-long\fR 58 | prefix each phy event source string with its numeric identifier in hex. 59 | Also place "phy_id=" in front of the phy identifier number. 60 | For example: "phy_id=3: [0x1]: Invalid word count: 29"; without this option 61 | this line would be: "3: Invalid word count: 29". 62 | .TP 63 | \fB\-n\fR, \fB\-\-nonz\fR 64 | only show phy events with non\-zero counts or peak values. The default is to 65 | show all phy events in the response. 66 | .TP 67 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 68 | interface specific parameters. In this case "interface" refers to the 69 | path through the operating system to the SMP initiator. See the smp_utils 70 | man page for more information. 71 | .TP 72 | \fB\-r\fR, \fB\-\-raw\fR 73 | send the response (less the CRC field) to stdout in binary. All error 74 | messages are sent to stderr. 75 | .TP 76 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 77 | specifies the SAS address of the SMP target device. Typically this is an 78 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 79 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 80 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 81 | either prefix it with '0x' or put a trailing 'h' on it. 82 | .TP 83 | \fB\-v\fR, \fB\-\-verbose\fR 84 | increase the verbosity of the output. Can be used multiple times 85 | .TP 86 | \fB\-V\fR, \fB\-\-version\fR 87 | print the version string and then exit. 88 | .SH NOTES 89 | Similar information is maintained for SAS SSP target phys (e.g. on a SAS 90 | disk). It can be obtained from the Protocol Specific Port log page with 91 | the sg_logs utility. 92 | .PP 93 | Similar information may be obtained for SAS initiator phys (e.g. on a SAS 94 | HBA). As an example in Linux 2.6.28 error information can be found in this 95 | directory /sys/class/sas_phy/phy\-4:0 (for the phy 0 in SCSI/SAS host 4). 96 | .PP 97 | Similar information may be obtained for SATA device phys (e.g. on a SATA 98 | disk). If there is a SAT layer between OS and the SATA device then the 99 | sg_sat_phy_event utility can fetch the information. 100 | .SH CONFORMING TO 101 | The SMP REPORT PHY EVENT LIST function was introduced in SAS\-2 . 102 | .SH AUTHORS 103 | Written by Douglas Gilbert. 104 | .SH "REPORTING BUGS" 105 | Report bugs to . 106 | .SH COPYRIGHT 107 | Copyright \(co 2011 Douglas Gilbert 108 | .br 109 | This software is distributed under a FreeBSD license. There is NO 110 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 111 | .SH "SEE ALSO" 112 | .B smp_utils, smp_phy_control, smp_rep_phy_event(smp_utils) 113 | .B sg_logs, sg_sat_phy_event(sg3_utils) 114 | -------------------------------------------------------------------------------- /doc/smp_rep_phy_sata.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_PHY_SATA "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_phy_sata \- invoke REPORT PHY SATA SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_phy_sata 6 | [\fI\-\-affiliation=AC\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] 9 | [\fI\-\-zero\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT PHY SATA request 14 | function to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 16 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 17 | uses \fISMP_DEVICE\fR to identify an HBA (an SMP initiator) and needs the 18 | additional \fI,N\fR to differentiate between HBAs if there are multiple 19 | present. 20 | .TP 21 | \fB\-a\fR, \fB\-\-affiliation\fR=\fIAC\fR 22 | where \fIAC\fR is the affiliation context relative identifier that is 23 | placed in request (new in sas2r08). Defaults to 0. 24 | .TP 25 | \fB\-h\fR, \fB\-\-help\fR 26 | output the usage message then exit. 27 | .TP 28 | \fB\-H\fR, \fB\-\-hex\fR 29 | output the response (less the CRC field) in hexadecimal. 30 | .TP 31 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 32 | interface specific parameters. In this case "interface" refers to the 33 | path through the operating system to the SMP initiator. See the smp_utils 34 | man page for more information. 35 | .TP 36 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 37 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 38 | .TP 39 | \fB\-r\fR, \fB\-\-raw\fR 40 | send the response (less the CRC field) to stdout in binary. All error 41 | messages are sent to stderr. 42 | .TP 43 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 44 | specifies the SAS address of the SMP target device. Typically this is an 45 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 46 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 47 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 48 | either prefix it with '0x' or put a trailing 'h' on it. 49 | .TP 50 | \fB\-v\fR, \fB\-\-verbose\fR 51 | increase the verbosity of the output. Can be used multiple times 52 | .TP 53 | \fB\-V\fR, \fB\-\-version\fR 54 | print the version string and then exit. 55 | .TP 56 | \fB\-z\fR, \fB\-\-zero\fR 57 | zero the Allocated Response Length field in the request. This option 58 | also zeros the Request Length field in the request. This is required 59 | for strict SAS\-1.1 compliance. However this option should not be 60 | given in SAS\-2 and later; if it is given an abridged response may result. 61 | .SH EXAMPLES 62 | See "Examples" section in http://sg.danny.cz/sg/smp_utils.html 63 | .SH CONFORMING TO 64 | The SMP REPORT PHY SATA function was introduced in SAS\-1 . 65 | The "Expander change count", "STP I_T nexus loss occurred" and several other 66 | fields were added in SAS\-2 . 67 | .SH AUTHORS 68 | Written by Douglas Gilbert. 69 | .SH "REPORTING BUGS" 70 | Report bugs to . 71 | .SH COPYRIGHT 72 | Copyright \(co 2006\-2011 Douglas Gilbert 73 | .br 74 | This software is distributed under a FreeBSD license. There is NO 75 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 76 | .SH "SEE ALSO" 77 | .B smp_utils, smp_phy_control(smp_utils) 78 | -------------------------------------------------------------------------------- /doc/smp_rep_route_info.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_ROUTE_INFO "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_route_info \- invoke REPORT ROUTE INFORMATION SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_route_info 6 | [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-index=IN\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-multiple\fR] [\fI\-\-num=NUM\fR] 8 | [\fI\-\-phy=ID\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zero\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT ROUTE INFORMATION 14 | function request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the interface, the 16 | \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 17 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 18 | additional \fI,N\fR to differentiate between HBAs if there are multiple 19 | present. 20 | .PP 21 | There are two expander route table types: phy\-based and expander\-based. 22 | The expander\-based route table was introduced in SAS\-2 and supersedes the 23 | phy\-based route tables. The REPORT ROUTE INFORMATION function is associated 24 | with a phy\-based route table. The CONFIGURE ROUTE INFORMATION function 25 | is provided to manually set up a phy\-based route table. 26 | .PP 27 | Each phy in a SAS expander that has an associated routing attribute 28 | of "table" has a router table. The number of rows (or entries) in 29 | each router table is given by the "expander route indexes" field 30 | in the response of the REPORT GENERAL function. 31 | .PP 32 | When the \fI\-\-multiple\fR option is given, the REPORT ROUTE INFORMATION 33 | function is called multiple times. The index value increments on 34 | each iteration, starting from \fI\-\-index=IN\fR (default 0). If 35 | \fI\-\-num=NUM\fR is given and \fINUM\fR is greater than zero then that is 36 | the maximum number of iterations performed. If \fI\-\-num=NUM\fR is not 37 | given (or \fINUM\fR is zero) then iterations continue until there are 4 38 | adjacent disabled route entries (or some error is detected). 39 | .SH OPTIONS 40 | Mandatory arguments to long options are mandatory for short options as well. 41 | .TP 42 | \fB\-h\fR, \fB\-\-help\fR 43 | output the usage message then exit. 44 | .TP 45 | \fB\-H\fR, \fB\-\-hex\fR 46 | output the response (less the CRC field) in hexadecimal. 47 | .TP 48 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 49 | expander route index. \fIIN\fR is a value between 0 and 65535. Default is 0. 50 | More precisely the maximum index value is (expander_route_indexes \- 1). 51 | .TP 52 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 53 | interface specific parameters. In this case "interface" refers to the 54 | path through the operating system to the SMP initiator. See the smp_utils 55 | man page for more information. 56 | .TP 57 | \fB\-m\fR, \fB\-\-multiple\fR 58 | call the REPORT ROUTE INFORMATION function multiple times, starting at 59 | \fI\-\-index=IN\fR, incrementing the index value on each iteration for a 60 | maximum of \fI\-\-num=NUM\fR iterations. For each enabled route table entry, 61 | one line is output. If \fI\-\-num=NUM\fR is not given (or \fINUM\fR is zero) 62 | then iterations continue until 4 adjacent disabled entries are found (or 63 | some error occurs). 64 | .TP 65 | \fB\-n\fR, \fB\-\-num\fR=\fINUM\fR 66 | used with \fI\-\-multiple\fR option to specify the maximum number of 67 | iterations. 68 | .TP 69 | \fB\-p\fR, \fB\-\-phy\fR=\fIID\fR 70 | phy identifier. \fIID\fR is a value between 0 and 254. Default is 0. 71 | .TP 72 | \fB\-r\fR, \fB\-\-raw\fR 73 | send the response (less the CRC field) to stdout in binary. All error 74 | messages are sent to stderr. 75 | .TP 76 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 77 | specifies the SAS address of the SMP target device. Typically this is an 78 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 79 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 80 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 81 | either prefix it with '0x' or put a trailing 'h' on it. 82 | .TP 83 | \fB\-v\fR, \fB\-\-verbose\fR 84 | increase the verbosity of the output. Can be used multiple times. 85 | .TP 86 | \fB\-V\fR, \fB\-\-version\fR 87 | print the version string and then exit. 88 | .TP 89 | \fB\-z\fR, \fB\-\-zero\fR 90 | zero the Allocated Response Length field in the request. This option 91 | also zeros the Request Length field in the request. This is required 92 | for strict SAS\-1.1 compliance. However this option should not be 93 | given in SAS\-2 and later; if it is given an abridged response may result. 94 | .SH CONFORMING TO 95 | The SMP REPORT ROUTE INFORMATION function was introduced in SAS\-1 . 96 | The "Expander change count" field was added in SAS\-2 . 97 | .SH AUTHORS 98 | Written by Douglas Gilbert. 99 | .SH "REPORTING BUGS" 100 | Report bugs to . 101 | .SH COPYRIGHT 102 | Copyright \(co 2006\-2011 Douglas Gilbert 103 | .br 104 | This software is distributed under a FreeBSD license. There is NO 105 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 106 | .SH "SEE ALSO" 107 | .B smp_utils, smp_rep_general(smp_utils) 108 | -------------------------------------------------------------------------------- /doc/smp_rep_self_conf_stat.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_SELF_CONF_STAT "8" "December 2020" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_self_conf_stat \- invoke REPORT SELF\-CONFIGURATION STATUS SMP function 4 | .SH SYNOPSIS 5 | .B smp_rep_self_conf_stat 6 | [\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-index=SDI\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-last\fR] [\fI\-\-one\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] 9 | \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT SELF\-CONFIGURATION STATUS 14 | function request to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 16 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt interface 17 | uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and needs the 18 | additional \fI,N\fR to differentiate between HBAs if there are multiple 19 | present. 20 | .SH OPTIONS 21 | Mandatory arguments to long options are mandatory for short options as well. 22 | .TP 23 | \fB\-b\fR, \fB\-\-brief\fR 24 | lessen the amount of header information output and compress each self 25 | configuration status descriptor to one line of output. 26 | .TP 27 | \fB\-h\fR, \fB\-\-help\fR 28 | output the usage message then exit. 29 | .TP 30 | \fB\-H\fR, \fB\-\-hex\fR 31 | output the response (less the CRC field) in hexadecimal. 32 | .TP 33 | \fB\-i\fR, \fB\-\-index\fR=\fISDI\fR 34 | \fISDI\fR is the starting self\-configuration status descriptor index, an 35 | integer in the range 0 to 65535. The default value is 1 . If \fISDI\fR is 0 36 | then no descriptors are placed in the response plus the "starting 37 | self\-configuration status descriptor index" and "total number of 38 | self\-configuration status descriptors" fields in the response are both set 39 | to 0. That makes setting \fISDI\fR to 0 a lot less useful that it could have 40 | been. \fISDI\fR may be decimal (default) or 41 | hexadecimal prefixed by '0x' (or '0X') or with a 'h' (or 'H') suffix. 42 | .TP 43 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 44 | interface specific parameters. In this case "interface" refers to the 45 | path through the operating system to the SMP initiator. See the smp_utils 46 | man page for more information. 47 | .TP 48 | \fB\-l\fR, \fB\-\-last\fR 49 | Sends a REPORT SELF\-CONFIGURATION STATUS request to find out the contents 50 | of the "last self\-configuration status descriptor index" field in the 51 | response. If it is different from \fISDI\fR then it re\-issues that request 52 | with the "starting self\-configuration status descriptor index" field set 53 | to the "last" value. Often only the last (i.e. most recent) recorded 54 | descriptor is of interest and that is what this option should show. In 55 | cases there may be more than one descriptor starting at the last index. 56 | .TP 57 | \fB\-o\fR, \fB\-\-one\fR 58 | If multiple self\-configuration status descriptors are found, then only 59 | output the first one. 60 | .TP 61 | \fB\-r\fR, \fB\-\-raw\fR 62 | send the response (less the CRC field) to stdout in binary. All error 63 | messages are sent to stderr. 64 | .TP 65 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 66 | specifies the SAS address of the SMP target device. The mpt interface needs 67 | this option and it will typically be an expander's SAS address. The 68 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 69 | To give a number in hexadecimal either prefix it with '0x' or put a 70 | trailing 'h' on it. 71 | .TP 72 | \fB\-v\fR, \fB\-\-verbose\fR 73 | increase the verbosity of the output. Can be used multiple times. 74 | .TP 75 | \fB\-V\fR, \fB\-\-version\fR 76 | print the version string and then exit. 77 | .SH NOTES 78 | The "last self\-configuration status descriptor index" field in the response 79 | may indicate the lowest index of the last recorded (i.e. most recent) "clump" 80 | of status descriptors placed in the expander's storage. 81 | .PP 82 | This utility flags the "last self\-configuration status descriptor index" 83 | descriptor in its output with a ">>>" indication. For brief output the 84 | descriptor line starts with ">>>" while for normal output (i.e. when 85 | \fI\-\-brief\fR not given) the index has ">>>" placed in front of it. 86 | .SH CONFORMING TO 87 | The SMP REPORT SELF\-CONFIGURATION STATUS function was introduced in SAS\-2 . 88 | .SH AUTHORS 89 | Written by Douglas Gilbert. 90 | .SH "REPORTING BUGS" 91 | Report bugs to . 92 | .SH COPYRIGHT 93 | Copyright \(co 2011\-2020 Douglas Gilbert 94 | .br 95 | This software is distributed under a FreeBSD license. There is NO 96 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 97 | .SH "SEE ALSO" 98 | .B smp_utils, smp_rep_general, smp_discover, smp_discover_list(smp_utils) 99 | -------------------------------------------------------------------------------- /doc/smp_rep_zone_man_pass.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_ZONE_MAN_PASS "8" "May 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_rep_zone_man_pass \- invoke REPORT ZONE MANAGER PASSWORD function 4 | .SH SYNOPSIS 5 | .B smp_rep_zone_man_pass 6 | [\fI\-\-fpass=FP\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-phex\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-report=RT\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] 9 | [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) REPORT ZONE MANAGER PASSWORD 14 | function requests to an SMP target. The SMP target is identified by the 15 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 16 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 17 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 18 | needs the additional \fI,N\fR to differentiate between HBAs if there are 19 | multiple present. 20 | .SH OPTIONS 21 | Mandatory arguments to long options are mandatory for short options as well. 22 | .TP 23 | \fB\-F\fR, \fB\-\-fpass\fR=\fIFP\fR 24 | where \fIFP\fR is the name of a file which the password will be written to. 25 | The default action (in the absence of this option) is to write the password 26 | to stdout. 27 | .TP 28 | \fB\-h\fR, \fB\-\-help\fR 29 | output the usage message then exit. 30 | .TP 31 | \fB\-H\fR, \fB\-\-hex\fR 32 | output the response (less the CRC field) in hexadecimal. To only see the 33 | password in hexadecimal use the \fI\-\-phex\fR option. 34 | .TP 35 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 36 | interface specific parameters. In this case "interface" refers to the 37 | path through the operating system to the SMP initiator. See the smp_utils 38 | man page for more information. 39 | .TP 40 | \fB\-p\fR, \fB\-\-phex\fR 41 | Output the password in comma separated hexadecimal bytes. In the absence 42 | of this option the password is output in ASCII surrounded by single quotes. 43 | Note the hexadecimal bytes are output with a hex indication (i.e. there is 44 | nos leading "0x" nor trailing "h"). 45 | .TP 46 | \fB\-r\fR, \fB\-\-raw\fR 47 | send the response (less the CRC field) to stdout in binary. All error 48 | messages are sent to stderr. 49 | .TP 50 | \fB\-R\fR, \fB\-\-report\fR=\fIRT\fR 51 | set the 'report type' field in the SMP request. \fIRT\fR may take these 52 | values: 0 for report the current zone manager password (default); 1 is 53 | reserved; 2 for report the saved zone manager password; 3 for report the 54 | default zone manager password. 55 | .TP 56 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 57 | specifies the SAS address of the SMP target device. The mpt interface needs 58 | this option and it will typically be an expander's SAS address. The 59 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 60 | To give a number in hexadecimal either prefix it with '0x' or put a 61 | trailing 'h' on it. 62 | .TP 63 | \fB\-v\fR, \fB\-\-verbose\fR 64 | increase the verbosity of the output. Can be used multiple times. 65 | .TP 66 | \fB\-V\fR, \fB\-\-version\fR 67 | print the version string and then exit. 68 | .SH CONFORMING TO 69 | The SMP REPORT ZONE MANAGER PASSWORD function was introduced in SAS\-2 . 70 | .SH AUTHORS 71 | Written by Douglas Gilbert. 72 | .SH "REPORTING BUGS" 73 | Report bugs to . 74 | .SH COPYRIGHT 75 | Copyright \(co 2011 Douglas Gilbert 76 | .br 77 | This software is distributed under a FreeBSD license. There is NO 78 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 79 | .SH "SEE ALSO" 80 | .B smp_utils, smp_conf_zone_man_pass, smp_zone_lock(smp_utils) 81 | -------------------------------------------------------------------------------- /doc/smp_rep_zone_perm_tbl.8: -------------------------------------------------------------------------------- 1 | .TH SMP_REP_ZONE_PERM_TBL "8" "February 2023" "smp_utils\-1.00" SMP_UTILS 2 | .SH NAME 3 | smp_rep_zone_perm_tbl \- invoke REPORT ZONE PERMISSION TABLE function 4 | .SH SYNOPSIS 5 | .B smp_rep_zone_perm_tbl 6 | [\fI\-\-append\fR] [\fI\-\-bits=COL\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-multiple\fR] [\fI\-\-nocomma\fR] 8 | [\fI\-\-num=MD\fR] [\fI\-\-permf=FN\fR] [\fI\-\-raw\fR] 9 | [\fI\-\-report=RT\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-start=SS\fR] 10 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] 11 | \fISMP_DEVICE[,N]\fR 12 | .SH DESCRIPTION 13 | .\" Add any additional description here 14 | .PP 15 | Sends one or more SAS Serial Management Protocol (SMP) REPORT ZONE PERMISSION 16 | TABLE function requests to an SMP target. The SMP target is identified by the 17 | \fISMP_DEVICE\fR and the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, 18 | the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The mpt 19 | interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) and 20 | needs the additional \fI,N\fR to differentiate between HBAs if there are 21 | multiple present. 22 | .PP 23 | This SMP function returns zone permission descriptors which represent rows 24 | of the zone permission table. There is a row for each source zone group 25 | starting at zone group 0 and finishing at zone group 127 or zone group 255. 26 | Due to the SMP response size restriction of 1028 bytes (including trailing 27 | CRC), not all the zone permission table rows can be returned in one 28 | REPORT ZONE PERMISSION TABLE function response. So multiple function calls 29 | may be required with the \fI\-\-start=SS\fR option being used on the latter 30 | calls to specify the next starting source zone group. 31 | .PP 32 | The \fI\-\-multiple\fR option will send multiple REPORT ZONE PERMISSION 33 | TABLE requests until all source zone groups (or starting from 34 | \fI\-\-start=SS\fR) are output. This option is the most convenient way 35 | to output the whole zone permission table. In the absence of the 36 | \fI\-\-multiple\fR option only one REPORT ZONE PERMISSION TABLE request is 37 | sent. 38 | .PP 39 | The output of this utility is designed to be useful as input to the 40 | smp_conf_zone_perm_tbl utility. In other words these utilities can be 41 | used to save and restore zone permission table settings. 42 | .SH OPTIONS 43 | Mandatory arguments to long options are mandatory for short options as well. 44 | .TP 45 | \fB\-a\fR, \fB\-\-append\fR 46 | used in conjunction with \fI\-\-permf=FN\fR to append to \fIFN\fR if it 47 | already exists. If \fIFN\fR does not exist then it is created. 48 | .TP 49 | \fB\-B\fR, \fB\-\-bits\fR=\fICOL\fR 50 | This is an alternate zone permission table representation showing single bits 51 | with the origin (i.e. ZP[0,0]) in the top left. The output is a bit array 52 | with \fICOL\fR columns and up to \fICOL\fR rows. This output resembles the 53 | example zone permission tables shown in the SAS draft documents (at t10.org). 54 | The default (i.e. without this option) is output that reflects the byte 55 | oriented, big endian nature of SCSI (and hence SMP) commands. The output 56 | produced by this option is not suitable as input for the 57 | smp_conf_zone_perm_tbl utility. 58 | .TP 59 | \fB\-f\fR, \fB\-\-start\fR=\fISS\fR 60 | starting (first and lowest numbered) source zone group (default: zone group 61 | 0). 62 | .TP 63 | \fB\-h\fR, \fB\-\-help\fR 64 | output the usage message then exit. 65 | .TP 66 | \fB\-H\fR, \fB\-\-hex\fR 67 | output the response (less the CRC field) in hexadecimal. 68 | .TP 69 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 70 | interface specific parameters. In this case "interface" refers to the 71 | path through the operating system to the SMP initiator. See the smp_utils 72 | man page for more information. 73 | .TP 74 | \fB\-m\fR, \fB\-\-multiple\fR 75 | starting at source zone group 0 (or \fISS\fR), multiple REPORT ZONE 76 | PERMISSION TABLE requests are issued until the last (127th and 255th) 77 | source zone descriptor is output. This option should not be given 78 | together with the \fI\-\-num=MD\fR option. 79 | .TP 80 | \fB\-N\fR, \fB\-\-nocomma\fR 81 | output each zone group descriptor as a long string of hexadecimal digits, 82 | two digits per byte. Default action is to output a comma separated list of 83 | hexadecimal ASCII bytes for each zone group descriptor. 84 | .TP 85 | \fB\-n\fR, \fB\-\-num\fR=\fIMD\fR 86 | where \fIMD\fR is the maximum number of descriptors that can be reported 87 | in the one response. The default value is 63. 63 is the maximum number 88 | of "128 zone groups" sized descriptors that can fit in one response. If the 89 | expander is using "256 zone groups" sized descriptors then a maximum of 31 90 | descriptors can fit in one response. This option should not be given 91 | together with the \fI\-\-multiple\fR option. 92 | .TP 93 | \fB\-P\fR, \fB\-\-permf\fR=\fIFN\fR 94 | \fIFN\fR is a file to write the zone permission descriptors to. The default 95 | action is to output the zone permissions descriptors to stdout. Note that the 96 | whole permissions table may not fit in one response. If the \fIFN\fR exists 97 | then it is truncated prior to the write unless \fI\-\-append\fR is given. To 98 | append to the existing \fIFN\fR add the \fI\-\-append\fR option. 99 | .TP 100 | \fB\-r\fR, \fB\-\-raw\fR 101 | send the response (less the CRC field) to stdout in binary. All error 102 | messages are sent to stderr. 103 | .TP 104 | \fB\-R\fR, \fB\-\-report\fR=\fIRT\fR 105 | set the 'report type' field in the SMP request. \fIRT\fR may take these 106 | values: 0 for report current values (default); 1 for report the shadow 107 | values; 2 for report saved values; 3 for report default values. 108 | .TP 109 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 110 | specifies the SAS address of the SMP target device. The mpt interface needs 111 | this option and it will typically be an expander's SAS address. The 112 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 113 | To give a number in hexadecimal either prefix it with '0x' or put a 114 | trailing 'h' on it. 115 | .TP 116 | \fB\-f\fR, \fB\-\-start\fR=\fISS\fR 117 | See entry above, listed in order by its short option letter (i.e. 118 | \fI\-f\fR). 119 | .TP 120 | \fB\-v\fR, \fB\-\-verbose\fR 121 | increase the verbosity of the output. Can be used multiple times. 122 | .TP 123 | \fB\-V\fR, \fB\-\-version\fR 124 | print the version string and then exit. 125 | .SH NOTES 126 | When the \fI\-\-permf=FN\fR is given and \fISS\fR is greater than zero 127 | then a line of the form "\-\-start=\fISS\fR" is written to \fIFN\fR 128 | just prior to the first row of zone permissions. 129 | .PP 130 | There are some examples of the \fI\-\-permf=FN\fR format in the examples 131 | directory. 132 | .SH CONFORMING TO 133 | The SMP REPORT ZONE PERMISSION TABLE function was introduced in SAS\-2 . 134 | .SH AUTHORS 135 | Written by Douglas Gilbert. 136 | .SH "REPORTING BUGS" 137 | Report bugs to . 138 | .SH COPYRIGHT 139 | Copyright \(co 2011\-2023 Douglas Gilbert 140 | .br 141 | This software is distributed under a FreeBSD license. There is NO 142 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 143 | .SH "SEE ALSO" 144 | .B smp_utils, smp_conf_zone_perm_tbl, smp_zone_lock(smp_utils) 145 | -------------------------------------------------------------------------------- /doc/smp_write_gpio.8: -------------------------------------------------------------------------------- 1 | .TH SMP_WRITE_GPIO "8" "August 2011" "smp_utils\-0.97" SMP_UTILS 2 | .SH NAME 3 | smp_write_gpio \- invoke WRITE GPIO REGISTER (ENHANCED) SMP function 4 | .SH SYNOPSIS 5 | .B smp_write_gpio 6 | [\fI\-\-count=CO\fR] [\fI\-\-data=H,H...\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-index=IN\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-type=TY\fR] [\fI\-\-verbose\fR] 9 | [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) WRITE GPIO REGISTER or a WRITE 14 | GPIO REGISTER ENHANCED function request to an SMP target. The SMP target is 15 | identified by the \fISMP_DEVICE\fR and the \fISAS_ADDR\fR. Depending on the 16 | interface, the \fISAS_ADDR\fR may be deduced from the \fISMP_DEVICE\fR. The 17 | mpt interface uses \fISMP_DEVICE\fR to identify a HBA (an SMP initiator) 18 | and needs the additional \fI,N\fR to differentiate between HBAs if there 19 | are multiple present. 20 | .PP 21 | This function is defined in SFF\-8485 ( see www.sffcommittee.com ) together 22 | with its corresponding READ GPIO REGISTER (ENHANCED) SMP function. 23 | The other SMP functions are defined in SAS documents at www.t10.org . 24 | SFF\-8485 defines a curious device called a "virtual SMP port" 25 | that lives in a host bus adapter (HBA) and allows SMP to manipulate 26 | the sideband signals in wide internal cables. To stop other initiators 27 | in a multi\-initiator domain from accessing those sideband signals, 28 | the virtual SMP (target) port is not indicated in a DISCOVER response. 29 | .PP 30 | For notes on the SMP WRITE GPIO REGISTER ENHANCED function see the section 31 | on the ENHANCED FUNCTION below. 32 | .SH OPTIONS 33 | Mandatory arguments to long options are mandatory for short options as well. 34 | .TP 35 | \fB\-c\fR, \fB\-\-count\fR=\fICO\fR 36 | where \fICO\fR is the register count. This is the number of (4 byte) 37 | registers to send. The default value is 1. 38 | .TP 39 | \fB\-d\fR, \fB\-\-data\fR=\fIH,H...\fR 40 | this option supplies a comma separated list of hexadecimal bytes (0 to 41 | ff inclusive) that will be used as write data in the WRITE GPIO REGISTER 42 | request. The number of bytes supplied should be four times \fI\-\-count=C\fR 43 | The first 4 bytes will become the first register written. 44 | .TP 45 | \fB\-d\fR, \fB\-\-data\fR=\fB-\fR 46 | reads string of hexadecimal bytes from stdin. Spaces, tabs and line feeds 47 | additionally are permitted as separators. 48 | .TP 49 | \fB\-E\fR, \fB\-\-enhanced\fR 50 | sends a WRITE GPIO REGISTER ENHANCED function request (default: send a WRITE 51 | GPIO REGISTER function request). 52 | .TP 53 | \fB\-h\fR, \fB\-\-help\fR 54 | output the usage message then exit. 55 | .TP 56 | \fB\-H\fR, \fB\-\-hex\fR 57 | output the response (less the CRC field) in hexadecimal. 58 | .TP 59 | \fB\-i\fR, \fB\-\-index\fR=\fIIN\fR 60 | where \fIIN\fR is the register index. This value is origin zero and its 61 | default value is 0. The request will send \fI\-\-count=CO\fR registers 62 | starting from \fI\-\-index=IN\fR of the given \fI\-\-type=TY\fR. 63 | .TP 64 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 65 | interface specific parameters. In this case "interface" refers to the 66 | path through the operating system to the SMP initiator. See the smp_utils 67 | man page for more information. 68 | .TP 69 | \fB\-r\fR, \fB\-\-raw\fR 70 | send the response (less the CRC field) to stdout in binary. All error 71 | messages are sent to stderr. 72 | .TP 73 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 74 | specifies the SAS address of the SMP target device. Typically this is an 75 | expander. This option may not be needed if the \fISMP_DEVICE\fR has the 76 | target's SAS address within it. The \fISAS_ADDR\fR is in decimal but most 77 | SAS addresses are shown in hexadecimal. To give a number in hexadecimal 78 | either prefix it with '0x' or put a trailing 'h' on it. 79 | .TP 80 | \fB\-t\fR, \fB\-\-type\fR=\fITY\fR 81 | where \fITY\fR is the register type. The default value is 0 (GPIO_CFG). 82 | The request will send \fI\-\-count=CO\fR registers starting from 83 | \fI\-\-index=IN\fR of the given \fI\-\-type=TY\fR. 84 | .TP 85 | \fB\-v\fR, \fB\-\-verbose\fR 86 | increase the verbosity of the output. Can be used multiple times. 87 | .TP 88 | \fB\-V\fR, \fB\-\-version\fR 89 | print the version string and then exit. 90 | .SH ENHANCED FUNCTION 91 | In the technical review of SAS\-2 prior to standardization in this t10 92 | document: 08\-212r8.pdf (page 871 or 552) there is a comment that the 93 | READ GPIO REGISTER and WRITE GPIO REGISTER function headers (i.e. first 94 | 4 bytes) do not comply with all the other SMP functions in SAS\-2. 95 | .PP 96 | There is a suggestion that enhanced variants be introduced in the next 97 | version of the SFF\-8485 document. If that ever happened then it has 98 | not been made public. In SAS\-2.1 both the READ and WRITE GPIO REGISTER 99 | functions have been made obsolete and the corresponding ENHANCED function 100 | numbers are "restricted" for SFF\-8485. 101 | .PP 102 | If the \fI\-\-enhanced\fR option is given then the ENHANCED function 103 | number is sent; the register type, index and count fields (1 byte each) 104 | are increased by two byte positions leaving enough space for a compliant 105 | SAS\-2 SMP header to be built. 106 | .SH CONFORMING TO 107 | The SMP WRITE GPIO REGISTER function is defined in SFF\-8485 (see 108 | www.sffcommittee.com ) together with its corresponding READ 109 | GPIO REGISTER SMP function. 110 | .SH AUTHORS 111 | Written by Douglas Gilbert. 112 | .SH "REPORTING BUGS" 113 | Report bugs to . 114 | .SH COPYRIGHT 115 | Copyright \(co 2006\-2011 Douglas Gilbert 116 | .br 117 | This software is distributed under a FreeBSD license. There is NO 118 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 119 | .SH "SEE ALSO" 120 | .B smp_utils, smp_read_gpio(smp_utils) 121 | -------------------------------------------------------------------------------- /doc/smp_zone_activate.8: -------------------------------------------------------------------------------- 1 | .TH SMP_ZONE_ACTIVATE "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_zone_activate \- invoke ZONE ACTIVATE SMP function 4 | .SH SYNOPSIS 5 | .B smp_zone_activate 6 | [\fI\-\-expected=EX\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] 7 | [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 8 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 9 | .SH DESCRIPTION 10 | .\" Add any additional description here 11 | .PP 12 | Sends a SAS Serial Management Protocol (SMP) ZONE ACTIVATE function request 13 | to an SMP target. The SMP target is identified by the \fISMP_DEVICE\fR and 14 | the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, the \fISAS_ADDR\fR may 15 | be deduced from the \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 16 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 17 | differentiate between HBAs if there are multiple present. 18 | .PP 19 | This function, if successful, will cause various zoning related shadow 20 | values (e.g. zone permission table and zone phy information) to be copied 21 | to the corresponding current values. If the saving to "saved" values option 22 | has been selected then the various zoning related shadow values will also 23 | be copied to the corresponding saved values. 24 | .SH OPTIONS 25 | Mandatory arguments to long options are mandatory for short options as well. 26 | .TP 27 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 28 | set the 'expected expander change count' field in the SMP request. 29 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 30 | value. When \fIEX\fR is greater than zero then if the value doesn't match 31 | the expander change count of the SMP target (i.e. the expander) when 32 | the request arrives then the target ignores the request and sets a 33 | function result of "invalid expander change count" in the response. 34 | .TP 35 | \fB\-h\fR, \fB\-\-help\fR 36 | output the usage message then exit. 37 | .TP 38 | \fB\-H\fR, \fB\-\-hex\fR 39 | output the response (less the CRC field) in hexadecimal. 40 | .TP 41 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 42 | interface specific parameters. In this case "interface" refers to the 43 | path through the operating system to the SMP initiator. See the smp_utils 44 | man page for more information. 45 | .TP 46 | \fB\-r\fR, \fB\-\-raw\fR 47 | send the response (less the CRC field) to stdout in binary. All error 48 | messages are sent to stderr. 49 | .TP 50 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 51 | specifies the SAS address of the SMP target device. The mpt interface needs 52 | this option and it will typically be an expander's SAS address. The 53 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 54 | To give a number in hexadecimal either prefix it with '0x' or put a 55 | trailing 'h' on it. 56 | .TP 57 | \fB\-v\fR, \fB\-\-verbose\fR 58 | increase the verbosity of the output. Can be used multiple times. 59 | .TP 60 | \fB\-V\fR, \fB\-\-version\fR 61 | print the version string and then exit. 62 | .SH CONFORMING TO 63 | The SMP ZONE ACTIVATE function was introduced in SAS\-2 . 64 | .SH AUTHORS 65 | Written by Douglas Gilbert. 66 | .SH "REPORTING BUGS" 67 | Report bugs to . 68 | .SH COPYRIGHT 69 | Copyright \(co 2011 Douglas Gilbert 70 | .br 71 | This software is distributed under a FreeBSD license. There is NO 72 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 73 | .SH "SEE ALSO" 74 | .B smp_utils, smp_zone_lock, smp_zone_unlock, smp_ena_dis_zoning(smp_utils) 75 | -------------------------------------------------------------------------------- /doc/smp_zone_lock.8: -------------------------------------------------------------------------------- 1 | .TH SMP_ZONE_LOCK "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_zone_lock \- invoke ZONE LOCK SMP function 4 | .SH SYNOPSIS 5 | .B smp_zone_lock 6 | [\fI\-\-expected=EX\fR] [\fI\-\-fpass=FP\fR] [\fI\-\-help\fR] 7 | [\fI\-\-hex\fR] [\fI\-\-inactivity=TL\fR] [\fI\-\-interface=PARAMS\fR] 8 | [\fI\-\-password=PA\fR] [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) ZONE LOCK function request to an 14 | SMP target. The SMP target is identified by the \fISMP_DEVICE\fR and the 15 | \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, the \fISAS_ADDR\fR may 16 | be deduced from the \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 17 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 18 | differentiate between HBAs if there are multiple present. 19 | .SH OPTIONS 20 | Mandatory arguments to long options are mandatory for short options as well. 21 | .TP 22 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 23 | set the 'expected expander change count' field in the SMP request. 24 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 25 | value. When \fIEX\fR is greater than zero then if the value doesn't match 26 | the expander change count of the SMP target (i.e. the expander) when 27 | the request arrives then the target ignores the request and sets a 28 | function result of "invalid expander change count" in the response. 29 | .TP 30 | \fB\-F\fR, \fB\-\-fpass\fR=\fIFP\fR 31 | where \fIFP\fR is the name of a file which contains the password. The 32 | password may be in ASCII in which case it is on one line surrounded by either 33 | single quotes are double quotes. Alternatively the password may be given in 34 | ASCII hexadecimal; either as bytes separated by space, tab, comma or 35 | newline, or as longer strings of hexadecimal bytes in which every 2 digits 36 | represents a byte. Empty lines and those starting with "#" are ignored. 37 | .TP 38 | \fB\-h\fR, \fB\-\-help\fR 39 | output the usage message then exit. 40 | .TP 41 | \fB\-H\fR, \fB\-\-hex\fR 42 | output the response (less the CRC field) in hexadecimal. 43 | .TP 44 | \fB\-i\fR, \fB\-\-inactivity\fR=\fITL\fR 45 | sets the zone lock inactivity time limit to \fITL\fR which has units of 46 | 100 milliseconds. The default value is 0 which implies no time limit. 47 | .TP 48 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 49 | interface specific parameters. In this case "interface" refers to the 50 | path through the operating system to the SMP initiator. See the smp_utils 51 | man page for more information. 52 | .TP 53 | \fB\-P\fR, \fB\-\-password\fR=\fIPA\fR 54 | where \fIPA\fR is the zone manager password which may be up to 32 bytes 55 | long. This option cannot be give together with the \fI\-\-fpass=FP\fR 56 | option. The default password is 32 NULLs (zero bytes) and \fIPA\fR is 57 | padded with NULLs to the right (to make it 32 bytes long in the request). 58 | .TP 59 | \fB\-r\fR, \fB\-\-raw\fR 60 | send the response (less the CRC field) to stdout in binary. All error 61 | messages are sent to stderr. 62 | .TP 63 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 64 | specifies the SAS address of the SMP target device. The mpt interface needs 65 | this option and it will typically be an expander's SAS address. The 66 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 67 | To give a number in hexadecimal either prefix it with '0x' or put a 68 | trailing 'h' on it. 69 | .TP 70 | \fB\-v\fR, \fB\-\-verbose\fR 71 | increase the verbosity of the output. Can be used multiple times. 72 | .TP 73 | \fB\-V\fR, \fB\-\-version\fR 74 | print the version string and then exit. 75 | .SH CONFORMING TO 76 | The SMP ZONE LOCK function was introduced in SAS\-2 . 77 | .SH AUTHORS 78 | Written by Douglas Gilbert. 79 | .SH "REPORTING BUGS" 80 | Report bugs to . 81 | .SH COPYRIGHT 82 | Copyright \(co 2011 Douglas Gilbert 83 | .br 84 | This software is distributed under a FreeBSD license. There is NO 85 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 86 | .SH "SEE ALSO" 87 | .B smp_utils, smp_zone_activate, smp_zone_unlock, smp_ena_dis_zoning(smp_utils) 88 | -------------------------------------------------------------------------------- /doc/smp_zone_unlock.8: -------------------------------------------------------------------------------- 1 | .TH SMP_ZONE_UNLOCK "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_zone_unlock \- invoke ZONE UNLOCK SMP function 4 | .SH SYNOPSIS 5 | .B smp_zone_unlock 6 | [\fI\-\-activate\fR] [\fI\-\-expected=EX\fR] [\fI\-\-help\fR] 7 | [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] [\fI\-\-raw\fR] 8 | [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] 9 | \fISMP_DEVICE[,N]\fR 10 | .SH DESCRIPTION 11 | .\" Add any additional description here 12 | .PP 13 | Sends a SAS Serial Management Protocol (SMP) ZONE UNLOCK function request to 14 | an SMP target. The SMP target is identified by the \fISMP_DEVICE\fR and the 15 | \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, the \fISAS_ADDR\fR may 16 | be deduced from the \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 17 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 18 | differentiate between HBAs if there are multiple present. 19 | .PP 20 | If this function is successful then a Broadcast (Change) is sent from either 21 | each zone group whose zone permission table entries or zone phy information 22 | has changed; or from zone group 1. Broadcast (Change) should cause a 23 | management application client behind an SMP initiator port (e.g. a SAS HBA) 24 | to start a discover process. 25 | .SH OPTIONS 26 | Mandatory arguments to long options are mandatory for short options as well. 27 | .TP 28 | \fB\-a\fR, \fB\-\-activate\fR 29 | sets the ACTIVATE REQUIRED bit in the function request. When it is set the 30 | function call will fail with a function result of NOT ACTIVATED if the 31 | expander has not "processed the activate step". 32 | .TP 33 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 34 | set the 'expected expander change count' field in the SMP request. 35 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 36 | value. When \fIEX\fR is greater than zero then if the value doesn't match 37 | the expander change count of the SMP target (i.e. the expander) when 38 | the request arrives then the target ignores the request and sets a 39 | function result of "invalid expander change count" in the response. 40 | .TP 41 | \fB\-h\fR, \fB\-\-help\fR 42 | output the usage message then exit. 43 | .TP 44 | \fB\-H\fR, \fB\-\-hex\fR 45 | output the response (less the CRC field) in hexadecimal. 46 | .TP 47 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 48 | interface specific parameters. In this case "interface" refers to the 49 | path through the operating system to the SMP initiator. See the smp_utils 50 | man page for more information. 51 | .TP 52 | \fB\-r\fR, \fB\-\-raw\fR 53 | send the response (less the CRC field) to stdout in binary. All error 54 | messages are sent to stderr. 55 | .TP 56 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 57 | specifies the SAS address of the SMP target device. The mpt interface needs 58 | this option and it will typically be an expander's SAS address. The 59 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 60 | To give a number in hexadecimal either prefix it with '0x' or put a 61 | trailing 'h' on it. 62 | .TP 63 | \fB\-v\fR, \fB\-\-verbose\fR 64 | increase the verbosity of the output. Can be used multiple times. 65 | .TP 66 | \fB\-V\fR, \fB\-\-version\fR 67 | print the version string and then exit. 68 | .SH CONFORMING TO 69 | The SMP ZONE UNLOCK function was introduced in SAS\-2 . 70 | .SH AUTHORS 71 | Written by Douglas Gilbert. 72 | .SH "REPORTING BUGS" 73 | Report bugs to . 74 | .SH COPYRIGHT 75 | Copyright \(co 2011 Douglas Gilbert 76 | .br 77 | This software is distributed under a FreeBSD license. There is NO 78 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 79 | .SH "SEE ALSO" 80 | .B smp_utils, smp_zone_activate, smp_zone_lock, smp_ena_dis_zoning(smp_utils) 81 | -------------------------------------------------------------------------------- /doc/smp_zoned_broadcast.8: -------------------------------------------------------------------------------- 1 | .TH SMP_ZONED_BROADCAST "8" "June 2011" "smp_utils\-0.96" SMP_UTILS 2 | .SH NAME 3 | smp_zoned_broadcast \- invoke ZONED BROADCAST SMP function 4 | .SH SYNOPSIS 5 | .B smp_zoned_broadcast 6 | [\fI\-\-broadcast=BT\fR] [\fI\-\-expected=EX\fR] [\fI\-\-fszg=FS\fR] 7 | [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-interface=PARAMS\fR] 8 | [\fI\-\-raw\fR] [\fI\-\-sa=SAS_ADDR\fR] [\fI\-\-szg=ZGL\fR] 9 | [\fI\-\-verbose\fR] [\fI\-\-version\fR] 10 | \fISMP_DEVICE[,N]\fR 11 | .SH DESCRIPTION 12 | .\" Add any additional description here 13 | .PP 14 | Sends a SAS Serial Management Protocol (SMP) ZONED BROADCAST function request 15 | to an SMP target. The SMP target is identified by the \fISMP_DEVICE\fR and 16 | the \fI\-\-sa=SAS_ADDR\fR. Depending on the interface, the \fISAS_ADDR\fR may 17 | be deduced from the \fISMP_DEVICE\fR. The mpt interface uses \fISMP_DEVICE\fR 18 | to identify a HBA (an SMP initiator) and needs the additional \fI,N\fR to 19 | differentiate between HBAs if there are multiple present. 20 | .PP 21 | This function requires zoning to be enabled. To send a Broadcast (Change) 22 | in the absence of zoning, the least intrusive way seems to be to use 23 | a PHY CONTROL request to send a link reset to an expander phy. 24 | Broadcast (Change) should cause a management application client behind an SMP 25 | initiator port (e.g. a SAS HBA) to start a discover process. 26 | .SH OPTIONS 27 | Mandatory arguments to long options are mandatory for short options as well. 28 | .TP 29 | \fB\-b\fR, \fB\-\-broadcast\fR=\fIBT\fR 30 | \fIBT\fR is the broadcast type, an integer in the range 0 (default) to 15. 31 | Broadcast (Change) corresponds to 0 and will cause SMP initiators that 32 | receive it to do their discover process. Other known broadcast types are 33 | listed in the NOTES section. \fIBT\fR may be decimal (default) or 34 | hexadecimal prefixed by '0x' (or '0X') or with a 'h' (or 'H') suffix. 35 | .TP 36 | \fB\-E\fR, \fB\-\-expected\fR=\fIEX\fR 37 | set the 'expected expander change count' field in the SMP request. 38 | The value \fIEX\fR is from 0 to 65535 inclusive with 0 being the default 39 | value. When \fIEX\fR is greater than zero then if the value doesn't match 40 | the expander change count of the SMP target (i.e. the expander) when 41 | the request arrives then the target ignores the request and sets a 42 | function result of "invalid expander change count" in the response. 43 | In SPL\-1 this field is marked as "restricted (for expected expander 44 | change count)". 45 | .TP 46 | \fB\-F\fR, \fB\-\-fszg\fR=\fIFS\fR 47 | where \fIFS\fR is the name of a file which contains one or more source 48 | zone groups to send a broadcast to. The zone groups can be given in 49 | decimal (default) or hexadecimal prefixed by '0x' (or '0X') or 50 | with a 'h' (or 'H') suffix. A zone group is a number in the range 0 51 | to 255. Each zone group can be separated by space, tab, comma or 52 | newline. Empty lines and those starting with "#" are ignored. 53 | .TP 54 | \fB\-h\fR, \fB\-\-help\fR 55 | output the usage message then exit. 56 | .TP 57 | \fB\-H\fR, \fB\-\-hex\fR 58 | output the response (less the CRC field) in hexadecimal. 59 | .TP 60 | \fB\-I\fR, \fB\-\-interface\fR=\fIPARAMS\fR 61 | interface specific parameters. In this case "interface" refers to the 62 | path through the operating system to the SMP initiator. See the smp_utils 63 | man page for more information. 64 | .TP 65 | \fB\-r\fR, \fB\-\-raw\fR 66 | send the response (less the CRC field) to stdout in binary. All error 67 | messages are sent to stderr. 68 | .TP 69 | \fB\-s\fR, \fB\-\-sa\fR=\fISAS_ADDR\fR 70 | specifies the SAS address of the SMP target device. The mpt interface needs 71 | this option and it will typically be an expander's SAS address. The 72 | \fISAS_ADDR\fR is in decimal but most SAS addresses are shown in hexadecimal. 73 | To give a number in hexadecimal either prefix it with '0x' or put a 74 | trailing 'h' on it. 75 | .TP 76 | \fB\-S\fR, \fB\-\-szg\fR=\fIZGL\fR 77 | one or more source zone groups for broadcast can appear as a comma separated 78 | list \fIZGL\fR. The may be decimal (default) or hexadecimal prefixed by '0x' 79 | (or '0X') or with a 'h' (or 'H') suffix. A zone group is a number in the 80 | range 0 to 255. Either this option or \fI\-\-fszg=FS\fR (but not both) should 81 | be given. 82 | .TP 83 | \fB\-v\fR, \fB\-\-verbose\fR 84 | increase the verbosity of the output. Can be used multiple times. 85 | .TP 86 | \fB\-V\fR, \fB\-\-version\fR 87 | print the version string and then exit. 88 | .SH NOTES 89 | The following is a list of broadcast types: 90 | .br 91 | 0 Broadcast (Change) 92 | .br 93 | 1 Broadcast (Reserved change 0) 94 | .br 95 | 2 Broadcast (Reserved change 1) 96 | .br 97 | 3 Broadcast (SES) 98 | .br 99 | 4 Broadcast (Expander) 100 | .br 101 | 5 Broadcast (Asynchronous event) 102 | .br 103 | 6 Broadcast (Reserved 3) 104 | .br 105 | 7 Broadcast (Reserved 4) 106 | .br 107 | 8 Broadcast (Zone activate) 108 | .PP 109 | The remaining zone types (9 to 15) may be issued by the ZONED BROADCAST 110 | function. 111 | .SH CONFORMING TO 112 | The SMP ZONED BROADCAST function was introduced in SAS\-2 . 113 | .SH AUTHORS 114 | Written by Douglas Gilbert. 115 | .SH "REPORTING BUGS" 116 | Report bugs to . 117 | .SH COPYRIGHT 118 | Copyright \(co 2011 Douglas Gilbert 119 | .br 120 | This software is distributed under a FreeBSD license. There is NO 121 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 122 | .SH "SEE ALSO" 123 | .B smp_utils, smp_zone_lock, smp_zone_unlock, smp_ena_dis_zoning(smp_utils) 124 | -------------------------------------------------------------------------------- /examples/README: -------------------------------------------------------------------------------- 1 | This directory contains scripts and associated files to show how 2 | SAS-2 zoning might be set up and disabled using the utilities 3 | from this package. 4 | 5 | Scripts: 6 | zoning_ex.sh - configure zoning 7 | dis_zoning_ex.sh - disable zoning 8 | t10annex_zoning_ex.sh - configure zoning with permissions as seen 9 | in the SAS-2 Annex example (see below) 10 | 11 | 12 | The zoning_ex.sh script will override any zoning configuration in 13 | place prior to its invocation. The zoning_ex.sh script does not save 14 | any of its new settings to non-volatile storage on the expander. So 15 | when the experimentation is complete, then resetting or power cycling 16 | the expander will restore the previous settings **. 17 | 18 | The zoning_ex.sh script is relatively generic with the tailoring to 19 | a set of zone permissions and mapping of expander phys to zone groups 20 | being done by these two files in this directory: 21 | permf_8i9i.txt *** 22 | pconf_2i2t.txt 23 | or, alternatively the permission file and the phy info file can be given 24 | on the script command line (following the expander device node name). 25 | Note that if pconf_2i2t.txt is used then phy ids will most likely need 26 | to be changed depending on what the expanders phys are connected to. 27 | [Suggestion: examine the output of smp_discover closely to determine 28 | which expander phys are connected to what.] 29 | 30 | The zone permission table can be read back from the expander with the 31 | REPORT ZONE PERMISSION TABLE function. After zoning was set up on the 32 | author's equipment, the smp_rep_zone_perm_tbl utility was called twice, 33 | the second time with the --nocomma option, and the output placed in 34 | these files: 35 | rep_permf_8i9i.txt 36 | rep_nocom_permf_8i9i.txt 37 | Note that the input permission file (i.e. permf_8i9i.txt) was formatted 38 | as if there are only 128 zone groups but the output shows there are 39 | actually 256 zone groups. The expander obviously can cope with this. Also 40 | the smp_rep_zone_perm_tbl utility was called without --multiple so less 41 | than 256 source zone groups are returned. This does not matter since 42 | no zone group above 30 is being used, so all the remaining rows have their 43 | default settings. 44 | 45 | The zone phy information settings can also be read back from the expander. 46 | There is no special function for that since the information is available 47 | in a DISCOVER and DISCOVER LIST response. The smp_discover_list utility 48 | has a --zpi=FN option to create a zone phy information file from the 49 | current expander settings. This file is suitable for the 50 | smp_conf_zone_phy_info utility. 51 | 52 | 53 | The most recent draft of SAS-2 (and later: SPL and SPL-2) at t10.org 54 | contains an annex titled: "Zone permission configuration descriptor 55 | examples". It shows how two descriptors in a CONFIGURE ZONE PERMISSION 56 | TABLE request change the internal zone permission table. One feature 57 | that annex is trying to highlight is that a descriptor not only becomes 58 | a source zone group row in that table, but that its transpose becomes the 59 | corresponding destination zone group column in that table. There is a 60 | reason for highlighting that: not all SAS-2 expanders apply that transpose. 61 | 62 | The t10annex_zoning_ex.sh script starts up zoning based on the zone 63 | permission file permf_t10annex.txt. This will send a CONFIGURE ZONE 64 | PERMISSION TABLE request as shown in the annex example. There is an 65 | associated zone phy control file pconf_all10.txt which puts the first 24 66 | expander phys in zone group 10. If the t10annex_zoning_ex.sh script is 67 | successful then the smp_rep_zone_perm_tbl utility can be used to read the 68 | expander zone permission table. The t10annex_zoning_ex.sh script prints 69 | out a copy of the annex table (Table H.4 in my copy) showing the final state 70 | of the zone permission table. A comparison can then be made between this 71 | and what is read back with 'smp_rep_zone_perm_tbl --bits=13 ' 72 | command. 73 | 74 | 75 | ** Just in case the zone permission table or the zone phy information 76 | is saved, these default files are provided: 77 | def_permf.txt 78 | def_pconf.txt 79 | 80 | *** The permf_8i9i.txt assumes an expander that does not do the descriptor 81 | transpose discussed in the t10 annex example above. This should not 82 | cause a problem on an expander that does perform the descriptor 83 | transpose. 84 | 85 | 86 | Doug Gilbert 87 | 27th January 2012 88 | -------------------------------------------------------------------------------- /examples/def_pconf.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_phy_info --pconf= 3 | # 4 | # Assume an expander with 24 phys. Put all its phys in zone group 1 so 5 | # they can all access one another if zoning is enabled. This seems 6 | # to be the default setting for expanders. 7 | # 8 | # N.B. All values are hex. On each line first byte is phy_id, last byte is 9 | # zone group. All phys that make up a wide port need to be set to the same 10 | # zone group. 11 | 0,0,0,1 12 | 1,0,0,1 13 | 2,0,0,1 14 | 3,0,0,1 15 | 4,0,0,1 16 | 5,0,0,1 17 | 6,0,0,1 18 | 7,0,0,1 19 | 8,0,0,1 20 | 9,0,0,1 21 | a,0,0,1 22 | b,0,0,1 23 | c,0,0,1 24 | d,0,0,1 25 | e,0,0,1 26 | f,0,0,1 27 | 10,0,0,1 28 | 11,0,0,1 29 | 12,0,0,1 30 | 13,0,0,1 31 | 14,0,0,1 32 | 15,0,0,1 33 | 16,0,0,1 34 | 17,0,0,1 35 | 36 | # The default zone permission and phy control files could be used 37 | # with the scripts in this directory to reset a 24 phy expander to its 38 | # zoning defaults (and turn off zoning) like this: 39 | # ./zoning_ex.sh def_permf.txt def_pconf.txt 40 | # ./dis_zoning_ex.sh 41 | -------------------------------------------------------------------------------- /examples/def_permf.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_perm_tbl --permf= --deduce 3 | # 4 | # Assume 128 zone groups (hence 16 byte table entries); note: even 5 | # if expander permits 256 zone groups, it still seems to accept the 6 | # 16 byte table entries format. 7 | # Assume starting source zone group is 0, define 25 descriptors to 8 | # their default permission table settings. 9 | 10 | # N.B. Since SCSI is big endian, the lower bit positions are to the right. 11 | # Each element below is a byte, represented in ASCII hexadecimal. 12 | # 13 | # first zone permission configuration descriptor follows and 14 | # corresponds to source zone group 0 permissions (ZP[0,*]): 15 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 16 | ff,ff,ff,ff,ff,ff,ff,ff ff,ff,ff,ff,ff,ff,ff,ff 17 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 18 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 19 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 20 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 21 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 22 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 23 | 24 | # source ZG 8 25 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 26 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 27 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 28 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 29 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 30 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 31 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 32 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 33 | 34 | # source ZG 16 35 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 36 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 37 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 38 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 39 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 40 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 41 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 42 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 43 | 44 | # source ZG 24 45 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 46 | 47 | # Actually each line can be 16 zeros since the setting of ZG 1 to all 48 | # ones and all other zone groups to have access to ZG 1 is implicit 49 | # (i.e. cannot be overridden). 50 | 51 | # Note that a zoning expander can be asked for its default permission 52 | # table like this: 53 | # smp_rep_zone_perm_tbl --multiple --report=3 54 | 55 | # The default zone permission and phy control files could be used 56 | # with the scripts in this directory to reset a 24 phy expander to its 57 | # zoning defaults (and turn off zoning) like this: 58 | # ./zoning_ex.sh def_permf.txt def_pconf.txt 59 | # ./dis_zoning_ex.sh 60 | -------------------------------------------------------------------------------- /examples/dis_zoning_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is an example script showing a simple SAS-2 disable 4 | # zoning example. It should undo the affect of the associated 5 | # 'zoning_ex.sh' script. If run multiple times or without a 6 | # prior 'zoning_ex.sh' script, then this script is harmless. 7 | 8 | if [ $1 ] ; then 9 | if [ "-h" = $1 ] || [ "--help" = $1 ] ; then 10 | echo "Usage: dis_zoning_ex.sh []" 11 | echo " where:" 12 | echo " expander device node" 13 | echo 14 | echo "dis_zoning_ex.sh disables zoning on . If zoning has " 15 | echo "not been set up this script is harmless. If not given " 16 | echo "defaults to a value within this script which may need editing." 17 | exit 0 18 | fi 19 | fi 20 | 21 | # If the SMP_DEV is not given on the command line then the string 22 | # below will probably need to change. Look at 'ls /dev/bsg' . 23 | if [ $1 ] ; then 24 | SMP_DEV="$1" 25 | else 26 | SMP_DEV="/dev/bsg/expander-6:0" 27 | fi 28 | 29 | # First a SMP ZONE LOCK function is required. Assume the zone manager 30 | # password is zero (i.e. all 32 bytes are zero) or disabled (i.e. all 31 | # 32 bytes 0xff) with the physical presence switch on. 32 | echo "smp_zone_lock $SMP_DEV" 33 | smp_zone_lock $SMP_DEV 34 | res=$? 35 | if [ $res -ne 0 ] ; then 36 | echo "smp_zone_lock failed with exit status: $res" 37 | exit $res 38 | fi 39 | echo 40 | 41 | # Then a SMP ENABLE DISABLE ZONING function is sent. 42 | # Here we disable zoning. 43 | echo "smp_ena_dis_zoning --disable $SMP_DEV" 44 | smp_ena_dis_zoning --disable $SMP_DEV 45 | res=$? 46 | if [ $res -ne 0 ] ; then 47 | echo "smp_ena_dis_zoning failed with exit status: $res" 48 | echo "N.B. about to unlock the zone" 49 | smp_zone_unlock $SMP_DEV 50 | exit $res 51 | fi 52 | echo 53 | 54 | # Almost finished with a SMP ZONE ACTIVATE function being sent. 55 | echo "smp_zone_activate $SMP_DEV" 56 | smp_zone_activate $SMP_DEV 57 | res=$? 58 | if [ $res -ne 0 ] ; then 59 | echo "smp_zone_activate failed with exit status: $res" 60 | echo "N.B. about to unlock the zone" 61 | smp_zone_unlock $SMP_DEV 62 | exit $res 63 | fi 64 | echo 65 | 66 | # And the last active step in the SMP ZONE UNLOCK function being sent. 67 | # This will send a Broadcast (Change) [to any affected phys] so any 68 | # connected servers will "see" the change [by doing a "discover process"]. 69 | echo "smp_zone_unlock $SMP_DEV" 70 | smp_zone_unlock $SMP_DEV 71 | res=$? 72 | if [ $res -ne 0 ] ; then 73 | echo "smp_zone_unlock failed with exit status: $res" 74 | exit $res 75 | fi 76 | echo 77 | 78 | 79 | # To see if anything has happened, call smp_discover_list which uses 80 | # the SMP DISCOVER LIST function. 81 | echo "smp_discover_list $SMP_DEV" 82 | smp_discover_list $SMP_DEV 83 | res=$? 84 | if [ $res -ne 0 ] ; then 85 | echo "smp_smp_discover_list failed with exit status: $res" 86 | fi 87 | echo 88 | # Note that if zoning was previous in effect then the zone groups are 89 | # still shown in the smp_discover_list utility output. However because 90 | # zoning is disabled, the zone groups have no effect. Also the zone 91 | # permission table is still in place but inactive. 92 | -------------------------------------------------------------------------------- /examples/pconf_2i2t.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_phy_info --pconf= 3 | # 4 | # Assume phy ids 0, 1, 2 and 3 are attached to initiator (HBA) doing 5 | # zoning and phy control 6 | # Assume phy ids 20, 21, 22 and 23 are attached to another initiator (HBA) 7 | # Assume phy id 5 is attached to a target (SAS or SATA disk) 8 | # Assume phy id 7 is attached to a target (SAS or SATA disk) 9 | # 10 | # N.B. All values are HEX. On each line first byte is phy_id, last byte is 11 | # zone group. All phys that make up a wide port need to be set to the same 12 | # zone group. 13 | 0,0,0,8 # so phy_id 0 is set to zone group 8 14 | 1,0,0,8 15 | 2,0,0,8 16 | 3,0,0,8 17 | 14,0,0,9 # so phy_id is 20 (14h) 18 | 15,0,0,9 19 | 16,0,0,9 20 | 17,0,0,9 21 | 5,0,0,10 # so this is zone group 16 (10h) 22 | 7,0,0,11 23 | 24 | # To make the disks connected to phy_ids 5 and 7 visible to both initiators, 25 | # place them in ZG 24 (18h). 26 | -------------------------------------------------------------------------------- /examples/pconf_all10.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_phy_info --pconf= 3 | # 4 | # Put all phys in zone group 10 5 | # Assume expander with 24 phys. If larger onlt the first 24 phys will 6 | # be placed in zine group 10. 7 | # 8 | # N.B. All values are hex. On each line first byte is phy_id, last byte is 9 | # zone group. All phys that make up a wide port need to be set to the same 10 | # zone group. 11 | 0,0,0,a 12 | 1,0,0,a 13 | 2,0,0,a 14 | 3,0,0,a 15 | 4,0,0,a 16 | 5,0,0,a 17 | 6,0,0,a 18 | 7,0,0,a 19 | 8,0,0,a 20 | 9,0,0,a 21 | a,0,0,a 22 | b,0,0,a 23 | c,0,0,a 24 | d,0,0,a 25 | e,0,0,a 26 | f,0,0,a 27 | 10,0,0,a 28 | 11,0,0,a 29 | 12,0,0,a 30 | 13,0,0,a 31 | 14,0,0,a 32 | 15,0,0,a 33 | 16,0,0,a 34 | 17,0,0,a 35 | 36 | -------------------------------------------------------------------------------- /examples/permf_8i9i.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_perm_tbl --permf= --deduce 3 | # 4 | # Assume 128 zone groups (hence 16 byte table entries); note: even 5 | # if expander permits 256 zone groups, it still seems to accept the 6 | # 16 byte table entries format. 7 | # Assume starting source zone group is 0, define 25 descriptors 8 | 9 | # ZG0 : can only access ZG1 [cannot modify] 10 | # ZG1 : can access all ZGs [cannot modify] 11 | # ZG2 : access to ZG2 allows zoning and phy changes 12 | # ZG3 : access to ZG3 allows zoned broadcast 13 | # ZG4-7: reserved 14 | # ZG8 : initiator (HBA) zone groups with zoning and phy control 15 | # ZG9-15: other initiator (HBA) zone groups, can't change expander 16 | # ZG16-23: isolated target zone groups (SAS or SATA disk) 17 | # ZG24: common target zone group (SAS or SATA disk) 18 | 19 | # Set up permissions so ZG8 initiators can talk to ZG16 + ZG24 targets; 20 | # ZG9 initiators can talk to ZG17 + ZG24 targets; etc until 21 | # ZG15 initiators can talk to ZG23 + ZG24 targets. 22 | # So initiators (ZG8-15) can talk to ZG24 targets. 23 | # Also ZG8 can access ZG2-3 (so can send zoning and phy changes) 24 | # and ZG9 can access ZG3 (so ZG9 (and ZG8) can send ZONED BROADCAST) 25 | # 26 | # N.B. Since SCSI is big endian, the lower bit positions are to the right. 27 | # Let initiators see themselves (so ZP[8,8]=1 etc). 28 | # Targets don't need to talk to themselves (so ZP[16,16]=0 etc). 29 | # Each element below is a byte, represented in ASCII hexadecimal. 30 | # 31 | # 32 | # first zone permission configuration descriptor follows and 33 | # corresponds to source zone group 0 permissions (ZP[0,*]): 34 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 35 | ff,ff,ff,ff,ff,ff,ff,ff ff,ff,ff,ff,ff,ff,ff,ff 36 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,1,2 37 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,3,2 38 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 39 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 40 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 41 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2 42 | 43 | # source ZG 8 permissions (ZP[8,*]); 8 initiator zone groups follow 44 | 0,0,0,0,0,0,0,0 0,0,0,0,1,1,1,e 45 | 0,0,0,0,0,0,0,0 0,0,0,0,1,2,2,a 46 | 0,0,0,0,0,0,0,0 0,0,0,0,1,4,4,2 47 | 0,0,0,0,0,0,0,0 0,0,0,0,1,8,8,2 48 | 0,0,0,0,0,0,0,0 0,0,0,0,1,10,10,2 49 | 0,0,0,0,0,0,0,0 0,0,0,0,1,20,20,2 50 | 0,0,0,0,0,0,0,0 0,0,0,0,1,40,40,2 51 | 0,0,0,0,0,0,0,0 0,0,0,0,1,80,80,2 52 | 53 | # source ZG 16 permissions (ZP[16,*]); 8 isolated target zone groups follow 54 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,1,2 55 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,2,2 56 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,4,2 57 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,8,2 58 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,10,2 59 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,20,2 60 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,40,2 61 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,80,2 62 | 63 | # source ZG 24 permissions (ZP[24,*]); 1 common target zone group follows 64 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,ff,2 65 | 66 | 67 | # allow remaining source zone groups permissions to take default values 68 | -------------------------------------------------------------------------------- /examples/permf_t10annex.txt: -------------------------------------------------------------------------------- 1 | # Example file invoked like this: 2 | # smp_conf_zone_perm_tbl --permf= --deduce 3 | # 4 | # Assume 128 zone groups (hence 16 byte table entries); note: even 5 | # if expander permits 256 zone groups, it still seems to accept the 6 | # 16 byte table entries format. 7 | # Note that the starting source zone group is set to 10 by this file. 8 | 9 | # This zone permission descriptor file is designed to set up the 10 | # SMP CONFIGURE ZONE PERMISSION TABLE request shown in the "Zone 11 | # permission configuration descriptor examples" annex is various 12 | # SAS-2 (and later) drafts. [It is Annex L in sas2r16.pdf; Annex H in 13 | # spl-r07.pdf and spl2r03.pdf .] 14 | 15 | # 16 | # The request in the Annex example turns all the zone group permission 17 | # bits on in source zone group 10, then turns all the zone group 18 | # permission bits off in source zone group 11 . 19 | 20 | # N.B. Since SCSI is big endian, the lower bit positions are to the right. 21 | # Each element below is a byte, represented in ASCII hexadecimal. 22 | # 23 | 24 | # Note the '--start=10' so the following descriptors start at source 25 | # zone group 10. 26 | # If an expander only supports 256 zone groups without expansion of the 16 27 | # byte format, just expand the first line to have 32 bytes of ff and the 28 | # second line to 32 bytes of 0 . 29 | --start=10 30 | ff,ff,ff,ff,ff,ff,ff,ff ff,ff,ff,ff,ff,ff,ff,ff 31 | 0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0 32 | 33 | # Why do this? To illustrate that the descriptor not only becomes the 34 | # source zone group row in the permission table, but its transpose 35 | # should also be placed in the corresponding destination zone group 36 | # column. Also invariants are preserved (e.g. ZP[1,*] and ZP[*,1] are 37 | # always set). And the descriptors are applied in the order that appear 38 | # (i.e. ascending source zone group numbers). 39 | 40 | # Not all SAS-2 expanders do the transpose insertion. Users may need 41 | # to check. Such a check could be done with: 42 | # smp_rep_zone_perm_tbl --bits=13 43 | # 44 | # Note that the t10 annex example shows the ZP array with its origin 45 | # (i.e. ZP[0,0]) in the top left corner. However smp_rep_zone_perm_tbl's 46 | # output will show the origin in the top right corner (due to SCSI's big 47 | # endian internal representation). To override that, the "--bits=13" option 48 | # presents the output like the t10 annex example (i.e. bit oriented, little 49 | # endian). 50 | # 51 | # To comply with t10 rules ZP[10,11] should be zero (as should ZP[11,10]). 52 | -------------------------------------------------------------------------------- /examples/rep_nocom_permf_8i9i.txt: -------------------------------------------------------------------------------- 1 | # Report zone permission table response: 2 | # Expander change count: 86 3 | # zone locked: 0 4 | # report type: 0 [current] 5 | # number of zone groups: 1 (256) 6 | # number of zone permission descriptors: 31 7 | 0000000000000000000000000000000000000000000000000000000000000002 8 | ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 9 | 0000000000000000000000000000000000000000000000000000000000000102 10 | 0000000000000000000000000000000000000000000000000000000000000302 11 | 0000000000000000000000000000000000000000000000000000000000000002 12 | 0000000000000000000000000000000000000000000000000000000000000002 13 | 0000000000000000000000000000000000000000000000000000000000000002 14 | 0000000000000000000000000000000000000000000000000000000000000002 15 | 000000000000000000000000000000000000000000000000000000000101010e 16 | 000000000000000000000000000000000000000000000000000000000102020a 17 | 0000000000000000000000000000000000000000000000000000000001040402 18 | 0000000000000000000000000000000000000000000000000000000001080802 19 | 0000000000000000000000000000000000000000000000000000000001101002 20 | 0000000000000000000000000000000000000000000000000000000001202002 21 | 0000000000000000000000000000000000000000000000000000000001404002 22 | 0000000000000000000000000000000000000000000000000000000001808002 23 | 0000000000000000000000000000000000000000000000000000000000000102 24 | 0000000000000000000000000000000000000000000000000000000000000202 25 | 0000000000000000000000000000000000000000000000000000000000000402 26 | 0000000000000000000000000000000000000000000000000000000000000802 27 | 0000000000000000000000000000000000000000000000000000000000001002 28 | 0000000000000000000000000000000000000000000000000000000000002002 29 | 0000000000000000000000000000000000000000000000000000000000004002 30 | 0000000000000000000000000000000000000000000000000000000000008002 31 | 000000000000000000000000000000000000000000000000000000000000ff02 32 | 0000000000000000000000000000000000000000000000000000000000000002 33 | 0000000000000000000000000000000000000000000000000000000000000002 34 | 0000000000000000000000000000000000000000000000000000000000000002 35 | 0000000000000000000000000000000000000000000000000000000000000002 36 | 0000000000000000000000000000000000000000000000000000000000000002 37 | 0000000000000000000000000000000000000000000000000000000000000002 38 | -------------------------------------------------------------------------------- /examples/rep_permf_8i9i.txt: -------------------------------------------------------------------------------- 1 | # Report zone permission table response: 2 | # Expander change count: 86 3 | # zone locked: 0 4 | # report type: 0 [current] 5 | # number of zone groups: 1 (256) 6 | # number of zone permission descriptors: 31 7 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 8 | ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff 9 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2 10 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2 11 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 12 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 13 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 14 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 15 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,e 16 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,a 17 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4,4,2 18 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,8,2 19 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,10,10,2 20 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,20,2 21 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,40,40,2 22 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,80,80,2 23 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2 24 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2 25 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,2 26 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,2 27 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,2 28 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2 29 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,2 30 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,2 31 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,ff,2 32 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 38 | -------------------------------------------------------------------------------- /examples/t10annex_zoning_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is an example script showing a SAS-2 zoning being set up 4 | # by calling various smp_utils utilities. 5 | 6 | # This example is taken from the "Zone permission configuration descriptor 7 | # examples" annex in SAS-2 (and later) drafts found at t10.org 8 | # The PERM_FILE is fixed to 'permf_t10annex.txt' while the mapping of 9 | # expander phy_ids to zone groups in in the PHYINFO_FILE or can be passed on 10 | # the command line. 11 | 12 | if [ $1 ] ; then 13 | if [ "-h" = $1 ] || [ "--help" = $1 ] ; then 14 | echo "Usage: t10annex_zoning_ex.sh [ []]" 15 | echo " where:" 16 | echo " expander device node" 17 | echo " phy information file name" 18 | echo 19 | echo "t10annex_zoning_ex.sh sets up zoning on according to data" 20 | echo "in the permf_t10annex.txt file in this directory file. If" 21 | echo "either or are not given, they default to values" 22 | echo "coded within this script which may need editing." 23 | exit 0 24 | fi 25 | fi 26 | 27 | # Set SMP_DEV to the first argument given to this script or the fixed 28 | # name shown below. This identifies an expander device (using a bsg 29 | # device node in the fixed name shown below)). Place SMP_DEV 30 | # on the command line of each smp_utils invocation. If the fixed name 31 | # below is used it will probably need to be changed (e.g. look at 32 | # 'ls /dev/bsg' output for available expander nodes). 33 | if [ $1 ] ; then 34 | SMP_DEV="$1" 35 | else 36 | SMP_DEV="/dev/bsg/expander-6:0" 37 | fi 38 | 39 | # Note the zone permission table file is fixed. Also this file 40 | # contains '--start=10' so the (two) descriptors are applied 41 | # starting at zone group 10. 42 | PERM_FILE="permf_t10annex.txt" 43 | 44 | # the zone phy information file name is either the second argument, or 45 | # defaults: 46 | if [ $2 ] ; then 47 | PHYINFO_FILE="$2" 48 | else 49 | PHYINFO_FILE="pconf_all10.txt" 50 | fi 51 | 52 | # First a SMP ZONE LOCK function is required. Assume the zone manager 53 | # password is zero (i.e. all 32 bytes are zero) or disabled (i.e. all 54 | # 32 bytes 0xff) with the physical presence switch on. 55 | echo "smp_zone_lock $SMP_DEV" 56 | smp_zone_lock $SMP_DEV 57 | res=$? 58 | if [ $res -ne 0 ] ; then 59 | echo "smp_zone_lock failed with exit status: $res" 60 | exit $res 61 | fi 62 | echo 63 | 64 | # Then a SMP CONFIGURE ZONE PERMISSION TABLE function is sent. 65 | # Since --save=SAV is not given, only the shadow values are updated 66 | # (and won't be copied to the saved value during the activate step). 67 | # Even though the expander supports 256 zone groups, it is still possible 68 | # to provide 128 zone group style descriptors (which is the default for 69 | # this utility). Note that smp_rep_zone_perm_tbl will output 256 style 70 | # descriptors in this case. 71 | echo "smp_conf_zone_perm_tbl --permf=$PERM_FILE --deduce $SMP_DEV" 72 | smp_conf_zone_perm_tbl --permf=$PERM_FILE --deduce $SMP_DEV 73 | res=$? 74 | if [ $res -ne 0 ] ; then 75 | echo "smp_conf_zone_perm_tbl failed with exit status: $res" 76 | echo "N.B. about to unlock the zone" 77 | smp_zone_unlock $SMP_DEV 78 | exit $res 79 | fi 80 | echo 81 | 82 | # Next a SMP CONFIGURE ZONE PHY INFORMATION function is sent. 83 | # Set up zone phy information descriptors and since --save=SAV is not 84 | # given, only the shadow values are updated (and won't be copied to the 85 | # saved value during the activate step). 86 | echo "smp_conf_zone_phy_info --pconf=$PHYINFO_FILE $SMP_DEV" 87 | smp_conf_zone_phy_info --pconf=$PHYINFO_FILE $SMP_DEV 88 | res=$? 89 | if [ $res -ne 0 ] ; then 90 | echo "smp_conf_zone_phy_info failed with exit status: $res" 91 | echo "N.B. about to unlock the zone" 92 | smp_zone_unlock $SMP_DEV 93 | exit $res 94 | fi 95 | echo 96 | 97 | # Then a SMP ENABLE DISABLE ZONING function is sent. 98 | # Enable zoning is the default action of this utility. 99 | echo "smp_ena_dis_zoning $SMP_DEV" 100 | smp_ena_dis_zoning $SMP_DEV 101 | res=$? 102 | if [ $res -ne 0 ] ; then 103 | echo "smp_ena_dis_zoning failed with exit status: $res" 104 | echo "N.B. about to unlock the zone" 105 | smp_zone_unlock $SMP_DEV 106 | exit $res 107 | fi 108 | echo 109 | 110 | # Almost finished with a SMP ZONE ACTIVATE function being sent. 111 | # The above zone phy information, permission table and enable-disable 112 | # values are copied from the shadow values to the current values 113 | # making them "live". Note the "saved" values haven't been altered so 114 | # an expander power cycle (or a disable zoning) will undo any damage 115 | # done by this example. 116 | echo "smp_zone_activate $SMP_DEV" 117 | smp_zone_activate $SMP_DEV 118 | res=$? 119 | if [ $res -ne 0 ] ; then 120 | echo "smp_zone_activate failed with exit status: $res" 121 | echo "N.B. about to unlock the zone" 122 | smp_zone_unlock $SMP_DEV 123 | exit $res 124 | fi 125 | echo 126 | 127 | # And the last active step in the SMP ZONE UNLOCK function being sent. 128 | # This will send a Broadcast (Change) [to any affected phys] so any 129 | # connected servers will "see" the change [by doing a "discover process"]. 130 | echo "smp_zone_unlock $SMP_DEV" 131 | smp_zone_unlock $SMP_DEV 132 | res=$? 133 | if [ $res -ne 0 ] ; then 134 | echo "smp_zone_unlock failed with exit status: $res" 135 | exit $res 136 | fi 137 | echo 138 | 139 | 140 | # To see if anything has happened, call smp_discover_list which uses 141 | # the SMP DISCOVER LIST function. 142 | echo "smp_discover_list $SMP_DEV" 143 | smp_discover_list $SMP_DEV 144 | res=$? 145 | if [ $res -ne 0 ] ; then 146 | echo "smp_smp_discover_list failed with exit status: $res" 147 | fi 148 | echo 149 | 150 | # Do smp_discover_list again this time with the "ignore zone group" 151 | # bit set. 152 | echo "smp_discover_list --ignore $SMP_DEV" 153 | smp_discover_list --ignore $SMP_DEV 154 | res=$? 155 | if [ $res -ne 0 ] ; then 156 | echo "smp_smp_discover_list failed with exit status: $res" 157 | fi 158 | 159 | 160 | echo 161 | echo "The zone permission table can now be viewed with:" 162 | echo " smp_rep_zone_perm_tbl --bits=13 $SMP_DEV" 163 | echo 164 | echo "For comparison what follows is reproduced from spl2r04a.pdf Table H.4" 165 | echo "on page 750 (formatted like the output of smp_rep_zone_perm_tbl " 166 | echo "should be):" 167 | echo " 0123456789012" 168 | echo 169 | echo "0 0100000000000" 170 | echo "1 1111111111111" 171 | echo "2 0100000000100" 172 | echo "3 0100000000100" 173 | echo "4 0100000000000" 174 | echo "5 0100000000000" 175 | echo "6 0100000000000" 176 | echo "7 0100000000000" 177 | echo "8 0100000000100" 178 | echo "9 0100000000100" 179 | echo "10 0111000011101" 180 | echo "11 0100000000000" 181 | echo "12 0100000000100" 182 | 183 | # 184 | # Note that the t10 annex example shows the ZP array with its origin 185 | # (i.e. ZP[0,0]) in the top left corner. However smp_rep_zone_perm_tbl's 186 | # output will show the origin in the top right corner (due to SCSI's big 187 | # endian internal representation). To override that, the "--bits=13" option 188 | # presents the output like the t10 annex example (i.e. bit oriented, little 189 | # endian). 190 | # 191 | # To comply with t10 rules ZP[10,11] should be zero (as should ZP[11,10]). 192 | -------------------------------------------------------------------------------- /examples/zoning_ex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This is an example script showing a SAS-2 zoning being set up 4 | # by calling various smp_utils utilities. 5 | 6 | # This is a relatively generic script for setting up zoning. The 7 | # customization of the zone groups (who can access whom) is in the 8 | # PERMISSION_FILE while the mapping of expander phy_ids to zone 9 | # groups in in the PHYINFO_FILE. 10 | 11 | if [ $1 ] ; then 12 | if [ "-h" = $1 ] || [ "--help" = $1 ] ; then 13 | echo "Usage: zoning_ex.sh [ [ []]]" 14 | echo " where:" 15 | echo " expander device node" 16 | echo " permission table file name" 17 | echo " phy information file name" 18 | echo 19 | echo "zoning_ex.sh sets up zoning on according to data in the " 20 | echo " and files. If these are not given, they default" 21 | echo "to values coded within this script which may need editing." 22 | exit 0 23 | fi 24 | fi 25 | 26 | # Set SMP_DEV to the first argument given to this script or the fixed 27 | # name shown below. This identifies an expander device (using a bsg 28 | # device node in the fixed name shown below)). Place SMP_DEV 29 | # on the command line of each smp_utils invocation. If the fixed name 30 | # below is used it will probably need to be changed (e.g. look at 31 | # 'ls /dev/bsg' output for available expander nodes). 32 | if [ $1 ] ; then 33 | SMP_DEV="$1" 34 | else 35 | SMP_DEV="/dev/bsg/expander-6:0" 36 | fi 37 | 38 | # Assumptions are made in the zone permission table file and the zone phy 39 | # information file. The zone permission table file name is either the 40 | # second argument, or defaults: 41 | if [ $2 ] ; then 42 | PERMISSION_FILE="$2" 43 | else 44 | PERMISSION_FILE="permf_8i9i.txt" 45 | fi 46 | 47 | # the zone phy information file name is either the third argument, or 48 | # defaults: 49 | if [ $3 ] ; then 50 | PHYINFO_FILE="$3" 51 | else 52 | PHYINFO_FILE="pconf_2i2t.txt" 53 | fi 54 | 55 | # First a SMP ZONE LOCK function is required. Assume the zone manager 56 | # password is zero (i.e. all 32 bytes are zero) or disabled (i.e. all 57 | # 32 bytes 0xff) with the physical presence switch on. 58 | echo "smp_zone_lock $SMP_DEV" 59 | smp_zone_lock $SMP_DEV 60 | res=$? 61 | if [ $res -ne 0 ] ; then 62 | echo "smp_zone_lock failed with exit status: $res" 63 | exit $res 64 | fi 65 | echo 66 | 67 | # Then a SMP CONFIGURE ZONE PERMISSION TABLE function is sent. 68 | # Since --save=SAV is not given, only the shadow values are updated 69 | # (and won't be copied to the saved value during the activate step). 70 | # Even though the expander support 256 zone groups, it is still possible 71 | # to provide 128 zone group style descriptors (which is the default for 72 | # this utility). Note that smp_rep_zone_perm_tbl will output 256 style 73 | # descriptors in this case. 74 | echo "smp_conf_zone_perm_tbl --permf=$PERMISSION_FILE --deduce $SMP_DEV" 75 | smp_conf_zone_perm_tbl --permf=$PERMISSION_FILE --deduce $SMP_DEV 76 | res=$? 77 | if [ $res -ne 0 ] ; then 78 | echo "smp_conf_zone_perm_tbl failed with exit status: $res" 79 | echo "N.B. about to unlock the zone" 80 | smp_zone_unlock $SMP_DEV 81 | exit $res 82 | fi 83 | echo 84 | 85 | # Next a SMP CONFIGURE ZONE PHY INFORMATION function is sent. 86 | # Set up zone phy information descriptors and since --save=SAV is not 87 | # given, only the shadow values are updated (and won't be copied to the 88 | # saved value during the activate step). 89 | echo "smp_conf_zone_phy_info --pconf=$PHYINFO_FILE $SMP_DEV" 90 | smp_conf_zone_phy_info --pconf=$PHYINFO_FILE $SMP_DEV 91 | res=$? 92 | if [ $res -ne 0 ] ; then 93 | echo "smp_conf_zone_phy_info failed with exit status: $res" 94 | echo "N.B. about to unlock the zone" 95 | smp_zone_unlock $SMP_DEV 96 | exit $res 97 | fi 98 | echo 99 | 100 | # Then a SMP ENABLE DISABLE ZONING function is sent. 101 | # Enable zoning is the default action of this utility. 102 | echo "smp_ena_dis_zoning $SMP_DEV" 103 | smp_ena_dis_zoning $SMP_DEV 104 | res=$? 105 | if [ $res -ne 0 ] ; then 106 | echo "smp_ena_dis_zoning failed with exit status: $res" 107 | echo "N.B. about to unlock the zone" 108 | smp_zone_unlock $SMP_DEV 109 | exit $res 110 | fi 111 | echo 112 | 113 | # Almost finished with a SMP ZONE ACTIVATE function being sent. 114 | # The above zone phy information, permission table and enable-disable 115 | # values are copied from the shadow values to the current values 116 | # making them "live". Note the "saved" values haven't been altered so 117 | # an expander power cycle (or a disable zoning) will undo any damage 118 | # done by this example. 119 | echo "smp_zone_activate $SMP_DEV" 120 | smp_zone_activate $SMP_DEV 121 | res=$? 122 | if [ $res -ne 0 ] ; then 123 | echo "smp_zone_activate failed with exit status: $res" 124 | echo "N.B. about to unlock the zone" 125 | smp_zone_unlock $SMP_DEV 126 | exit $res 127 | fi 128 | echo 129 | 130 | # And the last active step is the SMP ZONE UNLOCK function being sent. 131 | # This will send a Broadcast (Change) [to any affected phys] so any 132 | # connected servers will "see" the change [by doing a "discover process"]. 133 | echo "smp_zone_unlock $SMP_DEV" 134 | smp_zone_unlock $SMP_DEV 135 | res=$? 136 | if [ $res -ne 0 ] ; then 137 | echo "smp_zone_unlock failed with exit status: $res" 138 | exit $res 139 | fi 140 | echo 141 | 142 | 143 | # To see if anything has happened, call smp_discover_list which uses 144 | # the SMP DISCOVER LIST function. 145 | echo "smp_discover_list $SMP_DEV" 146 | smp_discover_list $SMP_DEV 147 | res=$? 148 | if [ $res -ne 0 ] ; then 149 | echo "smp_smp_discover_list failed with exit status: $res" 150 | fi 151 | echo 152 | 153 | # Do smp_discover_list again this time with the "ignore zone group" 154 | # bit set. 155 | echo "smp_discover_list --ignore $SMP_DEV" 156 | smp_discover_list --ignore $SMP_DEV 157 | res=$? 158 | if [ $res -ne 0 ] ; then 159 | echo "smp_smp_discover_list failed with exit status: $res" 160 | fi 161 | 162 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | scsiincludedir = $(includedir)/scsi 3 | 4 | ## Copied from sg3_utils. Some remnants left commented out as examples 5 | ## if OS_LINUX 6 | 7 | scsiinclude_HEADERS = \ 8 | smp_lib.h 9 | 10 | ## noinst_HEADERS = \ 11 | ## sg_pt_win32.h 12 | 13 | ## endif 14 | -------------------------------------------------------------------------------- /include/dummy/linux/bsg.h: -------------------------------------------------------------------------------- 1 | #ifndef _UAPIBSG_H 2 | #define _UAPIBSG_H 3 | 4 | #include 5 | 6 | #define BSG_PROTOCOL_SCSI 0 7 | 8 | #define BSG_SUB_PROTOCOL_SCSI_CMD 0 9 | #define BSG_SUB_PROTOCOL_SCSI_TMF 1 10 | #define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2 11 | 12 | /* 13 | * For flag constants below: 14 | * sg.h sg_io_hdr also has bits defined for it's flags member. These 15 | * two flag values (0x10 and 0x20) have the same meaning in sg.h . For 16 | * bsg the BSG_FLAG_Q_AT_HEAD flag is ignored since it is the deafult. 17 | */ 18 | #define BSG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */ 19 | #define BSG_FLAG_Q_AT_HEAD 0x20 20 | 21 | struct sg_io_v4 { 22 | __s32 guard; /* [i] 'Q' to differentiate from v3 */ 23 | __u32 protocol; /* [i] 0 -> SCSI , .... */ 24 | __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task 25 | management function, .... */ 26 | 27 | __u32 request_len; /* [i] in bytes */ 28 | __u64 request; /* [i], [*i] {SCSI: cdb} */ 29 | __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */ 30 | __u32 request_attr; /* [i] {SCSI: task attribute} */ 31 | __u32 request_priority; /* [i] {SCSI: task priority} */ 32 | __u32 request_extra; /* [i] {spare, for padding} */ 33 | __u32 max_response_len; /* [i] in bytes */ 34 | __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ 35 | 36 | /* "dout_": data out (to device); "din_": data in (from device) */ 37 | __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else 38 | dout_xfer points to array of iovec */ 39 | __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ 40 | __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */ 41 | __u32 din_xfer_len; /* [i] bytes to be transferred from device */ 42 | __u64 dout_xferp; /* [i], [*i] */ 43 | __u64 din_xferp; /* [i], [*o] */ 44 | 45 | __u32 timeout; /* [i] units: millisecond */ 46 | __u32 flags; /* [i] bit mask */ 47 | __u64 usr_ptr; /* [i->o] unused internally */ 48 | __u32 spare_in; /* [i] */ 49 | 50 | __u32 driver_status; /* [o] 0 -> ok */ 51 | __u32 transport_status; /* [o] 0 -> ok */ 52 | __u32 device_status; /* [o] {SCSI: command completion status} */ 53 | __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */ 54 | __u32 info; /* [o] additional information */ 55 | __u32 duration; /* [o] time to complete, in milliseconds */ 56 | __u32 response_len; /* [o] bytes of response actually written */ 57 | __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */ 58 | __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */ 59 | __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */ 60 | __u32 spare_out; /* [o] */ 61 | 62 | __u32 padding; 63 | }; 64 | 65 | 66 | #endif /* _UAPIBSG_H */ 67 | -------------------------------------------------------------------------------- /include/sg_pr2serr.h: -------------------------------------------------------------------------------- 1 | #ifndef SG_PR2SERR_H 2 | #define SG_PR2SERR_H 3 | 4 | /* 5 | * Copyright (c) 2004-2018 Douglas Gilbert. 6 | * All rights reserved. 7 | * Use of this source code is governed by a BSD-style 8 | * license that can be found in the BSD_LICENSE file. 9 | */ 10 | 11 | /* These are convenience functions that replace the somewhat long-winded 12 | * fprintf(stderr, ....). The second form (i.e. pr2ws() ) is for internal 13 | * library use and may place its output somewhere other than stderr; it 14 | * depends on the external variable sg_warnings_strm which can be set 15 | * with sg_set_warnings_strm(). By default it uses stderr. */ 16 | 17 | /* With regard to sg_scnpr(): 18 | * Want safe, 'n += snprintf(b + n, blen - n, ...)' style sequence of 19 | * functions. Returns number of chars placed in cp excluding the 20 | * trailing null char. So for cp_max_len > 0 the return value is always 21 | * < cp_max_len; for cp_max_len <= 1 the return value is 0 and no chars are 22 | * written to cp. Note this means that when cp_max_len = 1, this function 23 | * assumes that cp[0] is the null character and does nothing (and returns 24 | * 0). Linux kernel has a similar function called scnprintf(). */ 25 | 26 | 27 | #include 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | #if defined(__GNUC__) || defined(__clang__) 35 | #ifdef SG_LIB_MINGW 36 | /* MinGW uses Microsoft's printf */ 37 | int pr2serr(const char * fmt, ...); 38 | 39 | int pr2ws(const char * fmt, ...); 40 | 41 | int sg_scnpr(char * cp, int cp_max_len, const char * fmt, ...); 42 | 43 | #else /* GNU/clang other than MinGW */ 44 | 45 | int pr2serr(const char * fmt, ...) 46 | __attribute__ ((format (printf, 1, 2))); 47 | 48 | int pr2ws(const char * fmt, ...) 49 | __attribute__ ((format (printf, 1, 2))); 50 | 51 | int sg_scnpr(char * cp, int cp_max_len, const char * fmt, ...) 52 | __attribute__ ((format (printf, 3, 4))); 53 | #endif 54 | 55 | #else /* not GNU (and not clang) */ 56 | 57 | int pr2serr(const char * fmt, ...); 58 | 59 | int pr2ws(const char * fmt, ...); 60 | 61 | int sg_scnpr(char * cp, int cp_max_len, const char * fmt, ...); 62 | 63 | #endif 64 | 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /lib/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | if OS_LINUX 3 | 4 | libsmputils1_la_SOURCES = \ 5 | smp_lib.c \ 6 | smp_lin_bsg.c \ 7 | smp_lin_sel.c \ 8 | smp_mptctl_io.c \ 9 | smp_aac_io.c 10 | 11 | EXTRA_libsmputils1_la_SOURCES = \ 12 | smp_dummy.c 13 | 14 | endif 15 | 16 | 17 | if OS_FREEBSD 18 | 19 | libsmputils1_la_SOURCES = \ 20 | smp_lib.c \ 21 | smp_fre_cam.c 22 | 23 | EXTRA_libsmputils1_la_SOURCES = \ 24 | smp_dummy.c 25 | 26 | endif 27 | 28 | 29 | if OS_SOLARIS 30 | 31 | libsmputils1_la_SOURCES = \ 32 | smp_lib.c \ 33 | smp_sol_usmp.c 34 | 35 | EXTRA_libsmputils1_la_SOURCES = \ 36 | smp_dummy.c 37 | 38 | endif 39 | 40 | 41 | # for testing with various compilers 42 | ## CC = gcc 43 | ## CC = g++ 44 | ## CC = clang 45 | ## CC = clang++ 46 | 47 | # -std= can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same) 48 | AM_CPPFLAGS = -iquote ${top_srcdir}/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 49 | AM_CFLAGS = -Wall -W 50 | ## AM_CFLAGS = -Wall -W -pedantic -std=c11 51 | ## AM_CFLAGS = -Wall -W -pedantic -std=c++14 52 | ## AM_CFLAGS = -Wall -W -pedantic -std=c++20 53 | 54 | lib_LTLIBRARIES = libsmputils1.la 55 | 56 | libsmputils1_la_LDFLAGS = -version-info 1:0:0 57 | 58 | ## libsmputils1_la_LIBADD = 59 | 60 | distclean-local: 61 | rm -rf .deps 62 | 63 | -------------------------------------------------------------------------------- /lib/README_lin_mpt: -------------------------------------------------------------------------------- 1 | This interface uses a device node used by various MPT Fusion 2 | drivers. It is called '/dev/mptctl' or '/dev/mpt2ctl' and it 3 | is a char device (major: 10, minor: 220 or 221). 4 | Currently a special module needs to loaded called 'mptctl'. 5 | This can be loaded with 'modprobe mptctl'. If there are multiple 6 | MPT Fusion HBAs on one computer then the following construction: 7 | '/dev/mptctl,' can be used for the argument. 8 | LSI Logic call the a "ioc" number. If not given it defaults 9 | to 0 . 10 | 11 | There is a pass through ioctl defined for the /dev/mptctl 12 | device which this library uses. Since '/dev/mptctl,' only 13 | describes a SMP host (initiator), the SAS address of the target 14 | SMP device must also be given. This can be done on the command 15 | line (with the '--sa=' option) or with the environment 16 | variable SMP_UTILS_SAS_ADDR set to the SAS address of the SMP 17 | target device. 18 | 19 | To save typing, the SMP host (i.e. '/dev/mptctl,') can be 20 | placed in the SMP_UTILS_DEVICE environment variable 21 | 22 | Douglas Gilbert 23 | 29th December 2008 24 | -------------------------------------------------------------------------------- /lib/aacraid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 PMC-Sierra Corporation. 3 | * 4 | * 5 | * Name: aacraid.h 6 | * Title: aacraid driver Serial Attached SCSI structures and definitions 7 | * Creation Date: April 12, 2014 8 | * 9 | * Version History 10 | * --------------- 11 | * 12 | * Date Version Description 13 | * -------- -------- ------------------------------------------------------ 14 | 15 | * -------------------------------------------------------------------------- 16 | */ 17 | 18 | struct _LIST_ENTRY { 19 | struct _LIST_ENTRY *Flink; 20 | struct _LIST_ENTRY *Blink; 21 | } LIST_ENTRY; 22 | 23 | 24 | typedef struct { 25 | uint32_t XferState; 26 | uint16_t Command; 27 | uint8_t StructType; 28 | uint8_t Flags; 29 | uint16_t Size; 30 | uint16_t SenderSize; 31 | uint32_t SenderFibAddress; 32 | uint32_t ReceiveFibAddress; 33 | uint32_t SenderData; 34 | 35 | union { 36 | struct{ 37 | uint32_t ReceiverTimeStart; 38 | uint32_t ReceiverTimeDone; 39 | }_s; 40 | }_u; 41 | } FibHdr; 42 | 43 | #define SIZE_FIB_HDR (sizeof(FibHdr)) 44 | #define SIZE_FIB_DATA (512 - SIZE_FIB_HDR) 45 | 46 | typedef struct { 47 | uint32_t function; 48 | uint32_t expander_id; 49 | uint8_t sas_address[8]; 50 | uint32_t status; 51 | uint32_t dataTransmitLength; 52 | uint32_t dataReceiveLength; 53 | } SmpPassThruHeader; 54 | 55 | #define SIZE_SMP_PASS_THRU_HDR (sizeof(SmpPassThruHeader)) 56 | #define SIZE_SMP_PASS_THRU_DATA (512 - SIZE_FIB_HDR - SIZE_SMP_PASS_THRU_HDR) 57 | 58 | typedef struct { 59 | FibHdr fib_header; 60 | uint8_t data[SIZE_FIB_DATA]; 61 | } Fib; 62 | 63 | typedef struct { 64 | SmpPassThruHeader header; 65 | uint8_t smp_request[SIZE_SMP_PASS_THRU_DATA] ; 66 | } HostSmpPassThruRequest; 67 | 68 | typedef struct { 69 | SmpPassThruHeader header; 70 | union { 71 | uint32_t expander_count; 72 | uint8_t sas_address[8]; 73 | uint8_t reponse_data[SIZE_SMP_PASS_THRU_DATA]; 74 | } SmpResponse; 75 | } HostSmpPassThruResult; 76 | 77 | #define CRC_LEN 4 78 | 79 | #define MAX_SIZE_SMP_PASS_THRU_LEN (SIZE_FIB_DATA - SIZE_SMP_PASS_THRU_HDR) 80 | 81 | #define SIZE_FIB (sizeof(Fib)) 82 | #define SIZE_SMP_PASS_THRU_REQ (sizeof(HostSmpPassThruRequest)) 83 | #define SIZE_SMP_PASS_THRU_RES (sizeof(HostSmpPassThruResult)) 84 | 85 | #define SMP_PASS_THRU_SUCCESS 0x00 86 | #define SMP_PASS_THRU_ERROR 0x01 87 | #define SMP_PASS_THRU_BUSY 0x02 88 | #define SMP_PASS_THRU_TIMEOUT 0x03 89 | #define SMP_PASS_THRU_PARM_INVALID 0x04 90 | 91 | #define SMP_REQ_IN_PROGRESS 0x00010000 92 | #define SMP_REQ_WAIT_4_REQUEST 0x00020000 93 | #define SMP_REQ_SEND 0x00040000 94 | #define SMP_REQ_IDLE 0x00080000 95 | #define SMP_REQ_WAIT_4_RESPONSE 0x00100000 96 | 97 | #define SMP_FUNC_CMD_BY_EXP_INDEX 0x00 98 | #define SMPPassThruFib 0x38E 99 | #define HostOwned (1<<0) 100 | #define SentFromHost (1<<5) 101 | #define ApiFib (1<<20) 102 | #define Tfib 1 103 | 104 | #define CTL_CODE(function, method) ( \ 105 | (4<< 16) | ((function) << 2) | (method) \ 106 | ) 107 | 108 | #define METHOD_BUFFERED 0 109 | #define METHOD_NEITHER 3 110 | 111 | #define FSACTL_SENDFIB CTL_CODE(2050, METHOD_BUFFERED) 112 | -------------------------------------------------------------------------------- /lib/mpi_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2004 LSI Logic Corporation. 3 | * 4 | * 5 | * Name: mpi_type.h 6 | * Title: MPI Basic type definitions 7 | * Creation Date: June 6, 2000 8 | * 9 | * mpi_type.h Version: 01.05.01 10 | * 11 | * Version History 12 | * --------------- 13 | * 14 | * Date Version Description 15 | * -------- -------- ------------------------------------------------------ 16 | * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 17 | * 06-06-00 01.00.01 Update version number for 1.0 release. 18 | * 11-02-00 01.01.01 Original release for post 1.0 work 19 | * 02-20-01 01.01.02 Added define and ifdef for MPI_POINTER. 20 | * 08-08-01 01.02.01 Original release for v1.2 work. 21 | * 05-11-04 01.03.01 Original release for MPI v1.3. 22 | * 08-19-04 01.05.01 Original release for MPI v1.5. 23 | * -------------------------------------------------------------------------- 24 | */ 25 | 26 | #ifndef MPI_TYPE_H 27 | #define MPI_TYPE_H 28 | 29 | 30 | /******************************************************************************* 31 | * Define MPI_POINTER if it hasn't already been defined. By default MPI_POINTER 32 | * is defined to be a near pointer. MPI_POINTER can be defined as a far pointer 33 | * by defining MPI_POINTER as "far *" before this header file is included. 34 | */ 35 | #ifndef MPI_POINTER 36 | #define MPI_POINTER * 37 | #endif 38 | 39 | 40 | /***************************************************************************** 41 | * 42 | * B a s i c T y p e s 43 | * 44 | *****************************************************************************/ 45 | 46 | typedef signed char S8; 47 | typedef unsigned char U8; 48 | typedef signed short S16; 49 | typedef unsigned short U16; 50 | 51 | 52 | typedef int32_t S32; 53 | /* typedef u_int32_t U32; <--- originally, u_int* is non-standard from MS */ 54 | typedef uint32_t U32; 55 | 56 | typedef struct _S64 57 | { 58 | U32 Low; 59 | S32 High; 60 | } S64; 61 | 62 | typedef struct _U64 63 | { 64 | U32 Low; 65 | U32 High; 66 | } U64; 67 | 68 | 69 | /****************************************************************************/ 70 | /* Pointers */ 71 | /****************************************************************************/ 72 | 73 | typedef S8 *PS8; 74 | typedef U8 *PU8; 75 | typedef S16 *PS16; 76 | typedef U16 *PU16; 77 | typedef S32 *PS32; 78 | typedef U32 *PU32; 79 | typedef S64 *PS64; 80 | typedef U64 *PU64; 81 | 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /lib/smp_aac_io.h: -------------------------------------------------------------------------------- 1 | #ifndef SMP_AACRAID_IO_H 2 | #define SMP_AACRAID_IO_H 3 | 4 | #include "smp_lib.h" 5 | 6 | /* These functions are the interface to upper level. */ 7 | 8 | extern int chk_aac_device(const char * dev_name, int verbose); 9 | 10 | extern int open_aac_device(const char * dev_name, int verbose); 11 | 12 | extern int close_aac_device(int fd); 13 | 14 | extern int send_req_aac(int fd, int subvalue, const unsigned char * target_sa, 15 | struct smp_req_resp * rresp, int verbose); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/smp_dummy.c: -------------------------------------------------------------------------------- 1 | /* Nothing here */ 2 | 3 | 4 | #ifdef HAVE_CONFIG_H 5 | #include "config.h" 6 | #endif 7 | -------------------------------------------------------------------------------- /lib/smp_fre_cam.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2018, Douglas Gilbert 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | * THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | // #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #ifdef HAVE_CONFIG_H 46 | #include "config.h" 47 | #endif 48 | #include "smp_lib.h" 49 | #include "sg_unaligned.h" 50 | 51 | #define I_CAM 1 52 | 53 | struct tobj_cam_t { 54 | struct cam_device * cam_dev; 55 | char devname[DEV_IDLEN + 1]; /* for cam */ 56 | int unitnum; /* for cam */ 57 | }; 58 | 59 | 60 | /* Note that CAM (circa FreeBSD 9) cannot directly communicate with a SAS 61 | * expander because it isn't a SCSI device. FreeBSD assumes each SAS 62 | * expander is paired with a SES (enclosure) device. This seems to be true 63 | * for SAS-2 expanders but not the older SAS-1 expanders. Hence device_name 64 | * will be something like /dev/ses0 . */ 65 | int 66 | smp_initiator_open(const char * device_name, int subvalue, 67 | const char * i_params, uint64_t sa, 68 | struct smp_target_obj * tobj, int verbose) 69 | { 70 | struct cam_device* cam_dev; 71 | struct tobj_cam_t * tcp; 72 | 73 | if (i_params) { ; } /* unused, suppress warning */ 74 | if ((NULL == tobj) || (NULL == device_name)) 75 | return -1; 76 | memset(tobj, 0, sizeof(struct smp_target_obj)); 77 | strncpy(tobj->device_name, device_name, SMP_MAX_DEVICE_NAME); 78 | if (sa) 79 | sg_put_unaligned_be64(sa, tobj->sas_addr + 0); 80 | tobj->interface_selector = I_CAM; 81 | tcp = (struct tobj_cam_t *) 82 | calloc(1, sizeof(struct tobj_cam_t)); 83 | if (tcp == NULL) { 84 | // errno already set by call to calloc() 85 | return -1; 86 | } 87 | if (cam_get_device(device_name, tcp->devname, DEV_IDLEN, 88 | &(tcp->unitnum)) == -1) { 89 | if (verbose) 90 | fprintf(stderr, "bad device name structure\n"); 91 | free(tcp); 92 | return -1; 93 | } 94 | if (! (cam_dev = cam_open_spec_device(tcp->devname, tcp->unitnum, 95 | O_RDWR, NULL))) { 96 | fprintf(stderr, "cam_open_spec_device: %s\n", cam_errbuf); 97 | free(tcp); 98 | return -1; 99 | } 100 | tcp->cam_dev = cam_dev; 101 | tobj->vp = tcp; 102 | tobj->opened = 1; 103 | tobj->subvalue = subvalue; /* unused */ 104 | return 0; 105 | } 106 | 107 | int 108 | smp_send_req(const struct smp_target_obj * tobj, struct smp_req_resp * rresp, 109 | int verbose) 110 | { 111 | union ccb *ccb; 112 | struct tobj_cam_t * tcp; 113 | int retval, emsk; 114 | int flags = 0; 115 | 116 | if ((NULL == tobj) || (0 == tobj->opened) || (NULL == tobj->vp)) { 117 | if (verbose) 118 | fprintf(stderr, "smp_send_req: nothing open??\n"); 119 | return -1; 120 | } 121 | if (I_CAM != tobj->interface_selector) { 122 | fprintf(stderr, "smp_send_req: unknown transport [%d]\n", 123 | tobj->interface_selector); 124 | return -1; 125 | } 126 | tcp = (struct tobj_cam_t *)tobj->vp; 127 | if (! (ccb = cam_getccb(tcp->cam_dev))) { 128 | fprintf(stderr, "cam_getccb: failed\n"); 129 | return -1; 130 | } 131 | 132 | // clear out structure, except for header that was filled in for us 133 | bzero(&(&ccb->ccb_h)[1], 134 | sizeof(union ccb) - sizeof(struct ccb_hdr)); 135 | 136 | flags |= CAM_DEV_QFRZDIS; 137 | /* CAM does not want request_len including CRC */ 138 | cam_fill_smpio(&ccb->smpio, 139 | /*retries*/ 2, /* guess */ 140 | /*cbfcnp*/ NULL, 141 | /*flags*/ flags, 142 | /*smp_request*/ rresp->request, 143 | /*smp_request_len*/ rresp->request_len - 4, 144 | /*smp_response*/ rresp->response, 145 | /*smp_response_len*/ rresp->max_response_len, 146 | /*timeout*/ 5000); /* milliseconds ? */ 147 | 148 | ccb->smpio.flags = SMP_FLAG_NONE; 149 | 150 | emsk = 0; 151 | if (((retval = cam_send_ccb(tcp->cam_dev, ccb)) < 0) || 152 | ((((emsk = (ccb->ccb_h.status & CAM_STATUS_MASK))) != CAM_REQ_CMP) && 153 | (emsk != CAM_SMP_STATUS_ERROR))) { 154 | cam_error_print(tcp->cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); 155 | cam_freeccb(ccb); 156 | return -1; 157 | } 158 | if (((emsk == CAM_REQ_CMP) || (emsk == CAM_SMP_STATUS_ERROR)) && 159 | (rresp->max_response_len > 0)) { 160 | if ((emsk == CAM_SMP_STATUS_ERROR) && (verbose > 3)) 161 | cam_error_print(tcp->cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, 162 | stderr); 163 | rresp->act_response_len = -1; 164 | cam_freeccb(ccb); 165 | return 0; 166 | } else { 167 | fprintf(stderr, "smp_send_req(cam): not sure how it got here\n"); 168 | cam_freeccb(ccb); 169 | return emsk ? emsk : -1; 170 | } 171 | } 172 | 173 | int 174 | smp_initiator_close(struct smp_target_obj * tobj) 175 | { 176 | struct tobj_cam_t * tcp; 177 | 178 | if ((NULL == tobj) || (0 == tobj->opened)) { 179 | fprintf(stderr, "smp_initiator_close: nothing open??\n"); 180 | return -1; 181 | } 182 | if (tobj->vp) { 183 | tcp = (struct tobj_cam_t *)tobj->vp; 184 | cam_close_device(tcp->cam_dev); 185 | free(tobj->vp); 186 | tobj->vp = NULL; 187 | } 188 | tobj->opened = 0; 189 | return 0; 190 | } 191 | -------------------------------------------------------------------------------- /lib/smp_lin_bsg.h: -------------------------------------------------------------------------------- 1 | #ifndef SMP_LIN_BSG_H 2 | #define SMP_LIN_BSG_H 3 | 4 | #include "smp_lib.h" 5 | 6 | int chk_lin_bsg_device(const char * dev_name, int verbose); 7 | 8 | int open_lin_bsg_device(const char * dev_name, int verbose); 9 | 10 | int close_lin_bsg_device(int fd); 11 | 12 | int send_req_lin_bsg(int fd, int subvalue, 13 | struct smp_req_resp * rresp, int verbose); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /lib/smp_lin_sel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2023, Douglas Gilbert 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | * THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #ifdef HAVE_CONFIG_H 33 | #include "config.h" 34 | #endif 35 | #include "smp_lib.h" 36 | #include "sg_unaligned.h" 37 | 38 | #include "smp_aac_io.h" 39 | #include "smp_mptctl_io.h" 40 | #include "smp_lin_bsg.h" 41 | 42 | 43 | #define I_MPT 2 44 | #define I_SGV4 4 45 | #define I_AAC 6 46 | 47 | int 48 | smp_initiator_open(const char * device_name, int subvalue, 49 | const char * i_params, uint64_t sa, 50 | struct smp_target_obj * tobj, int verbose) 51 | { 52 | int force = 0; 53 | int res; 54 | int len = device_name ? (strlen(device_name) + 1) : 0; 55 | char * cp; 56 | 57 | if ((NULL == tobj) || (NULL == device_name)) 58 | return -1; 59 | memset(tobj, 0, sizeof(struct smp_target_obj)); 60 | memcpy(tobj->device_name, device_name, 61 | ((len > SMP_MAX_DEVICE_NAME) ? SMP_MAX_DEVICE_NAME : len)); 62 | if (sa) { 63 | tobj->sas_addr64 = sa; 64 | sg_put_unaligned_be64(sa, tobj->sas_addr + 0); 65 | } 66 | if (i_params[0]) { 67 | if (0 == strncmp("aac", i_params, 3)) 68 | tobj->interface_selector = I_AAC; 69 | else if(0 == strncmp("mpt",i_params,3)) 70 | tobj->interface_selector = I_MPT; 71 | else if ((0 == strncmp("sgv4", i_params, 2)) || 72 | (0 == strncmp("bsg", i_params, 3))) 73 | tobj->interface_selector = I_SGV4; 74 | else if (0 == strncmp("for", i_params, 3)) 75 | force = 1; 76 | else if (verbose > 3) 77 | fprintf(stderr, "smp_initiator_open: interface not recognized\n"); 78 | cp = (char *)strchr(i_params, ','); /* cast to stop C++ error */ 79 | if (cp) { 80 | if ((tobj->interface_selector > 0) && 81 | (0 == strncmp("for", cp + 1, 3))) 82 | force = 1; 83 | } 84 | } 85 | if ((I_SGV4 == tobj->interface_selector) || 86 | (0 == tobj->interface_selector)) { 87 | res = chk_lin_bsg_device(device_name, verbose); 88 | if (res || force) { 89 | if (0 == tobj->interface_selector) 90 | tobj->interface_selector = I_SGV4; 91 | if ((0 == res) && force) 92 | fprintf(stderr, "... overriding failed check due " 93 | "to 'force'\n"); 94 | res = open_lin_bsg_device(device_name, verbose); 95 | if (res < 0) 96 | goto err_out; 97 | tobj->fd = res; 98 | tobj->subvalue = subvalue; 99 | tobj->opened = 1; 100 | return 0; 101 | } else if (verbose > 2) 102 | fprintf(stderr, "chk_lin_bsg_device: failed\n"); 103 | } 104 | if ((I_MPT == tobj->interface_selector) || 105 | (0 == tobj->interface_selector)) { 106 | res = chk_mpt_device(device_name, verbose); 107 | if (res || force) { 108 | if (0 == tobj->interface_selector) 109 | tobj->interface_selector = I_MPT; 110 | if ((0 == res) && force) 111 | fprintf(stderr, "... overriding failed check due " 112 | "to 'force'\n"); 113 | res = open_mpt_device(device_name, verbose); 114 | if (res < 0) 115 | goto err_out; 116 | tobj->fd = res; 117 | tobj->subvalue = subvalue; 118 | tobj->opened = 1; 119 | 120 | return 0; 121 | } else if (verbose > 2) 122 | fprintf(stderr, "smp_initiator_open: chk_mpt_device failed\n"); 123 | } 124 | 125 | if((I_AAC == tobj->interface_selector) || 126 | (0 == tobj->interface_selector)) { 127 | res = chk_aac_device(device_name,verbose); 128 | if(res || force) { 129 | if (0 == tobj->interface_selector) 130 | tobj->interface_selector = I_AAC; 131 | if ((0 == res) && force) 132 | fprintf(stderr,"... overriding failed check due" 133 | "to 'force' \n"); 134 | res = open_aac_device(device_name,verbose); 135 | if (res < 0) 136 | goto err_out; 137 | tobj->fd = res; 138 | tobj->subvalue = subvalue; 139 | tobj->opened = 1; 140 | return 0; 141 | } else if (verbose > 2) 142 | fprintf(stderr,"smp_initiator_open: chk_aac_device failed\n"); 143 | } 144 | 145 | err_out: 146 | fprintf(stderr, "smp_initiator_open: failed to open %s\n", device_name); 147 | return -1; 148 | } 149 | 150 | int 151 | smp_send_req(const struct smp_target_obj * tobj, 152 | struct smp_req_resp * rresp, int verbose) 153 | { 154 | if ((NULL == tobj) || (0 == tobj->opened)) { 155 | if (verbose > 2) 156 | fprintf(stderr, "smp_send_req: nothing open??\n"); 157 | return -1; 158 | } 159 | if (I_SGV4 == tobj->interface_selector) 160 | return send_req_lin_bsg(tobj->fd, tobj->subvalue, rresp, verbose); 161 | else if (I_MPT == tobj->interface_selector) 162 | return send_req_mpt(tobj->fd, tobj->subvalue, tobj->sas_addr64, 163 | rresp, verbose); 164 | else if (I_AAC == tobj->interface_selector) 165 | return send_req_aac(tobj->fd, tobj->subvalue, tobj->sas_addr, 166 | rresp, verbose); 167 | else { 168 | if (verbose) 169 | fprintf(stderr, "smp_send_req: no transport??\n"); 170 | return -1; 171 | } 172 | } 173 | 174 | int 175 | smp_initiator_close(struct smp_target_obj * tobj) 176 | { 177 | int res; 178 | 179 | if ((NULL == tobj) || (0 == tobj->opened)) { 180 | fprintf(stderr, "smp_initiator_close: nothing open??\n"); 181 | return -1; 182 | } 183 | if (I_MPT == tobj->interface_selector) { 184 | res = close_mpt_device(tobj->fd); 185 | if (res < 0) 186 | fprintf(stderr, "close_mpt_device: failed\n"); 187 | }else if(I_AAC == tobj->interface_selector){ 188 | res = close_aac_device(tobj->fd); 189 | if (res < 0) 190 | fprintf(stderr,"close_aac_device: failed\n"); 191 | } 192 | 193 | 194 | tobj->opened = 0; 195 | return 0; 196 | } 197 | -------------------------------------------------------------------------------- /lib/smp_mptctl_glue.h: -------------------------------------------------------------------------------- 1 | #ifndef SMP_MPTCTL_GLUE_H 2 | #define SMP_MPTCTL_GLUE_H 3 | 4 | #ifndef __user 5 | #define __user 6 | #endif 7 | /* Typedefs 8 | */ 9 | #ifndef uint 10 | typedef unsigned int uint; 11 | #endif 12 | 13 | #ifndef ushort 14 | typedef unsigned short ushort; 15 | #endif 16 | 17 | #ifndef uchar 18 | typedef unsigned char uchar; 19 | #endif 20 | 21 | #ifndef u8 22 | typedef unsigned char u8; 23 | #endif 24 | 25 | #ifndef u16 26 | typedef unsigned short u16; 27 | #endif 28 | 29 | #ifndef u32 30 | typedef unsigned int u32; 31 | #endif 32 | 33 | #ifndef u64 34 | typedef unsigned long long u64; 35 | #endif 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/smp_mptctl_io.h: -------------------------------------------------------------------------------- 1 | #ifndef SMP_MPTCTL_IO_H 2 | #define SMP_MPTCTL_IO_H 3 | 4 | #include "smp_lib.h" 5 | 6 | /* These functions are the interface to upper level. */ 7 | 8 | extern int chk_mpt_device(const char * dev_name, int verbose); 9 | 10 | extern int open_mpt_device(const char * dev_name, int verbose); 11 | 12 | extern int close_mpt_device(int fd); 13 | 14 | extern int send_req_mpt(int fd, int subvalue, uint64_t target_sa, 15 | struct smp_req_resp * rresp, int verbose); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /lib/smp_sol_usmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006-2018, Douglas Gilbert 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 18 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 | * THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef HAVE_CONFIG_H 40 | #include "config.h" 41 | #endif 42 | #include "smp_lib.h" 43 | #include "sg_unaligned.h" 44 | 45 | #define I_USMP 1 46 | #define DEF_USMP_TIMEOUT 60 /* seconds */ 47 | 48 | /* Difference between usmp.h header in openSolaris 2009 and usmp-7i.html 49 | * Oracle (dated 2010) */ 50 | #ifdef USMPCMD 51 | #define USMP_IO USMPCMD 52 | #else 53 | #define USMP_IO USMPFUNC 54 | #endif 55 | 56 | int 57 | smp_initiator_open(const char * device_name, int subvalue, 58 | const char * i_params, uint64_t sa, 59 | struct smp_target_obj * tobj, int verbose) 60 | { 61 | int res; 62 | 63 | if (i_params) { ; } /* unused, suppress warning */ 64 | if ((NULL == tobj) || (NULL == device_name)) 65 | return -1; 66 | memset(tobj, 0, sizeof(struct smp_target_obj)); 67 | strncpy(tobj->device_name, device_name, SMP_MAX_DEVICE_NAME); 68 | if (sa) 69 | sg_put_unaligned_be64(sa, tobj->sas_addr + 0); 70 | tobj->interface_selector = I_USMP; 71 | if (I_USMP == tobj->interface_selector) { 72 | res = open(tobj->device_name, O_RDWR); 73 | if (res < 0) { 74 | perror("smp_initiator_open(usmp): open() failed"); 75 | if (verbose) 76 | fprintf(stderr, "tried to open %s\n", tobj->device_name); 77 | return -1; 78 | } 79 | tobj->fd = res; 80 | tobj->subvalue = subvalue; 81 | tobj->opened = 1; 82 | return 0; 83 | } else 84 | fprintf(stderr, "bad interface selector: %d\n", 85 | tobj->interface_selector); 86 | return -1; 87 | } 88 | 89 | int 90 | smp_send_req(const struct smp_target_obj * tobj, 91 | struct smp_req_resp * rresp, int verbose) 92 | { 93 | struct usmp_cmd urr; 94 | 95 | if ((NULL == tobj) || (0 == tobj->opened)) { 96 | if (verbose > 2) 97 | fprintf(stderr, "smp_send_req: nothing open??\n"); 98 | return -1; 99 | } 100 | if (I_USMP != tobj->interface_selector) { 101 | fprintf(stderr, "bad interface selector: %d\n", 102 | tobj->interface_selector); 103 | return -1; 104 | } 105 | memset(&urr, 0, sizeof(urr)); 106 | urr.usmp_req = rresp->request; 107 | urr.usmp_reqsize = rresp->request_len; /* header+payload+CRC in bytes */ 108 | urr.usmp_rsp = rresp->response; 109 | urr.usmp_rspsize = rresp->max_response_len; 110 | urr.usmp_timeout = DEF_USMP_TIMEOUT; 111 | if (ioctl(tobj->fd, USMP_IO, &urr) < 0) { 112 | perror("smp_send_req: ioctl(USMPCMD)"); 113 | return -1; 114 | } 115 | rresp->act_response_len = -1; 116 | rresp->transport_err = 0; 117 | return 0; 118 | } 119 | 120 | int 121 | smp_initiator_close(struct smp_target_obj * tobj) 122 | { 123 | int res; 124 | 125 | if ((NULL == tobj) || (0 == tobj->opened)) { 126 | fprintf(stderr, "smp_initiator_close(usmp): nothing open??\n"); 127 | return -1; 128 | } 129 | if (I_USMP != tobj->interface_selector) { 130 | fprintf(stderr, "bad interface selector: %d\n", 131 | tobj->interface_selector); 132 | return -1; 133 | } 134 | res = close(tobj->fd); 135 | if (res < 0) 136 | perror("smp_initiator_close(usmp): failed\n"); 137 | tobj->opened = 0; 138 | return 0; 139 | } 140 | -------------------------------------------------------------------------------- /smp_utils.spec: -------------------------------------------------------------------------------- 1 | %define name smp_utils 2 | %define version 1.00 3 | %define release 1 4 | 5 | Summary: Utilities for SAS Serial Management Protocol (SMP) 6 | Name: %{name} 7 | Version: %{version} 8 | Release: %{release} 9 | License: FreeBSD 10 | Group: Utilities/System 11 | URL: http://sg.danny.cz/sg/smp_utils.html 12 | Source0: http://sg.danny.cz/sg/p/%{name}-%{version}.tgz 13 | Provides: smp_utils 14 | # BuildRequires: libtool 15 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 16 | Packager: Douglas Gilbert 17 | 18 | %description 19 | This is a package of utilities. Each utility sends a Serial Attached 20 | SCSI (SAS) Serial Management Protocol (SMP) request to a SMP target. 21 | If the request fails then the error is decoded. If the request succeeds 22 | then the response is either decoded, printed out in hexadecimal or 23 | output in binary. This package supports the linux 2.6 and 3 series and 24 | has ports to FreeBSD and Solaris. 25 | 26 | Warning: These utilities access SAS expanders (storage switches) and 27 | the incorrect usage of them may render your system and others inoperable. 28 | 29 | %package libs 30 | Summary: Shared library for %{name} 31 | Group: System/Libraries 32 | 33 | %description libs 34 | This package contains the shared library for %{name}. 35 | 36 | %package devel 37 | Summary: Static library and header files for the smputils library 38 | Group: Development/C 39 | Requires: %{name}-libs = %{version}-%{release} 40 | 41 | %description devel 42 | This package contains the static %{name} library and its header files for 43 | developing applications. 44 | 45 | %prep 46 | %setup -q 47 | 48 | %build 49 | ./autogen.sh 50 | %configure 51 | sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool 52 | sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool 53 | 54 | %install 55 | if [ "$RPM_BUILD_ROOT" != "/" ]; then 56 | rm -rf $RPM_BUILD_ROOT 57 | fi 58 | 59 | make install \ 60 | DESTDIR=$RPM_BUILD_ROOT 61 | 62 | %clean 63 | if [ "$RPM_BUILD_ROOT" != "/" ]; then 64 | rm -rf $RPM_BUILD_ROOT 65 | fi 66 | 67 | %files 68 | %defattr(-,root,root) 69 | %doc AUTHORS ChangeLog COPYING COVERAGE CREDITS INSTALL NEWS README 70 | %attr(755,root,root) %{_bindir}/* 71 | %{_mandir}/man8/* 72 | 73 | %files libs 74 | %defattr(-,root,root) 75 | %{_libdir}/*.so.* 76 | 77 | %files devel 78 | %defattr(-,root,root) 79 | %{_includedir}/scsi/*.h 80 | %{_libdir}/*.so 81 | %{_libdir}/*.a 82 | %{_libdir}/*.la 83 | 84 | 85 | %changelog 86 | * Wed Feb 01 2023 - dgilbert at interlog dot com 87 | - see ChangeLog 88 | * smp_utils-1.00 89 | * Thu Mar 05 2020 - dgilbert at interlog dot com 90 | - add support for G5 (22.5 Gbps, SAS-4, SPL-5) 91 | * smp_utils-0.99 92 | * Mon May 26 2014 - dgilbert at interlog dot com 93 | - put execs back in /usr/bin, add aac interface 94 | * smp_utils-0.98 95 | * Fri Jan 20 2012 - dgilbert at interlog dot com 96 | - change to ./configure style build, put execs in /usr/sbin 97 | * smp_utils-0.97 98 | * Sun Jun 19 2011 - dgilbert at interlog dot com 99 | - add zoning for SAS-2, SPL, SPL-2 100 | * smp_utils-0.96 101 | * Tue Oct 27 2009 - dgilbert at interlog dot com 102 | - discover changes in spl-r04 103 | * smp_utils-0.95 104 | * Mon Dec 29 2008 - dgilbert at interlog dot com 105 | - adjust sgv4 for lk 2.6.27, sync with sas2r15 106 | * smp_utils-0.94 107 | * Sun Jan 06 2008 - dgilbert at interlog dot com 108 | - sync with sas2r13, add 'sgv4' interface 109 | * smp_utils-0.93 110 | * Fri Dec 08 2006 - dgilbert at interlog dot com 111 | - sync against sas2r07, add smp_conf_general 112 | * smp_utils-0.92 113 | * Tue Aug 22 2006 - dgilbert at interlog dot com 114 | - add smp_phy_test and smp_discover_list, uniform exit status values 115 | * smp_utils-0.91 116 | * Sun Jun 11 2006 - dgilbert at interlog dot com 117 | - add smp_read_gpio, smp_conf_route_info and smp_write_gpio 118 | * smp_utils-0.90 119 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | ## Copied from sg3_utils. Some remnants left commented out as examples 3 | ## if OS_LINUX 4 | 5 | # binaries were in in a sbin directory (e.g. /usr/sbin) using 6 | # sbin_PROGRAMS . Caused problems so put back in normal 7 | # place with bin_PROGRAMS = xxxx . 8 | 9 | bin_PROGRAMS = \ 10 | smp_conf_general smp_conf_phy_event smp_conf_route_info \ 11 | smp_conf_zone_man_pass smp_conf_zone_perm_tbl \ 12 | smp_conf_zone_phy_info smp_discover smp_discover_list \ 13 | smp_ena_dis_zoning smp_phy_control smp_phy_test \ 14 | smp_read_gpio smp_rep_broadcast smp_rep_exp_route_tbl \ 15 | smp_rep_general smp_rep_manufacturer smp_rep_phy_err_log \ 16 | smp_rep_phy_event smp_rep_phy_event_list smp_rep_phy_sata \ 17 | smp_rep_route_info smp_rep_self_conf_stat \ 18 | smp_rep_zone_man_pass smp_rep_zone_perm_tbl smp_write_gpio \ 19 | smp_zone_activate smp_zoned_broadcast smp_zone_lock \ 20 | smp_zone_unlock 21 | 22 | ## distclean-local: 23 | ## rm -f sg_scan.c 24 | 25 | ## sg_scan.c : sg_scan.c.linux 26 | ## cp sg_scan.c.linux sg_scan.c 27 | 28 | ## endif 29 | 30 | # for testing with various compilers 31 | ## CC = gcc 32 | ## CC = g++ 33 | ## CC = clang 34 | ## CC = clang++ 35 | 36 | # -std= can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same) 37 | AM_CPPFLAGS = -iquote ${top_srcdir}/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 38 | AM_CFLAGS = -Wall -W 39 | ## AM_CFLAGS = -Wall -W -pedantic -std=c11 40 | ## AM_CFLAGS = -Wall -W -pedantic -std=c++14 41 | ## AM_CFLAGS = -Wall -W -pedantic -std=gnu++1z 42 | ## AM_CFLAGS = -Wall -W -pedantic -std=c++20 43 | 44 | smp_conf_general_SOURCES = smp_conf_general.c 45 | smp_conf_general_LDADD = ../lib/libsmputils1.la 46 | 47 | smp_conf_phy_event_SOURCES = smp_conf_phy_event.c 48 | smp_conf_phy_event_LDADD = ../lib/libsmputils1.la 49 | 50 | smp_conf_route_info_SOURCES = smp_conf_route_info.c 51 | smp_conf_route_info_LDADD = ../lib/libsmputils1.la 52 | 53 | smp_conf_zone_man_pass_SOURCES = smp_conf_zone_man_pass.c 54 | smp_conf_zone_man_pass_LDADD = ../lib/libsmputils1.la 55 | 56 | smp_conf_zone_perm_tbl_SOURCES = smp_conf_zone_perm_tbl.c 57 | smp_conf_zone_perm_tbl_LDADD = ../lib/libsmputils1.la 58 | 59 | smp_conf_zone_phy_info_SOURCES = smp_conf_zone_phy_info.c 60 | smp_conf_zone_phy_info_LDADD = ../lib/libsmputils1.la 61 | 62 | smp_discover_SOURCES = smp_discover.c 63 | smp_discover_LDADD = ../lib/libsmputils1.la 64 | 65 | smp_discover_list_SOURCES = smp_discover_list.c 66 | smp_discover_list_LDADD = ../lib/libsmputils1.la 67 | 68 | smp_ena_dis_zoning_SOURCES = smp_ena_dis_zoning.c 69 | smp_ena_dis_zoning_LDADD = ../lib/libsmputils1.la 70 | 71 | smp_phy_control_SOURCES = smp_phy_control.c 72 | smp_phy_control_LDADD = ../lib/libsmputils1.la 73 | 74 | smp_phy_test_SOURCES = smp_phy_test.c 75 | smp_phy_test_LDADD = ../lib/libsmputils1.la 76 | 77 | smp_read_gpio_SOURCES = smp_read_gpio.c 78 | smp_read_gpio_LDADD = ../lib/libsmputils1.la 79 | 80 | smp_rep_broadcast_SOURCES = smp_rep_broadcast.c 81 | smp_rep_broadcast_LDADD = ../lib/libsmputils1.la 82 | 83 | smp_rep_exp_route_tbl_SOURCES = smp_rep_exp_route_tbl.c 84 | smp_rep_exp_route_tbl_LDADD = ../lib/libsmputils1.la 85 | 86 | smp_rep_general_SOURCES = smp_rep_general.c 87 | smp_rep_general_LDADD = ../lib/libsmputils1.la 88 | 89 | smp_rep_manufacturer_SOURCES = smp_rep_manufacturer.c 90 | smp_rep_manufacturer_LDADD = ../lib/libsmputils1.la 91 | 92 | smp_rep_phy_err_log_SOURCES = smp_rep_phy_err_log.c 93 | smp_rep_phy_err_log_LDADD = ../lib/libsmputils1.la 94 | 95 | smp_rep_phy_event_SOURCES = smp_rep_phy_event.c 96 | smp_rep_phy_event_LDADD = ../lib/libsmputils1.la 97 | 98 | smp_rep_phy_event_list_SOURCES = smp_rep_phy_event_list.c 99 | smp_rep_phy_event_list_LDADD = ../lib/libsmputils1.la 100 | 101 | smp_rep_phy_sata_SOURCES = smp_rep_phy_sata.c 102 | smp_rep_phy_sata_LDADD = ../lib/libsmputils1.la 103 | 104 | smp_rep_route_info_SOURCES = smp_rep_route_info.c 105 | smp_rep_route_info_LDADD = ../lib/libsmputils1.la 106 | 107 | smp_rep_self_conf_stat_SOURCES = smp_rep_self_conf_stat.c 108 | smp_rep_self_conf_stat_LDADD = ../lib/libsmputils1.la 109 | 110 | smp_rep_zone_man_pass_SOURCES = smp_rep_zone_man_pass.c 111 | smp_rep_zone_man_pass_LDADD = ../lib/libsmputils1.la 112 | 113 | smp_rep_zone_perm_tbl_SOURCES = smp_rep_zone_perm_tbl.c 114 | smp_rep_zone_perm_tbl_LDADD = ../lib/libsmputils1.la 115 | 116 | smp_write_gpio_SOURCES = smp_write_gpio.c 117 | smp_write_gpio_LDADD = ../lib/libsmputils1.la 118 | 119 | smp_zone_activate_SOURCES = smp_zone_activate.c 120 | smp_zone_activate_LDADD = ../lib/libsmputils1.la 121 | 122 | smp_zoned_broadcast_SOURCES = smp_zoned_broadcast.c 123 | smp_zoned_broadcast_LDADD = ../lib/libsmputils1.la 124 | 125 | smp_zone_lock_SOURCES = smp_zone_lock.c 126 | smp_zone_lock_LDADD = ../lib/libsmputils1.la 127 | 128 | smp_zone_unlock_SOURCES = smp_zone_unlock.c 129 | smp_zone_unlock_LDADD = ../lib/libsmputils1.la 130 | 131 | 132 | distclean-local: 133 | rm -rf .deps 134 | --------------------------------------------------------------------------------