freebsd-dev/sys/sys
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
..
_bus_dma.h
_iovec.h
_lock.h
_lockmgr.h
_mutex.h
_null.h
_pthreadtypes.h
_rmlock.h
_rwlock.h
_semaphore.h
_sigset.h
_sockaddr_storage.h
_stack.h
_sx.h
_task.h Use a safer mechanism for determining if a task is currently running, 2010-10-13 22:59:04 +00:00
_termios.h
_timespec.h
_timeval.h
_types.h
_umtx.h
aac_ioctl.h
acct.h
acl.h First step at adopting FreeBSD to support PSARC/2010/029. This makes 2010-09-20 17:10:06 +00:00
agpio.h
aio.h
alq.h
apm.h
assym.h
ata.h
bio.h
bitstring.h
blist.h
buf_ring.h
buf.h
bufobj.h
bus_dma.h
bus.h Add a resource_list_reserved() method that returns true if a resource 2010-11-17 22:28:04 +00:00
callout.h Make kern_tc.c provide minimum frequency of tc_ticktock() calls, required 2010-09-14 08:48:06 +00:00
cdefs.h After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
cdio.h
cdrio.h
cfictl.h
chio.h
clock.h
condvar.h
conf.h Check the device name validity on device registration. 2010-10-07 18:00:55 +00:00
cons.h
consio.h
copyright.h
cpu.h
cpuctl.h
cpuset.h
ctype.h
dataacq.h
device_port.h
devicestat.h
digiio.h
dir.h
dirent.h
disk.h
disklabel.h Add MIPS platform, this will make bsdlabel(8) work on MIPS (when invoked 2010-09-23 05:24:50 +00:00
diskmbr.h
diskpc98.h
dkstat.h
domain.h
dtrace_bsd.h
dvdio.h
elf32.h
elf64.h
elf_common.h Add PT_GNU_STACK definition. 2010-11-23 12:51:08 +00:00
elf_generic.h
elf.h
endian.h
errno.h
eui64.h
event.h
eventhandler.h
eventvar.h
exec.h Add macro DECLARE_MODULE_TIED to denote a module as requiring the 2010-10-12 09:18:17 +00:00
extattr.h
fail.h
fbio.h
fcntl.h
fdcio.h
file.h
filedesc.h
filio.h
firmware.h
fnv_hash.h
gmon.h
gpio.h Initial GPIO bus support. Includes: 2010-09-28 03:24:53 +00:00
gpt.h Add three GPT attributes: 2010-09-24 19:31:08 +00:00
hash.h
iconv.h
imgact_aout.h
imgact_elf.h
imgact.h
inflate.h
interrupt.h Remove 'softclock_ih' as it is no longer used. 2010-11-03 15:38:52 +00:00
ioccom.h
ioctl_compat.h
ioctl.h
ipc.h
ipmi.h
jail.h
joystick.h
kbio.h
kdb.h
kenv.h
kernel.h Remove unexisted since r212541 timer1hz/timer2hz variables. 2010-11-10 16:42:36 +00:00
kerneldump.h - Add minidump support for FreeBSD/mips 2010-11-07 03:09:02 +00:00
kobj.h
ksem.h
ksyms.h
kthread.h
ktr.h
ktrace.h - When disabling ktracing on a process, free any pending requests that 2010-10-21 19:17:40 +00:00
libkern.h Add support for asterisk characters when filling in the GELI password 2010-11-14 14:12:43 +00:00
limits.h
link_aout.h
link_elf.h
linker_set.h After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
linker.h
lock_profile.h
lock.h Protect BSDI $Id from accidental manipulation. 2010-09-10 06:26:28 +00:00
lockf.h
lockmgr.h
lockstat.h
mac.h
malloc.h
mbpool.h
mbuf.h
mchain.h
md4.h
md5.h
mdioctl.h
memrange.h
mman.h
module.h Add macro DECLARE_MODULE_TIED to denote a module as requiring the 2010-10-12 09:18:17 +00:00
mount.h The r184588 changed the layout of struct export_args, causing an ABI 2010-10-10 07:05:47 +00:00
mouse.h
mpt_ioctl.h
mqueue.h
msg.h
msgbuf.h
mtio.h
mutex.h - Remove <machine/mutex.h>. Most of the headers were empty, and the 2010-11-09 20:46:41 +00:00
namei.h
nlist_aout.h
osd.h
param.h Add Serial Management Protocol (SMP) passthrough support to CAM. 2010-11-30 22:39:46 +00:00
pciio.h
pcpu.h After some off-list discussion, revert a number of changes to the 2010-11-22 19:32:54 +00:00
pioctl.h
pipe.h
pmc.h
pmckern.h
pmclog.h
poll.h
posix4.h
power.h
priority.h
priv.h
proc.h - Insert thread0 into correct thread hash link list. 2010-10-17 11:01:52 +00:00
procfs.h Add the ability for GDB to printout the thread name along with other 2010-11-22 14:42:13 +00:00
protosw.h
ptio.h
ptrace.h Add the ability for GDB to printout the thread name along with other 2010-11-22 14:42:13 +00:00
queue.h
random.h
reboot.h
refcount.h
regression.h
resource.h
resourcevar.h
rman.h
rmlock.h
rtprio.h
runq.h
rwlock.h
sbuf.h Replace sbuf_overflowed() with sbuf_error(), which returns any error 2010-09-10 16:42:16 +00:00
sched.h there must be only one SYSINIT with SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order 2010-09-30 17:05:23 +00:00
sdt.h
select.h
selinfo.h
sem.h
sema.h
serial.h
sf_buf.h
sglist.h
shm.h
sigio.h
signal.h Make POLL_ERR and POLL_HUP different. 2010-11-12 15:30:49 +00:00
signalvar.h Create a global thread hash table to speed up thread lookup, use 2010-10-09 02:50:23 +00:00
sleepqueue.h
smp.h Add some platform KOBJ extensions and continue integrating PowerPC 2010-11-12 04:18:19 +00:00
snoop.h
sockbuf.h
socket.h This commit implements the SO_USER_COOKIE socket option, which lets 2010-11-12 13:02:26 +00:00
socketvar.h This commit implements the SO_USER_COOKIE socket option, which lets 2010-11-12 13:02:26 +00:00
sockio.h Reshuffle SIOCGIFCONF32 handler from r155224. 2010-10-21 16:20:48 +00:00
sockopt.h
sockstate.h
soundcard.h
stack.h
stat.h
statvfs.h
stddef.h
stdint.h
sun_disklabel.h
sx.h
syscall.h
syscall.mk
syscallsubr.h
sysctl.h Do not hold the sysctl lock across a call to the handler. This fixes a 2010-11-29 18:18:07 +00:00
sysent.h
syslimits.h
syslog.h
sysproto.h
systm.h Rename boot() to kern_reboot() and make it visible outside of 2010-10-18 04:30:27 +00:00
taskqueue.h Add a taskqueue_cancel(9) to cancel a pending task without waiting for 2010-11-08 20:56:31 +00:00
termios.h
thr.h
tiio.h
time.h Certain static code analysis tools (FlexeLint being one) are very 2010-10-04 10:48:47 +00:00
timeb.h
timeet.h Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
timepps.h
timers.h
times.h
timespec.h
timetc.h Make kern_tc.c provide minimum frequency of tc_ticktock() calls, required 2010-09-14 08:48:06 +00:00
timex.h
tree.h
tty.h
ttycom.h
ttydefaults.h
ttydevsw.h
ttydisc.h
ttyhook.h
ttyqueue.h
turnstile.h
types.h
ucontext.h
ucred.h
uio.h
umtx.h
un.h
unistd.h Indicate that POSIX semaphores are always supported. 2010-09-19 12:01:50 +00:00
unpcb.h
user.h Make a thread's address available via the kern proc sysctl, just like the 2010-10-08 00:44:53 +00:00
utsname.h
uuid.h
vmmeter.h
vnode.h Remove prtactive variable and related printf()s in the vop_inactive 2010-11-19 21:17:34 +00:00
vtoc.h
wait.h
watchdog.h