freebsd-skq/lib
Kenneth D. Merry 06e794928b Add Serial Management Protocol (SMP) passthrough support to CAM.
This includes support in the kernel, camcontrol(8), libcam and the mps(4)
driver for SMP passthrough.

The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00
to determine supported pages, and will now fetch page 0x83 in addition to
page 0x80 if supported.

Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO.  The SMP CCB is
intended for SMP requests and responses.  The ADVINFO is currently used to
fetch cached VPD page 0x83 data from the transport layer, but is intended
to be extensible to fetch other types of device-specific data.

SMP-only devices are not currently represented in the CAM topology, and so
the current semantics are that the SIM will route SMP CCBs to either the
addressed device, if it contains an SMP target, or its parent, if it
contains an SMP target.  (This is noted in cam_ccb.h, since it will change
later once we have the ability to have SMP-only devices in CAM's topology.)

smp_all.c,
smp_all.h:		New helper routines for SMP.  This includes
			SMP request building routines, response parsing
			routines, error decoding routines, and structure
			definitions for a number of SMP commands.

libcam/Makefile:	Add smp_all.c to libcam, so that SMP functionality
			is available to userland applications.

camcontrol.8,
camcontrol.c:		Add smp passthrough support to camcontrol.  Several
			new subcommands are now available:

			'smpcmd' functions much like 'cmd', except that it
			allows the user to send generic SMP commands.

			'smprg' sends the SMP report general command, and
			displays the decoded output.  It will automatically
			fetch extended output if it is available.

			'smppc' sends the SMP phy control command, with any
			number of potential options.  Among other things,
			this allows the user to reset a phy on a SAS
			expander, or disable a phy on an expander.

			'smpmaninfo' sends the SMP report manufacturer
			information and displays the decoded output.

			'smpphylist' displays a list of phys on an
			expander, and the CAM devices attached to those
			phys, if any.

cam.h,
cam.c:			Add a status value for SMP errors
			(CAM_SMP_STATUS_ERROR).

			Add a missing description for CAM_SCSI_IT_NEXUS_LOST.

			Add support for SMP commands to cam_error_string().

cam_ccb.h:		Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH.  SMP
			commands are by nature bi-directional, and we may
			need to support bi-directional SCSI commands later.

			Add the XPT_SMP_IO CCB.  Since SMP commands are
			bi-directional, there are pointers for both the
			request and response.

			Add a fill routine for SMP CCBs.

			Add the XPT_GDEV_ADVINFO CCB.  This is currently
			used to fetch cached page 0x83 data from the
			transport later, but is extensible to fetch many
			other types of data.

cam_periph.c:		Add support in cam_periph_mapmem() for XPT_SMP_IO
			and XPT_GDEV_ADVINFO CCBs.

cam_xpt.c:		Add support for executing XPT_SMP_IO CCBs.

cam_xpt_internal.h:	Add fields for VPD pages 0x00 and 0x83 in struct
			cam_ed.

scsi_all.c:		Add scsi_get_sas_addr(), a function that parses
			VPD page 0x83 data and pulls out a SAS address.

scsi_all.h:		Add VPD page 0x00 and 0x83 structures, and a
			prototype for scsi_get_sas_addr().

scsi_pass.c:		Add support for mapping buffers in XPT_SMP_IO and
			XPT_GDEV_ADVINFO CCBs.

scsi_xpt.c:		In the SCSI probe code, first ask the device for
			VPD page 0x00.  If any VPD pages are supported,
			that page is required to be implemented.  Based on
			the response, we may probe for the serial number
			(page 0x80) or device id (page 0x83).

			Add support for the XPT_GDEV_ADVINFO CCB.

sys/conf/files:		Add smp_all.c.

mps.c:			Add support for passing in a uio in mps_map_command(),
			so we can map a S/G list at once.

			Add support for SMP passthrough commands in
			mps_data_cb().  SMP is a special case, because the
			first buffer in the S/G list is outbound and the
			second buffer is inbound.

			Add support for warning the user if the busdma code
			comes back with more buffers than will work for the
			command.  This will, for example, help the user
			determine why an SMP command failed if busdma comes
			back with three buffers.

mps_pci.c:		Add sys/uio.h.

mps_sas.c:		Add the SAS address and the parent handle to the
			list of fields we pull from device page 0 and cache
			in struct mpssas_target.  These are needed for SMP
			passthrough.

			Add support for the XPT_SMP_IO CCB.  For now, this
			CCB is routed to the addressed device if it supports
			SMP, or to its parent if it does not and the parent
			does.  This is necessary because CAM does not
			currently support SMP-only nodes in the topology.

			Make SMP passthrough support conditional on
			__FreeBSD_version >= 900026.  This will make it
			easier to MFC this change to the driver without
			MFCing the CAM changes as well.

mps_user.c:		Un-staticize mpi_init_sge() so we can use it for
			the SMP passthrough code.

mpsvar.h:		Add a uio and iovecs into struct mps_command for
			SMP passthrough commands.

			Add a cm_max_segs field to struct mps_command so
			that we can warn the user if busdma comes back with
			too many segments.

			Clear the cm_reply when a command gets freed.  If
			it is not cleared, reply frames will eventually get
			freed into the pool multiple times and corrupt the
			pool.  (This fix is from scottl.)

			Add a prototype for mpi_init_sge().

sys/param.h:		Bump __FreeBSD_version to 900026 for the for the
			inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO
			CAM CCBs.
2010-11-30 22:39:46 +00:00
..
bind Prep for the 9.6-ESV-R2 update 2010-10-31 04:45:25 +00:00
clang Don't use -fno-exceptions or -fno-rtti for .c files, when building 2010-11-14 22:17:12 +00:00
csu Remove two .endp's without matching .proc in lib/csu/ia64/crtn.S. 2010-10-15 21:40:20 +00:00
libalias Remove redundant WARNS?=6 overrides and inherit the WARNS setting from 2010-03-02 18:44:08 +00:00
libarchive If the Zip reader doesn't see a PK signature block 2010-11-07 03:40:37 +00:00
libauditd Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libbegemot Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libblocksruntime Import libcompiler_rt into HEAD and add Makefiles. 2010-11-11 15:13:11 +00:00
libbluetooth Add the following Linux BlueZ compatibility macros: htobs(), htobl(), 2010-09-22 23:41:02 +00:00
libbsm Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libbsnmp Always assign WARNS using ?= 2010-03-02 16:58:04 +00:00
libbz2 Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libc Update the documentation to reflect changes to the implementation in 2010-11-30 21:26:21 +00:00
libcalendar Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libcam Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00
libcom_err
libcompat Small style(9) fix: use tabs instead of spaces. 2010-08-08 08:19:23 +00:00
libcompiler_rt Revert to libgcc for sparc64. 2010-11-12 15:52:27 +00:00
libcrypt Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libdevinfo Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libdevstat Spelling fixes. 2010-08-03 17:40:09 +00:00
libdisk mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libdwarf Removed redundant -I. from CFLAGS and "yes" from WITHOUT_MAN. 2010-02-25 22:16:30 +00:00
libedit libedit: Try to map <Delete> to ed-delete-next-char. 2010-09-05 16:12:10 +00:00
libefi Spelling fixes. 2010-08-03 17:40:09 +00:00
libelf mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libexpat Fix buildworld -DNO_CLEAN when using with Perforce, which marks files as 2010-08-12 20:46:49 +00:00
libfetch Move variable declarations into the conditional block where they are 2010-10-24 01:05:10 +00:00
libftpio mdoc: consistently spell our email addresses <foo@FreeBSD.org> 2010-05-19 08:57:53 +00:00
libgeom Remove code duplication by introducing static gctl_param_add() function which 2010-10-21 10:38:14 +00:00
libgpib Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libgssapi mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libipsec Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libipx Fix incorrect usage of 'assure' and 'insure'. 2010-08-28 16:32:01 +00:00
libjail Find a jail's type as part of jailparam_init rather than waiting until 2010-10-27 21:01:53 +00:00
libkiconv Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libkse Merge from tbemd: 2010-06-13 01:27:29 +00:00
libkvm Similar to sys/net/vnet.h, define the linker set name for sys/sys/pcpu.h 2010-11-14 20:14:25 +00:00
liblzma Remove obsoleted private symbol. 2010-11-19 09:59:55 +00:00
libmagic Use CFLAGS and LDFLAGS when compiling mkmagic. This ensures that all the 2010-08-01 12:10:32 +00:00
libmd Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libmemstat Spelling fixes. 2010-08-03 17:40:09 +00:00
libmilter Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libmp Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libncp Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libnetgraph bring the NGM_IPFW_COOKIE back into ng_ipfw.h, libnetgraph expects 2009-12-28 12:29:13 +00:00
libngatm Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libopie Let libopie use utmpx instead of utmp. 2010-01-13 18:02:30 +00:00
libpam Add <time.h> for ctime(), which we accidentally picked up through 2010-11-22 14:45:16 +00:00
libpcap Regenerate our lib/libpcap/config.h for libpcap 1.1.1. 2010-10-29 22:57:14 +00:00
libpkg - Take libinstall.a out of pkg_install and make it a proper shared library. 2010-04-23 11:07:43 +00:00
libpmc Fix manpage markup. 2010-11-06 10:54:33 +00:00
libproc Ignore EINTR when calling waitpid. 2010-09-18 23:38:21 +00:00
libradius Add links for libradius(3) functions. 2010-10-18 12:35:10 +00:00
librpcsec_gss Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
librpcsvc
librt To support stack unwinding for cancellation points, add -fexceptions flag 2010-09-25 01:57:47 +00:00
librtld_db Spelling fixes. 2010-08-03 17:40:09 +00:00
libsbuf Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libsdp Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while 2010-08-16 15:18:30 +00:00
libsm Enable the use of nanosleep() instead of using pause() and signals. 2010-03-04 05:53:06 +00:00
libsmb
libsmdb Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libsmutil Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libstand mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libtacplus mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libtelnet
libthr Use sysctl kern.sched.cpusetsize to retrieve size of kernel cpuset. 2010-11-02 02:13:13 +00:00
libthread_db Repair some build breakage introduced in r211725 and garbage collect some 2010-08-28 15:03:11 +00:00
libufs Search beyond the first 1/8th of inodes. 2010-05-01 18:56:45 +00:00
libugidfw mdoc: order prologue macros consistently by Dd/Dt/Os 2010-04-14 19:08:06 +00:00
libulog Fix reference to nonexistent manpage getuid(3). 2010-10-11 20:30:57 +00:00
libusb Correct description of the return values of 2010-11-18 08:32:47 +00:00
libusbhid - Add support for libusbhid in 32-bit compatibility mode. 2010-10-16 11:20:53 +00:00
libutil mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
libvgl Change libvgl's set4pixels() and set2lines() functions from plain 2010-10-04 18:16:38 +00:00
libwrap Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
liby Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libypclnt Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
libz Revert 212517 to restore pristine state of this file 2010-10-13 16:34:08 +00:00
msun Fix bug in jn(3) and jnf(3) that led to -inf results 2010-11-13 10:54:10 +00:00
ncurses Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00
Makefile Replace libgcc.a by libcompiler_rt.a. 2010-11-11 15:48:27 +00:00
Makefile.inc Build lib/ with WARNS=6 by default. 2010-01-02 09:58:07 +00:00