freebsd-dev/share
Kenneth D. Merry 64409eeee7 Add basic programmable early warning error injection to the sa(4) driver.
This will help application developers simulate end of tape conditions.

To inject an error in sa0:

sysctl kern.cam.sa.0.inject_eom=1

This will return the next read or write request queued with 0 bytes
written.  Any subsequent writes or reads will go along as usual.

This will also cause the early warning position flag to get set
for the next position query.  So, 'mt status' will show the BPEW
(Beyond Programmable Early Warning) flag on the first query after
an error injection.  After that, the position flags will be as they
are in the underlying tape drive.

Also, update the sa(4) man page to describe tape parameters,
which can be set via 'mt param'.

sys/cam/scsi/scsi_sa.c:
	In saregister(), create the inject_eom sysctl variable.

	In sastart(), check to see whether inject_eom is set.  If
	so, return the read or write with 0 bytes written to
	indicate EOM.  Set the set_pews_status flag so that we
	fake PEWS status in the next position call for reads, and the
	next 3 calls for writes.  This allows the user to see the BPEW
	flag one time via 'mt status'.

	In sagetpos(), check the set_pews_status flag and fake
	PEWS status and decrement the counter if it is set.

share/man/man4/sa.4:
	Document the inject_eom sysctl variable.

	Document all of the parameters currently supported via
	'mt param'.

usr.bin/mt/mt.1:
	Point the user to the sa(4) man page for more details on
	supported parameters.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-05-05 20:00:53 +00:00
..
colldef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
ctypedef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
dict Add META_MODE support. 2015-06-13 19:20:56 +00:00
doc share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
dtrace Remove redefinitions of some kernel types from mbuf.d. 2016-09-03 20:43:59 +00:00
examples Add UEFI support to vmrun.sh 2017-04-13 00:07:39 +00:00
i18n share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
keys META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
man Add basic programmable early warning error injection to the sa(4) driver. 2017-05-05 20:00:53 +00:00
me Add META_MODE support. 2015-06-13 19:20:56 +00:00
misc Add myself (wulf) as a src committer with gonzo and bapt as my mentors. 2017-05-03 20:56:34 +00:00
mk revert r313473 (Disable LLD_IS_LD option combinations that fail) 2017-04-30 16:12:23 +00:00
monetdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
msgdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
numericdef Readd Big5: some large databases setup are still requiring it. 2017-04-20 18:21:50 +00:00
security META MODE: These need object directories to handle staging. 2015-11-26 01:14:27 +00:00
sendmail share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
skel skel: Remove reference to deleted part in previous commit to this file. 2017-01-24 21:07:13 +00:00
snmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
syscons Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
tabset Add META_MODE support. 2015-06-13 19:20:56 +00:00
termcap Revert r314833 until the problem with INSTALL_RSYMLINKS can be found 2017-03-12 00:37:45 +00:00
tests Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed 2016-05-04 23:20:53 +00:00
timedef Canada adheres to ISO 8601, let's make the locale reflecting that fact 2017-03-19 18:21:35 +00:00
vt Remove pc98 support completely. 2017-01-28 02:22:15 +00:00
zoneinfo share: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:26:40 +00:00
Makefile Posixify the locales name for variants 2016-07-03 18:21:11 +00:00
Makefile.inc